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