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

Unified Diff: src/runtime.cc

Issue 11274014: Store Object.observe state per-isolate rather than per-context (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Simplified Created 8 years, 1 month 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
« src/heap.h ('K') | « src/runtime.h ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index b0a6b5e81427e1588a89f1c269a2b1e90c78f98b..062c4ea437d66a978db2fea370f76ea0fe610bb8 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -13222,6 +13222,50 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_HaveSameMap) {
return isolate->heap()->ToBoolean(obj1->map() == obj2->map());
}
+
+RUNTIME_FUNCTION(MaybeObject*, Runtime_GetObjectObservationState) {
+ ASSERT(args.length() == 0);
+ return isolate->heap()->object_observation_state();
+}
+
+
+RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateObjectHashTable) {
+ ASSERT(args.length() == 0);
+ return ObjectHashTable::Allocate(0);
Michael Starzinger 2012/11/06 14:17:44 As discussed offline, having this non-JS object es
adamk 2012/11/06 14:54:21 Noted. I'd also be fine with wrapping this in a JS
+}
+
+
+RUNTIME_FUNCTION(MaybeObject*, Runtime_ObjectHashTableGet) {
+ NoHandleAllocation ha;
+ ASSERT(args.length() == 2);
+ ObjectHashTable* table = ObjectHashTable::cast(args[0]);
Michael Starzinger 2012/11/06 14:17:44 Use the CONVERT_ARG_CHECKED macro here which will
adamk 2012/11/06 14:54:21 Done.
+ Object* key = args[1];
+ Object* lookup = table->Lookup(key);
+ return lookup->IsTheHole() ? isolate->heap()->undefined_value() : lookup;
+}
+
+
+RUNTIME_FUNCTION(MaybeObject*, Runtime_ObjectHashTableSet) {
+ HandleScope scope(isolate);
+ ASSERT(args.length() == 3);
+ Handle<ObjectHashTable> table = args.at<ObjectHashTable>(0);
Michael Starzinger 2012/11/06 14:17:44 Likewise.
adamk 2012/11/06 14:54:21 Done.
+ Handle<Object> key = args.at<Object>(1);
+ Handle<Object> value = args.at<Object>(2);
+ PutIntoObjectHashTable(table, key, value);
+ return isolate->heap()->undefined_value();
+}
+
+
+RUNTIME_FUNCTION(MaybeObject*, Runtime_ObjectHashTableHas) {
+ NoHandleAllocation ha;
+ ASSERT(args.length() == 2);
+ ObjectHashTable* table = ObjectHashTable::cast(args[0]);
Michael Starzinger 2012/11/06 14:17:44 Likewise.
adamk 2012/11/06 14:54:21 Done.
+ Object* key = args[1];
+ Object* lookup = table->Lookup(key);
+ return isolate->heap()->ToBoolean(!lookup->IsTheHole());
+}
+
+
// ----------------------------------------------------------------------------
// Implementation of Runtime
« src/heap.h ('K') | « src/runtime.h ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698