Index: src/api-arguments.cc |
diff --git a/src/api-arguments.cc b/src/api-arguments.cc |
index 3baf9ea36502ca7d24ff0b99577b2de7fb20735e..c7c54e5de1c37fc635644642cfeb1820e27f6f62 100644 |
--- a/src/api-arguments.cc |
+++ b/src/api-arguments.cc |
@@ -4,6 +4,7 @@ |
#include "src/api-arguments.h" |
+#include "src/debug/debug.h" |
#include "src/objects-inl.h" |
#include "src/tracing/trace-event.h" |
#include "src/vm-state-inl.h" |
@@ -13,6 +14,10 @@ namespace internal { |
Handle<Object> FunctionCallbackArguments::Call(FunctionCallback f) { |
Isolate* isolate = this->isolate(); |
+ if (isolate->needs_side_effect_check() && |
+ !isolate->debug()->PerformSideEffectCheckForCallback(FUNCTION_ADDR(f))) { |
+ return Handle<Object>(); |
+ } |
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::FunctionCallback); |
VMState<EXTERNAL> state(isolate); |
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); |
@@ -24,6 +29,10 @@ Handle<Object> FunctionCallbackArguments::Call(FunctionCallback f) { |
Handle<JSObject> PropertyCallbackArguments::Call( |
IndexedPropertyEnumeratorCallback f) { |
Isolate* isolate = this->isolate(); |
+ if (isolate->needs_side_effect_check() && |
+ !isolate->debug()->PerformSideEffectCheckForCallback(FUNCTION_ADDR(f))) { |
+ return Handle<JSObject>(); |
+ } |
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::PropertyCallback); |
VMState<EXTERNAL> state(isolate); |
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); |
@@ -32,5 +41,10 @@ Handle<JSObject> PropertyCallbackArguments::Call( |
return GetReturnValue<JSObject>(isolate); |
} |
+bool PropertyCallbackArguments::PerformSideEffectCheck(Isolate* isolate, |
+ Address function) { |
+ return isolate->debug()->PerformSideEffectCheckForCallback(function); |
+} |
+ |
} // namespace internal |
} // namespace v8 |