From e5564a3f29e0a818832a97c7c3b28d7c8b3b0460 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 8 Jul 2011 16:40:11 -0700 Subject: Upgrade V8 to 3.4.10 --- deps/v8/src/debug.h | 475 ++++++++++++++++++++++++++++------------------------ 1 file changed, 254 insertions(+), 221 deletions(-) (limited to 'deps/v8/src/debug.h') diff --git a/deps/v8/src/debug.h b/deps/v8/src/debug.h index 85c4d534ff..c4d3c7e373 100644 --- a/deps/v8/src/debug.h +++ b/deps/v8/src/debug.h @@ -28,6 +28,8 @@ #ifndef V8_DEBUG_H_ #define V8_DEBUG_H_ +#include "allocation.h" +#include "arguments.h" #include "assembler.h" #include "debug-agent.h" #include "execution.h" @@ -210,7 +212,6 @@ class DebugInfoListNode { DebugInfoListNode* next_; }; - // This class contains the debugger support. The main purpose is to handle // setting break points in the code. // @@ -220,33 +221,33 @@ class DebugInfoListNode { // DebugInfo. class Debug { public: - static void Setup(bool create_heap_objects); - static bool Load(); - static void Unload(); - static bool IsLoaded() { return !debug_context_.is_null(); } - static bool InDebugger() { return thread_local_.debugger_entry_ != NULL; } - static void PreemptionWhileInDebugger(); - static void Iterate(ObjectVisitor* v); - - static Object* Break(Arguments args); - static void SetBreakPoint(Handle shared, - Handle break_point_object, - int* source_position); - static void ClearBreakPoint(Handle break_point_object); - static void ClearAllBreakPoints(); - static void FloodWithOneShot(Handle shared); - static void FloodHandlerWithOneShot(); - static void ChangeBreakOnException(ExceptionBreakType type, bool enable); - static bool IsBreakOnException(ExceptionBreakType type); - static void PrepareStep(StepAction step_action, int step_count); - static void ClearStepping(); - static bool StepNextContinue(BreakLocationIterator* break_location_iterator, - JavaScriptFrame* frame); + void Setup(bool create_heap_objects); + bool Load(); + void Unload(); + bool IsLoaded() { return !debug_context_.is_null(); } + bool InDebugger() { return thread_local_.debugger_entry_ != NULL; } + void PreemptionWhileInDebugger(); + void Iterate(ObjectVisitor* v); + + Object* Break(Arguments args); + void SetBreakPoint(Handle shared, + Handle break_point_object, + int* source_position); + void ClearBreakPoint(Handle break_point_object); + void ClearAllBreakPoints(); + void FloodWithOneShot(Handle shared); + void FloodHandlerWithOneShot(); + void ChangeBreakOnException(ExceptionBreakType type, bool enable); + bool IsBreakOnException(ExceptionBreakType type); + void PrepareStep(StepAction step_action, int step_count); + void ClearStepping(); + bool StepNextContinue(BreakLocationIterator* break_location_iterator, + JavaScriptFrame* frame); static Handle GetDebugInfo(Handle shared); static bool HasDebugInfo(Handle shared); // Returns whether the operation succeeded. - static bool EnsureDebugInfo(Handle shared); + bool EnsureDebugInfo(Handle shared); // Returns true if the current stub call is patched to call the debugger. static bool IsDebugBreak(Address addr); @@ -266,66 +267,66 @@ class Debug { Handle shared); // Getter for the debug_context. - inline static Handle debug_context() { return debug_context_; } + inline Handle debug_context() { return debug_context_; } // Check whether a global object is the debug global object. - static bool IsDebugGlobal(GlobalObject* global); + bool IsDebugGlobal(GlobalObject* global); // Check whether this frame is just about to return. - static bool IsBreakAtReturn(JavaScriptFrame* frame); + bool IsBreakAtReturn(JavaScriptFrame* frame); // Fast check to see if any break points are active. - inline static bool has_break_points() { return has_break_points_; } + inline bool has_break_points() { return has_break_points_; } - static void NewBreak(StackFrame::Id break_frame_id); - static void SetBreak(StackFrame::Id break_frame_id, int break_id); - static StackFrame::Id break_frame_id() { + void NewBreak(StackFrame::Id break_frame_id); + void SetBreak(StackFrame::Id break_frame_id, int break_id); + StackFrame::Id break_frame_id() { return thread_local_.break_frame_id_; } - static int break_id() { return thread_local_.break_id_; } + int break_id() { return thread_local_.break_id_; } - static bool StepInActive() { return thread_local_.step_into_fp_ != 0; } - static void HandleStepIn(Handle function, - Handle holder, - Address fp, - bool is_constructor); - static Address step_in_fp() { return thread_local_.step_into_fp_; } - static Address* step_in_fp_addr() { return &thread_local_.step_into_fp_; } + bool StepInActive() { return thread_local_.step_into_fp_ != 0; } + void HandleStepIn(Handle function, + Handle holder, + Address fp, + bool is_constructor); + Address step_in_fp() { return thread_local_.step_into_fp_; } + Address* step_in_fp_addr() { return &thread_local_.step_into_fp_; } - static bool StepOutActive() { return thread_local_.step_out_fp_ != 0; } - static Address step_out_fp() { return thread_local_.step_out_fp_; } + bool StepOutActive() { return thread_local_.step_out_fp_ != 0; } + Address step_out_fp() { return thread_local_.step_out_fp_; } - static EnterDebugger* debugger_entry() { + EnterDebugger* debugger_entry() { return thread_local_.debugger_entry_; } - static void set_debugger_entry(EnterDebugger* entry) { + void set_debugger_entry(EnterDebugger* entry) { thread_local_.debugger_entry_ = entry; } // Check whether any of the specified interrupts are pending. - static bool is_interrupt_pending(InterruptFlag what) { + bool is_interrupt_pending(InterruptFlag what) { return (thread_local_.pending_interrupts_ & what) != 0; } // Set specified interrupts as pending. - static void set_interrupts_pending(InterruptFlag what) { + void set_interrupts_pending(InterruptFlag what) { thread_local_.pending_interrupts_ |= what; } // Clear specified interrupts from pending. - static void clear_interrupt_pending(InterruptFlag what) { + void clear_interrupt_pending(InterruptFlag what) { thread_local_.pending_interrupts_ &= ~static_cast(what); } // Getter and setter for the disable break state. - static bool disable_break() { return disable_break_; } - static void set_disable_break(bool disable_break) { + bool disable_break() { return disable_break_; } + void set_disable_break(bool disable_break) { disable_break_ = disable_break; } // Getters for the current exception break state. - static bool break_on_exception() { return break_on_exception_; } - static bool break_on_uncaught_exception() { + bool break_on_exception() { return break_on_exception_; } + bool break_on_uncaught_exception() { return break_on_uncaught_exception_; } @@ -337,34 +338,35 @@ class Debug { }; // Support for setting the address to jump to when returning from break point. - static Address* after_break_target_address() { + Address* after_break_target_address() { return reinterpret_cast(&thread_local_.after_break_target_); } - static Address* restarter_frame_function_pointer_address() { + Address* restarter_frame_function_pointer_address() { Object*** address = &thread_local_.restarter_frame_function_pointer_; return reinterpret_cast(address); } // Support for saving/restoring registers when handling debug break calls. - static Object** register_address(int r) { + Object** register_address(int r) { return ®isters_[r]; } // Access to the debug break on return code. - static Code* debug_break_return() { return debug_break_return_; } - static Code** debug_break_return_address() { + Code* debug_break_return() { return debug_break_return_; } + Code** debug_break_return_address() { return &debug_break_return_; } // Access to the debug break in debug break slot code. - static Code* debug_break_slot() { return debug_break_slot_; } - static Code** debug_break_slot_address() { + Code* debug_break_slot() { return debug_break_slot_; } + Code** debug_break_slot_address() { return &debug_break_slot_; } static const int kEstimatedNofDebugInfoEntries = 16; static const int kEstimatedNofBreakPointsInFunction = 16; + // Passed to MakeWeak. static void HandleWeakDebugInfo(v8::Persistent obj, void* data); friend class Debugger; @@ -372,22 +374,22 @@ class Debug { friend void CheckDebuggerUnloaded(bool check_functions); // In test-debug.cc // Threading support. - static char* ArchiveDebug(char* to); - static char* RestoreDebug(char* from); + char* ArchiveDebug(char* to); + char* RestoreDebug(char* from); static int ArchiveSpacePerThread(); - static void FreeThreadResources() { } + void FreeThreadResources() { } // Mirror cache handling. - static void ClearMirrorCache(); + void ClearMirrorCache(); // Script cache handling. - static void CreateScriptCache(); - static void DestroyScriptCache(); - static void AddScriptToScriptCache(Handle