OLD | NEW |
1 // Copyright (c) 2012, 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" |
11 #include "vm/growable_array.h" | 11 #include "vm/growable_array.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 void SetCallerFp(intptr_t callers_fp); | 45 void SetCallerFp(intptr_t callers_fp); |
46 | 46 |
47 RawObject* ObjectAt(intptr_t index) const { | 47 RawObject* ObjectAt(intptr_t index) const { |
48 return object_table_.At(index); | 48 return object_table_.At(index); |
49 } | 49 } |
50 | 50 |
51 intptr_t RegisterValue(Register reg) const { | 51 intptr_t RegisterValue(Register reg) const { |
52 return registers_copy_[reg]; | 52 return registers_copy_[reg]; |
53 } | 53 } |
54 | 54 |
55 double XmmRegisterValue(XmmRegister reg) const { | 55 double FpuRegisterValue(FpuRegister reg) const { |
56 return xmm_registers_copy_[reg]; | 56 return fpu_registers_copy_[reg]; |
57 } | 57 } |
58 | 58 |
59 int64_t XmmRegisterValueAsInt64(XmmRegister reg) const { | 59 int64_t FpuRegisterValueAsInt64(FpuRegister reg) const { |
60 return (reinterpret_cast<int64_t*>(xmm_registers_copy_))[reg]; | 60 return (reinterpret_cast<int64_t*>(fpu_registers_copy_))[reg]; |
61 } | 61 } |
62 | 62 |
63 Isolate* isolate() const { return isolate_; } | 63 Isolate* isolate() const { return isolate_; } |
64 | 64 |
65 intptr_t from_frame_size() const { return from_frame_size_; } | 65 intptr_t from_frame_size() const { return from_frame_size_; } |
66 | 66 |
67 DeoptReasonId deopt_reason() const { return deopt_reason_; } | 67 DeoptReasonId deopt_reason() const { return deopt_reason_; } |
68 | 68 |
69 private: | 69 private: |
70 const Array& object_table_; | 70 const Array& object_table_; |
71 intptr_t* to_frame_; | 71 intptr_t* to_frame_; |
72 const intptr_t to_frame_size_; | 72 const intptr_t to_frame_size_; |
73 intptr_t* from_frame_; | 73 intptr_t* from_frame_; |
74 intptr_t from_frame_size_; | 74 intptr_t from_frame_size_; |
75 intptr_t* registers_copy_; | 75 intptr_t* registers_copy_; |
76 double* xmm_registers_copy_; | 76 double* fpu_registers_copy_; |
77 const intptr_t num_args_; | 77 const intptr_t num_args_; |
78 const DeoptReasonId deopt_reason_; | 78 const DeoptReasonId deopt_reason_; |
79 intptr_t caller_fp_; | 79 intptr_t caller_fp_; |
80 Isolate* isolate_; | 80 Isolate* isolate_; |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(DeoptimizationContext); | 82 DISALLOW_COPY_AND_ASSIGN(DeoptimizationContext); |
83 }; | 83 }; |
84 | 84 |
85 | 85 |
86 | 86 |
87 // Represents one deopt instruction, e.g, setup return address, store object, | 87 // Represents one deopt instruction, e.g, setup return address, store object, |
88 // 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 |
89 // the deopt-info array. | 89 // the deopt-info array. |
90 class DeoptInstr : public ZoneAllocated { | 90 class DeoptInstr : public ZoneAllocated { |
91 public: | 91 public: |
92 enum Kind { | 92 enum Kind { |
93 kRetAfterAddress, | 93 kRetAfterAddress, |
94 kRetBeforeAddress, | 94 kRetBeforeAddress, |
95 kConstant, | 95 kConstant, |
96 kRegister, | 96 kRegister, |
97 kXmmRegister, | 97 kFpuRegister, |
98 kInt64XmmRegister, | 98 kInt64FpuRegister, |
99 kStackSlot, | 99 kStackSlot, |
100 kDoubleStackSlot, | 100 kDoubleStackSlot, |
101 kInt64StackSlot, | 101 kInt64StackSlot, |
102 kPcMarker, | 102 kPcMarker, |
103 kCallerFp, | 103 kCallerFp, |
104 kCallerPc, | 104 kCallerPc, |
105 kSuffix, | 105 kSuffix, |
106 }; | 106 }; |
107 | 107 |
108 static DeoptInstr* Create(intptr_t kind_as_int, intptr_t from_index); | 108 static DeoptInstr* Create(intptr_t kind_as_int, intptr_t from_index); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 DeoptInfo* info, | 217 DeoptInfo* info, |
218 Smi* reason); | 218 Smi* reason); |
219 | 219 |
220 private: | 220 private: |
221 static const intptr_t kEntrySize = 3; | 221 static const intptr_t kEntrySize = 3; |
222 }; | 222 }; |
223 | 223 |
224 } // namespace dart | 224 } // namespace dart |
225 | 225 |
226 #endif // VM_DEOPT_INSTRUCTIONS_H_ | 226 #endif // VM_DEOPT_INSTRUCTIONS_H_ |
OLD | NEW |