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

Side by Side Diff: runtime/vm/compiler.cc

Issue 1973553003: VM precompiler: Compute and use result type of static initializers of final fields. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: preprocess initializers Created 4 years, 7 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
« no previous file with comments | « runtime/vm/compiler.h ('k') | runtime/vm/flow_graph_type_propagator.cc » ('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) 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 #include "vm/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 8
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/block_scheduler.h" 10 #include "vm/block_scheduler.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // Build the flow graph. 98 // Build the flow graph.
99 FlowGraphBuilder builder(*parsed_function, 99 FlowGraphBuilder builder(*parsed_function,
100 ic_data_array, 100 ic_data_array,
101 NULL, // NULL = not inlining. 101 NULL, // NULL = not inlining.
102 osr_id); 102 osr_id);
103 103
104 return builder.BuildGraph(); 104 return builder.BuildGraph();
105 } 105 }
106 106
107 107
108 void DartCompilationPipeline::FinalizeCompilation() { } 108 void DartCompilationPipeline::FinalizeCompilation(FlowGraph* flow_graph) { }
109 109
110 110
111 void IrregexpCompilationPipeline::ParseFunction( 111 void IrregexpCompilationPipeline::ParseFunction(
112 ParsedFunction* parsed_function) { 112 ParsedFunction* parsed_function) {
113 RegExpParser::ParseFunction(parsed_function); 113 RegExpParser::ParseFunction(parsed_function);
114 // Variables are allocated after compilation. 114 // Variables are allocated after compilation.
115 } 115 }
116 116
117 117
118 FlowGraph* IrregexpCompilationPipeline::BuildFlowGraph( 118 FlowGraph* IrregexpCompilationPipeline::BuildFlowGraph(
(...skipping 16 matching lines...) Expand all
135 ic_data_array, 135 ic_data_array,
136 NULL, // NULL = not inlining. 136 NULL, // NULL = not inlining.
137 osr_id); 137 osr_id);
138 138
139 return new(zone) FlowGraph(*parsed_function, 139 return new(zone) FlowGraph(*parsed_function,
140 result.graph_entry, 140 result.graph_entry,
141 result.num_blocks); 141 result.num_blocks);
142 } 142 }
143 143
144 144
145 void IrregexpCompilationPipeline::FinalizeCompilation() { 145 void IrregexpCompilationPipeline::FinalizeCompilation(FlowGraph* flow_graph) {
146 backtrack_goto_->ComputeOffsetTable(); 146 backtrack_goto_->ComputeOffsetTable();
147 } 147 }
148 148
149 149
150 CompilationPipeline* CompilationPipeline::New(Zone* zone, 150 CompilationPipeline* CompilationPipeline::New(Zone* zone,
151 const Function& function) { 151 const Function& function) {
152 if (function.IsIrregexpFunction()) { 152 if (function.IsIrregexpFunction()) {
153 return new(zone) IrregexpCompilationPipeline(); 153 return new(zone) IrregexpCompilationPipeline();
154 } else { 154 } else {
155 return new(zone) DartCompilationPipeline(); 155 return new(zone) DartCompilationPipeline();
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 *parsed_function(), optimized(), 1120 *parsed_function(), optimized(),
1121 inline_id_to_function, 1121 inline_id_to_function,
1122 inline_id_to_token_pos, 1122 inline_id_to_token_pos,
1123 caller_inline_id); 1123 caller_inline_id);
1124 { 1124 {
1125 CSTAT_TIMER_SCOPE(thread(), graphcompiler_timer); 1125 CSTAT_TIMER_SCOPE(thread(), graphcompiler_timer);
1126 NOT_IN_PRODUCT(TimelineDurationScope tds(thread(), 1126 NOT_IN_PRODUCT(TimelineDurationScope tds(thread(),
1127 compiler_timeline, 1127 compiler_timeline,
1128 "CompileGraph")); 1128 "CompileGraph"));
1129 graph_compiler.CompileGraph(); 1129 graph_compiler.CompileGraph();
1130 pipeline->FinalizeCompilation(); 1130 pipeline->FinalizeCompilation(flow_graph);
1131 } 1131 }
1132 { 1132 {
1133 NOT_IN_PRODUCT(TimelineDurationScope tds(thread(), 1133 NOT_IN_PRODUCT(TimelineDurationScope tds(thread(),
1134 compiler_timeline, 1134 compiler_timeline,
1135 "FinalizeCompilation")); 1135 "FinalizeCompilation"));
1136 if (thread()->IsMutatorThread()) { 1136 if (thread()->IsMutatorThread()) {
1137 FinalizeCompilation(&assembler, &graph_compiler, flow_graph); 1137 FinalizeCompilation(&assembler, &graph_compiler, flow_graph);
1138 } else { 1138 } else {
1139 // This part of compilation must be at a safepoint. 1139 // This part of compilation must be at a safepoint.
1140 // Stop mutator thread before creating the instruction object and 1140 // Stop mutator thread before creating the instruction object and
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
2110 } 2110 }
2111 2111
2112 2112
2113 void BackgroundCompiler::EnsureInit(Thread* thread) { 2113 void BackgroundCompiler::EnsureInit(Thread* thread) {
2114 UNREACHABLE(); 2114 UNREACHABLE();
2115 } 2115 }
2116 2116
2117 #endif // DART_PRECOMPILED_RUNTIME 2117 #endif // DART_PRECOMPILED_RUNTIME
2118 2118
2119 } // namespace dart 2119 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler.h ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698