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

Unified Diff: src/v8.cc

Issue 11266011: Delivery logic for Object.observe (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased against newest per-isolate patch 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
Index: src/v8.cc
diff --git a/src/v8.cc b/src/v8.cc
index 2407037b32feebaca9cc5bc28e50c49b58fac1f4..7c52fe796d4dc8112c78d3f5d3117caeea287173 100644
--- a/src/v8.cc
+++ b/src/v8.cc
@@ -38,6 +38,7 @@
#include "hydrogen.h"
#include "lithium-allocator.h"
#include "log.h"
+#include "objects.h"
#include "once.h"
#include "platform.h"
#include "runtime-profiler.h"
@@ -216,14 +217,21 @@ void V8::RemoveCallCompletedCallback(CallCompletedCallback callback) {
void V8::FireCallCompletedCallback(Isolate* isolate) {
- if (call_completed_callbacks_ == NULL) return;
+ bool has_call_completed_callbacks = call_completed_callbacks_ != NULL;
+ bool has_active_object_observers = isolate->has_active_object_observers();
+ if (!has_call_completed_callbacks && !has_active_object_observers) return;
HandleScopeImplementer* handle_scope_implementer =
isolate->handle_scope_implementer();
if (!handle_scope_implementer->CallDepthIsZero()) return;
// Fire callbacks. Increase call depth to prevent recursive callbacks.
handle_scope_implementer->IncrementCallDepth();
- for (int i = 0; i < call_completed_callbacks_->length(); i++) {
- call_completed_callbacks_->at(i)();
+ if (has_active_object_observers) {
rossberg 2012/11/06 16:45:57 FLAG_harmony_observation && ...
adamk 2012/11/06 17:00:09 Done.
+ JSObject::DeliverChangeRecords(isolate);
+ }
+ if (has_call_completed_callbacks) {
+ for (int i = 0; i < call_completed_callbacks_->length(); i++) {
+ call_completed_callbacks_->at(i)();
+ }
}
handle_scope_implementer->DecrementCallDepth();
}

Powered by Google App Engine
This is Rietveld 408576698