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

Unified Diff: src/objects.cc

Issue 209013: Add Object::IsDirty function in the API. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 3 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
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698