| 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 } | 424 } |
| 425 bool IsFunction() { | 425 bool IsFunction() { |
| 426 return ((GetClassId() == kFunctionCid)); | 426 return ((GetClassId() == kFunctionCid)); |
| 427 } | 427 } |
| 428 bool IsInstructions() { | 428 bool IsInstructions() { |
| 429 return ((GetClassId() == kInstructionsCid)); | 429 return ((GetClassId() == kInstructionsCid)); |
| 430 } | 430 } |
| 431 bool IsCode() { | 431 bool IsCode() { |
| 432 return ((GetClassId() == kCodeCid)); | 432 return ((GetClassId() == kCodeCid)); |
| 433 } | 433 } |
| 434 bool IsString() { |
| 435 return IsStringClassId(GetClassId()); |
| 436 } |
| 434 | 437 |
| 435 intptr_t Size() const { | 438 intptr_t Size() const { |
| 436 uword tags = ptr()->tags_; | 439 uword tags = ptr()->tags_; |
| 437 intptr_t result = SizeTag::decode(tags); | 440 intptr_t result = SizeTag::decode(tags); |
| 438 if (result != 0) { | 441 if (result != 0) { |
| 439 ASSERT(result == SizeFromClass()); | 442 ASSERT(result == SizeFromClass()); |
| 440 return result; | 443 return result; |
| 441 } | 444 } |
| 442 result = SizeFromClass(); | 445 result = SizeFromClass(); |
| 443 ASSERT(result > SizeTag::kMaxSizeTag); | 446 ASSERT(result > SizeTag::kMaxSizeTag); |
| (...skipping 1886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2330 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2333 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
| 2331 kTypedDataInt8ArrayViewCid + 15); | 2334 kTypedDataInt8ArrayViewCid + 15); |
| 2332 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2335 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
| 2333 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2336 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
| 2334 return (kNullCid - kTypedDataInt8ArrayCid); | 2337 return (kNullCid - kTypedDataInt8ArrayCid); |
| 2335 } | 2338 } |
| 2336 | 2339 |
| 2337 } // namespace dart | 2340 } // namespace dart |
| 2338 | 2341 |
| 2339 #endif // VM_RAW_OBJECT_H_ | 2342 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |