Chromium Code Reviews| Index: pkg/compiler/lib/src/js_backend/backend.dart |
| diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart |
| index 638a1775d37269538c2b2c26b32010c07bed92e5..c6485bbcdcf77f8579c7a22920e1f5530e85ec29 100644 |
| --- a/pkg/compiler/lib/src/js_backend/backend.dart |
| +++ b/pkg/compiler/lib/src/js_backend/backend.dart |
| @@ -2991,6 +2991,7 @@ class JavaScriptResolutionCallbacks extends ResolutionCallbacks { |
| registerBackendInstantiation(backend.compiler.listClass, registry); |
| registerBackendStaticInvocation(backend.getRuntimeTypeToString(), registry); |
| registerBackendStaticInvocation(backend.getCreateRuntimeType(), registry); |
| + needsInt(registry); // Needed for accessing the type variable literal. |
|
karlklose
2015/09/11 12:21:15
Maybe we should make these comments into string ar
Johnni Winther
2015/09/11 12:38:36
Done.
|
| } |
| // TODO(johnniwinther): Maybe split this into [onAssertType] and [onTestType]. |
| @@ -3051,7 +3052,7 @@ class JavaScriptResolutionCallbacks extends ResolutionCallbacks { |
| registerBackendStaticInvocation( |
| backend.getThrowAbstractClassInstantiationError(), registry); |
| // Also register the types of the arguments passed to this method. |
| - registerBackendInstantiation(backend.compiler.stringClass, registry); |
| + needsString(registry); // Needed to encode the message. |
| } |
| void onFallThroughError(Registry registry) { |
| @@ -3068,8 +3069,8 @@ class JavaScriptResolutionCallbacks extends ResolutionCallbacks { |
| assert(registry.isForResolution); |
| registerBackendStaticInvocation(backend.getThrowNoSuchMethod(), registry); |
| // Also register the types of the arguments passed to this method. |
| - registerBackendInstantiation(backend.compiler.listClass, registry); |
| - registerBackendInstantiation(backend.compiler.stringClass, registry); |
| + needsList(registry); // Needed to encode the arguments. |
| + needsString(registry); // Needed to encode the name. |
| } |
| void onThrowRuntimeError(Registry registry) { |
| @@ -3094,8 +3095,9 @@ class JavaScriptResolutionCallbacks extends ResolutionCallbacks { |
| backend.compiler.objectClass.lookupLocalMember( |
| Identifiers.noSuchMethod_), |
| registry); |
| - registerBackendInstantiation(backend.compiler.listClass, registry); |
| - registerBackendInstantiation(backend.compiler.stringClass, registry); |
| + needsInt(registry); // Needed to encode the invocation kind. |
| + needsList(registry); // Needed to encode the arguments. |
| + needsString(registry); // Needed to encode the name. |
| } |
| void onMapLiteral(ResolutionRegistry registry, |
| @@ -3125,6 +3127,26 @@ class JavaScriptResolutionCallbacks extends ResolutionCallbacks { |
| registerBackendStaticInvocation( |
| backend.compiler.symbolValidatedConstructor, registry); |
| } |
| + |
| + /// Called when resolving a prefix or postfix expression. |
| + void onIncDecOperation(Registry registry) { |
| + needsInt(registry); // Need for the `+ 1` or `- 1` operation. |
| + } |
| + |
| + /// Helper for registering that `int` is needed. |
| + void needsInt(Registry registry) { |
| + registerBackendInstantiation(backend.compiler.intClass, registry); |
| + } |
| + |
| + /// Helper for registering that `List` is needed. |
| + void needsList(Registry registry) { |
| + registerBackendInstantiation(backend.compiler.listClass, registry); |
| + } |
| + |
| + /// Helper for registering that `String` is needed. |
| + void needsString(Registry registry) { |
| + registerBackendInstantiation(backend.compiler.stringClass, registry); |
| + } |
| } |
| /// Records that [constant] is used by the element behind [registry]. |