Remove markLiveAcrossCall functionality that was never used for any optimizations

This commit is contained in:
igor%mir2.org 2004-05-08 21:05:00 +00:00
parent 9e6291f693
commit 07a54c7b74
3 changed files with 1 additions and 76 deletions

View File

@ -243,60 +243,6 @@ class Block
return sw.toString();
}
/*
We maintain the liveSet as each statement executes, identifying
those variables that are live across function calls
*/
void lookForVariablesAndCalls(Node n, boolean liveSet[],
OptFunctionNode fn)
{
switch (n.getType()) {
case Token.SETVAR :
{
Node lhs = n.getFirstChild();
Node rhs = lhs.getNext();
lookForVariablesAndCalls(rhs, liveSet, fn);
Object theVarProp = n.getProp(Node.VARIABLE_PROP);
if (theVarProp != null) {
int theVarIndex = ((OptLocalVariable)theVarProp).getIndex();
liveSet[theVarIndex] = true;
}
}
break;
case Token.CALL : {
Node child = n.getFirstChild();
while (child != null) {
lookForVariablesAndCalls(child, liveSet, fn);
child = child.getNext();
}
for (int i = 0; i < liveSet.length; i++) {
if (liveSet[i])
fn.getVar(i).markLiveAcrossCall();
}
}
break;
case Token.GETVAR :
{
Object theVarProp = n.getProp(Node.VARIABLE_PROP);
if (theVarProp != null) {
int theVarIndex = ((OptLocalVariable)theVarProp).getIndex();
if ((n.getProp(Node.LASTUSE_PROP) != null)
&& !itsLiveOnExitSet.test(theVarIndex))
liveSet[theVarIndex] = false;
}
}
break;
default :
Node child = n.getFirstChild();
while (child != null) {
lookForVariablesAndCalls(child, liveSet, fn);
child = child.getNext();
}
break;
}
}
void markAnyTypeVariables(OptFunctionNode fn)
{
for (int i = 0; i < fn.getVarCount(); i++)
@ -305,17 +251,6 @@ class Block
}
void markVolatileVariables(OptFunctionNode fn)
{
boolean liveSet[] = new boolean[fn.getVarCount()];
for (int i = 0; i < liveSet.length; i++)
liveSet[i] = itsLiveOnEntrySet.test(i);
for (int i = itsStartNodeIndex; i <= itsEndNodeIndex; i++) {
Node n = itsStatementNodes[i];
lookForVariablesAndCalls(n, liveSet, fn);
}
}
/*
We're tracking uses and defs - in order to
build the def set and to identify the last use
@ -424,7 +359,7 @@ class Block
Literals,
Arithmetic operations - always return a Number
*/
int findExpressionType(Node n)
private static int findExpressionType(Node n)
{
switch (n.getType()) {
case Token.NUMBER :

View File

@ -53,7 +53,6 @@ final class OptLocalVariable implements JavaVariable {
public String toString() {
return "LocalVariable : '" + getName()
+ "', index = " + getIndex()
+ ", LiveAcrossCall = " + itsLiveAcrossCall
+ ", isNumber = " + itsIsNumber
+ ", isParameter = " + isParameter()
+ ", JRegister = " + itsJRegister;
@ -104,10 +103,6 @@ final class OptLocalVariable implements JavaVariable {
boolean isParameter() { return itsIsParameter; }
void markLiveAcrossCall() { itsLiveAcrossCall = true; }
void clearLiveAcrossCall() { itsLiveAcrossCall = false; }
boolean isLiveAcrossCall() { return itsLiveAcrossCall; }
boolean assignType(int aType) {
itsTypeUnion |= aType;
return itsTypeUnion != aType;
@ -123,7 +118,6 @@ final class OptLocalVariable implements JavaVariable {
private short itsJRegister = -1; // unassigned
private boolean itsLiveAcrossCall;
private boolean itsIsNumber;
private int itsTypeUnion; // the union of all assigned types

View File

@ -292,10 +292,6 @@ class Optimizer
'undefined'-ness of that variable.
*/
for (int i = 0; i < theBlocks.length; i++) {
theBlocks[i].markVolatileVariables(fn);
}
theBlocks[0].markAnyTypeVariables(fn);
}