Chromium Code Reviews| 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(); |
| } |