| 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/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 intptr_t* GetFromPcAddress() const; | 40 intptr_t* GetFromPcAddress() const; |
| 41 | 41 |
| 42 RawObject* ObjectAt(intptr_t index) const { | 42 RawObject* ObjectAt(intptr_t index) const { |
| 43 return object_table_.At(index); | 43 return object_table_.At(index); |
| 44 } | 44 } |
| 45 | 45 |
| 46 intptr_t RegisterValue(Register reg) const { | 46 intptr_t RegisterValue(Register reg) const { |
| 47 return registers_copy_[reg]; | 47 return registers_copy_[reg]; |
| 48 } | 48 } |
| 49 | 49 |
| 50 double XmmRegisterValue(XmmRegister reg) const { |
| 51 return xmm_registers_copy_[reg]; |
| 52 } |
| 53 |
| 50 Isolate* isolate() const { return isolate_; } | 54 Isolate* isolate() const { return isolate_; } |
| 51 | 55 |
| 52 intptr_t from_frame_size() const { return from_frame_size_; } | 56 intptr_t from_frame_size() const { return from_frame_size_; } |
| 53 | 57 |
| 54 private: | 58 private: |
| 55 const Array& object_table_; | 59 const Array& object_table_; |
| 56 intptr_t* to_frame_; | 60 intptr_t* to_frame_; |
| 57 const intptr_t to_frame_size_; | 61 const intptr_t to_frame_size_; |
| 58 intptr_t* from_frame_; | 62 intptr_t* from_frame_; |
| 59 intptr_t from_frame_size_; | 63 intptr_t from_frame_size_; |
| 60 intptr_t* registers_copy_; | 64 intptr_t* registers_copy_; |
| 65 double* xmm_registers_copy_; |
| 61 const intptr_t num_args_; | 66 const intptr_t num_args_; |
| 62 Isolate* isolate_; | 67 Isolate* isolate_; |
| 63 | 68 |
| 64 DISALLOW_COPY_AND_ASSIGN(DeoptimizationContext); | 69 DISALLOW_COPY_AND_ASSIGN(DeoptimizationContext); |
| 65 }; | 70 }; |
| 66 | 71 |
| 67 | 72 |
| 68 | 73 |
| 69 // Represents one deopt instruction, e.g, setup return address, store object, | 74 // Represents one deopt instruction, e.g, setup return address, store object, |
| 70 // store register, etc. The target is defined by instruction's position in | 75 // store register, etc. The target is defined by instruction's position in |
| 71 // the deopt-info array. | 76 // the deopt-info array. |
| 72 class DeoptInstr : public ZoneAllocated { | 77 class DeoptInstr : public ZoneAllocated { |
| 73 public: | 78 public: |
| 74 static DeoptInstr* Create(intptr_t kind_as_int, intptr_t from_index); | 79 static DeoptInstr* Create(intptr_t kind_as_int, intptr_t from_index); |
| 75 | 80 |
| 76 DeoptInstr() {} | 81 DeoptInstr() {} |
| 77 virtual ~DeoptInstr() {} | 82 virtual ~DeoptInstr() {} |
| 78 | 83 |
| 79 virtual const char* ToCString() const = 0; | 84 virtual const char* ToCString() const = 0; |
| 80 | 85 |
| 81 virtual void Execute(DeoptimizationContext* deopt_context, | 86 virtual void Execute(DeoptimizationContext* deopt_context, |
| 82 intptr_t to_index) = 0; | 87 intptr_t to_index) = 0; |
| 83 | 88 |
| 84 protected: | 89 protected: |
| 85 enum Kind { | 90 enum Kind { |
| 86 kSetRetAddress, | 91 kSetRetAddress, |
| 87 kCopyConstant, | 92 kCopyConstant, |
| 88 kCopyRegister, | 93 kCopyRegister, |
| 94 kCopyXmmRegister, |
| 89 kCopyStackSlot, | 95 kCopyStackSlot, |
| 96 kCopyDoubleStackSlot, |
| 90 kSetPcMarker, | 97 kSetPcMarker, |
| 91 kSetCallerFp, | 98 kSetCallerFp, |
| 92 kSetCallerPc, | 99 kSetCallerPc, |
| 93 }; | 100 }; |
| 94 | 101 |
| 95 virtual DeoptInstr::Kind kind() const = 0; | 102 virtual DeoptInstr::Kind kind() const = 0; |
| 96 virtual intptr_t from_index() const = 0; | 103 virtual intptr_t from_index() const = 0; |
| 97 | 104 |
| 98 friend class DeoptInfoBuilder; | 105 friend class DeoptInfoBuilder; |
| 99 | 106 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 GrowableArray<DeoptInstr*> instructions_; | 143 GrowableArray<DeoptInstr*> instructions_; |
| 137 const GrowableObjectArray& object_table_; | 144 const GrowableObjectArray& object_table_; |
| 138 const intptr_t num_args_; | 145 const intptr_t num_args_; |
| 139 | 146 |
| 140 DISALLOW_COPY_AND_ASSIGN(DeoptInfoBuilder); | 147 DISALLOW_COPY_AND_ASSIGN(DeoptInfoBuilder); |
| 141 }; | 148 }; |
| 142 | 149 |
| 143 } // namespace dart | 150 } // namespace dart |
| 144 | 151 |
| 145 #endif // VM_DEOPT_INSTRUCTIONS_H_ | 152 #endif // VM_DEOPT_INSTRUCTIONS_H_ |
| OLD | NEW |