| 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 4403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4414 friend class ExternalTwoByteString; | 4414 friend class ExternalTwoByteString; |
| 4415 }; | 4415 }; |
| 4416 | 4416 |
| 4417 | 4417 |
| 4418 class OneByteString : public AllStatic { | 4418 class OneByteString : public AllStatic { |
| 4419 public: | 4419 public: |
| 4420 static int32_t CharAt(const String& str, intptr_t index) { | 4420 static int32_t CharAt(const String& str, intptr_t index) { |
| 4421 return *CharAddr(str, index); | 4421 return *CharAddr(str, index); |
| 4422 } | 4422 } |
| 4423 | 4423 |
| 4424 static void SetCharAt(const String& str, intptr_t index, uint8_t code_point) { |
| 4425 *CharAddr(str, index) = code_point; |
| 4426 } |
| 4424 static RawOneByteString* EscapeSpecialCharacters(const String& str); | 4427 static RawOneByteString* EscapeSpecialCharacters(const String& str); |
| 4425 | 4428 |
| 4426 // We use the same maximum elements for all strings. | 4429 // We use the same maximum elements for all strings. |
| 4427 static const intptr_t kBytesPerElement = 1; | 4430 static const intptr_t kBytesPerElement = 1; |
| 4428 static const intptr_t kMaxElements = String::kMaxElements; | 4431 static const intptr_t kMaxElements = String::kMaxElements; |
| 4429 | 4432 |
| 4430 static intptr_t data_offset() { return OFFSET_OF(RawOneByteString, data_); } | 4433 static intptr_t data_offset() { return OFFSET_OF(RawOneByteString, data_); } |
| 4431 | 4434 |
| 4432 static intptr_t InstanceSize() { | 4435 static intptr_t InstanceSize() { |
| 4433 ASSERT(sizeof(RawOneByteString) == OFFSET_OF(RawOneByteString, data_)); | 4436 ASSERT(sizeof(RawOneByteString) == OFFSET_OF(RawOneByteString, data_)); |
| (...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5721 | 5724 |
| 5722 | 5725 |
| 5723 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 5726 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 5724 intptr_t index) { | 5727 intptr_t index) { |
| 5725 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 5728 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 5726 } | 5729 } |
| 5727 | 5730 |
| 5728 } // namespace dart | 5731 } // namespace dart |
| 5729 | 5732 |
| 5730 #endif // VM_OBJECT_H_ | 5733 #endif // VM_OBJECT_H_ |
| OLD | NEW |