Commit 8e771d9b authored by mythria's avatar mythria Committed by Commit bot

Updated the check for unmodfied objects to handle Smi Objects.

The new minorGC pass collects all unmodified objects that are not marked
active by blink. The earlier implementation assumed all new space nodes
to be Heap objects. Updated this code to handle Smi objects as well.

BUG=553287
LOG=Y

Review URL: https://codereview.chromium.org/1491203002

Cr-Commit-Position: refs/heads/master@{#32704}
parent 20e54f0c
......@@ -1494,12 +1494,13 @@ static bool IsUnscavengedHeapObject(Heap* heap, Object** p) {
static bool IsUnmodifiedHeapObject(Object** p) {
Object* object = *p;
DCHECK(object->IsHeapObject());
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;
......
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