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

Unified Diff: src/heap/heap.cc

Issue 1844413002: Use EmbedderHeapTracer instead of object grouping when trace_embedder_heap flag is set (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporated Jochen's wonderful comments Created 4 years, 9 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 506a723796a7da2737030661e9137fde9398d7ef..a46e5dd0bd33f45f619339b2952fe6919b331d31 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -1557,15 +1557,12 @@ static bool IsUnmodifiedHeapObject(Object** p) {
if (object->IsSmi()) return false;
HeapObject* heap_object = HeapObject::cast(object);
if (!object->IsJSObject()) return false;
- Object* obj_constructor = (JSObject::cast(object))->map()->GetConstructor();
- if (!obj_constructor->IsJSFunction()) return false;
- JSFunction* constructor = JSFunction::cast(obj_constructor);
- if (!constructor->shared()->IsApiFunction()) return false;
- if (constructor != nullptr &&
- constructor->initial_map() == heap_object->map()) {
- return true;
- }
- return false;
+ JSObject* js_object = JSObject::cast(object);
+ if (!js_object->WasConstructedFromApiFunction()) return false;
+ JSFunction* constructor =
+ JSFunction::cast(js_object->map()->GetConstructor());
+
+ return constructor->initial_map() == heap_object->map();
}

Powered by Google App Engine
This is Rietveld 408576698