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 <limits> | 8 #include <limits> |
9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
(...skipping 5341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5352 result = String::Hash(*this, 0, this->Length()); | 5352 result = String::Hash(*this, 0, this->Length()); |
5353 this->SetHash(result); | 5353 this->SetHash(result); |
5354 return result; | 5354 return result; |
5355 } | 5355 } |
5356 | 5356 |
5357 static intptr_t hash_offset() { return OFFSET_OF(RawString, hash_); } | 5357 static intptr_t hash_offset() { return OFFSET_OF(RawString, hash_); } |
5358 static intptr_t Hash(const String& str, intptr_t begin_index, intptr_t len); | 5358 static intptr_t Hash(const String& str, intptr_t begin_index, intptr_t len); |
5359 static intptr_t Hash(const uint8_t* characters, intptr_t len); | 5359 static intptr_t Hash(const uint8_t* characters, intptr_t len); |
5360 static intptr_t Hash(const uint16_t* characters, intptr_t len); | 5360 static intptr_t Hash(const uint16_t* characters, intptr_t len); |
5361 static intptr_t Hash(const int32_t* characters, intptr_t len); | 5361 static intptr_t Hash(const int32_t* characters, intptr_t len); |
| 5362 static intptr_t HashRawSymbol(const RawString* symbol) { |
| 5363 ASSERT(symbol->IsCanonical()); |
| 5364 intptr_t result = Smi::Value(symbol->ptr()->hash_); |
| 5365 ASSERT(result != 0); |
| 5366 return result; |
| 5367 } |
5362 | 5368 |
5363 virtual RawObject* HashCode() const { return Integer::New(Hash()); } | 5369 virtual RawObject* HashCode() const { return Integer::New(Hash()); } |
5364 | 5370 |
5365 int32_t CharAt(intptr_t index) const; | 5371 int32_t CharAt(intptr_t index) const; |
5366 | 5372 |
5367 Scanner::CharAtFunc CharAtFunc() const; | 5373 Scanner::CharAtFunc CharAtFunc() const; |
5368 | 5374 |
5369 intptr_t CharSize() const; | 5375 intptr_t CharSize() const; |
5370 | 5376 |
5371 inline bool Equals(const String& str) const; | 5377 inline bool Equals(const String& str) const; |
(...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7184 | 7190 |
7185 | 7191 |
7186 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 7192 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
7187 intptr_t index) { | 7193 intptr_t index) { |
7188 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 7194 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
7189 } | 7195 } |
7190 | 7196 |
7191 } // namespace dart | 7197 } // namespace dart |
7192 | 7198 |
7193 #endif // VM_OBJECT_H_ | 7199 #endif // VM_OBJECT_H_ |
OLD | NEW |