Index: runtime/vm/intermediate_language.h |
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h |
index 0f0cfdb8d13eaff760112adcd63f7464f7e50684..5490b3b80c82f554e2395597d488897426276f9e 100644 |
--- a/runtime/vm/intermediate_language.h |
+++ b/runtime/vm/intermediate_language.h |
@@ -1332,6 +1332,17 @@ class GraphEntryInstr : public BlockEntryInstr { |
return indirect_entries_; |
} |
+ void set_indirect_entry_offsets(GrowableObjectArray* offsets) { |
+ ASSERT(offsets != NULL); |
+ ASSERT(indirect_entry_offsets_ == NULL); |
+ indirect_entry_offsets_ = offsets; |
+ } |
+ |
+ GrowableObjectArray* indirect_entry_offsets() const { |
+ ASSERT(indirect_entry_offsets_ != NULL); |
+ return indirect_entry_offsets_; |
+ } |
+ |
virtual void PrintTo(BufferFormatter* f) const; |
private: |
@@ -1343,6 +1354,7 @@ class GraphEntryInstr : public BlockEntryInstr { |
GrowableArray<CatchBlockEntryInstr*> catch_entries_; |
// Indirect targets are blocks reachable only through indirect gotos. |
GrowableArray<IndirectEntryInstr*> indirect_entries_; |
+ GrowableObjectArray* indirect_entry_offsets_; |
GrowableArray<Definition*> initial_definitions_; |
const intptr_t osr_id_; |
intptr_t entry_count_; |
@@ -2191,15 +2203,9 @@ class GotoInstr : public TemplateInstruction<0, NoThrow> { |
// In order to preserve split-edge form, an indirect goto does not itself point |
// to its targets. Instead, for each possible target, the successors_ field |
// will contain an ordinary goto instruction that jumps to the target. |
-// |
-// Byte offsets of all possible targets are stored in the offsets_ array. The |
-// desired offset is looked up while the generated code is executing, and passed |
-// to IndirectGoto as an input. |
class IndirectGotoInstr : public TemplateInstruction<1, NoThrow> { |
public: |
- IndirectGotoInstr(GrowableObjectArray* offsets, |
- Value* offset_from_start) |
- : offsets_(*offsets) { |
+ explicit IndirectGotoInstr(Value* offset_from_start) { |
SetInputAt(0, offset_from_start); |
} |
@@ -2226,22 +2232,8 @@ class IndirectGotoInstr : public TemplateInstruction<1, NoThrow> { |
virtual void PrintTo(BufferFormatter* f) const; |
- const GrowableObjectArray& offsets() const { return offsets_; } |
- void SetOffsetCount(Isolate* isolate, intptr_t count) { |
- if (offsets_.Capacity() < count) { |
- offsets_.Grow(count, Heap::kOld); |
- } |
- if (offsets_.Length() < count) { |
- offsets_.SetLength(count); |
- } |
- } |
- void SetOffsetAt(Isolate* isolate, intptr_t index, intptr_t offset) { |
- offsets_.SetAt(index, Smi::ZoneHandle(isolate, Smi::New(offset))); |
- } |
- |
private: |
GrowableArray<TargetEntryInstr*> successors_; |
- GrowableObjectArray& offsets_; |
}; |