Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 2778803002: Move resolve* from NativeResolutionEnqueuer to NativeDataResolver (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/native/enqueue.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library js_backend.backend; 5 library js_backend.backend;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; 9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames;
10 10
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 /// Returns the [WorldImpact] of enabling deferred loading. 848 /// Returns the [WorldImpact] of enabling deferred loading.
849 WorldImpact computeDeferredLoadingImpact() { 849 WorldImpact computeDeferredLoadingImpact() {
850 backendUsageBuilder.processBackendImpact(impacts.deferredLoading); 850 backendUsageBuilder.processBackendImpact(impacts.deferredLoading);
851 return impacts.deferredLoading.createImpact(compiler.elementEnvironment); 851 return impacts.deferredLoading.createImpact(compiler.elementEnvironment);
852 } 852 }
853 853
854 /// Called when resolving a call to a foreign function. 854 /// Called when resolving a call to a foreign function.
855 native.NativeBehavior resolveForeignCall(Send node, Element element, 855 native.NativeBehavior resolveForeignCall(Send node, Element element,
856 CallStructure callStructure, ForeignResolver resolver) { 856 CallStructure callStructure, ForeignResolver resolver) {
857 if (element.name == BackendHelpers.JS) { 857 if (element.name == BackendHelpers.JS) {
858 return _nativeResolutionEnqueuer.resolveJsCall(node, resolver); 858 return _nativeDataResolver.resolveJsCall(node, resolver);
859 } else if (element.name == BackendHelpers.JS_EMBEDDED_GLOBAL) { 859 } else if (element.name == BackendHelpers.JS_EMBEDDED_GLOBAL) {
860 return _nativeResolutionEnqueuer.resolveJsEmbeddedGlobalCall( 860 return _nativeDataResolver.resolveJsEmbeddedGlobalCall(node, resolver);
861 node, resolver);
862 } else if (element.name == BackendHelpers.JS_BUILTIN) { 861 } else if (element.name == BackendHelpers.JS_BUILTIN) {
863 return _nativeResolutionEnqueuer.resolveJsBuiltinCall(node, resolver); 862 return _nativeDataResolver.resolveJsBuiltinCall(node, resolver);
864 } else if (element.name == BackendHelpers.JS_INTERCEPTOR_CONSTANT) { 863 } else if (element.name == BackendHelpers.JS_INTERCEPTOR_CONSTANT) {
865 // The type constant that is an argument to JS_INTERCEPTOR_CONSTANT names 864 // The type constant that is an argument to JS_INTERCEPTOR_CONSTANT names
866 // a class that will be instantiated outside the program by attaching a 865 // a class that will be instantiated outside the program by attaching a
867 // native class dispatch record referencing the interceptor. 866 // native class dispatch record referencing the interceptor.
868 if (!node.argumentsNode.isEmpty) { 867 if (!node.argumentsNode.isEmpty) {
869 Node argument = node.argumentsNode.nodes.head; 868 Node argument = node.argumentsNode.nodes.head;
870 ConstantExpression constant = resolver.getConstant(argument); 869 ConstantExpression constant = resolver.getConstant(argument);
871 if (constant != null && constant.kind == ConstantExpressionKind.TYPE) { 870 if (constant != null && constant.kind == ConstantExpressionKind.TYPE) {
872 TypeConstantExpression typeConstant = constant; 871 TypeConstantExpression typeConstant = constant;
873 if (typeConstant.type is ResolutionInterfaceType) { 872 if (typeConstant.type is ResolutionInterfaceType) {
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 return _backend.defaultSuperclass(element); 1614 return _backend.defaultSuperclass(element);
1616 } 1615 }
1617 1616
1618 @override 1617 @override
1619 bool isNativeClass(ClassEntity element) => 1618 bool isNativeClass(ClassEntity element) =>
1620 _backend.nativeBasicData.isNativeClass(element); 1619 _backend.nativeBasicData.isNativeClass(element);
1621 1620
1622 @override 1621 @override
1623 bool isForeign(Element element) => _backend.isForeign(element); 1622 bool isForeign(Element element) => _backend.isForeign(element);
1624 } 1623 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/native/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698