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

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

Issue 2824423002: Compute NativeBasicData for KernelWorldBuilder (Closed)
Patch Set: Updated cf. comments. 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 | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/kernel/element_adapter.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.native_data; 5 library js_backend.native_data;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common_elements.dart' show ElementEnvironment; 8 import '../common_elements.dart' show ElementEnvironment;
9 import '../elements/entities.dart'; 9 import '../elements/entities.dart';
10 import '../native/behavior.dart' show NativeBehavior; 10 import '../native/behavior.dart' show NativeBehavior;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 Set<LibraryEntity> jsInteropLibraries = new Set<LibraryEntity>(); 149 Set<LibraryEntity> jsInteropLibraries = new Set<LibraryEntity>();
150 150
151 /// The JavaScript classes implemented via typed JavaScript interop. 151 /// The JavaScript classes implemented via typed JavaScript interop.
152 Set<ClassEntity> jsInteropClasses = new Set<ClassEntity>(); 152 Set<ClassEntity> jsInteropClasses = new Set<ClassEntity>();
153 153
154 /// Sets the native tag info for [cls]. 154 /// Sets the native tag info for [cls].
155 /// 155 ///
156 /// The tag info string contains comma-separated 'words' which are either 156 /// The tag info string contains comma-separated 'words' which are either
157 /// dispatch tags (having JavaScript identifier syntax) and directives that 157 /// dispatch tags (having JavaScript identifier syntax) and directives that
158 /// begin with `!`. 158 /// begin with `!`.
159 void setNativeClassTagInfo(ClassEntity cls, String tagInfo) { 159 void setNativeClassTagInfo(ClassEntity cls, String tagText) {
160 String tagText = tagInfo.substring(1, tagInfo.length - 1);
161 // TODO(johnniwinther): Assert that this is only called once. The memory 160 // TODO(johnniwinther): Assert that this is only called once. The memory
162 // compiler copies pre-processed elements into a new compiler through 161 // compiler copies pre-processed elements into a new compiler through
163 // [Compiler.onLibraryScanned] and thereby causes multiple calls to this 162 // [Compiler.onLibraryScanned] and thereby causes multiple calls to this
164 // method. 163 // method.
165 assert(invariant( 164 assert(invariant(
166 cls, 165 cls,
167 nativeClassTagInfo[cls] == null || 166 nativeClassTagInfo[cls] == null ||
168 nativeClassTagInfo[cls].text == tagText, 167 nativeClassTagInfo[cls].text == tagText,
169 message: "Native tag info set inconsistently on $cls: " 168 message: "Native tag info set inconsistently on $cls: "
170 "Existing tag info '${nativeClassTagInfo[cls]}', " 169 "Existing tag info '${nativeClassTagInfo[cls]}', "
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 int get hashCode => Hashing.listHash(names, isNonLeaf.hashCode); 533 int get hashCode => Hashing.listHash(names, isNonLeaf.hashCode);
535 534
536 bool operator ==(other) { 535 bool operator ==(other) {
537 if (identical(this, other)) return true; 536 if (identical(this, other)) return true;
538 if (other is! NativeClassTag) return false; 537 if (other is! NativeClassTag) return false;
539 return equalElements(names, other.names) && isNonLeaf == other.isNonLeaf; 538 return equalElements(names, other.names) && isNonLeaf == other.isNonLeaf;
540 } 539 }
541 540
542 String toString() => text; 541 String toString() => text;
543 } 542 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/kernel/element_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698