| 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 2342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2353 } | 2353 } |
| 2354 | 2354 |
| 2355 RawCode* Code() const { return raw_ptr()->code_; } | 2355 RawCode* Code() const { return raw_ptr()->code_; } |
| 2356 void SetCode(const dart::Code& code) const; | 2356 void SetCode(const dart::Code& code) const; |
| 2357 | 2357 |
| 2358 intptr_t Length() const { return raw_ptr()->length_; } | 2358 intptr_t Length() const { return raw_ptr()->length_; } |
| 2359 | 2359 |
| 2360 uword PC() const { return raw_ptr()->pc_; } | 2360 uword PC() const { return raw_ptr()->pc_; } |
| 2361 void SetPC(uword value) const { raw_ptr()->pc_ = value; } | 2361 void SetPC(uword value) const { raw_ptr()->pc_ = value; } |
| 2362 | 2362 |
| 2363 intptr_t RegisterCount() const { return raw_ptr()->register_count_; } |
| 2364 void SetRegisterCount(intptr_t register_count) const { |
| 2365 raw_ptr()->register_count_ = register_count; |
| 2366 } |
| 2367 |
| 2363 static const intptr_t kMaxLengthInBytes = kSmiMax; | 2368 static const intptr_t kMaxLengthInBytes = kSmiMax; |
| 2364 | 2369 |
| 2365 static intptr_t InstanceSize() { | 2370 static intptr_t InstanceSize() { |
| 2366 ASSERT(sizeof(RawStackmap) == OFFSET_OF(RawStackmap, data_)); | 2371 ASSERT(sizeof(RawStackmap) == OFFSET_OF(RawStackmap, data_)); |
| 2367 return 0; | 2372 return 0; |
| 2368 } | 2373 } |
| 2369 static intptr_t InstanceSize(intptr_t length) { | 2374 static intptr_t InstanceSize(intptr_t length) { |
| 2370 ASSERT(length >= 0); | 2375 ASSERT(length >= 0); |
| 2371 // The stackmap payload is in an array of bytes. | 2376 // The stackmap payload is in an array of bytes. |
| 2372 intptr_t payload_size = | 2377 intptr_t payload_size = |
| 2373 Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte; | 2378 Utils::RoundUp(length, kBitsPerByte) / kBitsPerByte; |
| 2374 return RoundedAllocationSize(sizeof(RawStackmap) + payload_size); | 2379 return RoundedAllocationSize(sizeof(RawStackmap) + payload_size); |
| 2375 } | 2380 } |
| 2376 static RawStackmap* New(intptr_t pc_offset, BitmapBuilder* bmap); | 2381 static RawStackmap* New(intptr_t pc_offset, |
| 2382 BitmapBuilder* bmap, |
| 2383 intptr_t register_count); |
| 2377 | 2384 |
| 2378 private: | 2385 private: |
| 2379 void SetLength(intptr_t length) const { raw_ptr()->length_ = length; } | 2386 void SetLength(intptr_t length) const { raw_ptr()->length_ = length; } |
| 2380 | 2387 |
| 2381 bool InRange(intptr_t index) const { return index < Length(); } | 2388 bool InRange(intptr_t index) const { return index < Length(); } |
| 2382 | 2389 |
| 2383 bool GetBit(intptr_t bit_index) const; | 2390 bool GetBit(intptr_t bit_index) const; |
| 2384 void SetBit(intptr_t bit_index, bool value) const; | 2391 void SetBit(intptr_t bit_index, bool value) const; |
| 2385 | 2392 |
| 2386 HEAP_OBJECT_IMPLEMENTATION(Stackmap, Object); | 2393 HEAP_OBJECT_IMPLEMENTATION(Stackmap, Object); |
| (...skipping 3149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5536 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5543 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
| 5537 return false; | 5544 return false; |
| 5538 } | 5545 } |
| 5539 } | 5546 } |
| 5540 return true; | 5547 return true; |
| 5541 } | 5548 } |
| 5542 | 5549 |
| 5543 } // namespace dart | 5550 } // namespace dart |
| 5544 | 5551 |
| 5545 #endif // VM_OBJECT_H_ | 5552 #endif // VM_OBJECT_H_ |
| OLD | NEW |