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

Unified Diff: src/debug.h

Issue 300793002: Move LiveEdit-related code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix x64 Created 6 years, 7 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/arm64/debug-arm64.cc ('k') | src/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.h
diff --git a/src/debug.h b/src/debug.h
index 03ddc0f04295033e1bb05cd2e0381a3a23e82d8e..e6c1d262d4e6cb1f5760537ecf2afdeedacce569 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -13,6 +13,7 @@
#include "flags.h"
#include "frames-inl.h"
#include "hashmap.h"
+#include "liveedit.h"
#include "platform.h"
#include "string-stream.h"
#include "v8threads.h"
@@ -532,10 +533,9 @@ class Debug {
return break_on_uncaught_exception_;
}
- enum AddressId {
- k_after_break_target_address,
- k_restarter_frame_function_pointer
- };
+ void FramesHaveBeenDropped(StackFrame::Id new_break_frame_id,
+ LiveEdit::FrameDropMode mode,
+ Object** restarter_frame_function_pointer);
// Support for setting the address to jump to when returning from break point.
Address after_break_target_address() {
@@ -547,7 +547,6 @@ class Debug {
return reinterpret_cast<Address>(address);
}
- static const int kEstimatedNofDebugInfoEntries = 16;
static const int kEstimatedNofBreakPointsInFunction = 16;
// Passed to MakeWeak.
@@ -578,86 +577,6 @@ class Debug {
// Garbage collection notifications.
void AfterGarbageCollection();
- // Describes how exactly a frame has been dropped from stack.
- enum FrameDropMode {
- // No frame has been dropped.
- FRAMES_UNTOUCHED,
- // The top JS frame had been calling IC stub. IC stub mustn't be called now.
- FRAME_DROPPED_IN_IC_CALL,
- // The top JS frame had been calling debug break slot stub. Patch the
- // address this stub jumps to in the end.
- FRAME_DROPPED_IN_DEBUG_SLOT_CALL,
- // The top JS frame had been calling some C++ function. The return address
- // gets patched automatically.
- FRAME_DROPPED_IN_DIRECT_CALL,
- FRAME_DROPPED_IN_RETURN_CALL,
- CURRENTLY_SET_MODE
- };
-
- void FramesHaveBeenDropped(StackFrame::Id new_break_frame_id,
- FrameDropMode mode,
- Object** restarter_frame_function_pointer);
-
- // Initializes an artificial stack frame. The data it contains is used for:
- // a. successful work of frame dropper code which eventually gets control,
- // b. being compatible with regular stack structure for various stack
- // iterators.
- // Returns address of stack allocated pointer to restarted function,
- // the value that is called 'restarter_frame_function_pointer'. The value
- // at this address (possibly updated by GC) may be used later when preparing
- // 'step in' operation.
- static Object** SetUpFrameDropperFrame(StackFrame* bottom_js_frame,
- Handle<Code> code);
-
- static const int kFrameDropperFrameSize;
-
- // Architecture-specific constant.
- static const bool kFrameDropperSupported;
-
- /**
- * Defines layout of a stack frame that supports padding. This is a regular
- * internal frame that has a flexible stack structure. LiveEdit can shift
- * its lower part up the stack, taking up the 'padding' space when additional
- * stack memory is required.
- * Such frame is expected immediately above the topmost JavaScript frame.
- *
- * Stack Layout:
- * --- Top
- * LiveEdit routine frames
- * ---
- * C frames of debug handler
- * ---
- * ...
- * ---
- * An internal frame that has n padding words:
- * - any number of words as needed by code -- upper part of frame
- * - padding size: a Smi storing n -- current size of padding
- * - padding: n words filled with kPaddingValue in form of Smi
- * - 3 context/type words of a regular InternalFrame
- * - fp
- * ---
- * Topmost JavaScript frame
- * ---
- * ...
- * --- Bottom
- */
- class FramePaddingLayout : public AllStatic {
- public:
- // Architecture-specific constant.
- static const bool kIsSupported;
-
- // A size of frame base including fp. Padding words starts right above
- // the base.
- static const int kFrameBaseSize = 4;
-
- // A number of words that should be reserved on stack for the LiveEdit use.
- // Normally equals 1. Stored on stack in form of Smi.
- static const int kInitialSize;
- // A value that padding words are filled with (in form of Smi). Going
- // bottom-top, the first word not having this value is a counter word.
- static const int kPaddingValue;
- };
-
private:
explicit Debug(Isolate* isolate);
@@ -767,6 +686,9 @@ class Debug {
// Per-thread data.
class ThreadLocal {
public:
+ // Top debugger entry.
+ EnterDebugger* debugger_entry_;
+
// Counter for generating next break id.
int break_count_;
@@ -801,16 +723,13 @@ class Debug {
// Storage location for jump when exiting debug break calls.
Address after_break_target_;
- // Stores the way how LiveEdit has patched the stack. It is used when
- // debugger returns control back to user script.
- FrameDropMode frame_drop_mode_;
-
- // Top debugger entry.
- EnterDebugger* debugger_entry_;
-
// Pending interrupts scheduled while debugging.
bool has_pending_interrupt_;
+ // Stores the way how LiveEdit has patched the stack. It is used when
+ // debugger returns control back to user script.
+ LiveEdit::FrameDropMode frame_drop_mode_;
+
// When restarter frame is on stack, stores the address
// of the pointer to function being restarted. Otherwise (most of the time)
// stores NULL. This pointer is used with 'step in' implementation.
@@ -831,6 +750,7 @@ class Debug {
friend class Isolate;
friend class EnterDebugger;
+ friend class FrameDropper;
DISALLOW_COPY_AND_ASSIGN(Debug);
};
@@ -912,6 +832,7 @@ class DebugCodegen : public AllStatic {
static void GenerateFrameDropperLiveEdit(MacroAssembler* masm);
};
+
} } // namespace v8::internal
#endif // V8_DEBUG_H_
« no previous file with comments | « src/arm64/debug-arm64.cc ('k') | src/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698