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

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

Issue 1089793002: Add a command line option to use the new CPS based backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update comment. Created 5 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 | Annotate | Revision Log
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 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR");
10
11 class JavaScriptItemCompilationContext extends ItemCompilationContext { 9 class JavaScriptItemCompilationContext extends ItemCompilationContext {
12 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>();
13 final Set<HInstruction> allocatedFixedLists = new Set<HInstruction>(); 11 final Set<HInstruction> allocatedFixedLists = new Set<HInstruction>();
14 } 12 }
15 13
16 abstract class FunctionCompiler { 14 abstract class FunctionCompiler {
17 /// Generates JavaScript code for `work.element`. 15 /// Generates JavaScript code for `work.element`.
18 jsAst.Fun compile(CodegenWorkItem work); 16 jsAst.Fun compile(CodegenWorkItem work);
19 17
20 Iterable get tasks; 18 Iterable get tasks;
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 rti = new RuntimeTypes(compiler), 605 rti = new RuntimeTypes(compiler),
608 specializedGetInterceptors = new Map<String, Set<ClassElement>>(), 606 specializedGetInterceptors = new Map<String, Set<ClassElement>>(),
609 super(compiler) { 607 super(compiler) {
610 emitter = new CodeEmitterTask(compiler, namer, generateSourceMap); 608 emitter = new CodeEmitterTask(compiler, namer, generateSourceMap);
611 typeVariableHandler = new TypeVariableHandler(this); 609 typeVariableHandler = new TypeVariableHandler(this);
612 customElementsAnalysis = new CustomElementsAnalysis(this); 610 customElementsAnalysis = new CustomElementsAnalysis(this);
613 noSuchMethodRegistry = new NoSuchMethodRegistry(this); 611 noSuchMethodRegistry = new NoSuchMethodRegistry(this);
614 constantCompilerTask = new JavaScriptConstantTask(compiler); 612 constantCompilerTask = new JavaScriptConstantTask(compiler);
615 resolutionCallbacks = new JavaScriptResolutionCallbacks(this); 613 resolutionCallbacks = new JavaScriptResolutionCallbacks(this);
616 patchResolverTask = new PatchResolverTask(compiler); 614 patchResolverTask = new PatchResolverTask(compiler);
617 functionCompiler = USE_CPS_IR 615 functionCompiler = compiler.useCpsIr
618 ? new CpsFunctionCompiler( 616 ? new CpsFunctionCompiler(
619 compiler, this, generateSourceMap: generateSourceMap) 617 compiler, this, generateSourceMap: generateSourceMap)
620 : new SsaFunctionCompiler(this, generateSourceMap); 618 : new SsaFunctionCompiler(this, generateSourceMap);
621 } 619 }
622 620
623 ConstantSystem get constantSystem => constants.constantSystem; 621 ConstantSystem get constantSystem => constants.constantSystem;
624 622
625 /// Returns constant environment for the JavaScript interpretation of the 623 /// Returns constant environment for the JavaScript interpretation of the
626 /// constants. 624 /// constants.
627 JavaScriptConstantCompiler get constants { 625 JavaScriptConstantCompiler get constants {
(...skipping 2260 matching lines...) Expand 10 before | Expand all | Expand 10 after
2888 } 2886 }
2889 } 2887 }
2890 2888
2891 /// Records that [constant] is used by the element behind [registry]. 2889 /// Records that [constant] is used by the element behind [registry].
2892 class Dependency { 2890 class Dependency {
2893 final ConstantValue constant; 2891 final ConstantValue constant;
2894 final Element annotatedElement; 2892 final Element annotatedElement;
2895 2893
2896 const Dependency(this.constant, this.annotatedElement); 2894 const Dependency(this.constant, this.annotatedElement);
2897 } 2895 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart ('k') | tests/compiler/dart2js/js_backend_cps_ir.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698