protected RubyArray makeGeneric(VirtualFrame frame, Object[] alreadyExecuted) { CompilerAsserts.neverPartOfCompilation(); replace(new ObjectArrayLiteralNode(getContext(), getSourceSection(), values)); final Object[] executedValues = new Object[values.length]; for (int n = 0; n < values.length; n++) { if (n < alreadyExecuted.length) { executedValues[n] = alreadyExecuted[n]; } else { executedValues[n] = values[n].execute(frame); } } return RubyArray.fromObjects(getContext().getCoreLibrary().getArrayClass(), executedValues); }
private Object handleException(VirtualFrame frame, RuntimeException exception) { CompilerAsserts.neverPartOfCompilation(); final RubyContext context = getContext(); final RubyBasicObject rubyException = ExceptionTranslator.translateException(context, exception); context.getCoreLibrary().getGlobalVariablesObject().setInstanceVariable("$!", rubyException); for (RescueNode rescue : rescueParts) { if (rescue.canHandle(frame, rubyException)) { return rescue.execute(frame); } } throw exception; }
@ExplodeLoop private Object handleException(VirtualFrame frame, RaiseException exception) { CompilerAsserts.neverPartOfCompilation(); notDesignedForCompilation(); getContext() .getCoreLibrary() .getGlobalVariablesObject() .getOperations() .setInstanceVariable( getContext().getCoreLibrary().getGlobalVariablesObject(), "$!", exception.getRubyException()); for (RescueNode rescue : rescueParts) { if (rescue.canHandle(frame, exception.getRubyException())) { return rescue.execute(frame); } } throw exception; }