summaryrefslogtreecommitdiff
path: root/deps/v8/src/identity-map.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/identity-map.cc')
-rw-r--r--deps/v8/src/identity-map.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/deps/v8/src/identity-map.cc b/deps/v8/src/identity-map.cc
index d5ab8ddb60..c6d74d2bd8 100644
--- a/deps/v8/src/identity-map.cc
+++ b/deps/v8/src/identity-map.cc
@@ -45,7 +45,7 @@ void IdentityMapBase::DisableIteration() {
int IdentityMapBase::ScanKeysFor(Object* address) const {
int start = Hash(address) & mask_;
- Object* not_mapped = heap_->not_mapped_symbol();
+ Object* not_mapped = ReadOnlyRoots(heap_).not_mapped_symbol();
for (int index = start; index < capacity_; index++) {
if (keys_[index] == address) return index; // Found.
if (keys_[index] == not_mapped) return -1; // Not found.
@@ -58,7 +58,7 @@ int IdentityMapBase::ScanKeysFor(Object* address) const {
}
int IdentityMapBase::InsertKey(Object* address) {
- Object* not_mapped = heap_->not_mapped_symbol();
+ Object* not_mapped = ReadOnlyRoots(heap_).not_mapped_symbol();
while (true) {
int start = Hash(address) & mask_;
int limit = capacity_ / 2;
@@ -80,7 +80,7 @@ int IdentityMapBase::InsertKey(Object* address) {
bool IdentityMapBase::DeleteIndex(int index, void** deleted_value) {
if (deleted_value != nullptr) *deleted_value = values_[index];
- Object* not_mapped = heap_->not_mapped_symbol();
+ Object* not_mapped = ReadOnlyRoots(heap_).not_mapped_symbol();
DCHECK_NE(keys_[index], not_mapped);
keys_[index] = not_mapped;
values_[index] = nullptr;
@@ -141,7 +141,7 @@ int IdentityMapBase::LookupOrInsert(Object* key) {
}
int IdentityMapBase::Hash(Object* address) const {
- CHECK_NE(address, heap_->not_mapped_symbol());
+ CHECK_NE(address, ReadOnlyRoots(heap_).not_mapped_symbol());
uintptr_t raw_address = reinterpret_cast<uintptr_t>(address);
return static_cast<int>(hasher_(raw_address));
}
@@ -159,7 +159,7 @@ IdentityMapBase::RawEntry IdentityMapBase::GetEntry(Object* key) {
gc_counter_ = heap_->gc_count();
keys_ = reinterpret_cast<Object**>(NewPointerArray(capacity_));
- Object* not_mapped = heap_->not_mapped_symbol();
+ Object* not_mapped = ReadOnlyRoots(heap_).not_mapped_symbol();
for (int i = 0; i < capacity_; i++) keys_[i] = not_mapped;
values_ = NewPointerArray(capacity_);
memset(values_, 0, sizeof(void*) * capacity_);
@@ -197,7 +197,7 @@ bool IdentityMapBase::DeleteEntry(Object* key, void** deleted_value) {
Object* IdentityMapBase::KeyAtIndex(int index) const {
DCHECK_LE(0, index);
DCHECK_LT(index, capacity_);
- DCHECK_NE(keys_[index], heap_->not_mapped_symbol());
+ DCHECK_NE(keys_[index], ReadOnlyRoots(heap_).not_mapped_symbol());
CHECK(is_iterable()); // Must be iterable to access by index;
return keys_[index];
}
@@ -205,7 +205,7 @@ Object* IdentityMapBase::KeyAtIndex(int index) const {
IdentityMapBase::RawEntry IdentityMapBase::EntryAtIndex(int index) const {
DCHECK_LE(0, index);
DCHECK_LT(index, capacity_);
- DCHECK_NE(keys_[index], heap_->not_mapped_symbol());
+ DCHECK_NE(keys_[index], ReadOnlyRoots(heap_).not_mapped_symbol());
CHECK(is_iterable()); // Must be iterable to access by index;
return &values_[index];
}
@@ -214,7 +214,7 @@ int IdentityMapBase::NextIndex(int index) const {
DCHECK_LE(-1, index);
DCHECK_LE(index, capacity_);
CHECK(is_iterable()); // Must be iterable to access by index;
- Object* not_mapped = heap_->not_mapped_symbol();
+ Object* not_mapped = ReadOnlyRoots(heap_).not_mapped_symbol();
for (++index; index < capacity_; ++index) {
if (keys_[index] != not_mapped) {
return index;
@@ -232,7 +232,7 @@ void IdentityMapBase::Rehash() {
// Search the table looking for keys that wouldn't be found with their
// current hashcode and evacuate them.
int last_empty = -1;
- Object* not_mapped = heap_->not_mapped_symbol();
+ Object* not_mapped = ReadOnlyRoots(heap_).not_mapped_symbol();
for (int i = 0; i < capacity_; i++) {
if (keys_[i] == not_mapped) {
last_empty = i;
@@ -270,7 +270,7 @@ void IdentityMapBase::Resize(int new_capacity) {
size_ = 0;
keys_ = reinterpret_cast<Object**>(NewPointerArray(capacity_));
- Object* not_mapped = heap_->not_mapped_symbol();
+ Object* not_mapped = ReadOnlyRoots(heap_).not_mapped_symbol();
for (int i = 0; i < capacity_; i++) keys_[i] = not_mapped;
values_ = NewPointerArray(capacity_);
memset(values_, 0, sizeof(void*) * capacity_);