Chromium Code Reviews| 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 2947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2958 kTokenPosEntry = 3, // Token position in source. | 2958 kTokenPosEntry = 3, // Token position in source. |
| 2959 kTryIndexEntry = 4, // Try block index. | 2959 kTryIndexEntry = 4, // Try block index. |
| 2960 // We would potentially be adding other objects here like | 2960 // We would potentially be adding other objects here like |
| 2961 // pointer maps for optimized functions, local variables information etc. | 2961 // pointer maps for optimized functions, local variables information etc. |
| 2962 kNumberOfEntries = 5, | 2962 kNumberOfEntries = 5, |
| 2963 }; | 2963 }; |
| 2964 | 2964 |
| 2965 public: | 2965 public: |
| 2966 enum Kind { | 2966 enum Kind { |
| 2967 kDeopt, // Deoptimization continuation point. | 2967 kDeopt, // Deoptimization continuation point. |
| 2968 kEntryPatch, // Location where to patch entry. | |
| 2969 kPatchCode, // Buffer for patching code entry. | |
| 2970 kLazyDeoptJump, // Lazy deoptimization trampoline. | |
| 2971 kIcCall, // IC call. | 2968 kIcCall, // IC call. |
| 2972 kOptStaticCall, // Call directly to known target, e.g. static call. | 2969 kOptStaticCall, // Call directly to known target, e.g. static call. |
| 2973 kUnoptStaticCall, // Call to a known target via a stub. | 2970 kUnoptStaticCall, // Call to a known target via a stub. |
| 2974 kClosureCall, // Closure call. | 2971 kClosureCall, // Closure call. |
| 2975 kRuntimeCall, // Runtime call. | 2972 kRuntimeCall, // Runtime call. |
| 2976 kReturn, // Return from function. | 2973 kReturn, // Return from function. |
| 2977 kOsrEntry, // OSR entry point in unoptimized code. | 2974 kOsrEntry, // OSR entry point in unoptimized code. |
| 2978 kOther | 2975 kOther |
| 2979 }; | 2976 }; |
| 2980 | 2977 |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3641 bool optimized = false); | 3638 bool optimized = false); |
| 3642 static RawCode* LookupCode(uword pc); | 3639 static RawCode* LookupCode(uword pc); |
| 3643 static RawCode* LookupCodeInVmIsolate(uword pc); | 3640 static RawCode* LookupCodeInVmIsolate(uword pc); |
| 3644 static RawCode* FindCode(uword pc, int64_t timestamp); | 3641 static RawCode* FindCode(uword pc, int64_t timestamp); |
| 3645 | 3642 |
| 3646 int32_t GetPointerOffsetAt(int index) const { | 3643 int32_t GetPointerOffsetAt(int index) const { |
| 3647 return *PointerOffsetAddrAt(index); | 3644 return *PointerOffsetAddrAt(index); |
| 3648 } | 3645 } |
| 3649 intptr_t GetTokenIndexOfPC(uword pc) const; | 3646 intptr_t GetTokenIndexOfPC(uword pc) const; |
| 3650 | 3647 |
| 3651 // Find pc, return 0 if not found. | 3648 enum { |
| 3649 kInvalidPc = -1 | |
| 3650 }; | |
| 3651 | |
| 3652 // Returns 0 if code is not patchable | |
| 3653 uword GetEntryPatchPc() const; | |
| 3652 uword GetPatchCodePc() const; | 3654 uword GetPatchCodePc() const; |
| 3655 | |
| 3653 uword GetLazyDeoptPc() const; | 3656 uword GetLazyDeoptPc() const; |
| 3654 | 3657 |
| 3658 // Find pc, return 0 if not found. | |
| 3655 uword GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const; | 3659 uword GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const; |
| 3656 intptr_t GetDeoptIdForOsr(uword pc) const; | 3660 intptr_t GetDeoptIdForOsr(uword pc) const; |
| 3657 | 3661 |
| 3658 // Returns true if there is an object in the code between 'start_offset' | 3662 // Returns true if there is an object in the code between 'start_offset' |
| 3659 // (inclusive) and 'end_offset' (exclusive). | 3663 // (inclusive) and 'end_offset' (exclusive). |
| 3660 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; | 3664 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; |
| 3661 | 3665 |
| 3662 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. | 3666 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. |
| 3663 // Returns the maximum id found. | 3667 // Returns the maximum id found. |
| 3664 intptr_t ExtractIcDataArraysAtCalls( | 3668 intptr_t ExtractIcDataArraysAtCalls( |
| 3665 GrowableArray<intptr_t>* node_ids, | 3669 GrowableArray<intptr_t>* node_ids, |
| 3666 const GrowableObjectArray& ic_data_objs) const; | 3670 const GrowableObjectArray& ic_data_objs) const; |
| 3667 | 3671 |
| 3668 // Returns an array indexed by deopt id, containing the extracted ICData. | 3672 // Returns an array indexed by deopt id, containing the extracted ICData. |
| 3669 RawArray* ExtractTypeFeedbackArray() const; | 3673 RawArray* ExtractTypeFeedbackArray() const; |
| 3670 | 3674 |
| 3671 RawString* Name() const; | 3675 RawString* Name() const; |
| 3672 RawString* PrettyName() const; | 3676 RawString* PrettyName() const; |
| 3673 | 3677 |
| 3674 int64_t compile_timestamp() const { | 3678 int64_t compile_timestamp() const { |
| 3675 return raw_ptr()->compile_timestamp_; | 3679 return raw_ptr()->compile_timestamp_; |
| 3676 } | 3680 } |
| 3677 | 3681 |
| 3682 intptr_t entry_patch_pc() const { | |
| 3683 return raw_ptr()->entry_patch_pc_; | |
|
srdjan
2014/06/03 15:45:45
Append 'offset' to all names to differentiate it f
| |
| 3684 } | |
| 3685 void set_entry_patch_pc(intptr_t pc) const { | |
| 3686 raw_ptr()->entry_patch_pc_ = pc; | |
| 3687 } | |
| 3688 | |
| 3689 | |
| 3690 intptr_t patch_code_pc() const { | |
| 3691 return raw_ptr()->patch_code_pc_; | |
| 3692 } | |
| 3693 void set_patch_code_pc(intptr_t pc) const { | |
| 3694 raw_ptr()->patch_code_pc_ = pc; | |
| 3695 } | |
| 3696 | |
| 3697 | |
| 3698 intptr_t lazy_deopt_pc() const { | |
| 3699 return raw_ptr()->lazy_deopt_pc_; | |
| 3700 } | |
| 3701 void set_lazy_deopt_pc(intptr_t pc) const { | |
| 3702 raw_ptr()->lazy_deopt_pc_ = pc; | |
| 3703 } | |
| 3704 | |
| 3678 private: | 3705 private: |
| 3679 void set_state_bits(intptr_t bits) const; | 3706 void set_state_bits(intptr_t bits) const; |
| 3680 | 3707 |
| 3681 friend class RawCode; | 3708 friend class RawCode; |
| 3682 enum { | 3709 enum { |
| 3683 kOptimizedBit = 0, | 3710 kOptimizedBit = 0, |
| 3684 kAliveBit = 1, | 3711 kAliveBit = 1, |
| 3685 }; | 3712 }; |
| 3686 | 3713 |
| 3687 class OptimizedBit : public BitField<bool, kOptimizedBit, 1> {}; | 3714 class OptimizedBit : public BitField<bool, kOptimizedBit, 1> {}; |
| (...skipping 3386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7074 | 7101 |
| 7075 | 7102 |
| 7076 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 7103 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 7077 intptr_t index) { | 7104 intptr_t index) { |
| 7078 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 7105 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 7079 } | 7106 } |
| 7080 | 7107 |
| 7081 } // namespace dart | 7108 } // namespace dart |
| 7082 | 7109 |
| 7083 #endif // VM_OBJECT_H_ | 7110 #endif // VM_OBJECT_H_ |
| OLD | NEW |