diff --git a/rhino/src/main/java/org/mozilla/javascript/optimizer/BodyCodegen.java b/rhino/src/main/java/org/mozilla/javascript/optimizer/BodyCodegen.java index 29bf959a93..d9aaf0526e 100644 --- a/rhino/src/main/java/org/mozilla/javascript/optimizer/BodyCodegen.java +++ b/rhino/src/main/java/org/mozilla/javascript/optimizer/BodyCodegen.java @@ -1664,14 +1664,11 @@ private void generateYieldPoint(Node node, boolean exprContext) { if (unnestedYields.containsKey(node)) { // Yield was previously moved up via the "nestedYield" code below. if (exprContext) { + String name = unnestedYields.get(node); cfw.addALoad(variableObjectLocal); - cfw.addLoadConstant(unnestedYields.get(node)); cfw.addALoad(contextLocal); cfw.addALoad(variableObjectLocal); - addScriptRuntimeInvoke( - "getObjectPropNoWarn", - "(Ljava/lang/Object;Ljava/lang/String;Lorg/mozilla/javascript/Context;" - + "Lorg/mozilla/javascript/Scriptable;)Ljava/lang/Object;"); + addDynamicInvoke("PROP:GETNOWARN:" + name, Signatures.PROP_GET_NOWARN); } return; } @@ -1689,14 +1686,9 @@ private void generateYieldPoint(Node node, boolean exprContext) { unnestedYieldCount++; cfw.addALoad(variableObjectLocal); cfw.add(ByteCode.SWAP); - cfw.addLoadConstant(nn); - cfw.add(ByteCode.SWAP); cfw.addALoad(contextLocal); - - addScriptRuntimeInvoke( - "setObjectProp", - "(Lorg/mozilla/javascript/Scriptable;Ljava/lang/String;Ljava/lang/Object;" - + "Lorg/mozilla/javascript/Context;)Ljava/lang/Object;"); + cfw.addALoad(variableObjectLocal); + addDynamicInvoke("PROP:SET:" + nn, Signatures.PROP_SET); cfw.add(ByteCode.POP); unnestedYields.put(nestedYield, nn); diff --git a/rhino/src/main/java/org/mozilla/javascript/optimizer/Signatures.java b/rhino/src/main/java/org/mozilla/javascript/optimizer/Signatures.java index 7f64e8af7e..744b74005f 100644 --- a/rhino/src/main/java/org/mozilla/javascript/optimizer/Signatures.java +++ b/rhino/src/main/java/org/mozilla/javascript/optimizer/Signatures.java @@ -3,7 +3,9 @@ /** * This class defines the method signatures for the properties used by the invokedynamic * instructions in the bytecode. This helps us identify what each bytecode operation means, and what - * the method signature should be. + * the method signature should be. The method signatures here don't necessarily map 1:1 with + * ScriptRuntime operations -- the runtime will insert the value of the "name" part of the operation + * name before making the call. */ interface Signatures { /**