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

Side by Side Diff: src/ic/stub-cache.cc

Issue 528993002: First step to cleanup the power-of-2 mess. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: clang-format Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/ic/ic.cc ('k') | src/objects.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/base/bits.h"
7 #include "src/ic/stub-cache.h" 8 #include "src/ic/stub-cache.h"
8 #include "src/type-info.h" 9 #include "src/type-info.h"
9 10
10 namespace v8 { 11 namespace v8 {
11 namespace internal { 12 namespace internal {
12 13
13 14
14 StubCache::StubCache(Isolate* isolate) : isolate_(isolate) {} 15 StubCache::StubCache(Isolate* isolate) : isolate_(isolate) {}
15 16
16 17
17 void StubCache::Initialize() { 18 void StubCache::Initialize() {
18 DCHECK(IsPowerOf2(kPrimaryTableSize)); 19 DCHECK(base::bits::IsPowerOfTwo32(kPrimaryTableSize));
19 DCHECK(IsPowerOf2(kSecondaryTableSize)); 20 DCHECK(base::bits::IsPowerOfTwo32(kSecondaryTableSize));
20 Clear(); 21 Clear();
21 } 22 }
22 23
23 24
24 static Code::Flags CommonStubCacheChecks(Name* name, Map* map, 25 static Code::Flags CommonStubCacheChecks(Name* name, Map* map,
25 Code::Flags flags) { 26 Code::Flags flags) {
26 flags = Code::RemoveTypeAndHolderFromFlags(flags); 27 flags = Code::RemoveTypeAndHolderFromFlags(flags);
27 28
28 // Validate that the name does not move on scavenge, and that we 29 // Validate that the name does not move on scavenge, and that we
29 // can use identity checks instead of structural equality checks. 30 // can use identity checks instead of structural equality checks.
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 int offset = SecondaryOffset(*name, flags, primary_offset); 138 int offset = SecondaryOffset(*name, flags, primary_offset);
138 if (entry(secondary_, offset) == &secondary_[i] && 139 if (entry(secondary_, offset) == &secondary_[i] &&
139 !TypeFeedbackOracle::CanRetainOtherContext(map, *native_context)) { 140 !TypeFeedbackOracle::CanRetainOtherContext(map, *native_context)) {
140 types->AddMapIfMissing(Handle<Map>(map), zone); 141 types->AddMapIfMissing(Handle<Map>(map), zone);
141 } 142 }
142 } 143 }
143 } 144 }
144 } 145 }
145 } 146 }
146 } // namespace v8::internal 147 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic/ic.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698