aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsundar <none@none>2014-06-04 16:39:04 +0530
committersundar <none@none>2014-06-04 16:39:04 +0530
commit4b0a69d09ea3c8c0ab75e1056d21fa493956c7e4 (patch)
treec4e39fa59df7031ffd358caf29bd5b8dbf65acf5 /src
parent66e95be4970fa8efb1dec62d03f9af775f2a8b9d (diff)
downloadnashorn-4b0a69d09ea3c8c0ab75e1056d21fa493956c7e4.tar.gz
8044750: megamorphic getter for scope objects does not call __noSuchProperty__ hook
Reviewed-by: attila, lagergren, hannesw
Diffstat (limited to 'src')
-rw-r--r--src/jdk/nashorn/internal/runtime/ScriptObject.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/jdk/nashorn/internal/runtime/ScriptObject.java b/src/jdk/nashorn/internal/runtime/ScriptObject.java
index a9e1e90c..deae803e 100644
--- a/src/jdk/nashorn/internal/runtime/ScriptObject.java
+++ b/src/jdk/nashorn/internal/runtime/ScriptObject.java
@@ -132,7 +132,7 @@ public abstract class ScriptObject implements PropertyAccess {
/** Method handle to retrive prototype of this object */
public static final MethodHandle GETPROTO = findOwnMH("getProto", ScriptObject.class);
- static final MethodHandle MEGAMORPHIC_GET = findOwnMH("megamorphicGet", Object.class, String.class, boolean.class, boolean.class);
+ static final MethodHandle MEGAMORPHIC_GET = findOwnMH("megamorphicGet", Object.class, String.class, boolean.class);
static final MethodHandle GLOBALFILTER = findOwnMH("globalFilter", Object.class, Object.class);
static final MethodHandle SETFIELD = findOwnMH("setField", void.class, CallSiteDescriptor.class, PropertyMap.class, PropertyMap.class, MethodHandle.class, Object.class, Object.class);
@@ -1745,7 +1745,7 @@ public abstract class ScriptObject implements PropertyAccess {
protected GuardedInvocation findGetMethod(final CallSiteDescriptor desc, final LinkRequest request, final String operator) {
final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND);
if (request.isCallSiteUnstable() || hasWithScope()) {
- return findMegaMorphicGetMethod(desc, name, "getMethod".equals(operator), isScope() && NashornCallSiteDescriptor.isScope(desc));
+ return findMegaMorphicGetMethod(desc, name, "getMethod".equals(operator));
}
final FindProperty find = findProperty(name, true);
@@ -1788,22 +1788,19 @@ public abstract class ScriptObject implements PropertyAccess {
}
private static GuardedInvocation findMegaMorphicGetMethod(final CallSiteDescriptor desc, final String name,
- final boolean isMethod, final boolean isScope) {
- final MethodHandle invoker = MH.insertArguments(MEGAMORPHIC_GET, 1, name, isMethod, isScope);
+ final boolean isMethod) {
+ final MethodHandle invoker = MH.insertArguments(MEGAMORPHIC_GET, 1, name, isMethod);
final MethodHandle guard = getScriptObjectGuard(desc.getMethodType());
return new GuardedInvocation(invoker, guard);
}
@SuppressWarnings("unused")
- private Object megamorphicGet(final String key, final boolean isMethod, final boolean isScope) {
+ private Object megamorphicGet(final String key, final boolean isMethod) {
final FindProperty find = findProperty(key, true);
if (find != null) {
return find.getObjectValue();
}
- if (isScope) {
- throw referenceError("not.defined", key);
- }
return isMethod ? getNoSuchMethod(key) : invokeNoSuchProperty(key);
}