From 87d617665bbe9e98b2c0fc00138d5b9699443d4f Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewa Date: Sun, 31 Jan 2021 11:13:40 +0100 Subject: [PATCH] foo --- .../callable/resolver/BaseResolverNode.java | 93 ------------------- 1 file changed, 93 deletions(-) diff --git a/engine/runtime/src/main/java/org/enso/interpreter/node/callable/resolver/BaseResolverNode.java b/engine/runtime/src/main/java/org/enso/interpreter/node/callable/resolver/BaseResolverNode.java index 08cf6eb629c7..bec6ad75e30f 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/node/callable/resolver/BaseResolverNode.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/node/callable/resolver/BaseResolverNode.java @@ -23,67 +23,6 @@ protected Function throwIfNull( return function; } - @CompilerDirectives.TruffleBoundary - protected Function resolveMethodOnAtom( - Context context, AtomConstructor cons, UnresolvedSymbol symbol) { - return symbol.resolveFor(cons, context.getBuiltins().any()); - } - - @CompilerDirectives.TruffleBoundary - Function resolveMethodOnLong(Context context, UnresolvedSymbol symbol) { - Number number = context.getBuiltins().number(); - return symbol.resolveFor( - number.getSmallInteger(), - number.getInteger(), - number.getNumber(), - context.getBuiltins().any()); - } - - @CompilerDirectives.TruffleBoundary - Function resolveMethodOnBigInteger(Context context, UnresolvedSymbol symbol) { - Number number = context.getBuiltins().number(); - return symbol.resolveFor( - number.getBigInteger(), - number.getInteger(), - number.getNumber(), - context.getBuiltins().any()); - } - - @CompilerDirectives.TruffleBoundary - Function resolveMethodOnDouble(Context context, UnresolvedSymbol symbol) { - Number number = context.getBuiltins().number(); - return symbol.resolveFor(number.getDecimal(), number.getNumber(), context.getBuiltins().any()); - } - - @CompilerDirectives.TruffleBoundary - Function resolveMethodOnPrimBoolean(Context context, UnresolvedSymbol symbol) { - Bool bool = context.getBuiltins().bool(); - if (symbol.resolveFor(bool.getFalse()) != null) { - return null; - } - if (symbol.resolveFor(bool.getTrue()) != null) { - return null; - } - return symbol.resolveFor(bool.getBool(), context.getBuiltins().any()); - } - - @CompilerDirectives.TruffleBoundary - Function resolveMethodOnBool(Context context, boolean self, UnresolvedSymbol symbol) { - Bool bool = context.getBuiltins().bool(); - AtomConstructor cons = self ? bool.getTrue() : bool.getFalse(); - return symbol.resolveFor(cons, bool.getBool(), context.getBuiltins().any()); - } - - @CompilerDirectives.TruffleBoundary - Function resolveMethodOnString(Context context, UnresolvedSymbol symbol) { - return symbol.resolveFor(context.getBuiltins().text().getText(), context.getBuiltins().any()); - } - - @CompilerDirectives.TruffleBoundary - Function resolveMethodOnFunction(Context context, UnresolvedSymbol symbol) { - return symbol.resolveFor(context.getBuiltins().function(), context.getBuiltins().any()); - } - @CompilerDirectives.TruffleBoundary Function resolveMethodOnError(Context context, UnresolvedSymbol symbol) { return symbol.resolveFor(context.getBuiltins().dataflowError().constructor()); @@ -93,36 +32,4 @@ Function resolveMethodOnError(Context context, UnresolvedSymbol symbol) { Function resolveMethodOnAny(Context context, UnresolvedSymbol symbol) { return symbol.resolveFor(context.getBuiltins().any()); } - - @CompilerDirectives.TruffleBoundary - Function resolveMethodOnArray(Context context, UnresolvedSymbol symbol) { - return symbol.resolveFor(context.getBuiltins().mutable().array(), context.getBuiltins().any()); - } - - @CompilerDirectives.TruffleBoundary - Function buildHostResolver(Context context, UnresolvedSymbol symbol) { - if (symbol.getName().equals("new")) { - return context.getBuiltins().polyglot().getConstructorDispatch(); - } else if (symbol.getName().equals("to_text")) { - return context.getBuiltins().polyglot().getPolyglotToTextFunction(); - } else if (symbol.getName().equals("catch")) { - return symbol.resolveFor(context.getBuiltins().any()); - } else if (symbol.getName().equals("==")) { - return symbol.resolveFor(context.getBuiltins().any()); - } else { - return context.getBuiltins().polyglot().buildPolyglotMethodDispatch(symbol); - } - } - - static boolean isPolyglotArrayMethod(UnresolvedSymbol symbol) { - return symbol.getName().equals("at") || symbol.getName().equals("length"); - } - - Function resolveMethodOnPolyglotArray(Context context, UnresolvedSymbol symbol) { - if (symbol.getName().equals("length")) { - return context.getBuiltins().polyglot().getPolyglotArrayLengthFunction(); - } else { - return context.getBuiltins().polyglot().getPolyglotArrayAtFunction(); - } - } }