OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/profiler/strings-storage.h" | 5 #include "src/profiler/strings-storage.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/base/smart-pointers.h" | |
10 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
11 | 10 |
12 namespace v8 { | 11 namespace v8 { |
13 namespace internal { | 12 namespace internal { |
14 | 13 |
15 | 14 |
16 bool StringsStorage::StringsMatch(void* key1, void* key2) { | 15 bool StringsStorage::StringsMatch(void* key1, void* key2) { |
17 return strcmp(reinterpret_cast<char*>(key1), reinterpret_cast<char*>(key2)) == | 16 return strcmp(reinterpret_cast<char*>(key1), reinterpret_cast<char*>(key2)) == |
18 0; | 17 0; |
19 } | 18 } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 116 } |
118 return size; | 117 return size; |
119 } | 118 } |
120 | 119 |
121 base::HashMap::Entry* StringsStorage::GetEntry(const char* str, int len) { | 120 base::HashMap::Entry* StringsStorage::GetEntry(const char* str, int len) { |
122 uint32_t hash = StringHasher::HashSequentialString(str, len, hash_seed_); | 121 uint32_t hash = StringHasher::HashSequentialString(str, len, hash_seed_); |
123 return names_.LookupOrInsert(const_cast<char*>(str), hash); | 122 return names_.LookupOrInsert(const_cast<char*>(str), hash); |
124 } | 123 } |
125 } // namespace internal | 124 } // namespace internal |
126 } // namespace v8 | 125 } // namespace v8 |
OLD | NEW |