1. Removal of unused fields and methods:

Codegen.java:
-    private int ordinal;
-    private short scriptRuntimeIndex;
-    private short debug_pcLocal;
-    private short debugStopSubRetLocal;

OptFunctionNode.java
-    private ObjArray itsDirectCallTargets;
-    void addDirectCallTarget(FunctionNode target) {
-    ObjArray getDirectCallTargets() {

2. Better naming and method moves in Codegen.java for better readability
This commit is contained in:
igor%mir2.org 2003-03-10 17:46:32 +00:00
Родитель 4d297c4ca3
Коммит 1acdc5f2f0
3 изменённых файлов: 857 добавлений и 862 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -82,19 +82,6 @@ class OptFunctionNode extends FunctionNode {
return itsIsTargetOfDirectCall;
}
void addDirectCallTarget(FunctionNode target) {
if (itsDirectCallTargets == null)
itsDirectCallTargets = new ObjArray();
for (int i = 0; i < itsDirectCallTargets.size(); i++) // OPT !!
if (((FunctionNode)itsDirectCallTargets.get(i)) == target)
return;
itsDirectCallTargets.add(target);
}
ObjArray getDirectCallTargets() {
return itsDirectCallTargets;
}
void setIsTargetOfDirectCall() {
itsIsTargetOfDirectCall = true;
}
@ -107,19 +94,6 @@ class OptFunctionNode extends FunctionNode {
return itsParameterNumberContext;
}
boolean containsCalls(int argCount) {
if ((argCount < itsContainsCallsCount.length) && (argCount >= 0))
return itsContainsCallsCount[argCount];
else
return itsContainsCalls;
}
void setContainsCalls(int argCount) {
if (argCount < itsContainsCallsCount.length)
itsContainsCallsCount[argCount] = true;
itsContainsCalls = true;
}
int getVarCount() {
return optVars.length;
}
@ -161,8 +135,7 @@ class OptFunctionNode extends FunctionNode {
private OptLocalVariable[] optVars;
private String itsClassName;
private boolean itsIsTargetOfDirectCall;
private boolean itsContainsCalls;
private boolean[] itsContainsCallsCount = new boolean[4];
private boolean itsParameterNumberContext;
private ObjArray itsDirectCallTargets;
boolean itsContainsCalls0;
boolean itsContainsCalls1;
}

Просмотреть файл

@ -105,8 +105,9 @@ class OptTransformer extends NodeTransformer {
protected void visitCall(Node node, ScriptOrFnNode tree) {
int argCount = detectDirectCall(node, tree);
if (inFunction && (argCount == 0))
((OptFunctionNode)tree).setContainsCalls(argCount);
if (inFunction && (argCount == 0)) {
((OptFunctionNode)tree).itsContainsCalls0 = true;
}
super.visitCall(node, tree);
}
@ -138,8 +139,6 @@ class OptTransformer extends NodeTransformer {
if (argCount == N) {
callNode.putProp(Node.DIRECTCALL_PROP, theFunction);
((OptFunctionNode)containingTree)
.addDirectCallTarget(theFunction);
theFunction.setIsTargetOfDirectCall();
}
}