< prev index next >

src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java

Print this page

        

*** 107,130 **** public static final String NO_SUCH_METHOD_NAME = "__noSuchMethod__"; /** Search fall back routine name for "no such property" */ public static final String NO_SUCH_PROPERTY_NAME = "__noSuchProperty__"; - /** Per ScriptObject flag - is this a scope object? */ - public static final int IS_SCOPE = 1 << 0; - /** Per ScriptObject flag - is this an array object? */ ! public static final int IS_ARRAY = 1 << 1; /** Per ScriptObject flag - is this an arguments object? */ ! public static final int IS_ARGUMENTS = 1 << 2; /** Is length property not-writable? */ ! public static final int IS_LENGTH_NOT_WRITABLE = 1 << 3; /** Is this a builtin object? */ ! public static final int IS_BUILTIN = 1 << 4; /** * Spill growth rate - by how many elements does {@link ScriptObject#primitiveSpill} and * {@link ScriptObject#objectSpill} when full */ --- 107,127 ---- public static final String NO_SUCH_METHOD_NAME = "__noSuchMethod__"; /** Search fall back routine name for "no such property" */ public static final String NO_SUCH_PROPERTY_NAME = "__noSuchProperty__"; /** Per ScriptObject flag - is this an array object? */ ! public static final int IS_ARRAY = 1 << 0; /** Per ScriptObject flag - is this an arguments object? */ ! public static final int IS_ARGUMENTS = 1 << 1; /** Is length property not-writable? */ ! public static final int IS_LENGTH_NOT_WRITABLE = 1 << 2; /** Is this a builtin object? */ ! public static final int IS_BUILTIN = 1 << 3; /** * Spill growth rate - by how many elements does {@link ScriptObject#primitiveSpill} and * {@link ScriptObject#objectSpill} when full */
*** 1628,1654 **** */ public boolean isFrozen() { return getMap().isFrozen(); } - - /** - * Flag this ScriptObject as scope - */ - public final void setIsScope() { - if (Context.DEBUG) { - scopeCount++; - } - flags |= IS_SCOPE; - } - /** * Check whether this ScriptObject is scope * @return true if scope */ ! public final boolean isScope() { ! return (flags & IS_SCOPE) != 0; } /** * Tag this script object as built in */ --- 1625,1640 ---- */ public boolean isFrozen() { return getMap().isFrozen(); } /** * Check whether this ScriptObject is scope * @return true if scope */ ! public boolean isScope() { ! return false; } /** * Tag this script object as built in */
*** 1919,1936 **** /** * Test whether this object contains in its prototype chain or is itself a with-object. * @return true if a with-object was found */ ! final boolean hasWithScope() { ! if (isScope()) { ! for (ScriptObject obj = this; obj != null; obj = obj.getProto()) { ! if (obj instanceof WithObject) { ! return true; ! } ! } ! } return false; } /** * Add a filter to the first argument of {@code methodHandle} that calls its {@link #getProto()} method --- 1905,1915 ---- /** * Test whether this object contains in its prototype chain or is itself a with-object. * @return true if a with-object was found */ ! boolean hasWithScope() { return false; } /** * Add a filter to the first argument of {@code methodHandle} that calls its {@link #getProto()} method
*** 3815,3843 **** } /** This is updated only in debug mode - counts number of {@code ScriptObject} instances created */ private static int count; - /** This is updated only in debug mode - counts number of {@code ScriptObject} instances created that are scope */ - private static int scopeCount; - /** * Get number of {@code ScriptObject} instances created. If not running in debug * mode this is always 0 * * @return number of ScriptObjects created */ public static int getCount() { return count; } - - /** - * Get number of scope {@code ScriptObject} instances created. If not running in debug - * mode this is always 0 - * - * @return number of scope ScriptObjects created - */ - public static int getScopeCount() { - return scopeCount; - } - } --- 3794,3808 ----
< prev index next >