Chromium Code Reviews| 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/deopt_instructions.h" | 5 #include "vm/deopt_instructions.h" |
| 6 | 6 |
| 7 #include "vm/assembler_macros.h" | 7 #include "vm/assembler_macros.h" |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 #include "vm/locations.h" | 9 #include "vm/locations.h" |
| 10 #include "vm/parser.h" | 10 #include "vm/parser.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 return chars; | 93 return chars; |
| 94 } | 94 } |
| 95 | 95 |
| 96 void Execute(DeoptimizationContext* deopt_context, intptr_t to_index) { | 96 void Execute(DeoptimizationContext* deopt_context, intptr_t to_index) { |
| 97 Function& function = Function::Handle(deopt_context->isolate()); | 97 Function& function = Function::Handle(deopt_context->isolate()); |
| 98 function ^= deopt_context->ObjectAt(object_table_index_); | 98 function ^= deopt_context->ObjectAt(object_table_index_); |
| 99 Smi& deopt_id_as_smi = Smi::Handle(deopt_context->isolate()); | 99 Smi& deopt_id_as_smi = Smi::Handle(deopt_context->isolate()); |
| 100 deopt_id_as_smi ^= deopt_context->ObjectAt(object_table_index_ + 1); | 100 deopt_id_as_smi ^= deopt_context->ObjectAt(object_table_index_ + 1); |
| 101 const Code& code = | 101 const Code& code = |
| 102 Code::Handle(deopt_context->isolate(), function.unoptimized_code()); | 102 Code::Handle(deopt_context->isolate(), function.unoptimized_code()); |
| 103 uword continue_at_pc = code.GetDeoptPcAtDeoptId(deopt_id_as_smi.Value()); | 103 uword continue_at_pc = |
| 104 code.GetDeoptBeforePcAtDeoptId(deopt_id_as_smi.Value()); | |
|
siva
2012/08/30 01:37:30
Ditto question about unoptimized code having a Deo
srdjan
2012/08/30 17:16:16
Ditto answer
| |
| 104 intptr_t* to_addr = deopt_context->GetToFrameAddressAt(to_index); | 105 intptr_t* to_addr = deopt_context->GetToFrameAddressAt(to_index); |
| 105 *to_addr = continue_at_pc; | 106 *to_addr = continue_at_pc; |
| 106 } | 107 } |
| 107 | 108 |
| 108 private: | 109 private: |
| 109 const intptr_t object_table_index_; | 110 const intptr_t object_table_index_; |
| 110 | 111 |
| 111 DISALLOW_COPY_AND_ASSIGN(DeoptRetAddrInstr); | 112 DISALLOW_COPY_AND_ASSIGN(DeoptRetAddrInstr); |
| 112 }; | 113 }; |
| 113 | 114 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 const intptr_t len = instructions_.length(); | 345 const intptr_t len = instructions_.length(); |
| 345 const DeoptInfo& deopt_info = DeoptInfo::Handle(DeoptInfo::New(len)); | 346 const DeoptInfo& deopt_info = DeoptInfo::Handle(DeoptInfo::New(len)); |
| 346 for (intptr_t i = 0; i < len; i++) { | 347 for (intptr_t i = 0; i < len; i++) { |
| 347 DeoptInstr* instr = instructions_[i]; | 348 DeoptInstr* instr = instructions_[i]; |
| 348 deopt_info.SetAt(i, instr->kind(), instr->from_index()); | 349 deopt_info.SetAt(i, instr->kind(), instr->from_index()); |
| 349 } | 350 } |
| 350 return deopt_info.raw(); | 351 return deopt_info.raw(); |
| 351 } | 352 } |
| 352 | 353 |
| 353 } // namespace dart | 354 } // namespace dart |
| OLD | NEW |