Commit 58a374bc authored by ishell's avatar ishell Committed by Commit bot

[ic] Cleanup stub cache.

BUG=

Review-Url: https://codereview.chromium.org/2710513003
Cr-Commit-Position: refs/heads/master@{#43329}
parent 7a457c71
......@@ -100,12 +100,12 @@ void StubCache::Clear() {
Code* empty = isolate_->builtins()->builtin(Builtins::kIllegal);
for (int i = 0; i < kPrimaryTableSize; i++) {
primary_[i].key = isolate()->heap()->empty_string();
primary_[i].map = NULL;
primary_[i].map = nullptr;
primary_[i].value = empty;
}
for (int j = 0; j < kSecondaryTableSize; j++) {
secondary_[j].key = isolate()->heap()->empty_string();
secondary_[j].map = NULL;
secondary_[j].map = nullptr;
secondary_[j].value = empty;
}
}
......@@ -117,9 +117,9 @@ void StubCache::CollectMatchingMaps(SmallMapList* types, Handle<Name> name,
for (int i = 0; i < kPrimaryTableSize; i++) {
if (primary_[i].key == *name) {
Map* map = primary_[i].map;
// Map can be NULL, if the stub is constant function call
// Map can be nullptr, if the stub is constant function call
// with a primitive receiver.
if (map == NULL) continue;
if (map == nullptr) continue;
int offset = PrimaryOffset(*name, map);
if (entry(primary_, offset) == &primary_[i] &&
......@@ -132,9 +132,9 @@ void StubCache::CollectMatchingMaps(SmallMapList* types, Handle<Name> name,
for (int i = 0; i < kSecondaryTableSize; i++) {
if (secondary_[i].key == *name) {
Map* map = secondary_[i].map;
// Map can be NULL, if the stub is constant function call
// Map can be nullptr, if the stub is constant function call
// with a primitive receiver.
if (map == NULL) continue;
if (map == nullptr) continue;
// Lookup in primary table and skip duplicates.
int primary_offset = PrimaryOffset(*name, map);
......
......@@ -74,7 +74,7 @@ class StubCache {
return StubCache::secondary_;
}
UNREACHABLE();
return NULL;
return nullptr;
}
Isolate* isolate() { return isolate_; }
......@@ -92,7 +92,7 @@ class StubCache {
// Some magic number used in primary and secondary hash computations.
static const int kPrimaryMagic = 0x3d532433;
static const int kSecondaryMagic = 0xb16b00b5;
static const int kSecondaryMagic = 0xb16ca6e5;
static int PrimaryOffsetForTesting(Name* name, Map* map) {
return PrimaryOffset(name, map);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment