Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: src/ast/context-slot-cache.cc

Issue 2324783002: Include only stuff you need, part 9: variables.h (Closed)
Patch Set: rebased Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ast/context-slot-cache.h ('k') | src/ast/prettyprinter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/ast/context-slot-cache.h ('k') | src/ast/prettyprinter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698