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

Unified Diff: src/heap/heap.cc

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase master 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
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | src/heap/heap-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index ba21937edb2ee2a5cb178adfee70a67bfae6e8cc..dd97e4077462b064f802ec280d7662be8733d41b 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -1111,9 +1111,11 @@ class StringTableVerifier : public ObjectVisitor {
// Visit all HeapObject pointers in [start, end).
for (Object** p = start; p < end; p++) {
if ((*p)->IsHeapObject()) {
+ HeapObject* object = HeapObject::cast(*p);
+ Isolate* isolate = object->GetIsolate();
// Check that the string is actually internalized.
- CHECK((*p)->IsTheHole() || (*p)->IsUndefined() ||
- (*p)->IsInternalizedString());
+ CHECK(object->IsTheHole(isolate) || object->IsUndefined(isolate) ||
+ object->IsInternalizedString());
}
}
}
@@ -1212,12 +1214,12 @@ void Heap::ClearNormalizedMapCaches() {
}
Object* context = native_contexts_list();
- while (!context->IsUndefined()) {
+ while (!context->IsUndefined(isolate())) {
// GC can happen when the context is not fully initialized,
// so the cache can be undefined.
Object* cache =
Context::cast(context)->get(Context::NORMALIZED_MAP_CACHE_INDEX);
- if (!cache->IsUndefined()) {
+ if (!cache->IsUndefined(isolate())) {
NormalizedMapCache::cast(cache)->Clear();
}
context = Context::cast(context)->next_context_link();
@@ -6261,8 +6263,9 @@ void DescriptorLookupCache::Clear() {
void Heap::ExternalStringTable::CleanUp() {
int last = 0;
+ Isolate* isolate = heap_->isolate();
for (int i = 0; i < new_space_strings_.length(); ++i) {
- if (new_space_strings_[i] == heap_->the_hole_value()) {
+ if (new_space_strings_[i]->IsTheHole(isolate)) {
continue;
}
DCHECK(new_space_strings_[i]->IsExternalString());
@@ -6277,7 +6280,7 @@ void Heap::ExternalStringTable::CleanUp() {
last = 0;
for (int i = 0; i < old_space_strings_.length(); ++i) {
- if (old_space_strings_[i] == heap_->the_hole_value()) {
+ if (old_space_strings_[i]->IsTheHole(isolate)) {
continue;
}
DCHECK(old_space_strings_[i]->IsExternalString());
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | src/heap/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698