|
95 | 95 | import com.oracle.graal.python.builtins.objects.common.SequenceNodes; |
96 | 96 | import com.oracle.graal.python.builtins.objects.common.SequenceStorageNodes; |
97 | 97 | import com.oracle.graal.python.builtins.objects.dict.PDict; |
98 | | -import com.oracle.graal.python.builtins.objects.frame.PFrame; |
99 | 98 | import com.oracle.graal.python.builtins.objects.frame.FrameBuiltins.GetLocalsNode; |
100 | 99 | import com.oracle.graal.python.builtins.objects.function.Arity; |
101 | 100 | import com.oracle.graal.python.builtins.objects.function.PArguments; |
@@ -506,12 +505,7 @@ private static void inheritGlobals(Frame callerFrame, Object[] args) { |
506 | 505 | } |
507 | 506 |
|
508 | 507 | private void inheritLocals(Frame callerFrame, Object[] args, GetLocalsNode getLocalsNode) { |
509 | | - PFrame pFrame = PArguments.getPFrame(callerFrame); |
510 | | - if (pFrame == null) { |
511 | | - pFrame = factory().createPFrame(callerFrame); |
512 | | - PArguments.setPFrame(callerFrame, pFrame); |
513 | | - } |
514 | | - Object callerLocals = getLocalsNode.execute(pFrame); |
| 508 | + Object callerLocals = getLocalsNode.execute(callerFrame); |
515 | 509 | setCustomLocals(args, callerLocals); |
516 | 510 | } |
517 | 511 |
|
@@ -1653,21 +1647,11 @@ public Object globals(VirtualFrame frame) { |
1653 | 1647 | abstract static class LocalsNode extends PythonBuiltinNode { |
1654 | 1648 | @Child ReadCallerFrameNode readCallerFrameNode = ReadCallerFrameNode.create(); |
1655 | 1649 | @Child GetLocalsNode getLocalsNode = GetLocalsNode.create(); |
1656 | | - private final ConditionProfile hasFrame = ConditionProfile.createBinaryProfile(); |
1657 | | - private final ConditionProfile hasPFrame = ConditionProfile.createBinaryProfile(); |
1658 | 1650 |
|
1659 | 1651 | @Specialization |
1660 | 1652 | public Object locals(VirtualFrame frame) { |
1661 | 1653 | Frame callerFrame = readCallerFrameNode.executeWith(frame); |
1662 | | - PFrame pFrame = PArguments.getPFrame(callerFrame); |
1663 | | - if (hasPFrame.profile(pFrame == null)) { |
1664 | | - pFrame = factory().createPFrame(callerFrame); |
1665 | | - PArguments.setPFrame(callerFrame, pFrame); |
1666 | | - } else if (hasFrame.profile(!pFrame.hasFrame())) { |
1667 | | - pFrame = factory().createPFrame(callerFrame, pFrame.getLocalsDict()); |
1668 | | - PArguments.setPFrame(callerFrame, pFrame); |
1669 | | - } |
1670 | | - return getLocalsNode.execute(pFrame); |
| 1654 | + return getLocalsNode.execute(callerFrame); |
1671 | 1655 | } |
1672 | 1656 | } |
1673 | 1657 | } |
0 commit comments