Index: runtime/vm/deopt_instructions.cc |
=================================================================== |
--- runtime/vm/deopt_instructions.cc (revision 16818) |
+++ runtime/vm/deopt_instructions.cc (working copy) |
@@ -209,6 +209,13 @@ |
*to_addr = continue_at_pc; |
} |
+ static void GetEncodedValues(intptr_t from_index, |
+ intptr_t* object_table_index, |
+ intptr_t* deopt_id) { |
+ *object_table_index = ObjectTableIndex::decode(from_index); |
+ *deopt_id = DeoptId::decode(from_index); |
+ } |
+ |
private: |
static const intptr_t kFieldWidth = kBitsPerWord / 2; |
class ObjectTableIndex : public BitField<intptr_t, 0, kFieldWidth> { }; |
@@ -563,6 +570,24 @@ |
} |
+uword DeoptInstr::GetReturnAddress(intptr_t deopt_instr, |
srdjan
2013/01/10 21:53:57
You could remove argument deopt_instr.
siva
2013/01/12 00:20:54
Done.
I also renamed the function to GetRetAfterA
|
+ intptr_t from_index, |
+ const Array& object_table, |
+ Function* func) { |
+ ASSERT(deopt_instr == kRetAfterAddress); |
+ ASSERT(!object_table.IsNull()); |
+ ASSERT(func != NULL); |
+ intptr_t object_table_index; |
+ intptr_t deopt_id; |
+ DeoptRetAfterAddressInstr::GetEncodedValues(from_index, |
+ &object_table_index, |
+ &deopt_id); |
+ *func ^= object_table.At(object_table_index); |
+ const Code& code = Code::Handle(func->unoptimized_code()); |
+ return code.GetDeoptAfterPcAtDeoptId(deopt_id); |
+} |
+ |
+ |
DeoptInstr* DeoptInstr::Create(intptr_t kind_as_int, intptr_t from_index) { |
Kind kind = static_cast<Kind>(kind_as_int); |
switch (kind) { |