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

Side by Side Diff: pkg/compiler/lib/src/ssa/interceptor_simplifier.dart

Issue 2575083002: Pass ClosedWorld directly to codegen tasks (Closed)
Patch Set: Updated cf. comment. Created 4 years 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 import '../common/backend_api.dart' show BackendClasses; 5 import '../common/backend_api.dart' show BackendClasses;
6 import '../compiler.dart' show Compiler; 6 import '../compiler.dart' show Compiler;
7 import '../constants/constant_system.dart'; 7 import '../constants/constant_system.dart';
8 import '../constants/values.dart'; 8 import '../constants/values.dart';
9 import '../elements/elements.dart'; 9 import '../elements/elements.dart';
10 import '../js_backend/backend.dart'; 10 import '../js_backend/backend.dart';
(...skipping 19 matching lines...) Expand all
30 * the interceptor and then call the method. This saves code size and makes the 30 * the interceptor and then call the method. This saves code size and makes the
31 * receiver of an intercepted call a candidate for being generated at use site. 31 * receiver of an intercepted call a candidate for being generated at use site.
32 * 32 *
33 * 5) Some HIs operations on an interceptor are replaced with a HIs version that 33 * 5) Some HIs operations on an interceptor are replaced with a HIs version that
34 * uses 'instanceof' rather than testing a type flag. 34 * uses 'instanceof' rather than testing a type flag.
35 * 35 *
36 */ 36 */
37 class SsaSimplifyInterceptors extends HBaseVisitor 37 class SsaSimplifyInterceptors extends HBaseVisitor
38 implements OptimizationPhase { 38 implements OptimizationPhase {
39 final String name = "SsaSimplifyInterceptors"; 39 final String name = "SsaSimplifyInterceptors";
40 final ClosedWorld closedWorld;
40 final ConstantSystem constantSystem; 41 final ConstantSystem constantSystem;
41 final Compiler compiler; 42 final Compiler compiler;
42 final Element element; 43 final Element element;
43 HGraph graph; 44 HGraph graph;
44 45
45 SsaSimplifyInterceptors(this.compiler, this.constantSystem, this.element); 46 SsaSimplifyInterceptors(
47 this.compiler, this.closedWorld, this.constantSystem, this.element);
46 48
47 JavaScriptBackend get backend => compiler.backend; 49 JavaScriptBackend get backend => compiler.backend;
48 50
49 ClosedWorld get closedWorld => compiler.closedWorld;
50
51 BackendClasses get backendClasses => closedWorld.backendClasses; 51 BackendClasses get backendClasses => closedWorld.backendClasses;
52 52
53 void visitGraph(HGraph graph) { 53 void visitGraph(HGraph graph) {
54 this.graph = graph; 54 this.graph = graph;
55 visitDominatorTree(graph); 55 visitDominatorTree(graph);
56 } 56 }
57 57
58 void visitBasicBlock(HBasicBlock node) { 58 void visitBasicBlock(HBasicBlock node) {
59 currentBlock = node; 59 currentBlock = node;
60 60
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 instruction = new HInvokeDynamicMethod( 419 instruction = new HInvokeDynamicMethod(
420 selector, mask, inputs, node.instructionType, true); 420 selector, mask, inputs, node.instructionType, true);
421 } 421 }
422 422
423 HBasicBlock block = node.block; 423 HBasicBlock block = node.block;
424 block.addAfter(node, instruction); 424 block.addAfter(node, instruction);
425 block.rewrite(node, instruction); 425 block.rewrite(node, instruction);
426 return true; 426 return true;
427 } 427 }
428 } 428 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/graph_builder.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698