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

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: doing proper rebase 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/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 5c724bf3ee8d48f6fde9fcc0f194df4d564e469c..8d049d0f935ee0aa7906a69c37a37102030fbb78 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();
@@ -6259,8 +6261,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());
@@ -6275,7 +6278,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());

Powered by Google App Engine
This is Rietveld 408576698