Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 11 jdk.scripting.nashorn.jmod - Scripting Nashorn Module
JDK 11 jdk.scripting.nashorn.jmod is the JMOD file for JDK 11 Scripting Nashorn module.
JDK 11 Scripting Nashorn module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.scripting.nashorn.jmod.
JDK 11 Scripting Nashorn module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Scripting Nashorn module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.scripting.nashorn.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/nashorn/internal/runtime/arrays/DeletedRangeArrayFilter.java
/* * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.nashorn.internal.runtime.arrays; import java.lang.reflect.Array; import jdk.nashorn.internal.runtime.ScriptRuntime; /** * This filter handles the deletion of array elements. */ final class DeletedRangeArrayFilter extends ArrayFilter { /** Range (inclusive) tracking deletions */ private long lo, hi; DeletedRangeArrayFilter(final ArrayData underlying, final long lo, final long hi) { super(maybeSparse(underlying, hi)); this.lo = lo; this.hi = hi; } private static ArrayData maybeSparse(final ArrayData underlying, final long hi) { if (hi < SparseArrayData.MAX_DENSE_LENGTH || underlying instanceof SparseArrayData) { return underlying; } return new SparseArrayData(underlying, underlying.length()); } private boolean isEmpty() { return lo > hi; } private boolean isDeleted(final int index) { final long longIndex = ArrayIndex.toLongIndex(index); return lo <= longIndex && longIndex <= hi; } @Override public ArrayData copy() { return new DeletedRangeArrayFilter(underlying.copy(), lo, hi); } @Override public Object[] asObjectArray() { final Object[] value = super.asObjectArray(); if (lo < Integer.MAX_VALUE) { final int end = (int)Math.min(hi + 1, Integer.MAX_VALUE); for (int i = (int)lo; i < end; i++) { value[i] = ScriptRuntime.UNDEFINED; } } return value; } @Override public Object asArrayOfType(final Class<?> componentType) { final Object value = super.asArrayOfType(componentType); final Object undefValue = convertUndefinedValue(componentType); if (lo < Integer.MAX_VALUE) { final int end = (int)Math.min(hi + 1, Integer.MAX_VALUE); for (int i = (int)lo; i < end; i++) { Array.set(value, i, undefValue); } } return value; } @Override public ArrayData ensure(final long safeIndex) { if (safeIndex >= SparseArrayData.MAX_DENSE_LENGTH && safeIndex >= length()) { return new SparseArrayData(this, safeIndex + 1); } return super.ensure(safeIndex); } @Override public ArrayData shiftLeft(final int by) { super.shiftLeft(by); lo = Math.max(0, lo - by); hi = Math.max(-1, hi - by); return isEmpty() ? getUnderlying() : this; } @Override public ArrayData shiftRight(final int by) { super.shiftRight(by); final long len = length(); lo = Math.min(len, lo + by); hi = Math.min(len - 1, hi + by); return isEmpty() ? getUnderlying() : this; } @Override public ArrayData shrink(final long newLength) { super.shrink(newLength); lo = Math.min(newLength, lo); hi = Math.min(newLength - 1, hi); return isEmpty() ? getUnderlying() : this; } @Override public ArrayData set(final int index, final Object value, final boolean strict) { final long longIndex = ArrayIndex.toLongIndex(index); if (longIndex < lo || longIndex > hi) { return super.set(index, value, strict); } else if (longIndex > lo && longIndex < hi) { return getDeletedArrayFilter().set(index, value, strict); } if (longIndex == lo) { lo++; } else { assert longIndex == hi; hi--; } return isEmpty() ? getUnderlying().set(index, value, strict) : super.set(index, value, strict); } @Override public ArrayData set(final int index, final int value, final boolean strict) { final long longIndex = ArrayIndex.toLongIndex(index); if (longIndex < lo || longIndex > hi) { return super.set(index, value, strict); } else if (longIndex > lo && longIndex < hi) { return getDeletedArrayFilter().set(index, value, strict); } if (longIndex == lo) { lo++; } else { assert longIndex == hi; hi--; } return isEmpty() ? getUnderlying().set(index, value, strict) : super.set(index, value, strict); } @Override public ArrayData set(final int index, final double value, final boolean strict) { final long longIndex = ArrayIndex.toLongIndex(index); if (longIndex < lo || longIndex > hi) { return super.set(index, value, strict); } else if (longIndex > lo && longIndex < hi) { return getDeletedArrayFilter().set(index, value, strict); } if (longIndex == lo) { lo++; } else { assert longIndex == hi; hi--; } return isEmpty() ? getUnderlying().set(index, value, strict) : super.set(index, value, strict); } @Override public boolean has(final int index) { return super.has(index) && !isDeleted(index); } private ArrayData getDeletedArrayFilter() { final ArrayData deleteFilter = new DeletedArrayFilter(getUnderlying()); deleteFilter.delete(lo, hi); return deleteFilter; } @Override public ArrayData delete(final int index) { final long longIndex = ArrayIndex.toLongIndex(index); underlying.setEmpty(index); if (longIndex + 1 == lo) { lo = longIndex; } else if (longIndex - 1 == hi) { hi = longIndex; } else if (longIndex < lo || hi < longIndex) { return getDeletedArrayFilter().delete(index); } return this; } @Override public ArrayData delete(final long fromIndex, final long toIndex) { if (fromIndex > hi + 1 || toIndex < lo - 1) { return getDeletedArrayFilter().delete(fromIndex, toIndex); } lo = Math.min(fromIndex, lo); hi = Math.max(toIndex, hi); underlying.setEmpty(lo, hi); return this; } @Override public Object pop() { final int index = (int)length() - 1; if (super.has(index)) { final boolean isDeleted = isDeleted(index); final Object value = super.pop(); lo = Math.min(index + 1, lo); hi = Math.min(index, hi); return isDeleted ? ScriptRuntime.UNDEFINED : value; } return super.pop(); } @Override public ArrayData slice(final long from, final long to) { return new DeletedRangeArrayFilter(underlying.slice(from, to), Math.max(0, lo - from), Math.max(0, hi - from)); } }
⏎ jdk/nashorn/internal/runtime/arrays/DeletedRangeArrayFilter.java
Or download all of them as a single archive file:
File name: jdk.scripting.nashorn-11.0.1-src.zip File size: 1390965 bytes Release date: 2018-11-04 Download
⇒ JDK 11 jdk.scripting.nashorn.shell.jmod - Scripting Nashorn Shell Module
2020-04-25, 108178👍, 0💬
Popular Posts:
Smack is an Open Source XMPP (Jabber) client library for instant messaging and presence. A pure Java...
The Web Services Description Language for Java Toolkit (WSDL4J), Release 1.6.2, allows the creation,...
What Is HttpComponents commons-httpclient-3.1.j ar?HttpComponents commons-httpclient-3.1.j aris the ...
JDK 11 jdk.dynalink.jmod is the JMOD file for JDK 11 Dynamic Linking module. JDK 11 Dynamic Linking ...
kernel.jar is a component in iText Java library to provide low-level functionalities. iText Java lib...