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/codegen/ConstantData.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.codegen; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; import jdk.nashorn.internal.runtime.PropertyMap; /** * Manages constants needed by code generation. Objects are maintained in an * interning maps to remove duplicates. */ final class ConstantData { /** Constant table. */ final List<Object> constants; /** Constant table string interning map. */ final Map<String, Integer> stringMap; /** Constant table object interning map. */ final Map<Object, Integer> objectMap; private static class ArrayWrapper { private final Object array; private final int hashCode; public ArrayWrapper(final Object array) { this.array = array; this.hashCode = calcHashCode(); } /** * Calculate a shallow hashcode for the array. * @return Hashcode with elements factored in. */ private int calcHashCode() { final Class<?> cls = array.getClass(); if (!cls.getComponentType().isPrimitive()) { return Arrays.hashCode((Object[])array); } else if (cls == double[].class) { return Arrays.hashCode((double[])array); } if (cls == long[].class) { return Arrays.hashCode((long[])array); } if (cls == int[].class) { return Arrays.hashCode((int[])array); } throw new AssertionError("ConstantData doesn't support " + cls); } @Override public boolean equals(final Object other) { if (!(other instanceof ArrayWrapper)) { return false; } final Object otherArray = ((ArrayWrapper)other).array; if (array == otherArray) { return true; } final Class<?> cls = array.getClass(); if (cls == otherArray.getClass()) { if (!cls.getComponentType().isPrimitive()) { return Arrays.equals((Object[])array, (Object[])otherArray); } else if (cls == double[].class) { return Arrays.equals((double[])array, (double[])otherArray); } else if (cls == long[].class) { return Arrays.equals((long[])array, (long[])otherArray); } else if (cls == int[].class) { return Arrays.equals((int[])array, (int[])otherArray); } } return false; } @Override public int hashCode() { return hashCode; } } /** * {@link PropertyMap} wrapper class that provides implementations for the {@code hashCode} and {@code equals} * methods that are based on the map layout. {@code PropertyMap} itself inherits the identity based implementations * from {@code java.lang.Object}. */ private static class PropertyMapWrapper { private final PropertyMap propertyMap; private final int hashCode; public PropertyMapWrapper(final PropertyMap map) { this.hashCode = Arrays.hashCode(map.getProperties()) + 31 * Objects.hashCode(map.getClassName()); this.propertyMap = map; } @Override public int hashCode() { return hashCode; } @Override public boolean equals(final Object other) { if (!(other instanceof PropertyMapWrapper)) { return false; } final PropertyMap otherMap = ((PropertyMapWrapper) other).propertyMap; return propertyMap == otherMap || (Arrays.equals(propertyMap.getProperties(), otherMap.getProperties()) && Objects.equals(propertyMap.getClassName(), otherMap.getClassName())); } } /** * Constructor */ ConstantData() { this.constants = new ArrayList<>(); this.stringMap = new HashMap<>(); this.objectMap = new HashMap<>(); } /** * Add a string to the constant data * * @param string the string to add * @return the index in the constant pool that the string was given */ public int add(final String string) { final Integer value = stringMap.get(string); if (value != null) { return value; } constants.add(string); final int index = constants.size() - 1; stringMap.put(string, index); return index; } /** * Add an object to the constant data * * @param object the string to add * @return the index in the constant pool that the object was given */ public int add(final Object object) { assert object != null; final Object entry; if (object.getClass().isArray()) { entry = new ArrayWrapper(object); } else if (object instanceof PropertyMap) { entry = new PropertyMapWrapper((PropertyMap) object); } else { entry = object; } final Integer value = objectMap.get(entry); if (value != null) { return value; } constants.add(object); final int index = constants.size() - 1; objectMap.put(entry, index); return index; } Object[] toArray() { return constants.toArray(); } }
⏎ jdk/nashorn/internal/codegen/ConstantData.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, 83870👍, 0💬
Popular Posts:
JLayer is a library that decodes/plays/converts MPEG 1/2/2.5 Layer 1/2/3 (i.e. MP3) in real time for...
GJT (Giant Java Tree) implementation of XML Pull Parser. JAR File Size and Download Location: File n...
What Is poi-scratchpad-3.5.jar? poi-scratchpad-3.5.jar is one of the JAR files for Apache POI 3.5, w...
How to download and install JDK (Java Development Kit) 6? If you want to write Java applications, yo...
Where Can I see Java Source Code files for Xerces Java 2.11.2? Here are Java Source Code files for X...