| 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 5922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5933 this->SetHash(result); | 5933 this->SetHash(result); |
| 5934 return result; | 5934 return result; |
| 5935 } | 5935 } |
| 5936 bool HasHash() const { | 5936 bool HasHash() const { |
| 5937 ASSERT(Smi::New(0) == NULL); | 5937 ASSERT(Smi::New(0) == NULL); |
| 5938 return (raw_ptr()->hash_ != NULL); | 5938 return (raw_ptr()->hash_ != NULL); |
| 5939 } | 5939 } |
| 5940 | 5940 |
| 5941 static intptr_t hash_offset() { return OFFSET_OF(RawString, hash_); } | 5941 static intptr_t hash_offset() { return OFFSET_OF(RawString, hash_); } |
| 5942 static intptr_t Hash(const String& str, intptr_t begin_index, intptr_t len); | 5942 static intptr_t Hash(const String& str, intptr_t begin_index, intptr_t len); |
| 5943 static intptr_t HashLatin1(const uint8_t* characters, intptr_t len); | 5943 static intptr_t Hash(const char* characters, intptr_t len); |
| 5944 static intptr_t Hash(const uint16_t* characters, intptr_t len); | 5944 static intptr_t Hash(const uint16_t* characters, intptr_t len); |
| 5945 static intptr_t Hash(const int32_t* characters, intptr_t len); | 5945 static intptr_t Hash(const int32_t* characters, intptr_t len); |
| 5946 static intptr_t HashRawSymbol(const RawString* symbol) { | 5946 static intptr_t HashRawSymbol(const RawString* symbol) { |
| 5947 ASSERT(symbol->IsCanonical()); | 5947 ASSERT(symbol->IsCanonical()); |
| 5948 intptr_t result = Smi::Value(symbol->ptr()->hash_); | 5948 intptr_t result = Smi::Value(symbol->ptr()->hash_); |
| 5949 ASSERT(result != 0); | 5949 ASSERT(result != 0); |
| 5950 return result; | 5950 return result; |
| 5951 } | 5951 } |
| 5952 | 5952 |
| 5953 // Returns the hash of str1 + str2. | 5953 // Returns the hash of str1 + str2. |
| (...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8045 | 8045 |
| 8046 | 8046 |
| 8047 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 8047 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 8048 intptr_t index) { | 8048 intptr_t index) { |
| 8049 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 8049 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 8050 } | 8050 } |
| 8051 | 8051 |
| 8052 } // namespace dart | 8052 } // namespace dart |
| 8053 | 8053 |
| 8054 #endif // VM_OBJECT_H_ | 8054 #endif // VM_OBJECT_H_ |
| OLD | NEW |