Chromium Code Reviews| Index: pkg/compiler/lib/src/js_backend/codegen/glue.dart |
| diff --git a/pkg/compiler/lib/src/js_backend/codegen/glue.dart b/pkg/compiler/lib/src/js_backend/codegen/glue.dart |
| index dbe95dabb40a33f84295d1e24dd86abf2abf1d24..6d7197d45a8520228fadf23c2a8914f5e2f80166 100644 |
| --- a/pkg/compiler/lib/src/js_backend/codegen/glue.dart |
| +++ b/pkg/compiler/lib/src/js_backend/codegen/glue.dart |
| @@ -12,6 +12,24 @@ import '../../constants/values.dart'; |
| import '../../elements/elements.dart'; |
| import '../../constants/expressions.dart'; |
| import '../../closure.dart' show ClosureClassElement; |
| +import '../../universe/universe.dart' show SelectorKind; |
| + |
| +/// A non-call selector translated to JavaScript call semantics. |
| +/// |
| +/// The name of the this selector is already the correct JavaScript target name |
| +/// as translated by the namer. |
| +class JsCallSelector extends Selector { |
| + /// The selector from which this selector originated. This selector is used |
| + /// to identify possible targets using Dart semantics. |
| + final Selector source; |
| + JsCallSelector(Selector source, |
| + String name, |
| + int arity, |
| + List<String> namedArguments) |
| + : this.source = source, |
| + super.internal(SelectorKind.CALL, name, null, arity, namedArguments, |
| + <String>[], source.hashCode * 13 + name.hashCode); |
| +} |
|
asgerf
2015/01/21 10:21:05
It seems to me the JsCallSelector is never created
|
| /// Encapsulates the dependencies of the function-compiler to the compiler, |
| /// backend and emitter. |
| @@ -60,6 +78,9 @@ class Glue { |
| FunctionElement get identicalFunction => _compiler.identicalFunction; |
| String invocationName(Selector selector) { |
| + if (selector is JsCallSelector) { |
| + return selector.name; |
| + } |
| return _namer.invocationName(selector); |
| } |
| @@ -95,4 +116,15 @@ class Glue { |
| hasBeenInstantiated: hasBeenInstantiated); |
| } |
| + |
| + String getInterceptorName(Set<ClassElement> interceptedClasses) { |
| + return _backend.namer.getInterceptorName( |
| + getInterceptorMethod, |
| + interceptedClasses); |
| + } |
| + |
| + js.Expression getInterceptorLibrary() { |
| + return new js.VariableUse( |
| + _backend.namer.globalObjectFor(_backend.interceptorsLibrary)); |
| + } |
| } |