Exemplo n.º 1
0
  @ExplodeLoop
  @Override
  public Object execute(VirtualFrame frame) {
    PArguments.getControlData(frame).setIteratorAt(targetLoopIteratorSlot, null);

    for (int indexSlot : enclosingBlockIndexSlots) {
      PArguments.getControlData(frame).setBlockIndexAt(indexSlot, 0);
    }

    for (int flagSlot : enclosingIfFlagSlots) {
      PArguments.getControlData(frame).setActive(flagSlot, false);
    }

    throw BreakException.INSTANCE;
  }
Exemplo n.º 2
0
 public static PGenerator create(
     String name,
     RootCallTarget callTarget,
     FrameDescriptor frameDescriptor,
     MaterializedFrame declarationFrame,
     Object[] arguments,
     int numOfActiveFlags,
     int numOfGeneratorBlockNode,
     int numOfGeneratorForNode) {
   /** Setting up the persistent frame in {@link #arguments}. */
   GeneratorControlData generatorArgs =
       new GeneratorControlData(numOfActiveFlags, numOfGeneratorBlockNode, numOfGeneratorForNode);
   MaterializedFrame generatorFrame =
       Truffle.getRuntime().createMaterializedFrame(PArguments.create(), frameDescriptor);
   PArguments.setDeclarationFrame(arguments, declarationFrame);
   PArguments.setGeneratorFrame(arguments, generatorFrame);
   PArguments.setControlData(arguments, generatorArgs);
   return new PGenerator(name, callTarget, frameDescriptor, arguments);
 }
Exemplo n.º 3
0
 public Object send(Object value) throws StopIterationException {
   PArguments.setSpecialArgument(arguments, value);
   return callTarget.call(arguments);
 }