Chromium Code Reviews| 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 { |