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

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

Issue 2710513003: [ic] Cleanup stub cache. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | src/ic/stub-cache.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 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 #ifndef V8_STUB_CACHE_H_ 5 #ifndef V8_STUB_CACHE_H_
6 #define V8_STUB_CACHE_H_ 6 #define V8_STUB_CACHE_H_
7 7
8 #include "src/macro-assembler.h" 8 #include "src/macro-assembler.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 68
69 StubCache::Entry* first_entry(StubCache::Table table) { 69 StubCache::Entry* first_entry(StubCache::Table table) {
70 switch (table) { 70 switch (table) {
71 case StubCache::kPrimary: 71 case StubCache::kPrimary:
72 return StubCache::primary_; 72 return StubCache::primary_;
73 case StubCache::kSecondary: 73 case StubCache::kSecondary:
74 return StubCache::secondary_; 74 return StubCache::secondary_;
75 } 75 }
76 UNREACHABLE(); 76 UNREACHABLE();
77 return NULL; 77 return nullptr;
78 } 78 }
79 79
80 Isolate* isolate() { return isolate_; } 80 Isolate* isolate() { return isolate_; }
81 Code::Kind ic_kind() const { return ic_kind_; } 81 Code::Kind ic_kind() const { return ic_kind_; }
82 82
83 // Setting the entry size such that the index is shifted by Name::kHashShift 83 // Setting the entry size such that the index is shifted by Name::kHashShift
84 // is convenient; shifting down the length field (to extract the hash code) 84 // is convenient; shifting down the length field (to extract the hash code)
85 // automatically discards the hash bit field. 85 // automatically discards the hash bit field.
86 static const int kCacheIndexShift = Name::kHashShift; 86 static const int kCacheIndexShift = Name::kHashShift;
87 87
88 static const int kPrimaryTableBits = 11; 88 static const int kPrimaryTableBits = 11;
89 static const int kPrimaryTableSize = (1 << kPrimaryTableBits); 89 static const int kPrimaryTableSize = (1 << kPrimaryTableBits);
90 static const int kSecondaryTableBits = 9; 90 static const int kSecondaryTableBits = 9;
91 static const int kSecondaryTableSize = (1 << kSecondaryTableBits); 91 static const int kSecondaryTableSize = (1 << kSecondaryTableBits);
92 92
93 // Some magic number used in primary and secondary hash computations. 93 // Some magic number used in primary and secondary hash computations.
94 static const int kPrimaryMagic = 0x3d532433; 94 static const int kPrimaryMagic = 0x3d532433;
95 static const int kSecondaryMagic = 0xb16b00b5; 95 static const int kSecondaryMagic = 0xb16ca6e5;
96 96
97 static int PrimaryOffsetForTesting(Name* name, Map* map) { 97 static int PrimaryOffsetForTesting(Name* name, Map* map) {
98 return PrimaryOffset(name, map); 98 return PrimaryOffset(name, map);
99 } 99 }
100 100
101 static int SecondaryOffsetForTesting(Name* name, int seed) { 101 static int SecondaryOffsetForTesting(Name* name, int seed) {
102 return SecondaryOffset(name, seed); 102 return SecondaryOffset(name, seed);
103 } 103 }
104 104
105 // The constructor is made public only for the purposes of testing. 105 // The constructor is made public only for the purposes of testing.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 friend class Isolate; 162 friend class Isolate;
163 friend class SCTableReference; 163 friend class SCTableReference;
164 164
165 DISALLOW_COPY_AND_ASSIGN(StubCache); 165 DISALLOW_COPY_AND_ASSIGN(StubCache);
166 }; 166 };
167 } // namespace internal 167 } // namespace internal
168 } // namespace v8 168 } // namespace v8
169 169
170 #endif // V8_STUB_CACHE_H_ 170 #endif // V8_STUB_CACHE_H_
OLDNEW
« no previous file with comments | « no previous file | src/ic/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698