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

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

Issue 1390153004: Move deopt_id and related helpers/definitions from Isolate to Thread (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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) 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 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/cha.h" 10 #include "vm/cha.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 } 158 }
159 159
160 160
161 FlowGraphCompiler::FlowGraphCompiler( 161 FlowGraphCompiler::FlowGraphCompiler(
162 Assembler* assembler, 162 Assembler* assembler,
163 FlowGraph* flow_graph, 163 FlowGraph* flow_graph,
164 const ParsedFunction& parsed_function, 164 const ParsedFunction& parsed_function,
165 bool is_optimizing, 165 bool is_optimizing,
166 const GrowableArray<const Function*>& inline_id_to_function, 166 const GrowableArray<const Function*>& inline_id_to_function,
167 const GrowableArray<intptr_t>& caller_inline_id) 167 const GrowableArray<intptr_t>& caller_inline_id)
168 : isolate_(Isolate::Current()), 168 : thread_(Thread::Current()),
169 isolate_(Isolate::Current()),
169 zone_(Thread::Current()->zone()), 170 zone_(Thread::Current()->zone()),
170 assembler_(assembler), 171 assembler_(assembler),
171 parsed_function_(parsed_function), 172 parsed_function_(parsed_function),
172 flow_graph_(*flow_graph), 173 flow_graph_(*flow_graph),
173 block_order_(*flow_graph->CodegenBlockOrder(is_optimizing)), 174 block_order_(*flow_graph->CodegenBlockOrder(is_optimizing)),
174 current_block_(NULL), 175 current_block_(NULL),
175 exception_handlers_list_(NULL), 176 exception_handlers_list_(NULL),
176 pc_descriptors_list_(NULL), 177 pc_descriptors_list_(NULL),
177 stackmap_table_builder_(NULL), 178 stackmap_table_builder_(NULL),
178 block_info_(block_order_.length()), 179 block_info_(block_order_.length()),
(...skipping 19 matching lines...) Expand all
198 pending_deoptimization_env_(NULL), 199 pending_deoptimization_env_(NULL),
199 lazy_deopt_pc_offset_(Code::kInvalidPc), 200 lazy_deopt_pc_offset_(Code::kInvalidPc),
200 deopt_id_to_ic_data_(NULL), 201 deopt_id_to_ic_data_(NULL),
201 edge_counters_array_(Array::ZoneHandle()), 202 edge_counters_array_(Array::ZoneHandle()),
202 inlined_code_intervals_(Array::ZoneHandle(Object::empty_array().raw())), 203 inlined_code_intervals_(Array::ZoneHandle(Object::empty_array().raw())),
203 inline_id_to_function_(inline_id_to_function), 204 inline_id_to_function_(inline_id_to_function),
204 caller_inline_id_(caller_inline_id) { 205 caller_inline_id_(caller_inline_id) {
205 ASSERT(flow_graph->parsed_function().function().raw() == 206 ASSERT(flow_graph->parsed_function().function().raw() ==
206 parsed_function.function().raw()); 207 parsed_function.function().raw());
207 if (!is_optimizing) { 208 if (!is_optimizing) {
208 const intptr_t len = isolate()->deopt_id(); 209 const intptr_t len = thread()->deopt_id();
209 deopt_id_to_ic_data_ = new(zone()) ZoneGrowableArray<const ICData*>(len); 210 deopt_id_to_ic_data_ = new(zone()) ZoneGrowableArray<const ICData*>(len);
210 deopt_id_to_ic_data_->SetLength(len); 211 deopt_id_to_ic_data_->SetLength(len);
211 for (intptr_t i = 0; i < len; i++) { 212 for (intptr_t i = 0; i < len; i++) {
212 (*deopt_id_to_ic_data_)[i] = NULL; 213 (*deopt_id_to_ic_data_)[i] = NULL;
213 } 214 }
214 // TODO(fschneider): Abstract iteration into ICDataArrayIterator. 215 // TODO(fschneider): Abstract iteration into ICDataArrayIterator.
215 const Array& old_saved_ic_data = Array::Handle(zone(), 216 const Array& old_saved_ic_data = Array::Handle(zone(),
216 flow_graph->function().ic_data_array()); 217 flow_graph->function().ic_data_array());
217 const intptr_t saved_len = 218 const intptr_t saved_len =
218 old_saved_ic_data.IsNull() ? 0 : old_saved_ic_data.Length(); 219 old_saved_ic_data.IsNull() ? 0 : old_saved_ic_data.Length();
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after
1841 1842
1842 1843
1843 void FlowGraphCompiler::FrameStateClear() { 1844 void FlowGraphCompiler::FrameStateClear() {
1844 ASSERT(!is_optimizing()); 1845 ASSERT(!is_optimizing());
1845 frame_state_.TruncateTo(0); 1846 frame_state_.TruncateTo(0);
1846 } 1847 }
1847 #endif 1848 #endif
1848 1849
1849 1850
1850 } // namespace dart 1851 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698