public String getFile() { return method.getFileName(); }
public String getFile() { return method.getFileName(); }
public IRModuleBody(IRManager manager, IRScope lexicalParent, String name, int lineNumber, StaticScope scope) { this(manager, lexicalParent, name, lexicalParent.getFileName(), lineNumber, scope); }
public IRModuleBody(IRManager manager, IRScope lexicalParent, String name, int lineNumber, StaticScope scope) { this(manager, lexicalParent, name, lexicalParent.getFileName(), lineNumber, scope); }
public IGVDumper dumpToIGV() { if (RubyInstanceConfig.IR_DEBUG_IGV != null) { String spec = RubyInstanceConfig.IR_DEBUG_IGV; if (spec.contains(":") && spec.equals(getFileName() + ":" + getLineNumber()) || spec.equals(getFileName())) { return new IGVDumper(getFullyQualifiedName() + "; line " + getLineNumber()); } } return null; }
public IGVDumper dumpToIGV() { if (RubyInstanceConfig.IR_DEBUG_IGV != null) { String spec = RubyInstanceConfig.IR_DEBUG_IGV; if (spec.contains(":") && spec.equals(getFileName() + ":" + getLineNumber()) || spec.equals(getFileName())) { return new IGVDumper(getFullyQualifiedName() + "; line " + getLineNumber()); } } return null; }
public IRMethod(IRManager manager, IRScope lexicalParent, String name, boolean isInstanceMethod, int lineNumber, StaticScope staticScope) { super(manager, lexicalParent, name, lexicalParent.getFileName(), lineNumber, staticScope); this.isInstanceMethod = isInstanceMethod; this.callArgs = new ArrayList<Operand>(); this.argDesc = new ArrayList<String[]>(); if (!getManager().isDryRun()) { if (staticScope != null) ((IRStaticScope)staticScope).setIRScope(this); } }
public IRMethod(IRManager manager, IRScope lexicalParent, String name, boolean isInstanceMethod, int lineNumber, StaticScope staticScope) { super(manager, lexicalParent, name, lexicalParent.getFileName(), lineNumber, staticScope); this.isInstanceMethod = isInstanceMethod; this.callArgs = new ArrayList<Operand>(); this.argDesc = new ArrayList<String[]>(); if (!getManager().isDryRun()) { if (staticScope != null) ((IRStaticScope)staticScope).setIRScope(this); } }
@Override public String toString() { return getScopeName() + " " + getName() + "[" + getFileName() + ":" + getLineNumber() + "]"; }
@Override public String toString() { return getScopeName() + " " + getName() + "[" + getFileName() + ":" + getLineNumber() + "]"; }
public static IRubyObject INTERPRET_EVAL(ThreadContext context, IRubyObject self, IRScope scope, RubyModule clazz, IRubyObject[] args, String name, Block block, Block.Type blockType) { try { ThreadContext.pushBacktrace(context, name, scope.getFileName(), context.getLine()); return interpret(context, self, scope, null, clazz, args, block, blockType); } finally { ThreadContext.popBacktrace(context); } }
public static IRubyObject INTERPRET_BLOCK(ThreadContext context, IRubyObject self, IRScope scope, IRubyObject[] args, String name, Block block, Block.Type blockType) { try { ThreadContext.pushBacktrace(context, name, scope.getFileName(), context.getLine()); return interpret(context, self, scope, null, null, args, block, blockType); } finally { ThreadContext.popBacktrace(context); } }
public static IRubyObject INTERPRET_EVAL(ThreadContext context, IRubyObject self, IRScope scope, RubyModule clazz, IRubyObject[] args, String name, Block block, Block.Type blockType) { try { ThreadContext.pushBacktrace(context, name, scope.getFileName(), context.getLine()); return interpret(context, self, scope, null, clazz, args, block, blockType); } finally { ThreadContext.popBacktrace(context); } }
public static IRubyObject INTERPRET_BLOCK(ThreadContext context, IRubyObject self, IRScope scope, IRubyObject[] args, String name, Block block, Block.Type blockType) { try { ThreadContext.pushBacktrace(context, name, scope.getFileName(), context.getLine()); return interpret(context, self, scope, null, null, args, block, blockType); } finally { ThreadContext.popBacktrace(context); } }
public IRClosure(IRManager manager, IRScope lexicalParent, boolean isForLoopBody, int lineNumber, StaticScope staticScope, Arity arity, int argumentType, boolean is1_8) { this(manager, lexicalParent, lexicalParent.getFileName(), lineNumber, staticScope, isForLoopBody ? "_FOR_LOOP_" : "_CLOSURE_"); this.isForLoopBody = isForLoopBody; this.blockArgs = new ArrayList<Operand>(); if (getManager().isDryRun()) { this.body = null; } else { this.body = is1_8 ? new InterpretedIRBlockBody(this, arity, argumentType) : new InterpretedIRBlockBody19(this, arity, argumentType); if ((staticScope != null) && !isForLoopBody) ((IRStaticScope)staticScope).setIRScope(this); } // set nesting depth -- after isForLoopBody value is set int n = 0; IRScope s = this; while (s instanceof IRClosure) { if (!s.isForLoopBody()) n++; s = s.getLexicalParent(); } this.nestingDepth = n; }
public IRClosure(IRManager manager, IRScope lexicalParent, boolean isForLoopBody, int lineNumber, StaticScope staticScope, Arity arity, int argumentType, boolean is1_8) { this(manager, lexicalParent, lexicalParent.getFileName(), lineNumber, staticScope, isForLoopBody ? "_FOR_LOOP_" : "_CLOSURE_"); this.isForLoopBody = isForLoopBody; this.blockArgs = new ArrayList<Operand>(); if (getManager().isDryRun()) { this.body = null; } else { this.body = is1_8 ? new InterpretedIRBlockBody(this, arity, argumentType) : new InterpretedIRBlockBody19(this, arity, argumentType); if ((staticScope != null) && !isForLoopBody) ((IRStaticScope)staticScope).setIRScope(this); } // set nesting depth -- after isForLoopBody value is set int n = 0; IRScope s = this; while (s instanceof IRClosure) { if (!s.isForLoopBody()) n++; s = s.getLexicalParent(); } this.nestingDepth = n; }
public static IRubyObject INTERPRET_METHOD(ThreadContext context, InterpretedIRMethod irMethod, IRubyObject self, String name, IRubyObject[] args, Block block, Block.Type blockType, boolean isTraceable) { Ruby runtime = context.runtime; IRScope scope = irMethod.getIRMethod(); RubyModule implClass = irMethod.getImplementationClass(); Visibility viz = irMethod.getVisibility(); boolean syntheticMethod = name == null || name.equals(""); try { if (!syntheticMethod) ThreadContext.pushBacktrace(context, name, scope.getFileName(), context.getLine()); if (isTraceable) methodPreTrace(runtime, context, name, implClass); return interpret(context, self, scope, viz, implClass, args, block, blockType); } finally { if (isTraceable) { try {methodPostTrace(runtime, context, name, implClass);} finally { if (!syntheticMethod) ThreadContext.popBacktrace(context);} } else { if (!syntheticMethod) ThreadContext.popBacktrace(context); } } }
public static IRubyObject INTERPRET_METHOD(ThreadContext context, InterpretedIRMethod irMethod, IRubyObject self, String name, IRubyObject[] args, Block block, Block.Type blockType, boolean isTraceable) { Ruby runtime = context.runtime; IRScope scope = irMethod.getIRMethod(); RubyModule implClass = irMethod.getImplementationClass(); Visibility viz = irMethod.getVisibility(); boolean syntheticMethod = name == null || name.equals(""); try { if (!syntheticMethod) ThreadContext.pushBacktrace(context, name, scope.getFileName(), context.getLine()); if (isTraceable) methodPreTrace(runtime, context, name, implClass); return interpret(context, self, scope, viz, implClass, args, block, blockType); } finally { if (isTraceable) { try {methodPostTrace(runtime, context, name, implClass);} finally { if (!syntheticMethod) ThreadContext.popBacktrace(context);} } else { if (!syntheticMethod) ThreadContext.popBacktrace(context); } } }
public static IRScope createScope(IRManager manager, IRScopeType type, RubySymbol name, int line, IRScope lexicalParent, Signature signature, StaticScope staticScope) { switch (type) { case CLASS_BODY: return new IRClassBody(manager, lexicalParent, name, line, staticScope); case METACLASS_BODY: return new IRMetaClassBody(manager, lexicalParent, manager.getMetaClassName(), line, staticScope); case INSTANCE_METHOD: return new IRMethod(manager, lexicalParent, null, name, true, line, staticScope, false); case CLASS_METHOD: return new IRMethod(manager, lexicalParent, null, name, false, line, staticScope, false); case MODULE_BODY: return new IRModuleBody(manager, lexicalParent, name, line, staticScope); case SCRIPT_BODY: return new IRScriptBody(manager, name, staticScope); case FOR: return new IRFor(manager, lexicalParent, line, staticScope, signature); case CLOSURE: return new IRClosure(manager, lexicalParent, line, staticScope, signature); case EVAL_SCRIPT: // SSS FIXME: This is broken right now -- the isModuleEval arg has to be persisted and then read back. return new IREvalScript(manager, lexicalParent, lexicalParent.getFileName(), line, staticScope, EvalType.NONE); } throw new RuntimeException("No such scope type: " + type); } }
public static IRScope createScope(IRManager manager, IRScopeType type, RubySymbol name, int line, IRScope lexicalParent, Signature signature, StaticScope staticScope) { switch (type) { case CLASS_BODY: return new IRClassBody(manager, lexicalParent, name, line, staticScope); case METACLASS_BODY: return new IRMetaClassBody(manager, lexicalParent, manager.getMetaClassName(), line, staticScope); case INSTANCE_METHOD: return new IRMethod(manager, lexicalParent, null, name, true, line, staticScope, false); case CLASS_METHOD: return new IRMethod(manager, lexicalParent, null, name, false, line, staticScope, false); case MODULE_BODY: return new IRModuleBody(manager, lexicalParent, name, line, staticScope); case SCRIPT_BODY: return new IRScriptBody(manager, name, staticScope); case FOR: return new IRFor(manager, lexicalParent, line, staticScope, signature); case CLOSURE: return new IRClosure(manager, lexicalParent, line, staticScope, signature); case EVAL_SCRIPT: // SSS FIXME: This is broken right now -- the isModuleEval arg has to be persisted and then read back. return new IREvalScript(manager, lexicalParent, lexicalParent.getFileName(), line, staticScope, EvalType.NONE); } throw new RuntimeException("No such scope type: " + type); } }