| 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 37dd0ae333038226b49027cb39d9ab9ec0e54bbc..0b4eba7d346ab5105831acca3509998f206b5a51 100644
|
| --- a/pkg/compiler/lib/src/js_backend/codegen/glue.dart
|
| +++ b/pkg/compiler/lib/src/js_backend/codegen/glue.dart
|
| @@ -7,6 +7,8 @@ library code_generator_dependencies;
|
| import '../js_backend.dart';
|
| import '../../common/registry.dart' show
|
| Registry;
|
| +import '../../common/codegen.dart' show
|
| + CodegenRegistry;
|
| import '../../compiler.dart' show
|
| Compiler;
|
| import '../../constants/values.dart';
|
| @@ -19,6 +21,7 @@ import '../../enqueue.dart' show
|
| import '../../elements/elements.dart';
|
| import '../../js_emitter/js_emitter.dart';
|
| import '../../js/js.dart' as js;
|
| +import '../../native/native.dart' show NativeBehavior;
|
| import '../../universe/selector.dart' show
|
| Selector;
|
| import '../../world.dart' show
|
| @@ -126,6 +129,10 @@ class Glue {
|
| return _backend.getInterceptedClassesOn(selector.name);
|
| }
|
|
|
| + Set<ClassElement> get interceptedClasses {
|
| + return _backend.interceptedClasses;
|
| + }
|
| +
|
| void registerSpecializedGetInterceptor(Set<ClassElement> classes) {
|
| _backend.registerSpecializedGetInterceptor(classes);
|
| }
|
| @@ -228,12 +235,15 @@ class Glue {
|
| }
|
|
|
| js.Expression generateTypeRepresentation(DartType dartType,
|
| - List<js.Expression> arguments) {
|
| + List<js.Expression> arguments,
|
| + CodegenRegistry registry) {
|
| int variableIndex = 0;
|
| js.Expression representation = _backend.rti.getTypeRepresentation(
|
| dartType,
|
| (_) => arguments[variableIndex++]);
|
| assert(variableIndex == arguments.length);
|
| + // Representation contains JavaScript Arrays.
|
| + registry.registerInstantiatedClass(_backend.jsArrayClass);
|
| return representation;
|
| }
|
|
|
| @@ -258,7 +268,10 @@ class Glue {
|
| return _compiler.world.hasAnyStrictSubtype(element);
|
| }
|
|
|
| + ClassElement get jsFixedArrayClass => _backend.jsFixedArrayClass;
|
| ClassElement get jsExtendableArrayClass => _backend.jsExtendableArrayClass;
|
| + ClassElement get jsUnmodifiableArrayClass =>
|
| + _backend.jsUnmodifiableArrayClass;
|
| ClassElement get jsMutableArrayClass => _backend.jsMutableArrayClass;
|
|
|
| bool isStringClass(ClassElement classElement) =>
|
| @@ -268,4 +281,10 @@ class Glue {
|
| bool isBoolClass(ClassElement classElement) =>
|
| classElement == _backend.jsBoolClass ||
|
| classElement == _compiler.boolClass;
|
| +
|
| + // TODO(sra): Should this be part of CodegenRegistry?
|
| + void registerNativeBehavior(NativeBehavior nativeBehavior, node) {
|
| + if (nativeBehavior == null) return;
|
| + _enqueuer.nativeEnqueuer.registerNativeBehavior(nativeBehavior, node);
|
| + }
|
| }
|
|
|