MCPcopy Create free account
hub / github.com/dynjs/dynjs / prepareForInterpret

Method prepareForInterpret

src/main/java/org/dynjs/ir/Scope.java:180–196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

178
179
180 public Instruction[] prepareForInterpret() {
181 final CFG cfg = new CFG(this);
182 final DirectedGraph<BasicBlock> graph = cfg.build(getInstructions());
183
184 // FIXME: Add debug config for this
185// System.out.println(cfg.toStringInstrs());
186// System.out.println(graph.toString());
187
188 // FIXME: We don't save this linearized set yet
189 List<BasicBlock> linearizedCFG = CFGLinearizer.linearize(cfg);
190
191 // FIXME: This is not safe to do in all cases. We need more knowledge to make it 100% safe
192 // FIXME: This is happening twice once for interp and once for compilation. Do only once
193 renameLocalVariables(linearizedCFG);
194
195 return prepareIPCs(linearizedCFG, cfg);
196 }
197
198 private void setupLocalVarReplacement(LocalVariable v, Map<Operand, Operand> varRenameMap) {
199 if (varRenameMap.get(v) == null) varRenameMap.put(v, createTemporaryVariableFor(v));

Callers 2

IRJSProgramMethod · 0.80
IRJSFunctionMethod · 0.80

Calls 5

buildMethod · 0.95
getInstructionsMethod · 0.95
linearizeMethod · 0.95
renameLocalVariablesMethod · 0.95
prepareIPCsMethod · 0.95

Tested by

no test coverage detected