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