Commit 223e831a authored by yangguo@chromium.org's avatar yangguo@chromium.org

Ignore live_edit_ flag when when dealing with LiveEdit in a debug break.

LiveEdit maybe disabled when we enter the break and again when we
leave it, but enabled in between.

TEST=https://codereview.chromium.org/329533002
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/325183003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21770 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 23fc5b75
......@@ -886,9 +886,8 @@ void Debug::Break(Arguments args, JavaScriptFrame* frame) {
HandleScope scope(isolate_);
ASSERT(args.length() == 0);
if (live_edit_enabled()) {
thread_local_.frame_drop_mode_ = LiveEdit::FRAMES_UNTOUCHED;
}
// Initialize LiveEdit.
LiveEdit::InitializeThreadLocal(this);
// Just continue if breaks are disabled or debugger cannot be loaded.
if (break_disabled_) return;
......@@ -2307,11 +2306,9 @@ void Debug::RemoveDebugInfo(Handle<DebugInfo> debug_info) {
void Debug::SetAfterBreakTarget(JavaScriptFrame* frame) {
if (live_edit_enabled()) {
after_break_target_ =
LiveEdit::AfterBreakTarget(thread_local_.frame_drop_mode_, isolate_);
if (after_break_target_ != NULL) return; // LiveEdit did the job.
}
after_break_target_ = NULL;
if (LiveEdit::SetAfterBreakTarget(this)) return; // LiveEdit did the job.
HandleScope scope(isolate_);
PrepareForBreakPoints();
......
......@@ -674,6 +674,7 @@ class Debug {
friend class Isolate;
friend class DebugScope;
friend class DisableBreak;
friend class LiveEdit;
friend class SuppressDebug;
friend Handle<FixedArray> GetDebuggedFunctions(); // In test-debug.cc
......
......@@ -805,11 +805,17 @@ class FunctionInfoListener {
};
Address LiveEdit::AfterBreakTarget(FrameDropMode mode, Isolate* isolate) {
void LiveEdit::InitializeThreadLocal(Debug* debug) {
debug->thread_local_.frame_drop_mode_ = LiveEdit::FRAMES_UNTOUCHED;
}
bool LiveEdit::SetAfterBreakTarget(Debug* debug) {
Code* code = NULL;
switch (mode) {
Isolate* isolate = debug->isolate_;
switch (debug->thread_local_.frame_drop_mode_) {
case FRAMES_UNTOUCHED:
break;
return false;
case FRAME_DROPPED_IN_IC_CALL:
// We must have been calling IC stub. Do not go there anymore.
code = isolate->builtins()->builtin(Builtins::kPlainReturn_LiveEdit);
......@@ -821,7 +827,7 @@ Address LiveEdit::AfterBreakTarget(FrameDropMode mode, Isolate* isolate) {
break;
case FRAME_DROPPED_IN_DIRECT_CALL:
// Nothing to do, after_break_target is not used here.
break;
return true;
case FRAME_DROPPED_IN_RETURN_CALL:
code = isolate->builtins()->builtin(Builtins::kFrameDropper_LiveEdit);
break;
......@@ -829,8 +835,8 @@ Address LiveEdit::AfterBreakTarget(FrameDropMode mode, Isolate* isolate) {
UNREACHABLE();
break;
}
if (code == NULL) return NULL;
return code->entry();
debug->after_break_target_ = code->entry();
return true;
}
......
......@@ -74,7 +74,9 @@ class LiveEdit : AllStatic {
CURRENTLY_SET_MODE
};
static Address AfterBreakTarget(FrameDropMode mode, Isolate* isolate);
static void InitializeThreadLocal(Debug* debug);
static bool SetAfterBreakTarget(Debug* debug);
MUST_USE_RESULT static MaybeHandle<JSArray> GatherCompileInfo(
Handle<Script> script,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment