| OLD | NEW |
| 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/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/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 try_index); | 232 try_index); |
| 233 } | 233 } |
| 234 | 234 |
| 235 | 235 |
| 236 void FlowGraphCompiler::AddDeoptIndexAtCall(intptr_t deopt_id, | 236 void FlowGraphCompiler::AddDeoptIndexAtCall(intptr_t deopt_id, |
| 237 intptr_t token_pos) { | 237 intptr_t token_pos) { |
| 238 // TODO(srdjan): Temporary use deopt stubs to maintain deopt-indexes. | 238 // TODO(srdjan): Temporary use deopt stubs to maintain deopt-indexes. |
| 239 // kDeoptAtCall will not emit code, but will only generate deoptimization | 239 // kDeoptAtCall will not emit code, but will only generate deoptimization |
| 240 // information. | 240 // information. |
| 241 const intptr_t deopt_index = deopt_stubs_.length(); | 241 const intptr_t deopt_index = deopt_stubs_.length(); |
| 242 const intptr_t kNoTryIndex = -1; | 242 AddDeoptStub(deopt_id, kDeoptAtCall); |
| 243 AddDeoptStub(deopt_id, kNoTryIndex, kDeoptAtCall); | |
| 244 pc_descriptors_list()->AddDescriptor(PcDescriptors::kDeoptIndex, | 243 pc_descriptors_list()->AddDescriptor(PcDescriptors::kDeoptIndex, |
| 245 assembler()->CodeSize(), | 244 assembler()->CodeSize(), |
| 246 deopt_id, | 245 deopt_id, |
| 247 token_pos, | 246 token_pos, |
| 248 deopt_index); | 247 deopt_index); |
| 249 } | 248 } |
| 250 | 249 |
| 251 | 250 |
| 252 void FlowGraphCompiler::RecordSafepoint(LocationSummary* locs) { | 251 void FlowGraphCompiler::RecordSafepoint(LocationSummary* locs) { |
| 253 if (is_optimizing()) { | 252 if (is_optimizing()) { |
| 254 BitmapBuilder* bitmap = locs->stack_bitmap(); | 253 BitmapBuilder* bitmap = locs->stack_bitmap(); |
| 255 ASSERT(bitmap != NULL); | 254 ASSERT(bitmap != NULL); |
| 256 bitmap->SetLength(StackSize()); | 255 bitmap->SetLength(StackSize()); |
| 257 stackmap_table_builder_->AddEntry(assembler()->CodeSize(), bitmap); | 256 stackmap_table_builder_->AddEntry(assembler()->CodeSize(), bitmap); |
| 258 } | 257 } |
| 259 } | 258 } |
| 260 | 259 |
| 261 | 260 |
| 262 Label* FlowGraphCompiler::AddDeoptStub(intptr_t deopt_id, | 261 Label* FlowGraphCompiler::AddDeoptStub(intptr_t deopt_id, |
| 263 intptr_t try_index, | |
| 264 DeoptReasonId reason) { | 262 DeoptReasonId reason) { |
| 265 DeoptimizationStub* stub = | 263 DeoptimizationStub* stub = new DeoptimizationStub(deopt_id, reason); |
| 266 new DeoptimizationStub(deopt_id, try_index, reason); | |
| 267 ASSERT(is_optimizing_); | 264 ASSERT(is_optimizing_); |
| 268 ASSERT(pending_deoptimization_env_ != NULL); | 265 ASSERT(pending_deoptimization_env_ != NULL); |
| 269 stub->set_deoptimization_env(pending_deoptimization_env_); | 266 stub->set_deoptimization_env(pending_deoptimization_env_); |
| 270 deopt_stubs_.Add(stub); | 267 deopt_stubs_.Add(stub); |
| 271 return stub->entry_label(); | 268 return stub->entry_label(); |
| 272 } | 269 } |
| 273 | 270 |
| 274 | 271 |
| 275 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) { | 272 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) { |
| 276 ASSERT(exception_handlers_list_ != NULL); | 273 ASSERT(exception_handlers_list_ != NULL); |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 return; | 747 return; |
| 751 } | 748 } |
| 752 } | 749 } |
| 753 | 750 |
| 754 // This move is not blocked. | 751 // This move is not blocked. |
| 755 EmitMove(index); | 752 EmitMove(index); |
| 756 } | 753 } |
| 757 | 754 |
| 758 | 755 |
| 759 } // namespace dart | 756 } // namespace dart |
| OLD | NEW |