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

Unified Diff: src/api-arguments.cc

Issue 2622863003: [debugger] infrastructure for side-effect-free debug-evaluate. (Closed)
Patch Set: clean ups. Created 3 years, 11 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
Index: src/api-arguments.cc
diff --git a/src/api-arguments.cc b/src/api-arguments.cc
index f8d6c8fcc3ddda3ee8d83e5419be4b7127ff8f8a..2dd97004a8992b3a294e15941e9330f24bd3eae7 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/tracing/trace-event.h"
#include "src/vm-state-inl.h"
@@ -12,6 +13,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));
@@ -23,6 +28,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));
@@ -31,5 +40,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
« no previous file with comments | « src/api-arguments.h ('k') | src/api-arguments-inl.h » ('j') | src/debug/debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698