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

Side by Side Diff: frog/world.dart

Issue 8999030: frog isolate fixes: minor changes to the isolate library + architecture.py (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 8 years, 12 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 | Annotate | Revision Log
« no previous file with comments | « frog/minfrog ('k') | tests/isolate/isolate.status » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** The one true [World]. */ 5 /** The one true [World]. */
6 World world; 6 World world;
7 7
8 /** 8 /**
9 * Experimental phase to enable await, only set when using the 9 * Experimental phase to enable await, only set when using the
10 * await/awaitc.dart entrypoint. 10 * await/awaitc.dart entrypoint.
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 int existingPri = existing.jsnamePriority; 209 int existingPri = existing.jsnamePriority;
210 int namedPri = named.jsnamePriority; 210 int namedPri = named.jsnamePriority;
211 if (existingPri > namedPri || namedPri == 0) { 211 if (existingPri > namedPri || namedPri == 0) {
212 // Either existing was higher priority, or they're both 0 so first one 212 // Either existing was higher priority, or they're both 0 so first one
213 // wins. 213 // wins.
214 _renameJavascriptTopName(named); 214 _renameJavascriptTopName(named);
215 } else if (namedPri > existingPri) { 215 } else if (namedPri > existingPri) {
216 // New one takes priority over existing 216 // New one takes priority over existing
217 _renameJavascriptTopName(existing); 217 _renameJavascriptTopName(existing);
218 } else { 218 } else {
219 // Two conflicting native names or names in corelib. Libraries need 219 final msg = 'conflicting JS name "$name" of same '
220 // to be fixed.
221 world.internalError('conflicting JS name "$name" of same '
222 + 'priority $existingPri: (already defined in) ' 220 + 'priority $existingPri: (already defined in) '
223 + '${existing.span.locationText} with priority $namedPri)', 221 + '${existing.span.locationText} with priority $namedPri)';
224 named.span, existing.span); 222 if (named.isNative) {
223 // We trust that conflicting native names in builtin libraries are
224 // harmless. Most cases there are no conflicts, currently isolates
225 // in coreimpl and dart:dom define web workers to avoid adding a
226 // dependency from corelib to dart:dom.
227 world.info(msg, named.span, existing.span);
228 } else {
229 // Conflicting name in corelib needs to be fixed.
230 world.internalError(msg, named.span, existing.span);
231 }
225 } 232 }
226 } else { 233 } else {
227 // No one was using the name. Take it for ourselves. 234 // No one was using the name. Take it for ourselves.
228 _topNames[name] = named; 235 _topNames[name] = named;
229 } 236 }
230 } 237 }
231 238
232 /** Renames an [Element] that had a name conflict in the generated JS. */ 239 /** Renames an [Element] that had a name conflict in the generated JS. */
233 _renameJavascriptTopName(Element named) { 240 _renameJavascriptTopName(Element named) {
234 named._jsname = '${named.library.jsname}_${named.jsname}'; 241 named._jsname = '${named.library.jsname}_${named.jsname}';
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 551
545 withTiming(String name, f()) { 552 withTiming(String name, f()) {
546 final sw = new Stopwatch(); 553 final sw = new Stopwatch();
547 sw.start(); 554 sw.start();
548 var result = f(); 555 var result = f();
549 sw.stop(); 556 sw.stop();
550 info('$name in ${sw.elapsedInMs()}msec'); 557 info('$name in ${sw.elapsedInMs()}msec');
551 return result; 558 return result;
552 } 559 }
553 } 560 }
OLDNEW
« no previous file with comments | « frog/minfrog ('k') | tests/isolate/isolate.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698