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 6561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6572 friend class Symbols; | 6572 friend class Symbols; |
6573 friend class StringSlice; // SetHash | 6573 friend class StringSlice; // SetHash |
6574 template<typename CharType> friend class CharArray; // SetHash | 6574 template<typename CharType> friend class CharArray; // SetHash |
6575 friend class ConcatString; // SetHash | 6575 friend class ConcatString; // SetHash |
6576 friend class OneByteString; | 6576 friend class OneByteString; |
6577 friend class TwoByteString; | 6577 friend class TwoByteString; |
6578 friend class ExternalOneByteString; | 6578 friend class ExternalOneByteString; |
6579 friend class ExternalTwoByteString; | 6579 friend class ExternalTwoByteString; |
6580 // So that SkippedCodeFunctions can print a debug string from a NoHandleScope. | 6580 // So that SkippedCodeFunctions can print a debug string from a NoHandleScope. |
6581 friend class SkippedCodeFunctions; | 6581 friend class SkippedCodeFunctions; |
| 6582 friend class RawOneByteString; |
6582 }; | 6583 }; |
6583 | 6584 |
6584 | 6585 |
6585 class OneByteString : public AllStatic { | 6586 class OneByteString : public AllStatic { |
6586 public: | 6587 public: |
6587 static uint16_t CharAt(const String& str, intptr_t index) { | 6588 static uint16_t CharAt(const String& str, intptr_t index) { |
6588 ASSERT((index >= 0) && (index < str.Length())); | 6589 ASSERT((index >= 0) && (index < str.Length())); |
6589 ASSERT(str.IsOneByteString()); | 6590 ASSERT(str.IsOneByteString()); |
6590 return raw_ptr(str)->data()[index]; | 6591 return raw_ptr(str)->data()[index]; |
6591 } | 6592 } |
(...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8427 | 8428 |
8428 | 8429 |
8429 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 8430 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
8430 intptr_t index) { | 8431 intptr_t index) { |
8431 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 8432 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
8432 } | 8433 } |
8433 | 8434 |
8434 } // namespace dart | 8435 } // namespace dart |
8435 | 8436 |
8436 #endif // VM_OBJECT_H_ | 8437 #endif // VM_OBJECT_H_ |
OLD | NEW |