Index: runtime/vm/deopt_instructions.h |
diff --git a/runtime/vm/deopt_instructions.h b/runtime/vm/deopt_instructions.h |
index 01a6974d696e8c22d434d1da0c6127b7b2979247..c1811f0b15326e3a8e1c148e8a3cba4c74fadb38 100644 |
--- a/runtime/vm/deopt_instructions.h |
+++ b/runtime/vm/deopt_instructions.h |
@@ -7,6 +7,7 @@ |
#include "vm/allocation.h" |
#include "vm/assembler.h" |
+#include "vm/code_descriptors.h" |
#include "vm/code_generator.h" |
#include "vm/deferred_objects.h" |
#include "vm/flow_graph_compiler.h" |
@@ -57,6 +58,18 @@ class DeoptContext { |
return &source_frame_[index]; |
} |
+ // Returns index in stack slot notation where -1 is the first argument |
+ // For DBC returns index directly relative to FP. |
+ intptr_t GetStackSlot(intptr_t index) const { |
+ ASSERT((0 <= index) && (index < source_frame_size_)); |
+ index -= num_args_; |
+#if defined(TARGET_ARCH_DBC) |
+ return index < 0 ? index - kDartFrameFixedSize : index; |
+#else |
+ return index < 0 ? index : index - kDartFrameFixedSize; |
+#endif // defined(TARGET_ARCH_DBC) |
+ } |
+ |
intptr_t GetSourceFp() const; |
intptr_t GetSourcePp() const; |
intptr_t GetSourcePc() const; |
@@ -153,6 +166,9 @@ class DeoptContext { |
// objects. |
void FillDestFrame(); |
+ // Allocate and prepare exceptions metadata for TrySync |
+ intptr_t* CatchEntryState(intptr_t num_vars); |
+ |
// Materializes all deferred objects. Returns the total number of |
// artificial arguments used during deoptimization. |
intptr_t MaterializeDeferredObjects(); |
@@ -271,7 +287,6 @@ class DeoptContext { |
DISALLOW_COPY_AND_ASSIGN(DeoptContext); |
}; |
- |
// Represents one deopt instruction, e.g, setup return address, store object, |
// store register, etc. The target is defined by instruction's position in |
// the deopt-info array. |
@@ -319,6 +334,13 @@ class DeoptInstr : public ZoneAllocated { |
virtual void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) = 0; |
+ // Convert DeoptInstr to TrySync metadata entry. |
+ virtual CatchEntryStatePair ToCatchEntryStatePair(DeoptContext* deopt_context, |
+ intptr_t dest_slot) { |
+ UNREACHABLE(); |
+ return CatchEntryStatePair(); |
+ } |
+ |
virtual DeoptInstr::Kind kind() const = 0; |
bool Equals(const DeoptInstr& other) const { |
@@ -412,6 +434,14 @@ class RegisterSource { |
} |
} |
+ intptr_t StackSlot(DeoptContext* context) const { |
+ if (is_register()) { |
+ return raw_index(); // in DBC stack slots are registers. |
+ } else { |
+ return context->GetStackSlot(raw_index()); |
+ } |
+ } |
+ |
intptr_t source_index() const { return source_index_; } |
const char* ToCString() const { |