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 2375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2386 kDeoptIdEntry = 2, // Deopt id. | 2386 kDeoptIdEntry = 2, // Deopt id. |
2387 kTokenPosEntry = 3, // Token position in source. | 2387 kTokenPosEntry = 3, // Token position in source. |
2388 kTryIndexEntry = 4, // Try block index. | 2388 kTryIndexEntry = 4, // Try block index. |
2389 // We would potentially be adding other objects here like | 2389 // We would potentially be adding other objects here like |
2390 // pointer maps for optimized functions, local variables information etc. | 2390 // pointer maps for optimized functions, local variables information etc. |
2391 kNumberOfEntries = 5, | 2391 kNumberOfEntries = 5, |
2392 }; | 2392 }; |
2393 | 2393 |
2394 public: | 2394 public: |
2395 enum Kind { | 2395 enum Kind { |
2396 kDeoptBefore = 0, // Deoptimization continuation point before instruction. | 2396 kDeopt, // Deoptimization continuation point. |
2397 kDeoptAfter, // Deoptimization continuation point after instruction. | |
2398 kEntryPatch, // Location where to patch entry. | 2397 kEntryPatch, // Location where to patch entry. |
2399 kPatchCode, // Buffer for patching code entry. | 2398 kPatchCode, // Buffer for patching code entry. |
2400 kLazyDeoptJump, // Lazy deoptimization trampoline. | 2399 kLazyDeoptJump, // Lazy deoptimization trampoline. |
2401 kIcCall, // IC call. | 2400 kIcCall, // IC call. |
2402 kFuncCall, // Call to known target, e.g. static call, closure call. | 2401 kFuncCall, // Call to known target, e.g. static call, closure call. |
2403 kReturn, // Return from function. | 2402 kReturn, // Return from function. |
2404 kOther | 2403 kOther |
2405 }; | 2404 }; |
2406 | 2405 |
2407 intptr_t Length() const; | 2406 intptr_t Length() const; |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2803 | 2802 |
2804 int32_t GetPointerOffsetAt(int index) const { | 2803 int32_t GetPointerOffsetAt(int index) const { |
2805 return *PointerOffsetAddrAt(index); | 2804 return *PointerOffsetAddrAt(index); |
2806 } | 2805 } |
2807 intptr_t GetTokenIndexOfPC(uword pc) const; | 2806 intptr_t GetTokenIndexOfPC(uword pc) const; |
2808 | 2807 |
2809 // Find pc, return 0 if not found. | 2808 // Find pc, return 0 if not found. |
2810 uword GetPatchCodePc() const; | 2809 uword GetPatchCodePc() const; |
2811 uword GetLazyDeoptPc() const; | 2810 uword GetLazyDeoptPc() const; |
2812 | 2811 |
2813 uword GetDeoptBeforePcAtDeoptId(intptr_t deopt_id) const; | |
2814 uword GetDeoptAfterPcAtDeoptId(intptr_t deopt_id) const; | |
2815 | |
2816 uword GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const; | 2812 uword GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const; |
2817 | 2813 |
2818 // Returns true if there is an object in the code between 'start_offset' | 2814 // Returns true if there is an object in the code between 'start_offset' |
2819 // (inclusive) and 'end_offset' (exclusive). | 2815 // (inclusive) and 'end_offset' (exclusive). |
2820 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; | 2816 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; |
2821 | 2817 |
2822 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. | 2818 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. |
2823 // Returns the maximum id found. | 2819 // Returns the maximum id found. |
2824 intptr_t ExtractIcDataArraysAtCalls( | 2820 intptr_t ExtractIcDataArraysAtCalls( |
2825 GrowableArray<intptr_t>* node_ids, | 2821 GrowableArray<intptr_t>* node_ids, |
(...skipping 2741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5567 | 5563 |
5568 | 5564 |
5569 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 5565 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
5570 intptr_t index) { | 5566 intptr_t index) { |
5571 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 5567 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
5572 } | 5568 } |
5573 | 5569 |
5574 } // namespace dart | 5570 } // namespace dart |
5575 | 5571 |
5576 #endif // VM_OBJECT_H_ | 5572 #endif // VM_OBJECT_H_ |
OLD | NEW |