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

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

Issue 23512004: Revert "Compress memory usage. Imprive speed of finding exception handle..." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | « runtime/vm/exceptions.cc ('k') | 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 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after
2945 2945
2946 class Code : public Object { 2946 class Code : public Object {
2947 public: 2947 public:
2948 RawInstructions* instructions() const { return raw_ptr()->instructions_; } 2948 RawInstructions* instructions() const { return raw_ptr()->instructions_; }
2949 static intptr_t instructions_offset() { 2949 static intptr_t instructions_offset() {
2950 return OFFSET_OF(RawCode, instructions_); 2950 return OFFSET_OF(RawCode, instructions_);
2951 } 2951 }
2952 intptr_t pointer_offsets_length() const { 2952 intptr_t pointer_offsets_length() const {
2953 return raw_ptr()->pointer_offsets_length_; 2953 return raw_ptr()->pointer_offsets_length_;
2954 } 2954 }
2955
2956 bool is_optimized() const { 2955 bool is_optimized() const {
2957 return OptimizedBit::decode(raw_ptr()->state_bits_); 2956 return (raw_ptr()->is_optimized_ == 1);
2958 } 2957 }
2959 void set_is_optimized(bool value) const; 2958 void set_is_optimized(bool value) const {
2959 raw_ptr()->is_optimized_ = value ? 1 : 0;
2960 }
2960 bool is_alive() const { 2961 bool is_alive() const {
2961 return AliveBit::decode(raw_ptr()->state_bits_); 2962 return (raw_ptr()->is_alive_ == 1);
2962 } 2963 }
2963 void set_is_alive(bool value) const; 2964 void set_is_alive(bool value) const {
2965 raw_ptr()->is_alive_ = value ? 1 : 0;
2966 }
2964 2967
2965 uword EntryPoint() const { 2968 uword EntryPoint() const {
2966 const Instructions& instr = Instructions::Handle(instructions()); 2969 const Instructions& instr = Instructions::Handle(instructions());
2967 return instr.EntryPoint(); 2970 return instr.EntryPoint();
2968 } 2971 }
2969 intptr_t Size() const { 2972 intptr_t Size() const {
2970 const Instructions& instr = Instructions::Handle(instructions()); 2973 const Instructions& instr = Instructions::Handle(instructions());
2971 return instr.size(); 2974 return instr.size();
2972 } 2975 }
2973 RawArray* ObjectPool() const { 2976 RawArray* ObjectPool() const {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
3125 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. 3128 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n].
3126 // Returns the maximum id found. 3129 // Returns the maximum id found.
3127 intptr_t ExtractIcDataArraysAtCalls( 3130 intptr_t ExtractIcDataArraysAtCalls(
3128 GrowableArray<intptr_t>* node_ids, 3131 GrowableArray<intptr_t>* node_ids,
3129 const GrowableObjectArray& ic_data_objs) const; 3132 const GrowableObjectArray& ic_data_objs) const;
3130 3133
3131 // Returns an array indexed by deopt id, containing the extracted ICData. 3134 // Returns an array indexed by deopt id, containing the extracted ICData.
3132 RawArray* ExtractTypeFeedbackArray() const; 3135 RawArray* ExtractTypeFeedbackArray() const;
3133 3136
3134 private: 3137 private:
3135 void set_state_bits(intptr_t bits) const;
3136
3137 friend class RawCode;
3138 enum {
3139 kOptimizedBit = 0,
3140 kAliveBit = 1,
3141 };
3142
3143 class OptimizedBit : public BitField<bool, kOptimizedBit, 1> {};
3144 class AliveBit : public BitField<bool, kAliveBit, 1> {};
3145
3146 // An object finder visitor interface. 3138 // An object finder visitor interface.
3147 class FindRawCodeVisitor : public FindObjectVisitor { 3139 class FindRawCodeVisitor : public FindObjectVisitor {
3148 public: 3140 public:
3149 explicit FindRawCodeVisitor(uword pc) 3141 explicit FindRawCodeVisitor(uword pc)
3150 : FindObjectVisitor(Isolate::Current()), pc_(pc) { } 3142 : FindObjectVisitor(Isolate::Current()), pc_(pc) { }
3151 virtual ~FindRawCodeVisitor() { } 3143 virtual ~FindRawCodeVisitor() { }
3152 3144
3153 // Check if object matches find condition. 3145 // Check if object matches find condition.
3154 virtual bool FindObject(RawObject* obj); 3146 virtual bool FindObject(RawObject* obj);
3155 3147
(...skipping 2995 matching lines...) Expand 10 before | Expand all | Expand 10 after
6151 6143
6152 6144
6153 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6145 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6154 intptr_t index) { 6146 intptr_t index) {
6155 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6147 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6156 } 6148 }
6157 6149
6158 } // namespace dart 6150 } // namespace dart
6159 6151
6160 #endif // VM_OBJECT_H_ 6152 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/exceptions.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698