private static void buildStatementList_r(Node node, ObjArray statements) { int type = node.getType(); if (type == Token.BLOCK || type == Token.LOCAL_BLOCK || type == Token.LOOP || type == Token.FUNCTION) { Node child = node.getFirstChild(); while (child != null) { buildStatementList_r(child, statements); child = child.getNext(); } } else { statements.add(node); } }
private static void buildStatementList_r(Node node, ObjArray statements) { int type = node.getType(); if (type == Token.BLOCK || type == Token.LOCAL_BLOCK || type == Token.LOOP || type == Token.FUNCTION) { Node child = node.getFirstChild(); while (child != null) { buildStatementList_r(child, statements); child = child.getNext(); } } else { statements.add(node); } }
private static void buildStatementList_r(Node node, ObjArray statements) { int type = node.getType(); if (type == Token.BLOCK || type == Token.LOCAL_BLOCK || type == Token.LOOP || type == Token.FUNCTION) { Node child = node.getFirstChild(); while (child != null) { buildStatementList_r(child, statements); child = child.getNext(); } } else { statements.add(node); } }
private static void buildStatementList_r(Node node, ObjArray statements) { int type = node.getType(); if (type == Token.BLOCK || type == Token.LOCAL_BLOCK || type == Token.LOOP || type == Token.FUNCTION) { Node child = node.getFirstChild(); while (child != null) { buildStatementList_r(child, statements); child = child.getNext(); } } else { statements.add(node); } }
private static void buildStatementList_r(Node node, ObjArray statements) { int type = node.getType(); if (type == Token.BLOCK || type == Token.LOCAL_BLOCK || type == Token.LOOP || type == Token.FUNCTION) { Node child = node.getFirstChild(); while (child != null) { buildStatementList_r(child, statements); child = child.getNext(); } } else { statements.add(node); } }
private static void buildStatementList_r(Node node, ObjArray statements) { int type = node.getType(); if (type == Token.BLOCK || type == Token.LOCAL_BLOCK || type == Token.LOOP || type == Token.FUNCTION) { Node child = node.getFirstChild(); while (child != null) { buildStatementList_r(child, statements); child = child.getNext(); } } else { statements.add(node); } }
private void optimizeFunction(OptFunctionNode theFunction) { if (theFunction.fnode.requiresActivation()) return; inDirectCallFunction = theFunction.isTargetOfDirectCall(); this.theFunction = theFunction; ObjArray statementsArray = new ObjArray(); buildStatementList_r(theFunction.fnode, statementsArray); Node[] theStatementNodes = new Node[statementsArray.size()]; statementsArray.toArray(theStatementNodes); Block.runFlowAnalyzes(theFunction, theStatementNodes); if (!theFunction.fnode.requiresActivation()) { /* * Now that we know which local vars are in fact always * Numbers, we re-write the tree to take advantage of * that. Any arithmetic or assignment op involving just * Number typed vars is marked so that the codegen will * generate non-object code. */ parameterUsedInNumberContext = false; for (Node theStatementNode : theStatementNodes) { rewriteForNumberVariables(theStatementNode, NumberType); } theFunction.setParameterNumberContext(parameterUsedInNumberContext); } }
private void optimizeFunction(OptFunctionNode theFunction) { if (theFunction.fnode.requiresActivation()) return; inDirectCallFunction = theFunction.isTargetOfDirectCall(); this.theFunction = theFunction; ObjArray statementsArray = new ObjArray(); buildStatementList_r(theFunction.fnode, statementsArray); Node[] theStatementNodes = new Node[statementsArray.size()]; statementsArray.toArray(theStatementNodes); Block.runFlowAnalyzes(theFunction, theStatementNodes); if (!theFunction.fnode.requiresActivation()) { /* * Now that we know which local vars are in fact always * Numbers, we re-write the tree to take advantage of * that. Any arithmetic or assignment op involving just * Number typed vars is marked so that the codegen will * generate non-object code. */ parameterUsedInNumberContext = false; for (int i = 0; i < theStatementNodes.length; i++) { rewriteForNumberVariables(theStatementNodes[i], NumberType); } theFunction.setParameterNumberContext(parameterUsedInNumberContext); } }
private void optimizeFunction(OptFunctionNode theFunction) { if (theFunction.fnode.requiresActivation()) return; inDirectCallFunction = theFunction.isTargetOfDirectCall(); this.theFunction = theFunction; ObjArray statementsArray = new ObjArray(); buildStatementList_r(theFunction.fnode, statementsArray); Node[] theStatementNodes = new Node[statementsArray.size()]; statementsArray.toArray(theStatementNodes); Block.runFlowAnalyzes(theFunction, theStatementNodes); if (!theFunction.fnode.requiresActivation()) { /* * Now that we know which local vars are in fact always * Numbers, we re-write the tree to take advantage of * that. Any arithmetic or assignment op involving just * Number typed vars is marked so that the codegen will * generate non-object code. */ parameterUsedInNumberContext = false; for (Node theStatementNode : theStatementNodes) { rewriteForNumberVariables(theStatementNode, NumberType); } theFunction.setParameterNumberContext(parameterUsedInNumberContext); } }
private void optimizeFunction(OptFunctionNode theFunction) { if (theFunction.fnode.requiresActivation()) return; inDirectCallFunction = theFunction.isTargetOfDirectCall(); this.theFunction = theFunction; ObjArray statementsArray = new ObjArray(); buildStatementList_r(theFunction.fnode, statementsArray); Node[] theStatementNodes = new Node[statementsArray.size()]; statementsArray.toArray(theStatementNodes); Block.runFlowAnalyzes(theFunction, theStatementNodes); if (!theFunction.fnode.requiresActivation()) { /* * Now that we know which local vars are in fact always * Numbers, we re-write the tree to take advantage of * that. Any arithmetic or assignment op involving just * Number typed vars is marked so that the codegen will * generate non-object code. */ parameterUsedInNumberContext = false; for (Node theStatementNode : theStatementNodes) { rewriteForNumberVariables(theStatementNode, NumberType); } theFunction.setParameterNumberContext(parameterUsedInNumberContext); } }
private void optimizeFunction(OptFunctionNode theFunction) { if (theFunction.fnode.requiresActivation()) return; inDirectCallFunction = theFunction.isTargetOfDirectCall(); this.theFunction = theFunction; ObjArray statementsArray = new ObjArray(); buildStatementList_r(theFunction.fnode, statementsArray); Node[] theStatementNodes = new Node[statementsArray.size()]; statementsArray.toArray(theStatementNodes); Block.runFlowAnalyzes(theFunction, theStatementNodes); if (!theFunction.fnode.requiresActivation()) { /* * Now that we know which local vars are in fact always * Numbers, we re-write the tree to take advantage of * that. Any arithmetic or assignment op involving just * Number typed vars is marked so that the codegen will * generate non-object code. */ parameterUsedInNumberContext = false; for (Node theStatementNode : theStatementNodes) { rewriteForNumberVariables(theStatementNode, NumberType); } theFunction.setParameterNumberContext(parameterUsedInNumberContext); } }
private void optimizeFunction(OptFunctionNode theFunction) { if (theFunction.fnode.requiresActivation()) return; inDirectCallFunction = theFunction.isTargetOfDirectCall(); this.theFunction = theFunction; ObjArray statementsArray = new ObjArray(); buildStatementList_r(theFunction.fnode, statementsArray); Node[] theStatementNodes = new Node[statementsArray.size()]; statementsArray.toArray(theStatementNodes); Block.runFlowAnalyzes(theFunction, theStatementNodes); if (!theFunction.fnode.requiresActivation()) { /* * Now that we know which local vars are in fact always * Numbers, we re-write the tree to take advantage of * that. Any arithmetic or assignment op involving just * Number typed vars is marked so that the codegen will * generate non-object code. */ parameterUsedInNumberContext = false; for (int i = 0; i < theStatementNodes.length; i++) { rewriteForNumberVariables(theStatementNodes[i]); } theFunction.setParameterNumberContext(parameterUsedInNumberContext); } }