| 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 #include "vm/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 18112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18123 static intptr_t HashImpl(const T* characters, intptr_t len) { | 18123 static intptr_t HashImpl(const T* characters, intptr_t len) { |
| 18124 ASSERT(len >= 0); | 18124 ASSERT(len >= 0); |
| 18125 StringHasher hasher; | 18125 StringHasher hasher; |
| 18126 for (intptr_t i = 0; i < len; i++) { | 18126 for (intptr_t i = 0; i < len; i++) { |
| 18127 hasher.Add(characters[i]); | 18127 hasher.Add(characters[i]); |
| 18128 } | 18128 } |
| 18129 return hasher.Finalize(String::kHashBits); | 18129 return hasher.Finalize(String::kHashBits); |
| 18130 } | 18130 } |
| 18131 | 18131 |
| 18132 | 18132 |
| 18133 intptr_t String::Hash(const char* characters, intptr_t len) { |
| 18134 return HashImpl(characters, len); |
| 18135 } |
| 18136 |
| 18137 |
| 18133 intptr_t String::Hash(const uint8_t* characters, intptr_t len) { | 18138 intptr_t String::Hash(const uint8_t* characters, intptr_t len) { |
| 18134 return HashImpl(characters, len); | 18139 return HashImpl(characters, len); |
| 18135 } | 18140 } |
| 18136 | 18141 |
| 18137 | 18142 |
| 18138 intptr_t String::Hash(const uint16_t* characters, intptr_t len) { | 18143 intptr_t String::Hash(const uint16_t* characters, intptr_t len) { |
| 18139 StringHasher hasher; | 18144 StringHasher hasher; |
| 18140 intptr_t i = 0; | 18145 intptr_t i = 0; |
| 18141 while (i < len) { | 18146 while (i < len) { |
| 18142 hasher.Add(Utf16::Next(characters, &i, len)); | 18147 hasher.Add(Utf16::Next(characters, &i, len)); |
| (...skipping 3272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21415 return tag_label.ToCString(); | 21420 return tag_label.ToCString(); |
| 21416 } | 21421 } |
| 21417 | 21422 |
| 21418 | 21423 |
| 21419 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21424 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 21420 Instance::PrintJSONImpl(stream, ref); | 21425 Instance::PrintJSONImpl(stream, ref); |
| 21421 } | 21426 } |
| 21422 | 21427 |
| 21423 | 21428 |
| 21424 } // namespace dart | 21429 } // namespace dart |
| OLD | NEW |