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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 intptr_t GetCallerFp() const; | 51 intptr_t GetCallerFp() const; |
52 void SetCallerFp(intptr_t callers_fp); | 52 void SetCallerFp(intptr_t callers_fp); |
53 | 53 |
54 RawObject* ObjectAt(intptr_t index) const { | 54 RawObject* ObjectAt(intptr_t index) const { |
55 const Array& object_table = Array::Handle(object_table_); | 55 const Array& object_table = Array::Handle(object_table_); |
56 return object_table.At(index); | 56 return object_table.At(index); |
57 } | 57 } |
58 | 58 |
59 intptr_t RegisterValue(Register reg) const { | 59 intptr_t RegisterValue(Register reg) const { |
60 ASSERT(cpu_registers_ != NULL); | 60 ASSERT(cpu_registers_ != NULL); |
61 ASSERT(reg >= 0); | |
62 ASSERT(reg < kNumberOfCpuRegisters); | |
61 return cpu_registers_[reg]; | 63 return cpu_registers_[reg]; |
62 } | 64 } |
63 | 65 |
64 double FpuRegisterValue(FpuRegister reg) const { | 66 double FpuRegisterValue(FpuRegister reg) const { |
65 ASSERT(fpu_registers_ != NULL); | 67 ASSERT(fpu_registers_ != NULL); |
68 ASSERT(reg >= 0); | |
69 ASSERT(reg < kNumberOfFpuRegisters); | |
66 return *reinterpret_cast<double*>(&fpu_registers_[reg]); | 70 return *reinterpret_cast<double*>(&fpu_registers_[reg]); |
67 } | 71 } |
68 | 72 |
69 int64_t FpuRegisterValueAsInt64(FpuRegister reg) const { | 73 int64_t FpuRegisterValueAsInt64(FpuRegister reg) const { |
70 ASSERT(fpu_registers_ != NULL); | 74 ASSERT(fpu_registers_ != NULL); |
75 ASSERT(reg >= 0); | |
76 ASSERT(reg < kNumberOfFpuRegisters); | |
71 return *reinterpret_cast<int64_t*>(&fpu_registers_[reg]); | 77 return *reinterpret_cast<int64_t*>(&fpu_registers_[reg]); |
72 } | 78 } |
73 | 79 |
74 simd128_value_t FpuRegisterValueAsSimd128(FpuRegister reg) const { | 80 simd128_value_t FpuRegisterValueAsSimd128(FpuRegister reg) const { |
75 ASSERT(fpu_registers_ != NULL); | 81 ASSERT(fpu_registers_ != NULL); |
82 ASSERT(reg >= 0); | |
83 ASSERT(reg < kNumberOfFpuRegisters); | |
76 const float* address = reinterpret_cast<float*>(&fpu_registers_[reg]); | 84 const float* address = reinterpret_cast<float*>(&fpu_registers_[reg]); |
77 return simd128_value_t().readFrom(address); | 85 return simd128_value_t().readFrom(address); |
78 } | 86 } |
79 | 87 |
80 void set_dest_frame(intptr_t* dest_frame) { | 88 void set_dest_frame(intptr_t* dest_frame) { |
81 ASSERT(dest_frame != NULL && dest_frame_ == NULL); | 89 ASSERT(dest_frame != NULL && dest_frame_ == NULL); |
82 dest_frame_ = dest_frame; | 90 dest_frame_ = dest_frame; |
83 } | 91 } |
84 | 92 |
85 Isolate* isolate() const { return isolate_; } | 93 Isolate* isolate() const { return isolate_; } |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
209 // Represents one deopt instruction, e.g, setup return address, store object, | 217 // Represents one deopt instruction, e.g, setup return address, store object, |
210 // store register, etc. The target is defined by instruction's position in | 218 // store register, etc. The target is defined by instruction's position in |
211 // the deopt-info array. | 219 // the deopt-info array. |
212 class DeoptInstr : public ZoneAllocated { | 220 class DeoptInstr : public ZoneAllocated { |
213 public: | 221 public: |
214 enum Kind { | 222 enum Kind { |
215 kRetAddress, | 223 kRetAddress, |
216 kConstant, | 224 kConstant, |
217 kRegister, | 225 kRegister, |
218 kFpuRegister, | 226 kFpuRegister, |
219 kInt64FpuRegister, | 227 kInt64RegisterPair, |
regis
2014/05/22 17:09:40
Why not kRegisterPair?
kInt64RegisterPair sounds l
Cutch
2014/05/23 21:33:54
A kInt64RegisterPair is a mint (64-bit integer) wh
regis
2014/05/23 22:36:59
Do I understand correctly that some of these are f
| |
220 kFloat32x4FpuRegister, | 228 kFloat32x4FpuRegister, |
221 kFloat64x2FpuRegister, | 229 kFloat64x2FpuRegister, |
222 kInt32x4FpuRegister, | 230 kInt32x4FpuRegister, |
223 kStackSlot, | 231 kStackSlot, |
224 kDoubleStackSlot, | 232 kDoubleStackSlot, |
225 kInt64StackSlot, | 233 kInt64StackSlot, |
234 kInt64StackSlotPair, | |
226 kFloat32x4StackSlot, | 235 kFloat32x4StackSlot, |
227 kFloat64x2StackSlot, | 236 kFloat64x2StackSlot, |
228 kInt32x4StackSlot, | 237 kInt32x4StackSlot, |
238 kInt64StackSlotRegister, | |
regis
2014/05/22 17:09:40
Comments would help here. What is the difference b
Cutch
2014/05/23 21:33:54
See above.
| |
229 kPcMarker, | 239 kPcMarker, |
230 kPp, | 240 kPp, |
231 kCallerFp, | 241 kCallerFp, |
232 kCallerPp, | 242 kCallerPp, |
233 kCallerPc, | 243 kCallerPc, |
234 kSuffix, | 244 kSuffix, |
235 kMaterializedObjectRef, | 245 kMaterializedObjectRef, |
236 kMaterializeObject | 246 kMaterializeObject |
237 }; | 247 }; |
238 | 248 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
382 DeoptInfo* info, | 392 DeoptInfo* info, |
383 Smi* reason); | 393 Smi* reason); |
384 | 394 |
385 private: | 395 private: |
386 static const intptr_t kEntrySize = 3; | 396 static const intptr_t kEntrySize = 3; |
387 }; | 397 }; |
388 | 398 |
389 } // namespace dart | 399 } // namespace dart |
390 | 400 |
391 #endif // VM_DEOPT_INSTRUCTIONS_H_ | 401 #endif // VM_DEOPT_INSTRUCTIONS_H_ |
OLD | NEW |