diff options
-rw-r--r-- | sources/scala/tools/scalai/Compiler.java | 46 | ||||
-rw-r--r-- | sources/scala/tools/scalai/Evaluator.java | 4 |
2 files changed, 2 insertions, 48 deletions
diff --git a/sources/scala/tools/scalai/Compiler.java b/sources/scala/tools/scalai/Compiler.java index 7e79fa692c..afe54097fd 100644 --- a/sources/scala/tools/scalai/Compiler.java +++ b/sources/scala/tools/scalai/Compiler.java @@ -159,56 +159,10 @@ public class Compiler { // !!! method java.lang.Object.wait(long) // !!! method java.lang.Object.wait(long, int) - java.lang.reflect.Method bang_method = null; - try { - bang_method = scala.Boolean.class.getMethod("$bang", - new Class[0]); - } catch (Exception exception) { - throw Debug.abort("$bang", exception); - } - java.lang.reflect.Method box_boolean_method = null; - try { - box_boolean_method = - RunTime.class.getMethod("box", new Class[] { boolean.class }); - } catch (Exception exception) { - throw Debug.abort("RunTime.box(boolean)", exception); - } - - CodePromise eqeq_code = new CodePromise( - new CodeContainer( - definitions.EQEQ, - Code.Invoke( - Code.Self, Function.JavaMethod(equals_method), new Code[] { - Code.Load( - Code.Null, - Variable.Argument(0)) }, - 0), - 0)); - any_methods.put(definitions.EQEQ, eqeq_code); environment.insertFunction(definitions.EQEQ, Function.EqEq); Override eqeq_override = Override.empty().insert(definitions.EQEQ); environment.insertOverride(definitions.EQEQ, eqeq_override); - CodePromise bangeq_code = new CodePromise( - new CodeContainer( - definitions.BANGEQ, - Code.Invoke( - Code.Invoke( - Code.Null, - Function.JavaMethod(box_boolean_method), - new Code[] { - Code.Invoke( - Code.Self, Function.EqEq, new Code[] { - Code.Load( - Code.Null, - Variable.Argument(0)) }, - 0)}, - 0), - Function.JavaMethod(bang_method), - new Code[0], - 0), - 0)); - any_methods.put(definitions.BANGEQ, bangeq_code); environment.insertFunction(definitions.BANGEQ, Function.BangEq); Override bangeq_override = Override.empty().insert(definitions.BANGEQ); environment.insertOverride(definitions.BANGEQ, bangeq_override); diff --git a/sources/scala/tools/scalai/Evaluator.java b/sources/scala/tools/scalai/Evaluator.java index f9f6530af1..60eb4dd6ee 100644 --- a/sources/scala/tools/scalai/Evaluator.java +++ b/sources/scala/tools/scalai/Evaluator.java @@ -262,11 +262,11 @@ public class Evaluator { case EqEq: assert args.length == 1 : Debug.show(args); - return object == null ? new Boolean(args[0] == null) : isScalaObject(object) ? getScalaObject(object).invoke(object, scalac.Global.instance.definitions.EQEQ, args) : new Boolean(object.equals(args[0])); // !!! + return object == null ? new Boolean(args[0] == null) : new Boolean(object.equals(args[0])); // !!! case BangEq: assert args.length == 1 : Debug.show(args); - return object == null ? new Boolean(args[0] != null) : isScalaObject(object) ? getScalaObject(object).invoke(object, scalac.Global.instance.definitions.BANGEQ, args) : new Boolean(!object.equals(args[0])); // !!! + return object == null ? new Boolean(args[0] != null) : new Boolean(!object.equals(args[0])); // !!! case HashCode: assert args.length == 0 : Debug.show(args); |