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

Unified Diff: pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart

Issue 1264303002: dart2js: fix a few TODOs in the startup emitter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Emit affinity tag only once. Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
index 42d0e005c91a4693a389ae29d475bdfea09e9034..60382c168c88685200eede50b1df1a4b7a497afb 100644
--- a/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
@@ -848,7 +848,14 @@ class Emitter implements js_emitter.Emitter {
NativeGenerator.generateIsolateAffinityTagInitialization(
backend,
generateEmbeddedGlobalAccess,
- js("convertToFastObject", [])));
+ js("""
+ // On V8, the 'intern' function converts a string to a symbol, which
+ // makes property access much faster.
+ function (s) {
+ var o = {};
+ o[s] = 1;
+ return Object.keys(convertToFastObject(o))[0];
+ }""", [])));
}
parts..add(js.comment('BEGIN invoke [main].'))

Powered by Google App Engine
This is Rietveld 408576698