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

Unified Diff: src/objects.h

Issue 12183018: Create pre-frozen change records for Object.observe (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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/object-observe.js ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 12413123c09c2a922da3f76a7fbe3679a3dd0609..52dd1564ccddde620f7220d03e232eaede1e40d4 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -2217,6 +2217,10 @@ class JSObject: public JSReceiver {
const char* type,
Handle<String> name,
Handle<Object> old_value);
+ static void EnqueueChangeRecord(Handle<JSObject> object,
+ Handle<String> type,
+ Handle<String> name,
+ Handle<Object> old_value);
// Deliver change records to observers. May cause GC.
static void DeliverChangeRecords(Isolate* isolate);
@@ -8324,6 +8328,26 @@ class JSRegExpResult: public JSArray {
};
+// JSChangeRecords are JSObjects with a particular initial map
+// that includes in-object properties and non-extensibility.
+class JSChangeRecord: public JSObject {
+ public:
+ // Offsets of object fields.
+ static const int kTypeOffset = JSObject::kHeaderSize;
+ static const int kObjectOffset = kTypeOffset + kPointerSize;
+ static const int kNameOffset = kObjectOffset + kPointerSize;
+ static const int kOldValueOffset = kNameOffset + kPointerSize;
+ static const int kSize = kOldValueOffset + kPointerSize;
+ // Indices of in-object properties.
+ static const int kTypeIndex = 0;
+ static const int kObjectIndex = 1;
+ static const int kNameIndex = 2;
+ static const int kOldValueIndex = 3;
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(JSChangeRecord);
+};
+
+
// An accessor must have a getter, but can have no setter.
//
// When setting a property, V8 searches accessors in prototypes.
« no previous file with comments | « src/object-observe.js ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698