Index: runtime/vm/deopt_instructions.cc |
=================================================================== |
--- runtime/vm/deopt_instructions.cc (revision 16999) |
+++ 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,22 @@ |
} |
+uword DeoptInstr::GetRetAfterAddress(intptr_t from_index, |
+ const Array& object_table, |
+ Function* func) { |
+ 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) { |