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 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2269 // pointer maps for optimized functions, local variables information etc. | 2269 // pointer maps for optimized functions, local variables information etc. |
2270 kNumberOfEntries = 5, | 2270 kNumberOfEntries = 5, |
2271 }; | 2271 }; |
2272 | 2272 |
2273 public: | 2273 public: |
2274 enum Kind { | 2274 enum Kind { |
2275 kDeoptBefore = 0, // Deoptimization continuation point before instruction. | 2275 kDeoptBefore = 0, // Deoptimization continuation point before instruction. |
2276 kDeoptAfter, // Deoptimization continuation point after instruction. | 2276 kDeoptAfter, // Deoptimization continuation point after instruction. |
2277 kDeoptIndex, // Index into deopt info array. | 2277 kDeoptIndex, // Index into deopt info array. |
2278 kPatchCode, // Buffer for patching code entry. | 2278 kPatchCode, // Buffer for patching code entry. |
| 2279 kLazyDeoptJump, // Lazy deoptimization trampoline. |
2279 kIcCall, // IC call. | 2280 kIcCall, // IC call. |
2280 kFuncCall, // Call to known target, e.g. static call, closure call. | 2281 kFuncCall, // Call to known target, e.g. static call, closure call. |
2281 kReturn, // Return from function. | 2282 kReturn, // Return from function. |
2282 kOther | 2283 kOther |
2283 }; | 2284 }; |
2284 | 2285 |
2285 intptr_t Length() const; | 2286 intptr_t Length() const; |
2286 | 2287 |
2287 uword PC(intptr_t index) const; | 2288 uword PC(intptr_t index) const; |
2288 PcDescriptors::Kind DescriptorKind(intptr_t index) const; | 2289 PcDescriptors::Kind DescriptorKind(intptr_t index) const; |
(...skipping 27 matching lines...) Expand all Loading... |
2316 return 0; | 2317 return 0; |
2317 } | 2318 } |
2318 static intptr_t InstanceSize(intptr_t len) { | 2319 static intptr_t InstanceSize(intptr_t len) { |
2319 ASSERT(0 <= len && len <= kMaxElements); | 2320 ASSERT(0 <= len && len <= kMaxElements); |
2320 return RoundedAllocationSize( | 2321 return RoundedAllocationSize( |
2321 sizeof(RawPcDescriptors) + (len * kBytesPerElement)); | 2322 sizeof(RawPcDescriptors) + (len * kBytesPerElement)); |
2322 } | 2323 } |
2323 | 2324 |
2324 static RawPcDescriptors* New(intptr_t num_descriptors); | 2325 static RawPcDescriptors* New(intptr_t num_descriptors); |
2325 | 2326 |
| 2327 // Returns 0 if not found. |
| 2328 uword GetPcForKind(Kind kind) const; |
| 2329 |
2326 // Verify (assert) assumptions about pc descriptors in debug mode. | 2330 // Verify (assert) assumptions about pc descriptors in debug mode. |
2327 void Verify(bool check_ids) const; | 2331 void Verify(bool check_ids) const; |
2328 | 2332 |
2329 static void PrintHeaderString(); | 2333 static void PrintHeaderString(); |
2330 | 2334 |
2331 // We would have a VisitPointers function here to traverse the | 2335 // We would have a VisitPointers function here to traverse the |
2332 // pc descriptors table to visit objects if any in the table. | 2336 // pc descriptors table to visit objects if any in the table. |
2333 | 2337 |
2334 private: | 2338 private: |
2335 void SetPC(intptr_t index, uword value) const; | 2339 void SetPC(intptr_t index, uword value) const; |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2649 } | 2653 } |
2650 static RawCode* FinalizeCode(const Function& function, Assembler* assembler); | 2654 static RawCode* FinalizeCode(const Function& function, Assembler* assembler); |
2651 static RawCode* FinalizeCode(const char* name, Assembler* assembler); | 2655 static RawCode* FinalizeCode(const char* name, Assembler* assembler); |
2652 static RawCode* LookupCode(uword pc); | 2656 static RawCode* LookupCode(uword pc); |
2653 | 2657 |
2654 int32_t GetPointerOffsetAt(int index) const { | 2658 int32_t GetPointerOffsetAt(int index) const { |
2655 return *PointerOffsetAddrAt(index); | 2659 return *PointerOffsetAddrAt(index); |
2656 } | 2660 } |
2657 intptr_t GetTokenIndexOfPC(uword pc) const; | 2661 intptr_t GetTokenIndexOfPC(uword pc) const; |
2658 | 2662 |
2659 // Find pc of patch code buffer. Return 0 if not found. | 2663 // Find pc, return 0 if not found. |
2660 uword GetPatchCodePc() const; | 2664 uword GetPatchCodePc() const; |
| 2665 uword GetLazyDeoptPc() const; |
2661 | 2666 |
2662 uword GetDeoptBeforePcAtDeoptId(intptr_t deopt_id) const; | 2667 uword GetDeoptBeforePcAtDeoptId(intptr_t deopt_id) const; |
2663 uword GetDeoptAfterPcAtDeoptId(intptr_t deopt_id) const; | 2668 uword GetDeoptAfterPcAtDeoptId(intptr_t deopt_id) const; |
2664 | 2669 |
2665 // Returns true if there is an object in the code between 'start_offset' | 2670 // Returns true if there is an object in the code between 'start_offset' |
2666 // (inclusive) and 'end_offset' (exclusive). | 2671 // (inclusive) and 'end_offset' (exclusive). |
2667 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; | 2672 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; |
2668 | 2673 |
2669 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. | 2674 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. |
2670 // Returns the maximum id found. | 2675 // Returns the maximum id found. |
(...skipping 2898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5569 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5574 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
5570 return false; | 5575 return false; |
5571 } | 5576 } |
5572 } | 5577 } |
5573 return true; | 5578 return true; |
5574 } | 5579 } |
5575 | 5580 |
5576 } // namespace dart | 5581 } // namespace dart |
5577 | 5582 |
5578 #endif // VM_OBJECT_H_ | 5583 #endif // VM_OBJECT_H_ |
OLD | NEW |