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

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

Issue 10832292: Reduce space used for stackmaps. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Restore inadvertently deleted code. Created 8 years, 4 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
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 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after
2333 2333
2334 RawCode* GetCode() const { return raw_ptr()->code_; } 2334 RawCode* GetCode() const { return raw_ptr()->code_; }
2335 void SetCode(const Code& code) const; 2335 void SetCode(const Code& code) const;
2336 2336
2337 // Return the index of the highest stack slot that has an object. 2337 // Return the index of the highest stack slot that has an object.
2338 intptr_t MaximumBitIndex() const { return raw_ptr()->max_set_bit_index_; } 2338 intptr_t MaximumBitIndex() const { return raw_ptr()->max_set_bit_index_; }
2339 2339
2340 // Return the index of the lowest stack slot that has an object. 2340 // Return the index of the lowest stack slot that has an object.
2341 intptr_t MinimumBitIndex() const { return raw_ptr()->min_set_bit_index_; } 2341 intptr_t MinimumBitIndex() const { return raw_ptr()->min_set_bit_index_; }
2342 2342
2343 static const intptr_t kBytesPerElement = kWordSize; 2343 static const intptr_t kMaxLengthInBytes = kSmiMax;
2344 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement;
2345 2344
2346 static intptr_t InstanceSize() { 2345 static intptr_t InstanceSize() {
2347 ASSERT(sizeof(RawStackmap) == OFFSET_OF(RawStackmap, data_)); 2346 ASSERT(sizeof(RawStackmap) == OFFSET_OF(RawStackmap, data_));
2348 return 0; 2347 return 0;
2349 } 2348 }
2350 static intptr_t InstanceSize(intptr_t len) { 2349 static intptr_t InstanceSize(intptr_t length_in_bytes) {
Kevin Millikin (Google) 2012/08/14 13:02:32 This was already a length in bytes, no need to mul
Vyacheslav Egorov (Google) 2012/08/15 14:17:37 I wonder if we can pass a real length here to alig
Kevin Millikin (Google) 2012/08/15 14:41:31 Yes. Will do with the next change.
2351 ASSERT(0 <= len && len <= kMaxElements); 2350 ASSERT(length_in_bytes >= 0);
2352 return RoundedAllocationSize( 2351 ASSERT(length_in_bytes <= kMaxLengthInBytes);
2353 sizeof(RawStackmap) + (len * kBytesPerElement)); 2352 return RoundedAllocationSize(sizeof(RawStackmap) + length_in_bytes);
2354 } 2353 }
2355 static RawStackmap* New(uword pc, BitmapBuilder* bmap); 2354 static RawStackmap* New(intptr_t pc_offset,
2355 intptr_t length_in_bits,
2356 BitmapBuilder* bmap);
2356 2357
2357 private: 2358 private:
2358 inline intptr_t SizeInBits() const; 2359 inline intptr_t SizeInBits() const;
2359 2360
2360 void SetMinBitIndex(intptr_t value) const { 2361 void SetMinBitIndex(intptr_t value) const {
2361 raw_ptr()->min_set_bit_index_ = value; 2362 raw_ptr()->min_set_bit_index_ = value;
2362 } 2363 }
2363 void SetMaxBitIndex(intptr_t value) const { 2364 void SetMaxBitIndex(intptr_t value) const {
2364 raw_ptr()->max_set_bit_index_ = value; 2365 raw_ptr()->max_set_bit_index_ = value;
2365 } 2366 }
(...skipping 3120 matching lines...) Expand 10 before | Expand all | Expand 10 after
5486 if (this->CharAt(i) != str.CharAt(begin_index + i)) { 5487 if (this->CharAt(i) != str.CharAt(begin_index + i)) {
5487 return false; 5488 return false;
5488 } 5489 }
5489 } 5490 }
5490 return true; 5491 return true;
5491 } 5492 }
5492 5493
5493 } // namespace dart 5494 } // namespace dart
5494 5495
5495 #endif // VM_OBJECT_H_ 5496 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698