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

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

Issue 1153243003: dart2js: Use frequency of occurence to sort metadata indices. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 part of js_backend; 5 part of js_backend;
6 6
7 const VERBOSE_OPTIMIZER_HINTS = false; 7 const VERBOSE_OPTIMIZER_HINTS = false;
8 8
9 class JavaScriptItemCompilationContext extends ItemCompilationContext { 9 class JavaScriptItemCompilationContext extends ItemCompilationContext {
10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>();
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 break; 205 break;
206 } 206 }
207 } 207 }
208 } 208 }
209 209
210 void markAsMustInline(FunctionElement element) { 210 void markAsMustInline(FunctionElement element) {
211 _cachedDecisions[element] = _mustInline; 211 _cachedDecisions[element] = _mustInline;
212 } 212 }
213 } 213 }
214 214
215 class DummyConstantKinds {
karlklose 2015/05/28 09:39:52 I think it use sites of these constants read bette
herhut 2015/06/01 12:09:41 Done.
216 static const String dummyReceiver = "DUMMY_INTERCEPTOR";
217 static const String emptyValue = "EMPTY_VALUE";
218 static const String typeVariableReference = "TYPEVARIALE_REFERENCE";
sigurdm 2015/05/27 14:26:41 DBC: Typo in string
herhut 2015/06/01 12:09:41 Done.
219 }
220
215 class JavaScriptBackend extends Backend { 221 class JavaScriptBackend extends Backend {
216 static final Uri DART_JS_HELPER = new Uri(scheme: 'dart', path: '_js_helper'); 222 static final Uri DART_JS_HELPER = new Uri(scheme: 'dart', path: '_js_helper');
217 static final Uri DART_INTERCEPTORS = 223 static final Uri DART_INTERCEPTORS =
218 new Uri(scheme: 'dart', path: '_interceptors'); 224 new Uri(scheme: 'dart', path: '_interceptors');
219 static final Uri DART_INTERNAL = 225 static final Uri DART_INTERNAL =
220 new Uri(scheme: 'dart', path: '_internal'); 226 new Uri(scheme: 'dart', path: '_internal');
221 static final Uri DART_FOREIGN_HELPER = 227 static final Uri DART_FOREIGN_HELPER =
222 new Uri(scheme: 'dart', path: '_foreign_helper'); 228 new Uri(scheme: 'dart', path: '_foreign_helper');
223 static final Uri DART_JS_MIRRORS = 229 static final Uri DART_JS_MIRRORS =
224 new Uri(scheme: 'dart', path: '_js_mirrors'); 230 new Uri(scheme: 'dart', path: '_js_mirrors');
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 // the checked setter. 1411 // the checked setter.
1406 if (Elements.isStaticOrTopLevel(element)) return; 1412 if (Elements.isStaticOrTopLevel(element)) return;
1407 } else { 1413 } else {
1408 // If the constant-handler was not able to produce a result we have to 1414 // If the constant-handler was not able to produce a result we have to
1409 // go through the builder (below) to generate the lazy initializer for 1415 // go through the builder (below) to generate the lazy initializer for
1410 // the static variable. 1416 // the static variable.
1411 // We also need to register the use of the cyclic-error helper. 1417 // We also need to register the use of the cyclic-error helper.
1412 compiler.enqueuer.codegen.registerStaticUse(getCyclicThrowHelper()); 1418 compiler.enqueuer.codegen.registerStaticUse(getCyclicThrowHelper());
1413 } 1419 }
1414 } 1420 }
1421
1415 generatedCode[element] = functionCompiler.compile(work); 1422 generatedCode[element] = functionCompiler.compile(work);
1416 } 1423 }
1417 1424
1418 native.NativeEnqueuer nativeResolutionEnqueuer(Enqueuer world) { 1425 native.NativeEnqueuer nativeResolutionEnqueuer(Enqueuer world) {
1419 return new native.NativeResolutionEnqueuer(world, compiler); 1426 return new native.NativeResolutionEnqueuer(world, compiler);
1420 } 1427 }
1421 1428
1422 native.NativeEnqueuer nativeCodegenEnqueuer(Enqueuer world) { 1429 native.NativeEnqueuer nativeCodegenEnqueuer(Enqueuer world) {
1423 return new native.NativeCodegenEnqueuer(world, compiler, emitter); 1430 return new native.NativeCodegenEnqueuer(world, compiler, emitter);
1424 } 1431 }
(...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after
2929 } 2936 }
2930 } 2937 }
2931 2938
2932 /// Records that [constant] is used by the element behind [registry]. 2939 /// Records that [constant] is used by the element behind [registry].
2933 class Dependency { 2940 class Dependency {
2934 final ConstantValue constant; 2941 final ConstantValue constant;
2935 final Element annotatedElement; 2942 final Element annotatedElement;
2936 2943
2937 const Dependency(this.constant, this.annotatedElement); 2944 const Dependency(this.constant, this.annotatedElement);
2938 } 2945 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698