Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(641)

Side by Side Diff: dart/runtime/vm/object.h

Issue 328663002: Version 1.5.0-dev.4.5 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/runtime/vm/flow_graph_inliner.cc ('k') | dart/runtime/vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after
2963 kTokenPosEntry = 3, // Token position in source. 2963 kTokenPosEntry = 3, // Token position in source.
2964 kTryIndexEntry = 4, // Try block index. 2964 kTryIndexEntry = 4, // Try block index.
2965 // We would potentially be adding other objects here like 2965 // We would potentially be adding other objects here like
2966 // pointer maps for optimized functions, local variables information etc. 2966 // pointer maps for optimized functions, local variables information etc.
2967 kNumberOfEntries = 5, 2967 kNumberOfEntries = 5,
2968 }; 2968 };
2969 2969
2970 public: 2970 public:
2971 enum Kind { 2971 enum Kind {
2972 kDeopt, // Deoptimization continuation point. 2972 kDeopt, // Deoptimization continuation point.
2973 kEntryPatch, // Location where to patch entry.
2974 kPatchCode, // Buffer for patching code entry.
2975 kLazyDeoptJump, // Lazy deoptimization trampoline.
2976 kIcCall, // IC call. 2973 kIcCall, // IC call.
2977 kOptStaticCall, // Call directly to known target, e.g. static call. 2974 kOptStaticCall, // Call directly to known target, e.g. static call.
2978 kUnoptStaticCall, // Call to a known target via a stub. 2975 kUnoptStaticCall, // Call to a known target via a stub.
2979 kClosureCall, // Closure call. 2976 kClosureCall, // Closure call.
2980 kRuntimeCall, // Runtime call. 2977 kRuntimeCall, // Runtime call.
2981 kReturn, // Return from function. 2978 kReturn, // Return from function.
2982 kOsrEntry, // OSR entry point in unoptimized code. 2979 kOsrEntry, // OSR entry point in unoptimized code.
2983 kOther 2980 kOther
2984 }; 2981 };
2985 2982
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
3624 } 3621 }
3625 3622
3626 // We would have a VisitPointers function here to traverse all the 3623 // We would have a VisitPointers function here to traverse all the
3627 // embedded objects in the instructions using pointer_offsets. 3624 // embedded objects in the instructions using pointer_offsets.
3628 3625
3629 static const intptr_t kBytesPerElement = 3626 static const intptr_t kBytesPerElement =
3630 sizeof(reinterpret_cast<RawCode*>(0)->data_[0]); 3627 sizeof(reinterpret_cast<RawCode*>(0)->data_[0]);
3631 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; 3628 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement;
3632 3629
3633 static intptr_t InstanceSize() { 3630 static intptr_t InstanceSize() {
3634 ASSERT(sizeof(RawCode) == OFFSET_OF(RawCode, data_));
3635 return 0; 3631 return 0;
3636 } 3632 }
3637 static intptr_t InstanceSize(intptr_t len) { 3633 static intptr_t InstanceSize(intptr_t len) {
3638 ASSERT(0 <= len && len <= kMaxElements); 3634 ASSERT(0 <= len && len <= kMaxElements);
3639 return RoundedAllocationSize(sizeof(RawCode) + (len * kBytesPerElement)); 3635 return RoundedAllocationSize(sizeof(RawCode) + (len * kBytesPerElement));
3640 } 3636 }
3641 static RawCode* FinalizeCode(const Function& function, 3637 static RawCode* FinalizeCode(const Function& function,
3642 Assembler* assembler, 3638 Assembler* assembler,
3643 bool optimized = false); 3639 bool optimized = false);
3644 static RawCode* FinalizeCode(const char* name, 3640 static RawCode* FinalizeCode(const char* name,
3645 Assembler* assembler, 3641 Assembler* assembler,
3646 bool optimized = false); 3642 bool optimized = false);
3647 static RawCode* LookupCode(uword pc); 3643 static RawCode* LookupCode(uword pc);
3648 static RawCode* LookupCodeInVmIsolate(uword pc); 3644 static RawCode* LookupCodeInVmIsolate(uword pc);
3649 static RawCode* FindCode(uword pc, int64_t timestamp); 3645 static RawCode* FindCode(uword pc, int64_t timestamp);
3650 3646
3651 int32_t GetPointerOffsetAt(int index) const { 3647 int32_t GetPointerOffsetAt(int index) const {
3652 return *PointerOffsetAddrAt(index); 3648 return *PointerOffsetAddrAt(index);
3653 } 3649 }
3654 intptr_t GetTokenIndexOfPC(uword pc) const; 3650 intptr_t GetTokenIndexOfPC(uword pc) const;
3655 3651
3656 // Find pc, return 0 if not found. 3652 enum {
3653 kInvalidPc = -1
3654 };
3655
3656 // Returns 0 if code is not patchable
3657 uword GetEntryPatchPc() const;
3657 uword GetPatchCodePc() const; 3658 uword GetPatchCodePc() const;
3659
3658 uword GetLazyDeoptPc() const; 3660 uword GetLazyDeoptPc() const;
3659 3661
3662 // Find pc, return 0 if not found.
3660 uword GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const; 3663 uword GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const;
3661 intptr_t GetDeoptIdForOsr(uword pc) const; 3664 intptr_t GetDeoptIdForOsr(uword pc) const;
3662 3665
3663 // Returns true if there is an object in the code between 'start_offset' 3666 // Returns true if there is an object in the code between 'start_offset'
3664 // (inclusive) and 'end_offset' (exclusive). 3667 // (inclusive) and 'end_offset' (exclusive).
3665 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; 3668 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const;
3666 3669
3667 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. 3670 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n].
3668 // Returns the maximum id found. 3671 // Returns the maximum id found.
3669 intptr_t ExtractIcDataArraysAtCalls( 3672 intptr_t ExtractIcDataArraysAtCalls(
3670 GrowableArray<intptr_t>* node_ids, 3673 GrowableArray<intptr_t>* node_ids,
3671 const GrowableObjectArray& ic_data_objs) const; 3674 const GrowableObjectArray& ic_data_objs) const;
3672 3675
3673 // Returns an array indexed by deopt id, containing the extracted ICData. 3676 // Returns an array indexed by deopt id, containing the extracted ICData.
3674 RawArray* ExtractTypeFeedbackArray() const; 3677 RawArray* ExtractTypeFeedbackArray() const;
3675 3678
3676 RawString* Name() const; 3679 RawString* Name() const;
3677 RawString* PrettyName() const; 3680 RawString* PrettyName() const;
3678 3681
3679 int64_t compile_timestamp() const { 3682 int64_t compile_timestamp() const {
3680 return raw_ptr()->compile_timestamp_; 3683 return raw_ptr()->compile_timestamp_;
3681 } 3684 }
3682 3685
3686 intptr_t entry_patch_pc_offset() const {
3687 return raw_ptr()->entry_patch_pc_offset_;
3688 }
3689 void set_entry_patch_pc_offset(intptr_t pc) const {
3690 raw_ptr()->entry_patch_pc_offset_ = pc;
3691 }
3692
3693
3694 intptr_t patch_code_pc_offset() const {
3695 return raw_ptr()->patch_code_pc_offset_;
3696 }
3697 void set_patch_code_pc_offset(intptr_t pc) const {
3698 raw_ptr()->patch_code_pc_offset_ = pc;
3699 }
3700
3701
3702 intptr_t lazy_deopt_pc_offset() const {
3703 return raw_ptr()->lazy_deopt_pc_offset_;
3704 }
3705 void set_lazy_deopt_pc_offset(intptr_t pc) const {
3706 raw_ptr()->lazy_deopt_pc_offset_ = pc;
3707 }
3708
3683 private: 3709 private:
3684 void set_state_bits(intptr_t bits) const; 3710 void set_state_bits(intptr_t bits) const;
3685 3711
3686 friend class RawCode; 3712 friend class RawCode;
3687 enum { 3713 enum {
3688 kOptimizedBit = 0, 3714 kOptimizedBit = 0,
3689 kAliveBit = 1, 3715 kAliveBit = 1,
3690 }; 3716 };
3691 3717
3692 class OptimizedBit : public BitField<bool, kOptimizedBit, 1> {}; 3718 class OptimizedBit : public BitField<bool, kOptimizedBit, 1> {};
(...skipping 3386 matching lines...) Expand 10 before | Expand all | Expand 10 after
7079 7105
7080 7106
7081 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7107 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7082 intptr_t index) { 7108 intptr_t index) {
7083 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7109 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7084 } 7110 }
7085 7111
7086 } // namespace dart 7112 } // namespace dart
7087 7113
7088 #endif // VM_OBJECT_H_ 7114 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « dart/runtime/vm/flow_graph_inliner.cc ('k') | dart/runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698