| 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 2517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2528 enum Kind { | 2528 enum Kind { |
| 2529 kDeopt, // Deoptimization continuation point. | 2529 kDeopt, // Deoptimization continuation point. |
| 2530 kEntryPatch, // Location where to patch entry. | 2530 kEntryPatch, // Location where to patch entry. |
| 2531 kPatchCode, // Buffer for patching code entry. | 2531 kPatchCode, // Buffer for patching code entry. |
| 2532 kLazyDeoptJump, // Lazy deoptimization trampoline. | 2532 kLazyDeoptJump, // Lazy deoptimization trampoline. |
| 2533 kIcCall, // IC call. | 2533 kIcCall, // IC call. |
| 2534 kFuncCall, // Call to known target, e.g. static call. | 2534 kFuncCall, // Call to known target, e.g. static call. |
| 2535 kClosureCall, // Closure call. | 2535 kClosureCall, // Closure call. |
| 2536 kRuntimeCall, // Runtime call. | 2536 kRuntimeCall, // Runtime call. |
| 2537 kReturn, // Return from function. | 2537 kReturn, // Return from function. |
| 2538 kOsrEntry, // OSR entry point in unoptimized code. |
| 2538 kOther | 2539 kOther |
| 2539 }; | 2540 }; |
| 2540 | 2541 |
| 2541 intptr_t Length() const; | 2542 intptr_t Length() const; |
| 2542 | 2543 |
| 2543 uword PC(intptr_t index) const; | 2544 uword PC(intptr_t index) const; |
| 2544 PcDescriptors::Kind DescriptorKind(intptr_t index) const; | 2545 PcDescriptors::Kind DescriptorKind(intptr_t index) const; |
| 2545 const char* KindAsStr(intptr_t index) const; | 2546 const char* KindAsStr(intptr_t index) const; |
| 2546 intptr_t DeoptId(intptr_t index) const; | 2547 intptr_t DeoptId(intptr_t index) const; |
| 2547 intptr_t TokenPos(intptr_t index) const; | 2548 intptr_t TokenPos(intptr_t index) const; |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2863 return raw_ptr()->static_calls_target_table_; | 2864 return raw_ptr()->static_calls_target_table_; |
| 2864 } | 2865 } |
| 2865 | 2866 |
| 2866 RawDeoptInfo* GetDeoptInfoAtPc(uword pc, intptr_t* deopt_reason) const; | 2867 RawDeoptInfo* GetDeoptInfoAtPc(uword pc, intptr_t* deopt_reason) const; |
| 2867 | 2868 |
| 2868 // Returns null if there is no static call at 'pc'. | 2869 // Returns null if there is no static call at 'pc'. |
| 2869 RawFunction* GetStaticCallTargetFunctionAt(uword pc) const; | 2870 RawFunction* GetStaticCallTargetFunctionAt(uword pc) const; |
| 2870 // Aborts if there is no static call at 'pc'. | 2871 // Aborts if there is no static call at 'pc'. |
| 2871 void SetStaticCallTargetCodeAt(uword pc, const Code& code) const; | 2872 void SetStaticCallTargetCodeAt(uword pc, const Code& code) const; |
| 2872 | 2873 |
| 2874 void Disassemble() const; |
| 2875 |
| 2873 class Comments : public ZoneAllocated { | 2876 class Comments : public ZoneAllocated { |
| 2874 public: | 2877 public: |
| 2875 static Comments& New(intptr_t count); | 2878 static Comments& New(intptr_t count); |
| 2876 | 2879 |
| 2877 intptr_t Length() const; | 2880 intptr_t Length() const; |
| 2878 | 2881 |
| 2879 void SetPCOffsetAt(intptr_t idx, intptr_t pc_offset); | 2882 void SetPCOffsetAt(intptr_t idx, intptr_t pc_offset); |
| 2880 void SetCommentAt(intptr_t idx, const String& comment); | 2883 void SetCommentAt(intptr_t idx, const String& comment); |
| 2881 | 2884 |
| 2882 intptr_t PCOffsetAt(intptr_t idx) const; | 2885 intptr_t PCOffsetAt(intptr_t idx) const; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2950 int32_t GetPointerOffsetAt(int index) const { | 2953 int32_t GetPointerOffsetAt(int index) const { |
| 2951 return *PointerOffsetAddrAt(index); | 2954 return *PointerOffsetAddrAt(index); |
| 2952 } | 2955 } |
| 2953 intptr_t GetTokenIndexOfPC(uword pc) const; | 2956 intptr_t GetTokenIndexOfPC(uword pc) const; |
| 2954 | 2957 |
| 2955 // Find pc, return 0 if not found. | 2958 // Find pc, return 0 if not found. |
| 2956 uword GetPatchCodePc() const; | 2959 uword GetPatchCodePc() const; |
| 2957 uword GetLazyDeoptPc() const; | 2960 uword GetLazyDeoptPc() const; |
| 2958 | 2961 |
| 2959 uword GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const; | 2962 uword GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const; |
| 2963 intptr_t GetDeoptIdForOsr(uword pc) const; |
| 2960 | 2964 |
| 2961 // Returns true if there is an object in the code between 'start_offset' | 2965 // Returns true if there is an object in the code between 'start_offset' |
| 2962 // (inclusive) and 'end_offset' (exclusive). | 2966 // (inclusive) and 'end_offset' (exclusive). |
| 2963 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; | 2967 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; |
| 2964 | 2968 |
| 2965 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. | 2969 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. |
| 2966 // Returns the maximum id found. | 2970 // Returns the maximum id found. |
| 2967 intptr_t ExtractIcDataArraysAtCalls( | 2971 intptr_t ExtractIcDataArraysAtCalls( |
| 2968 GrowableArray<intptr_t>* node_ids, | 2972 GrowableArray<intptr_t>* node_ids, |
| 2969 const GrowableObjectArray& ic_data_objs) const; | 2973 const GrowableObjectArray& ic_data_objs) const; |
| (...skipping 2897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5867 | 5871 |
| 5868 | 5872 |
| 5869 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 5873 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 5870 intptr_t index) { | 5874 intptr_t index) { |
| 5871 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 5875 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 5872 } | 5876 } |
| 5873 | 5877 |
| 5874 } // namespace dart | 5878 } // namespace dart |
| 5875 | 5879 |
| 5876 #endif // VM_OBJECT_H_ | 5880 #endif // VM_OBJECT_H_ |
| OLD | NEW |