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

Unified Diff: src/ic/stub-cache.h

Issue 2031753003: [stubs] Introducing LoadICTFStub and LoadICTrampolineTFStub and a switch to enable them instead of … (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressing comments Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: src/ic/stub-cache.h
diff --git a/src/ic/stub-cache.h b/src/ic/stub-cache.h
index 4b27e6e396db6cfa619bd64e3a7fa2593376d455..03afcdcda5706726cdba2201a209383a47f0c989 100644
--- a/src/ic/stub-cache.h
+++ b/src/ic/stub-cache.h
@@ -92,9 +92,24 @@ class StubCache {
// automatically discards the hash bit field.
static const int kCacheIndexShift = Name::kHashShift;
- private:
+ static const int kPrimaryTableBits = 11;
+ static const int kPrimaryTableSize = (1 << kPrimaryTableBits);
+ static const int kSecondaryTableBits = 9;
+ static const int kSecondaryTableSize = (1 << kSecondaryTableBits);
+
+ static int PrimaryOffsetForTesting(Name* name, Code::Flags flags, Map* map) {
+ return PrimaryOffset(name, flags, map);
+ }
+
+ static int SecondaryOffsetForTesting(Name* name, Code::Flags flags,
+ int seed) {
+ return SecondaryOffset(name, flags, seed);
+ }
+
+ // The constructor is made public only for the purposes of testing.
explicit StubCache(Isolate* isolate);
+ private:
// The stub cache has a primary and secondary level. The two levels have
// different hashing algorithms in order to avoid simultaneous collisions
// in both caches. Unlike a probing strategy (quadratic or otherwise) the
@@ -150,11 +165,6 @@ class StubCache {
offset * multiplier);
}
- static const int kPrimaryTableBits = 11;
- static const int kPrimaryTableSize = (1 << kPrimaryTableBits);
- static const int kSecondaryTableBits = 9;
- static const int kSecondaryTableSize = (1 << kSecondaryTableBits);
-
private:
Entry primary_[kPrimaryTableSize];
Entry secondary_[kSecondaryTableSize];
« no previous file with comments | « src/ic/ic.cc ('k') | src/ic/stub-cache.cc » ('j') | test/cctest/test-code-stub-assembler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698