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

Unified Diff: src/debug/debug.h

Issue 2622863003: [debugger] infrastructure for side-effect-free debug-evaluate. (Closed)
Patch Set: 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
« no previous file with comments | « src/assembler.cc ('k') | src/debug/debug.cc » ('j') | src/debug/debug.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.h
diff --git a/src/debug/debug.h b/src/debug/debug.h
index e87e8aecad1644dc19e5da283942a83c37f6a8fd..4b0ae1be1c9c105112207fe00a7c5d4ff40527dd 100644
--- a/src/debug/debug.h
+++ b/src/debug/debug.h
@@ -518,6 +518,8 @@ class Debug {
return is_active() && !debug_context().is_null() && break_id() != 0;
}
+ bool PerformReadOnlyCheck(Handle<JSFunction> function);
+
// Flags and states.
DebugScope* debugger_entry() {
return reinterpret_cast<DebugScope*>(
@@ -537,6 +539,7 @@ class Debug {
}
void set_break_points_active(bool v) { break_points_active_ = v; }
bool break_points_active() const { return break_points_active_; }
+ bool needs_readonly_check() const { return needs_readonly_check_; }
StackFrame::Id break_frame_id() { return thread_local_.break_frame_id_; }
int break_id() { return thread_local_.break_id_; }
@@ -551,6 +554,10 @@ class Debug {
return reinterpret_cast<Address>(&is_active_);
}
+ Address hook_on_function_call_address() {
+ return reinterpret_cast<Address>(&hook_on_function_call_);
+ }
+
Address after_break_target_address() {
return reinterpret_cast<Address>(&after_break_target_);
}
@@ -571,6 +578,7 @@ class Debug {
explicit Debug(Isolate* isolate);
void UpdateState();
+ void UpdateHookOnFunctionCall();
void Unload();
void SetNextBreakId() {
thread_local_.break_id_ = ++thread_local_.break_count_;
@@ -667,6 +675,7 @@ class Debug {
LockingCommandMessageQueue command_queue_;
bool is_active_;
+ bool hook_on_function_call_;
jgruber 2017/01/10 12:46:37 A brief comment about what each of these new varia
Yang 2017/01/10 14:14:06 Done.
bool is_suppressed_;
bool live_edit_enabled_;
bool break_disabled_;
@@ -674,6 +683,8 @@ class Debug {
bool in_debug_event_listener_;
bool break_on_exception_;
bool break_on_uncaught_exception_;
+ bool needs_readonly_check_;
+ bool readonly_check_failed_;
DebugInfoListNode* debug_info_list_; // List of active debug info objects.
@@ -733,6 +744,7 @@ class Debug {
friend class DisableBreak;
friend class LiveEdit;
friend class SuppressDebug;
+ friend class ReadOnlyEvaluate;
friend Handle<FixedArray> GetDebuggedFunctions(); // In test-debug.cc
friend void CheckDebuggerUnloaded(bool check_functions); // In test-debug.cc
@@ -806,6 +818,21 @@ class SuppressDebug BASE_EMBEDDED {
DISALLOW_COPY_AND_ASSIGN(SuppressDebug);
};
+class ReadOnlyEvaluate {
jgruber 2017/01/10 12:46:37 Maybe ReadOnlyEvaluateScope?
Yang 2017/01/10 14:14:06 Done.
+ public:
+ ReadOnlyEvaluate(Debug* debug, bool readonly)
+ : debug_(debug), old_state_(debug->needs_readonly_check_) {
+ debug_->needs_readonly_check_ |= readonly;
+ debug_->UpdateHookOnFunctionCall();
+ debug_->readonly_check_failed_ = false;
+ }
+ ~ReadOnlyEvaluate();
+
+ private:
+ Debug* debug_;
+ bool old_state_;
jgruber 2017/01/10 12:46:37 Maybe old_needs_readonly_check_?
+ DISALLOW_COPY_AND_ASSIGN(ReadOnlyEvaluate);
+};
// Code generator routines.
class DebugCodegen : public AllStatic {
« no previous file with comments | « src/assembler.cc ('k') | src/debug/debug.cc » ('j') | src/debug/debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698