@Override
  public Object execute(VirtualFrame frame) {
    final RubyConstant constant = lookupConstantNode.executeLookupConstant(frame);
    final DynamicObject module = lexicalScope.getLiveModule();

    return getConstantNode.executeGetConstant(frame, module, name, constant);
  }
Example #2
0
  @Override
  public Object execute(VirtualFrame frame) {
    CompilerDirectives.transferToInterpreter();

    // TODO(CS): cast
    final DynamicObject module = (DynamicObject) definingModule.execute(frame);

    lexicalScope.setLiveModule(module);
    Layouts.MODULE.getFields(lexicalScope.getParent().getLiveModule()).addLexicalDependent(module);

    final InternalMethod definition =
        definitionMethod.executeMethod(frame).withDeclaringModule(module);
    return callModuleDefinitionNode.call(
        frame,
        definition.getCallTarget(),
        RubyArguments.pack(
            definition, null, null, module, null, DeclarationContext.MODULE, new Object[] {}));
  }
Example #3
0
 public void popLexicalScope() {
   lexicalScope = lexicalScope.getParent();
 }