| 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 2524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2535 enum Kind { | 2535 enum Kind { |
| 2536 kDeopt, // Deoptimization continuation point. | 2536 kDeopt, // Deoptimization continuation point. |
| 2537 kEntryPatch, // Location where to patch entry. | 2537 kEntryPatch, // Location where to patch entry. |
| 2538 kPatchCode, // Buffer for patching code entry. | 2538 kPatchCode, // Buffer for patching code entry. |
| 2539 kLazyDeoptJump, // Lazy deoptimization trampoline. | 2539 kLazyDeoptJump, // Lazy deoptimization trampoline. |
| 2540 kIcCall, // IC call. | 2540 kIcCall, // IC call. |
| 2541 kFuncCall, // Call to known target, e.g. static call. | 2541 kFuncCall, // Call to known target, e.g. static call. |
| 2542 kClosureCall, // Closure call. | 2542 kClosureCall, // Closure call. |
| 2543 kRuntimeCall, // Runtime call. | 2543 kRuntimeCall, // Runtime call. |
| 2544 kReturn, // Return from function. | 2544 kReturn, // Return from function. |
| 2545 kOsrEntry, // OSR entry point in unoptimized code. | |
| 2546 kOther | 2545 kOther |
| 2547 }; | 2546 }; |
| 2548 | 2547 |
| 2549 intptr_t Length() const; | 2548 intptr_t Length() const; |
| 2550 | 2549 |
| 2551 uword PC(intptr_t index) const; | 2550 uword PC(intptr_t index) const; |
| 2552 PcDescriptors::Kind DescriptorKind(intptr_t index) const; | 2551 PcDescriptors::Kind DescriptorKind(intptr_t index) const; |
| 2553 const char* KindAsStr(intptr_t index) const; | 2552 const char* KindAsStr(intptr_t index) const; |
| 2554 intptr_t DeoptId(intptr_t index) const; | 2553 intptr_t DeoptId(intptr_t index) const; |
| 2555 intptr_t TokenPos(intptr_t index) const; | 2554 intptr_t TokenPos(intptr_t index) const; |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2871 return raw_ptr()->static_calls_target_table_; | 2870 return raw_ptr()->static_calls_target_table_; |
| 2872 } | 2871 } |
| 2873 | 2872 |
| 2874 RawDeoptInfo* GetDeoptInfoAtPc(uword pc, intptr_t* deopt_reason) const; | 2873 RawDeoptInfo* GetDeoptInfoAtPc(uword pc, intptr_t* deopt_reason) const; |
| 2875 | 2874 |
| 2876 // Returns null if there is no static call at 'pc'. | 2875 // Returns null if there is no static call at 'pc'. |
| 2877 RawFunction* GetStaticCallTargetFunctionAt(uword pc) const; | 2876 RawFunction* GetStaticCallTargetFunctionAt(uword pc) const; |
| 2878 // Aborts if there is no static call at 'pc'. | 2877 // Aborts if there is no static call at 'pc'. |
| 2879 void SetStaticCallTargetCodeAt(uword pc, const Code& code) const; | 2878 void SetStaticCallTargetCodeAt(uword pc, const Code& code) const; |
| 2880 | 2879 |
| 2881 void Disassemble() const; | |
| 2882 | |
| 2883 class Comments : public ZoneAllocated { | 2880 class Comments : public ZoneAllocated { |
| 2884 public: | 2881 public: |
| 2885 static Comments& New(intptr_t count); | 2882 static Comments& New(intptr_t count); |
| 2886 | 2883 |
| 2887 intptr_t Length() const; | 2884 intptr_t Length() const; |
| 2888 | 2885 |
| 2889 void SetPCOffsetAt(intptr_t idx, intptr_t pc_offset); | 2886 void SetPCOffsetAt(intptr_t idx, intptr_t pc_offset); |
| 2890 void SetCommentAt(intptr_t idx, const String& comment); | 2887 void SetCommentAt(intptr_t idx, const String& comment); |
| 2891 | 2888 |
| 2892 intptr_t PCOffsetAt(intptr_t idx) const; | 2889 intptr_t PCOffsetAt(intptr_t idx) const; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2960 int32_t GetPointerOffsetAt(int index) const { | 2957 int32_t GetPointerOffsetAt(int index) const { |
| 2961 return *PointerOffsetAddrAt(index); | 2958 return *PointerOffsetAddrAt(index); |
| 2962 } | 2959 } |
| 2963 intptr_t GetTokenIndexOfPC(uword pc) const; | 2960 intptr_t GetTokenIndexOfPC(uword pc) const; |
| 2964 | 2961 |
| 2965 // Find pc, return 0 if not found. | 2962 // Find pc, return 0 if not found. |
| 2966 uword GetPatchCodePc() const; | 2963 uword GetPatchCodePc() const; |
| 2967 uword GetLazyDeoptPc() const; | 2964 uword GetLazyDeoptPc() const; |
| 2968 | 2965 |
| 2969 uword GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const; | 2966 uword GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const; |
| 2970 intptr_t GetDeoptIdForOsr(uword pc) const; | |
| 2971 | 2967 |
| 2972 // Returns true if there is an object in the code between 'start_offset' | 2968 // Returns true if there is an object in the code between 'start_offset' |
| 2973 // (inclusive) and 'end_offset' (exclusive). | 2969 // (inclusive) and 'end_offset' (exclusive). |
| 2974 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; | 2970 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; |
| 2975 | 2971 |
| 2976 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. | 2972 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. |
| 2977 // Returns the maximum id found. | 2973 // Returns the maximum id found. |
| 2978 intptr_t ExtractIcDataArraysAtCalls( | 2974 intptr_t ExtractIcDataArraysAtCalls( |
| 2979 GrowableArray<intptr_t>* node_ids, | 2975 GrowableArray<intptr_t>* node_ids, |
| 2980 const GrowableObjectArray& ic_data_objs) const; | 2976 const GrowableObjectArray& ic_data_objs) const; |
| (...skipping 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5915 | 5911 |
| 5916 | 5912 |
| 5917 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 5913 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 5918 intptr_t index) { | 5914 intptr_t index) { |
| 5919 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 5915 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 5920 } | 5916 } |
| 5921 | 5917 |
| 5922 } // namespace dart | 5918 } // namespace dart |
| 5923 | 5919 |
| 5924 #endif // VM_OBJECT_H_ | 5920 #endif // VM_OBJECT_H_ |
| OLD | NEW |