| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/ast/context-slot-cache.h" | 5 #include "src/ast/context-slot-cache.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| 11 // FIXME(mstarzinger, marja): This is weird, but required because of the missing |
| 12 // (disallowed) include: src/factory.h -> src/objects-inl.h |
| 13 #include "src/objects-inl.h" |
| 14 // FIXME(mstarzinger, marja): This is weird, but required because of the missing |
| 15 // (disallowed) include: src/type-feedback-vector.h -> |
| 16 // src/type-feedback-vector-inl.h |
| 17 #include "src/type-feedback-vector-inl.h" |
| 11 | 18 |
| 12 namespace v8 { | 19 namespace v8 { |
| 13 namespace internal { | 20 namespace internal { |
| 14 | 21 |
| 15 int ContextSlotCache::Hash(Object* data, String* name) { | 22 int ContextSlotCache::Hash(Object* data, String* name) { |
| 16 // Uses only lower 32 bits if pointers are larger. | 23 // Uses only lower 32 bits if pointers are larger. |
| 17 uintptr_t addr_hash = | 24 uintptr_t addr_hash = |
| 18 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(data)) >> 2; | 25 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(data)) >> 2; |
| 19 return static_cast<int>((addr_hash ^ name->Hash()) % kLength); | 26 return static_cast<int>((addr_hash ^ name->Hash()) % kLength); |
| 20 } | 27 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 DCHECK(result.initialization_flag() == init_flag); | 89 DCHECK(result.initialization_flag() == init_flag); |
| 83 DCHECK(result.maybe_assigned_flag() == maybe_assigned_flag); | 90 DCHECK(result.maybe_assigned_flag() == maybe_assigned_flag); |
| 84 DCHECK(result.index() + kNotFound == slot_index); | 91 DCHECK(result.index() + kNotFound == slot_index); |
| 85 } | 92 } |
| 86 } | 93 } |
| 87 | 94 |
| 88 #endif // DEBUG | 95 #endif // DEBUG |
| 89 | 96 |
| 90 } // namespace internal | 97 } // namespace internal |
| 91 } // namespace v8 | 98 } // namespace v8 |
| OLD | NEW |