public MixedModeIRBlockBody(IRClosure closure, Signature signature) { super(closure, signature); this.pushScope = true; this.reuseParentScope = false; // JIT currently JITs blocks along with their method and no on-demand by themselves. We only // promote to full build here if we are -X-C. if (!closure.getManager().getInstanceConfig().getCompileMode().shouldJIT() || Options.JIT_THRESHOLD.load() < 0) { callCount = -1; } }
public InterpretedIRBlockBody(IRClosure closure, Signature signature) { super(closure, signature); this.pushScope = true; this.reuseParentScope = false; // JIT currently JITs blocks along with their method and no on-demand by themselves. We only // promote to full build here if we are -X-C. if (closure.getManager().getInstanceConfig().getCompileMode().shouldJIT() || Options.JIT_THRESHOLD.load() == -1) { callCount = -1; } }
public MixedModeIRBlockBody(IRClosure closure, Signature signature) { super(closure, signature); this.pushScope = true; this.reuseParentScope = false; // JIT currently JITs blocks along with their method and no on-demand by themselves. We only // promote to full build here if we are -X-C. if (!closure.getManager().getInstanceConfig().getCompileMode().shouldJIT() || Options.JIT_THRESHOLD.load() < 0) { callCount = -1; } }
public InterpretedIRBlockBody(IRClosure closure, Signature signature) { super(closure, signature); this.pushScope = true; this.reuseParentScope = false; // JIT currently JITs blocks along with their method and no on-demand by themselves. We only // promote to full build here if we are -X-C. if (closure.getManager().getInstanceConfig().getCompileMode().shouldJIT() || Options.JIT_THRESHOLD.load() == -1) { callCount = -1; } }
public IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature, ByteList prefix, boolean isBeginEndBlock, boolean needsCoverage) { this(manager, lexicalParent, lineNumber, staticScope, prefix); this.signature = signature; lexicalParent.addClosure(this); if (getManager().isDryRun()) { this.body = null; } else { boolean shouldJit = manager.getInstanceConfig().getCompileMode().shouldJIT(); this.body = shouldJit ? new MixedModeIRBlockBody(this, signature) : new InterpretedIRBlockBody(this, signature); if (staticScope != null && !isBeginEndBlock) { staticScope.setIRScope(this); staticScope.setScopeType(this.getScopeType()); } } if (needsCoverage) getFlags().add(IRFlags.CODE_COVERAGE); }
public IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature, ByteList prefix, boolean isBeginEndBlock, boolean needsCoverage) { this(manager, lexicalParent, lineNumber, staticScope, prefix); this.signature = signature; lexicalParent.addClosure(this); if (getManager().isDryRun()) { this.body = null; } else { boolean shouldJit = manager.getInstanceConfig().getCompileMode().shouldJIT(); this.body = shouldJit ? new MixedModeIRBlockBody(this, signature) : new InterpretedIRBlockBody(this, signature); if (staticScope != null && !isBeginEndBlock) { staticScope.setIRScope(this); staticScope.setScopeType(this.getScopeType()); } } if (needsCoverage) getFlags().add(IRFlags.CODE_COVERAGE); }
public Operand buildDStr(Variable result, DStrNode node) { Node[] nodePieces = node.children(); Operand[] pieces = new Operand[nodePieces.length]; for (int i = 0; i < pieces.length; i++) { pieces[i] = dynamicPiece(nodePieces[i]); } if (result == null) result = createTemporaryVariable(); boolean debuggingFrozenStringLiteral = manager.getInstanceConfig().isDebuggingFrozenStringLiteral(); addInstr(new BuildCompoundStringInstr(result, pieces, node.getEncoding(), node.isFrozen(), debuggingFrozenStringLiteral, getFileName(), node.getLine())); return result; }
public Operand buildDStr(Variable result, DStrNode node) { Node[] nodePieces = node.children(); Operand[] pieces = new Operand[nodePieces.length]; for (int i = 0; i < pieces.length; i++) { pieces[i] = dynamicPiece(nodePieces[i]); } if (result == null) result = createTemporaryVariable(); boolean debuggingFrozenStringLiteral = manager.getInstanceConfig().isDebuggingFrozenStringLiteral(); addInstr(new BuildCompoundStringInstr(result, pieces, node.getEncoding(), node.isFrozen(), debuggingFrozenStringLiteral, getFileName(), node.getLine())); return result; }
public static BuildCompoundStringInstr decode(IRReaderDecoder d) { boolean debuggingFrozenStringLiteral = d.getCurrentScope().getManager().getInstanceConfig().isDebuggingFrozenStringLiteral(); return new BuildCompoundStringInstr(d.decodeVariable(), d.decodeOperandArray(), d.decodeEncoding(), d.decodeBoolean(), debuggingFrozenStringLiteral, d.decodeString(), d.decodeInt()); }
public static BuildCompoundStringInstr decode(IRReaderDecoder d) { boolean debuggingFrozenStringLiteral = d.getCurrentScope().getManager().getInstanceConfig().isDebuggingFrozenStringLiteral(); return new BuildCompoundStringInstr(d.decodeVariable(), d.decodeOperandArray(), d.decodeEncoding(), d.decodeBoolean(), debuggingFrozenStringLiteral, d.decodeString(), d.decodeInt()); }
public Operand buildDSymbol(Variable result, DSymbolNode node) { Node[] nodePieces = node.children(); Operand[] pieces = new Operand[nodePieces.length]; for (int i = 0; i < pieces.length; i++) { pieces[i] = dynamicPiece(nodePieces[i]); } if (result == null) result = createTemporaryVariable(); boolean debuggingFrozenStringLiteral = manager.getInstanceConfig().isDebuggingFrozenStringLiteral(); addInstr(new BuildCompoundStringInstr(result, pieces, node.getEncoding(), false, debuggingFrozenStringLiteral, getFileName(), node.getLine())); return copyAndReturnValue(new DynamicSymbol(result)); }
public Operand buildDSymbol(Variable result, DSymbolNode node) { Node[] nodePieces = node.children(); Operand[] pieces = new Operand[nodePieces.length]; for (int i = 0; i < pieces.length; i++) { pieces[i] = dynamicPiece(nodePieces[i]); } if (result == null) result = createTemporaryVariable(); boolean debuggingFrozenStringLiteral = manager.getInstanceConfig().isDebuggingFrozenStringLiteral(); addInstr(new BuildCompoundStringInstr(result, pieces, node.getEncoding(), false, debuggingFrozenStringLiteral, getFileName(), node.getLine())); return copyAndReturnValue(new DynamicSymbol(result)); }
public Operand buildDXStr(Variable result, DXStrNode node) { Node[] nodePieces = node.children(); Operand[] pieces = new Operand[nodePieces.length]; for (int i = 0; i < pieces.length; i++) { pieces[i] = dynamicPiece(nodePieces[i]); } Variable stringResult = createTemporaryVariable(); if (result == null) result = createTemporaryVariable(); boolean debuggingFrozenStringLiteral = manager.getInstanceConfig().isDebuggingFrozenStringLiteral(); addInstr(new BuildCompoundStringInstr(stringResult, pieces, node.getEncoding(), false, debuggingFrozenStringLiteral, getFileName(), node.getLine())); return addResultInstr(CallInstr.create(scope, CallType.FUNCTIONAL, result, manager.getRuntime().newSymbol("`"), Self.SELF, new Operand[] { stringResult }, null)); }
public Operand buildDXStr(Variable result, DXStrNode node) { Node[] nodePieces = node.children(); Operand[] pieces = new Operand[nodePieces.length]; for (int i = 0; i < pieces.length; i++) { pieces[i] = dynamicPiece(nodePieces[i]); } Variable stringResult = createTemporaryVariable(); if (result == null) result = createTemporaryVariable(); boolean debuggingFrozenStringLiteral = manager.getInstanceConfig().isDebuggingFrozenStringLiteral(); addInstr(new BuildCompoundStringInstr(stringResult, pieces, node.getEncoding(), false, debuggingFrozenStringLiteral, getFileName(), node.getLine())); return addResultInstr(CallInstr.create(scope, CallType.FUNCTIONAL, result, manager.getRuntime().newSymbol("`"), Self.SELF, new Operand[] { stringResult }, null)); }
/** Used by cloning code */ /* Inlining generates a new name and id and basic cloning will reuse the originals name */ protected IRClosure(IRClosure c, IRScope lexicalParent, int closureId, RubySymbol fullName) { super(c, lexicalParent); this.closureId = closureId; super.setName(fullName); this.startLabel = getNewLabel(getId() + "_START"); this.endLabel = getNewLabel(getId() + "_END"); if (getManager().isDryRun()) { this.body = null; } else { boolean shouldJit = getManager().getInstanceConfig().getCompileMode().shouldJIT(); this.body = shouldJit ? new MixedModeIRBlockBody(c, c.getSignature()) : new InterpretedIRBlockBody(c, c.getSignature()); } this.signature = c.signature; }
/** Used by cloning code */ /* Inlining generates a new name and id and basic cloning will reuse the originals name */ protected IRClosure(IRClosure c, IRScope lexicalParent, int closureId, RubySymbol fullName) { super(c, lexicalParent); this.closureId = closureId; super.setName(fullName); this.startLabel = getNewLabel(getId() + "_START"); this.endLabel = getNewLabel(getId() + "_END"); if (getManager().isDryRun()) { this.body = null; } else { boolean shouldJit = getManager().getInstanceConfig().getCompileMode().shouldJIT(); this.body = shouldJit ? new MixedModeIRBlockBody(c, c.getSignature()) : new InterpretedIRBlockBody(c, c.getSignature()); } this.signature = c.signature; }