Index: src/objects.cc |
=================================================================== |
--- src/objects.cc (revision 2910) |
+++ src/objects.cc (working copy) |
@@ -476,6 +476,21 @@ |
} |
+bool JSObject::IsDirty() { |
+ Object* cons_obj = map()->constructor(); |
Mads Ager (chromium)
2009/09/17 08:46:18
How about just calling it constructor instead of c
Christian Plesner Hansen
2009/09/17 08:53:15
The reason I used cons_obj is that we don't know i
|
+ if (!cons_obj->IsJSFunction()) |
+ return true; |
+ JSFunction* fun = JSFunction::cast(cons_obj); |
+ if (!fun->shared()->function_data()->IsFunctionTemplateInfo()) |
+ return true; |
+ // If the object is fully fast case and has the same map it was |
+ // created with then no changes can have been made to it. |
+ return map() != fun->initial_map() |
+ || !HasFastElements() |
+ || !HasFastProperties(); |
+} |
+ |
+ |
Object* Object::GetProperty(Object* receiver, |
LookupResult* result, |
String* name, |