OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #ifndef VM_DEOPT_INSTRUCTIONS_H_ | 5 #ifndef VM_DEOPT_INSTRUCTIONS_H_ |
6 #define VM_DEOPT_INSTRUCTIONS_H_ | 6 #define VM_DEOPT_INSTRUCTIONS_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/code_generator.h" | 10 #include "vm/code_generator.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 public: | 27 public: |
28 enum DestFrameOptions { | 28 enum DestFrameOptions { |
29 kDestIsOriginalFrame, // Replace the original frame with deopt frame. | 29 kDestIsOriginalFrame, // Replace the original frame with deopt frame. |
30 kDestIsAllocated // Write deopt frame to a buffer. | 30 kDestIsAllocated // Write deopt frame to a buffer. |
31 }; | 31 }; |
32 | 32 |
33 DeoptContext(const StackFrame* frame, | 33 DeoptContext(const StackFrame* frame, |
34 const Code& code, | 34 const Code& code, |
35 DestFrameOptions dest_options, | 35 DestFrameOptions dest_options, |
36 fpu_register_t* fpu_registers, | 36 fpu_register_t* fpu_registers, |
37 intptr_t* cpu_registers, | 37 intptr_t* cpu_registers); |
38 bool is_lazy_deopt); | |
39 virtual ~DeoptContext(); | 38 virtual ~DeoptContext(); |
40 | 39 |
41 // Returns the offset of the dest fp from the dest sp. Used in | 40 // Returns the offset of the dest fp from the dest sp. Used in |
42 // runtime code to adjust the stack size before deoptimization. | 41 // runtime code to adjust the stack size before deoptimization. |
43 intptr_t DestStackAdjustment() const; | 42 intptr_t DestStackAdjustment() const; |
44 | 43 |
45 intptr_t* GetSourceFrameAddressAt(intptr_t index) const { | 44 intptr_t* GetSourceFrameAddressAt(intptr_t index) const { |
46 ASSERT(source_frame_ != NULL); | 45 ASSERT(source_frame_ != NULL); |
47 ASSERT((0 <= index) && (index < source_frame_size_)); | 46 ASSERT((0 <= index) && (index < source_frame_size_)); |
48 return &source_frame_[index]; | 47 return &source_frame_[index]; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 87 } |
89 | 88 |
90 Thread* thread() const { return thread_; } | 89 Thread* thread() const { return thread_; } |
91 Zone* zone() const { return thread_->zone(); } | 90 Zone* zone() const { return thread_->zone(); } |
92 | 91 |
93 intptr_t source_frame_size() const { return source_frame_size_; } | 92 intptr_t source_frame_size() const { return source_frame_size_; } |
94 intptr_t dest_frame_size() const { return dest_frame_size_; } | 93 intptr_t dest_frame_size() const { return dest_frame_size_; } |
95 | 94 |
96 RawCode* code() const { return code_; } | 95 RawCode* code() const { return code_; } |
97 | 96 |
98 bool is_lazy_deopt() const { return is_lazy_deopt_; } | |
99 | |
100 ICData::DeoptReasonId deopt_reason() const { return deopt_reason_; } | 97 ICData::DeoptReasonId deopt_reason() const { return deopt_reason_; } |
101 bool HasDeoptFlag(ICData::DeoptFlags flag) { | 98 bool HasDeoptFlag(ICData::DeoptFlags flag) { |
102 return (deopt_flags_ & flag) != 0; | 99 return (deopt_flags_ & flag) != 0; |
103 } | 100 } |
104 | 101 |
105 RawTypedData* deopt_info() const { return deopt_info_; } | 102 RawTypedData* deopt_info() const { return deopt_info_; } |
106 | 103 |
107 // Fills the destination frame but defers materialization of | 104 // Fills the destination frame but defers materialization of |
108 // objects. | 105 // objects. |
109 void FillDestFrame(); | 106 void FillDestFrame(); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 uint32_t deopt_flags_; | 221 uint32_t deopt_flags_; |
225 intptr_t caller_fp_; | 222 intptr_t caller_fp_; |
226 Thread* thread_; | 223 Thread* thread_; |
227 TimelineEvent* timeline_event_; | 224 TimelineEvent* timeline_event_; |
228 | 225 |
229 DeferredSlot* deferred_slots_; | 226 DeferredSlot* deferred_slots_; |
230 | 227 |
231 intptr_t deferred_objects_count_; | 228 intptr_t deferred_objects_count_; |
232 DeferredObject** deferred_objects_; | 229 DeferredObject** deferred_objects_; |
233 | 230 |
234 const bool is_lazy_deopt_; | |
235 | |
236 DISALLOW_COPY_AND_ASSIGN(DeoptContext); | 231 DISALLOW_COPY_AND_ASSIGN(DeoptContext); |
237 }; | 232 }; |
238 | 233 |
239 | 234 |
240 | 235 |
241 // Represents one deopt instruction, e.g, setup return address, store object, | 236 // Represents one deopt instruction, e.g, setup return address, store object, |
242 // store register, etc. The target is defined by instruction's position in | 237 // store register, etc. The target is defined by instruction's position in |
243 // the deopt-info array. | 238 // the deopt-info array. |
244 class DeoptInstr : public ZoneAllocated { | 239 class DeoptInstr : public ZoneAllocated { |
245 public: | 240 public: |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 class ReasonField : public BitField<ICData::DeoptReasonId, 0, 8> { }; | 535 class ReasonField : public BitField<ICData::DeoptReasonId, 0, 8> { }; |
541 class FlagsField : public BitField<uint32_t, 8, 8> { }; | 536 class FlagsField : public BitField<uint32_t, 8, 8> { }; |
542 | 537 |
543 private: | 538 private: |
544 static const intptr_t kEntrySize = 3; | 539 static const intptr_t kEntrySize = 3; |
545 }; | 540 }; |
546 | 541 |
547 } // namespace dart | 542 } // namespace dart |
548 | 543 |
549 #endif // VM_DEOPT_INSTRUCTIONS_H_ | 544 #endif // VM_DEOPT_INSTRUCTIONS_H_ |
OLD | NEW |