| 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_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 2552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2563 } | 2563 } |
| 2564 intptr_t GetTokenIndexOfPC(uword pc) const; | 2564 intptr_t GetTokenIndexOfPC(uword pc) const; |
| 2565 | 2565 |
| 2566 // Find pc, return 0 if not found. | 2566 // Find pc, return 0 if not found. |
| 2567 uword GetPatchCodePc() const; | 2567 uword GetPatchCodePc() const; |
| 2568 uword GetLazyDeoptPc() const; | 2568 uword GetLazyDeoptPc() const; |
| 2569 | 2569 |
| 2570 uword GetDeoptBeforePcAtDeoptId(intptr_t deopt_id) const; | 2570 uword GetDeoptBeforePcAtDeoptId(intptr_t deopt_id) const; |
| 2571 uword GetDeoptAfterPcAtDeoptId(intptr_t deopt_id) const; | 2571 uword GetDeoptAfterPcAtDeoptId(intptr_t deopt_id) const; |
| 2572 | 2572 |
| 2573 uword GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const; |
| 2574 |
| 2573 // Returns true if there is an object in the code between 'start_offset' | 2575 // Returns true if there is an object in the code between 'start_offset' |
| 2574 // (inclusive) and 'end_offset' (exclusive). | 2576 // (inclusive) and 'end_offset' (exclusive). |
| 2575 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; | 2577 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; |
| 2576 | 2578 |
| 2577 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. | 2579 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. |
| 2578 // Returns the maximum id found. | 2580 // Returns the maximum id found. |
| 2579 intptr_t ExtractIcDataArraysAtCalls( | 2581 intptr_t ExtractIcDataArraysAtCalls( |
| 2580 GrowableArray<intptr_t>* node_ids, | 2582 GrowableArray<intptr_t>* node_ids, |
| 2581 const GrowableObjectArray& ic_data_objs) const; | 2583 const GrowableObjectArray& ic_data_objs) const; |
| 2582 | 2584 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2619 int32_t* PointerOffsetAddrAt(int index) const { | 2621 int32_t* PointerOffsetAddrAt(int index) const { |
| 2620 ASSERT(index >= 0); | 2622 ASSERT(index >= 0); |
| 2621 ASSERT(index < pointer_offsets_length()); | 2623 ASSERT(index < pointer_offsets_length()); |
| 2622 // TODO(iposva): Unit test is missing for this functionality. | 2624 // TODO(iposva): Unit test is missing for this functionality. |
| 2623 return &raw_ptr()->data_[index]; | 2625 return &raw_ptr()->data_[index]; |
| 2624 } | 2626 } |
| 2625 void SetPointerOffsetAt(int index, int32_t offset_in_instructions) { | 2627 void SetPointerOffsetAt(int index, int32_t offset_in_instructions) { |
| 2626 *PointerOffsetAddrAt(index) = offset_in_instructions; | 2628 *PointerOffsetAddrAt(index) = offset_in_instructions; |
| 2627 } | 2629 } |
| 2628 | 2630 |
| 2629 uword GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const; | |
| 2630 | 2631 |
| 2631 // New is a private method as RawInstruction and RawCode objects should | 2632 // New is a private method as RawInstruction and RawCode objects should |
| 2632 // only be created using the Code::FinalizeCode method. This method creates | 2633 // only be created using the Code::FinalizeCode method. This method creates |
| 2633 // the RawInstruction and RawCode objects, sets up the pointer offsets | 2634 // the RawInstruction and RawCode objects, sets up the pointer offsets |
| 2634 // and links the two in a GC safe manner. | 2635 // and links the two in a GC safe manner. |
| 2635 static RawCode* New(intptr_t pointer_offsets_length); | 2636 static RawCode* New(intptr_t pointer_offsets_length); |
| 2636 | 2637 |
| 2637 HEAP_OBJECT_IMPLEMENTATION(Code, Object); | 2638 HEAP_OBJECT_IMPLEMENTATION(Code, Object); |
| 2638 friend class Class; | 2639 friend class Class; |
| 2639 }; | 2640 }; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2779 } | 2780 } |
| 2780 | 2781 |
| 2781 intptr_t num_args_tested() const { | 2782 intptr_t num_args_tested() const { |
| 2782 return raw_ptr()->num_args_tested_; | 2783 return raw_ptr()->num_args_tested_; |
| 2783 } | 2784 } |
| 2784 | 2785 |
| 2785 intptr_t deopt_id() const { | 2786 intptr_t deopt_id() const { |
| 2786 return raw_ptr()->deopt_id_; | 2787 return raw_ptr()->deopt_id_; |
| 2787 } | 2788 } |
| 2788 | 2789 |
| 2790 intptr_t deopt_reason() const { |
| 2791 return raw_ptr()->deopt_reason_; |
| 2792 } |
| 2793 |
| 2794 void set_deopt_reason(intptr_t reason) const; |
| 2795 |
| 2789 intptr_t NumberOfChecks() const; | 2796 intptr_t NumberOfChecks() const; |
| 2790 | 2797 |
| 2791 static intptr_t InstanceSize() { | 2798 static intptr_t InstanceSize() { |
| 2792 return RoundedAllocationSize(sizeof(RawICData)); | 2799 return RoundedAllocationSize(sizeof(RawICData)); |
| 2793 } | 2800 } |
| 2794 | 2801 |
| 2795 static intptr_t target_name_offset() { | 2802 static intptr_t target_name_offset() { |
| 2796 return OFFSET_OF(RawICData, target_name_); | 2803 return OFFSET_OF(RawICData, target_name_); |
| 2797 } | 2804 } |
| 2798 | 2805 |
| (...skipping 3062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5861 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5868 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
| 5862 return false; | 5869 return false; |
| 5863 } | 5870 } |
| 5864 } | 5871 } |
| 5865 return true; | 5872 return true; |
| 5866 } | 5873 } |
| 5867 | 5874 |
| 5868 } // namespace dart | 5875 } // namespace dart |
| 5869 | 5876 |
| 5870 #endif // VM_OBJECT_H_ | 5877 #endif // VM_OBJECT_H_ |
| OLD | NEW |