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

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

Issue 2686533002: Refactor computation of NativeBehavior. (Closed)
Patch Set: Rebased Created 3 years, 10 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
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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 native.NativeBehavior.ofMethodElement(element, compiler); 776 native.NativeBehavior.ofMethodElement(element, compiler);
777 nativeData.setNativeMethodBehavior(element, behavior); 777 nativeData.setNativeMethodBehavior(element, behavior);
778 registry.registerNativeData(behavior); 778 registry.registerNativeData(behavior);
779 } 779 }
780 } else if (element.isField) { 780 } else if (element.isField) {
781 compiler.enqueuer.resolution.nativeEnqueuer 781 compiler.enqueuer.resolution.nativeEnqueuer
782 .handleFieldAnnotations(element); 782 .handleFieldAnnotations(element);
783 if (isNative(element)) { 783 if (isNative(element)) {
784 native.NativeBehavior fieldLoadBehavior = 784 native.NativeBehavior fieldLoadBehavior =
785 native.NativeBehavior.ofFieldElementLoad(element, compiler); 785 native.NativeBehavior.ofFieldElementLoad(element, compiler);
786 native.NativeBehavior fieldStoreBehavior = native.NativeBehavior 786 native.NativeBehavior fieldStoreBehavior =
787 .ofFieldElementStore(element, compiler.resolution); 787 native.NativeBehavior.ofFieldElementStore(element, compiler);
788 nativeData.setNativeFieldLoadBehavior(element, fieldLoadBehavior); 788 nativeData.setNativeFieldLoadBehavior(element, fieldLoadBehavior);
789 nativeData.setNativeFieldStoreBehavior(element, fieldStoreBehavior); 789 nativeData.setNativeFieldStoreBehavior(element, fieldStoreBehavior);
790 790
791 // TODO(sra): Process fields for storing separately. 791 // TODO(sra): Process fields for storing separately.
792 // We have to handle both loading and storing to the field because we 792 // We have to handle both loading and storing to the field because we
793 // only get one look at each member and there might be a load or store 793 // only get one look at each member and there might be a load or store
794 // we have not seen yet. 794 // we have not seen yet.
795 registry.registerNativeData(fieldLoadBehavior); 795 registry.registerNativeData(fieldLoadBehavior);
796 registry.registerNativeData(fieldStoreBehavior); 796 registry.registerNativeData(fieldStoreBehavior);
797 } 797 }
(...skipping 2371 matching lines...) Expand 10 before | Expand all | Expand 10 after
3169 @override 3169 @override
3170 bool isNativeClass(ClassElement element) { 3170 bool isNativeClass(ClassElement element) {
3171 return _nativeData.isNative(element); 3171 return _nativeData.isNative(element);
3172 } 3172 }
3173 3173
3174 @override 3174 @override
3175 bool isNativeMember(MemberElement element) { 3175 bool isNativeMember(MemberElement element) {
3176 return _nativeData.isNative(element); 3176 return _nativeData.isNative(element);
3177 } 3177 }
3178 } 3178 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/kernel/world_builder.dart » ('j') | pkg/compiler/lib/src/native/behavior.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698