| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/assert.h" | 8 #include "vm/assert.h" |
| 9 #include "vm/dart.h" | 9 #include "vm/dart.h" |
| 10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
| (...skipping 2481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2492 HEAP_OBJECT_IMPLEMENTATION(String, Instance); | 2492 HEAP_OBJECT_IMPLEMENTATION(String, Instance); |
| 2493 }; | 2493 }; |
| 2494 | 2494 |
| 2495 | 2495 |
| 2496 class OneByteString : public String { | 2496 class OneByteString : public String { |
| 2497 public: | 2497 public: |
| 2498 virtual int32_t CharAt(intptr_t index) const { | 2498 virtual int32_t CharAt(intptr_t index) const { |
| 2499 return *CharAddr(index); | 2499 return *CharAddr(index); |
| 2500 } | 2500 } |
| 2501 | 2501 |
| 2502 static intptr_t data_offset() { return OFFSET_OF(RawOneByteString, data_); } |
| 2503 |
| 2502 static intptr_t InstanceSize() { | 2504 static intptr_t InstanceSize() { |
| 2503 ASSERT(sizeof(RawOneByteString) == OFFSET_OF(RawOneByteString, data_)); | 2505 ASSERT(sizeof(RawOneByteString) == OFFSET_OF(RawOneByteString, data_)); |
| 2504 return 0; | 2506 return 0; |
| 2505 } | 2507 } |
| 2506 | 2508 |
| 2507 static intptr_t InstanceSize(intptr_t len) { | 2509 static intptr_t InstanceSize(intptr_t len) { |
| 2508 return RoundedAllocationSize(sizeof(RawOneByteString) + len); | 2510 return RoundedAllocationSize(sizeof(RawOneByteString) + len); |
| 2509 } | 2511 } |
| 2510 | 2512 |
| 2511 static RawOneByteString* New(intptr_t len, | 2513 static RawOneByteString* New(intptr_t len, |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2987 } | 2989 } |
| 2988 | 2990 |
| 2989 | 2991 |
| 2990 void Context::SetAt(intptr_t index, const Instance& value) const { | 2992 void Context::SetAt(intptr_t index, const Instance& value) const { |
| 2991 StorePointer(InstanceAddr(index), value.raw()); | 2993 StorePointer(InstanceAddr(index), value.raw()); |
| 2992 } | 2994 } |
| 2993 | 2995 |
| 2994 } // namespace dart | 2996 } // namespace dart |
| 2995 | 2997 |
| 2996 #endif // VM_OBJECT_H_ | 2998 #endif // VM_OBJECT_H_ |
| OLD | NEW |