| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 } | 47 } |
| 48 | 48 |
| 49 intptr_t GetSourceFp() const; | 49 intptr_t GetSourceFp() const; |
| 50 intptr_t GetSourcePp() const; | 50 intptr_t GetSourcePp() const; |
| 51 intptr_t GetSourcePc() const; | 51 intptr_t GetSourcePc() const; |
| 52 | 52 |
| 53 intptr_t GetCallerFp() const; | 53 intptr_t GetCallerFp() const; |
| 54 void SetCallerFp(intptr_t callers_fp); | 54 void SetCallerFp(intptr_t callers_fp); |
| 55 | 55 |
| 56 RawObject* ObjectAt(intptr_t index) const { | 56 RawObject* ObjectAt(intptr_t index) const { |
| 57 const Array& object_pool = Array::Handle(object_pool_); | 57 const ObjectPool& object_pool = ObjectPool::Handle(object_pool_); |
| 58 return object_pool.At(index); | 58 return object_pool.ObjectAt(index); |
| 59 } | 59 } |
| 60 | 60 |
| 61 intptr_t RegisterValue(Register reg) const { | 61 intptr_t RegisterValue(Register reg) const { |
| 62 ASSERT(cpu_registers_ != NULL); | 62 ASSERT(cpu_registers_ != NULL); |
| 63 ASSERT(reg >= 0); | 63 ASSERT(reg >= 0); |
| 64 ASSERT(reg < kNumberOfCpuRegisters); | 64 ASSERT(reg < kNumberOfCpuRegisters); |
| 65 return cpu_registers_[reg]; | 65 return cpu_registers_[reg]; |
| 66 } | 66 } |
| 67 | 67 |
| 68 double FpuRegisterValue(FpuRegister reg) const { | 68 double FpuRegisterValue(FpuRegister reg) const { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // Claims ownership of the memory for 'object'. | 198 // Claims ownership of the memory for 'object'. |
| 199 void SetDeferredObjectAt(intptr_t idx, DeferredObject* object) { | 199 void SetDeferredObjectAt(intptr_t idx, DeferredObject* object) { |
| 200 deferred_objects_[idx] = object; | 200 deferred_objects_[idx] = object; |
| 201 } | 201 } |
| 202 | 202 |
| 203 intptr_t DeferredObjectsCount() const { | 203 intptr_t DeferredObjectsCount() const { |
| 204 return deferred_objects_count_; | 204 return deferred_objects_count_; |
| 205 } | 205 } |
| 206 | 206 |
| 207 RawCode* code_; | 207 RawCode* code_; |
| 208 RawArray* object_pool_; | 208 RawObjectPool* object_pool_; |
| 209 RawTypedData* deopt_info_; | 209 RawTypedData* deopt_info_; |
| 210 bool dest_frame_is_allocated_; | 210 bool dest_frame_is_allocated_; |
| 211 intptr_t* dest_frame_; | 211 intptr_t* dest_frame_; |
| 212 intptr_t dest_frame_size_; | 212 intptr_t dest_frame_size_; |
| 213 bool source_frame_is_allocated_; | 213 bool source_frame_is_allocated_; |
| 214 intptr_t* source_frame_; | 214 intptr_t* source_frame_; |
| 215 intptr_t source_frame_size_; | 215 intptr_t source_frame_size_; |
| 216 intptr_t* cpu_registers_; | 216 intptr_t* cpu_registers_; |
| 217 fpu_register_t* fpu_registers_; | 217 fpu_register_t* fpu_registers_; |
| 218 intptr_t num_args_; | 218 intptr_t num_args_; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 280 |
| 281 virtual DeoptInstr::Kind kind() const = 0; | 281 virtual DeoptInstr::Kind kind() const = 0; |
| 282 | 282 |
| 283 bool Equals(const DeoptInstr& other) const { | 283 bool Equals(const DeoptInstr& other) const { |
| 284 return (kind() == other.kind()) && (source_index() == other.source_index()); | 284 return (kind() == other.kind()) && (source_index() == other.source_index()); |
| 285 } | 285 } |
| 286 | 286 |
| 287 // Get the code and return address which is encoded in this | 287 // Get the code and return address which is encoded in this |
| 288 // kRetAfterAddress deopt instruction. | 288 // kRetAfterAddress deopt instruction. |
| 289 static uword GetRetAddress(DeoptInstr* instr, | 289 static uword GetRetAddress(DeoptInstr* instr, |
| 290 const Array& object_pool, | 290 const ObjectPool& object_pool, |
| 291 Code* code); | 291 Code* code); |
| 292 | 292 |
| 293 // Return number of initialized fields in the object that will be | 293 // Return number of initialized fields in the object that will be |
| 294 // materialized by kMaterializeObject instruction. | 294 // materialized by kMaterializeObject instruction. |
| 295 static intptr_t GetFieldCount(DeoptInstr* instr) { | 295 static intptr_t GetFieldCount(DeoptInstr* instr) { |
| 296 ASSERT(instr->kind() == DeoptInstr::kMaterializeObject); | 296 ASSERT(instr->kind() == DeoptInstr::kMaterializeObject); |
| 297 return instr->source_index(); | 297 return instr->source_index(); |
| 298 } | 298 } |
| 299 | 299 |
| 300 protected: | 300 protected: |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 class ReasonField : public BitField<ICData::DeoptReasonId, 0, 8> { }; | 533 class ReasonField : public BitField<ICData::DeoptReasonId, 0, 8> { }; |
| 534 class FlagsField : public BitField<uint32_t, 8, 8> { }; | 534 class FlagsField : public BitField<uint32_t, 8, 8> { }; |
| 535 | 535 |
| 536 private: | 536 private: |
| 537 static const intptr_t kEntrySize = 3; | 537 static const intptr_t kEntrySize = 3; |
| 538 }; | 538 }; |
| 539 | 539 |
| 540 } // namespace dart | 540 } // namespace dart |
| 541 | 541 |
| 542 #endif // VM_DEOPT_INSTRUCTIONS_H_ | 542 #endif // VM_DEOPT_INSTRUCTIONS_H_ |
| OLD | NEW |