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

Unified Diff: src/heap/heap.cc

Issue 1491203002: Updated the check for unmodfied objects to handle Smi Objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed review comments. Does not mark any objects that are not created via C++ API as unmodified. Created 5 years 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 | « no previous file | no next file » | 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 1105c6868dc4699e0c0ffb9c057d7a6c16775112..0bb12f6b6af42d0f68ff8f9a88a84c8a7d86498d 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -1493,12 +1493,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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698