use static bundle (Main.getClassBundle())

only create one runtime environment


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@981 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 558b9aeee9
commit a9eeef15dd
  1. 12
      jode/jode/obfuscator/ConstantRuntimeEnvironment.java

@ -214,9 +214,7 @@ public class ConstantRuntimeEnvironment extends SimpleRuntimeEnvironment {
("Ljava/lang/Math;", "PI", "D")); ("Ljava/lang/Math;", "PI", "D"));
} }
MethodIdentifier m; public ConstantRuntimeEnvironment() {
public ConstantRuntimeEnvironment(MethodIdentifier method) {
m = method;
} }
public Object getField(Reference ref, Object obj) public Object getField(Reference ref, Object obj)
@ -224,8 +222,8 @@ public class ConstantRuntimeEnvironment extends SimpleRuntimeEnvironment {
if (isWhite(ref)) if (isWhite(ref))
return super.getField(ref, obj); return super.getField(ref, obj);
Type type = Type.tType(ref.getType()); Type type = Type.tType(ref.getType());
FieldIdentifier fi = (FieldIdentifier) FieldIdentifier fi
m.clazz.bundle.getIdentifier(ref); = (FieldIdentifier) Main.getClassBundle().getIdentifier(ref);
if (fi != null && !fi.isNotConstant()) { if (fi != null && !fi.isNotConstant()) {
Object result = fi.getConstant(); Object result = fi.getConstant();
if (result == null) if (result == null)
@ -253,8 +251,8 @@ public class ConstantRuntimeEnvironment extends SimpleRuntimeEnvironment {
if (isWhite(ref)) if (isWhite(ref))
return super.invokeMethod(ref, isVirtual, cls, params); return super.invokeMethod(ref, isVirtual, cls, params);
Type type = Type.tType(ref.getType()); Type type = Type.tType(ref.getType());
MethodIdentifier mi = (MethodIdentifier) MethodIdentifier mi
m.clazz.bundle.getIdentifier(ref); = (MethodIdentifier) Main.getClassBundle().getIdentifier(ref);
if (mi != null) { if (mi != null) {
BytecodeInfo code = mi.info.getBytecode(); BytecodeInfo code = mi.info.getBytecode();
if (code != null) { if (code != null) {

Loading…
Cancel
Save