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_RAW_OBJECT_H_ | 5 #ifndef VM_RAW_OBJECT_H_ |
6 #define VM_RAW_OBJECT_H_ | 6 #define VM_RAW_OBJECT_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/atomic.h" | 9 #include "vm/atomic.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 uword tags = ptr()->tags_; | 382 uword tags = ptr()->tags_; |
383 ptr()->tags_ = RememberedBit::update(false, tags); | 383 ptr()->tags_ = RememberedBit::update(false, tags); |
384 } | 384 } |
385 | 385 |
386 bool IsDartInstance() { | 386 bool IsDartInstance() { |
387 return (!IsHeapObject() || (GetClassId() >= kInstanceCid)); | 387 return (!IsHeapObject() || (GetClassId() >= kInstanceCid)); |
388 } | 388 } |
389 bool IsFreeListElement() { | 389 bool IsFreeListElement() { |
390 return ((GetClassId() == kFreeListElement)); | 390 return ((GetClassId() == kFreeListElement)); |
391 } | 391 } |
| 392 bool IsScript() { |
| 393 return ((GetClassId() == kScriptCid)); |
| 394 } |
392 | 395 |
393 intptr_t Size() const { | 396 intptr_t Size() const { |
394 uword tags = ptr()->tags_; | 397 uword tags = ptr()->tags_; |
395 intptr_t result = SizeTag::decode(tags); | 398 intptr_t result = SizeTag::decode(tags); |
396 if (result != 0) { | 399 if (result != 0) { |
397 ASSERT(result == SizeFromClass()); | 400 ASSERT(result == SizeFromClass()); |
398 return result; | 401 return result; |
399 } | 402 } |
400 result = SizeFromClass(); | 403 result = SizeFromClass(); |
401 ASSERT(result > SizeTag::kMaxSizeTag); | 404 ASSERT(result > SizeTag::kMaxSizeTag); |
(...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2123 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2126 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2124 kTypedDataInt8ArrayViewCid + 15); | 2127 kTypedDataInt8ArrayViewCid + 15); |
2125 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2128 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2126 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2129 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2127 return (kNullCid - kTypedDataInt8ArrayCid); | 2130 return (kNullCid - kTypedDataInt8ArrayCid); |
2128 } | 2131 } |
2129 | 2132 |
2130 } // namespace dart | 2133 } // namespace dart |
2131 | 2134 |
2132 #endif // VM_RAW_OBJECT_H_ | 2135 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |