| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/growable_array.h" | 11 #include "vm/growable_array.h" |
| 11 #include "vm/object.h" | 12 #include "vm/object.h" |
| 12 | 13 |
| 13 namespace dart { | 14 namespace dart { |
| 14 | 15 |
| 15 class Location; | 16 class Location; |
| 16 class Value; | 17 class Value; |
| 17 | 18 |
| 18 // Holds all data relevant for execution of deoptimization instructions. | 19 // Holds all data relevant for execution of deoptimization instructions. |
| 19 class DeoptimizationContext : public ValueObject { | 20 class DeoptimizationContext : public ValueObject { |
| 20 public: | 21 public: |
| 21 // 'to_frame_start' points to the return address just below the frame's | 22 // 'to_frame_start' points to the return address just below the frame's |
| 22 // stack pointer. 'num_args' is 0 if there are no arguments or if there | 23 // stack pointer. 'num_args' is 0 if there are no arguments or if there |
| 23 // are optional arguments. | 24 // are optional arguments. |
| 24 DeoptimizationContext(intptr_t* to_frame_start, | 25 DeoptimizationContext(intptr_t* to_frame_start, |
| 25 intptr_t to_frame_size, | 26 intptr_t to_frame_size, |
| 26 const Array& object_table, | 27 const Array& object_table, |
| 27 intptr_t num_args); | 28 intptr_t num_args, |
| 29 DeoptReasonId deopt_reason); |
| 28 | 30 |
| 29 intptr_t* GetFromFrameAddressAt(intptr_t index) const { | 31 intptr_t* GetFromFrameAddressAt(intptr_t index) const { |
| 30 ASSERT((0 <= index) && (index < from_frame_size_)); | 32 ASSERT((0 <= index) && (index < from_frame_size_)); |
| 31 return &from_frame_[index]; | 33 return &from_frame_[index]; |
| 32 } | 34 } |
| 33 | 35 |
| 34 intptr_t* GetToFrameAddressAt(intptr_t index) const { | 36 intptr_t* GetToFrameAddressAt(intptr_t index) const { |
| 35 ASSERT((0 <= index) && (index < to_frame_size_)); | 37 ASSERT((0 <= index) && (index < to_frame_size_)); |
| 36 return &to_frame_[index]; | 38 return &to_frame_[index]; |
| 37 } | 39 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 55 } | 57 } |
| 56 | 58 |
| 57 int64_t XmmRegisterValueAsInt64(XmmRegister reg) const { | 59 int64_t XmmRegisterValueAsInt64(XmmRegister reg) const { |
| 58 return (reinterpret_cast<int64_t*>(xmm_registers_copy_))[reg]; | 60 return (reinterpret_cast<int64_t*>(xmm_registers_copy_))[reg]; |
| 59 } | 61 } |
| 60 | 62 |
| 61 Isolate* isolate() const { return isolate_; } | 63 Isolate* isolate() const { return isolate_; } |
| 62 | 64 |
| 63 intptr_t from_frame_size() const { return from_frame_size_; } | 65 intptr_t from_frame_size() const { return from_frame_size_; } |
| 64 | 66 |
| 67 DeoptReasonId deopt_reason() const { return deopt_reason_; } |
| 68 |
| 65 private: | 69 private: |
| 66 const Array& object_table_; | 70 const Array& object_table_; |
| 67 intptr_t* to_frame_; | 71 intptr_t* to_frame_; |
| 68 const intptr_t to_frame_size_; | 72 const intptr_t to_frame_size_; |
| 69 intptr_t* from_frame_; | 73 intptr_t* from_frame_; |
| 70 intptr_t from_frame_size_; | 74 intptr_t from_frame_size_; |
| 71 intptr_t* registers_copy_; | 75 intptr_t* registers_copy_; |
| 72 double* xmm_registers_copy_; | 76 double* xmm_registers_copy_; |
| 73 const intptr_t num_args_; | 77 const intptr_t num_args_; |
| 78 const DeoptReasonId deopt_reason_; |
| 74 intptr_t caller_fp_; | 79 intptr_t caller_fp_; |
| 75 Isolate* isolate_; | 80 Isolate* isolate_; |
| 76 | 81 |
| 77 DISALLOW_COPY_AND_ASSIGN(DeoptimizationContext); | 82 DISALLOW_COPY_AND_ASSIGN(DeoptimizationContext); |
| 78 }; | 83 }; |
| 79 | 84 |
| 80 | 85 |
| 81 | 86 |
| 82 // Represents one deopt instruction, e.g, setup return address, store object, | 87 // Represents one deopt instruction, e.g, setup return address, store object, |
| 83 // store register, etc. The target is defined by instruction's position in | 88 // store register, etc. The target is defined by instruction's position in |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 DeoptInfo* info, | 211 DeoptInfo* info, |
| 207 Smi* reason); | 212 Smi* reason); |
| 208 | 213 |
| 209 private: | 214 private: |
| 210 static const intptr_t kEntrySize = 3; | 215 static const intptr_t kEntrySize = 3; |
| 211 }; | 216 }; |
| 212 | 217 |
| 213 } // namespace dart | 218 } // namespace dart |
| 214 | 219 |
| 215 #endif // VM_DEOPT_INSTRUCTIONS_H_ | 220 #endif // VM_DEOPT_INSTRUCTIONS_H_ |
| OLD | NEW |