Commit f1357a21 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Some debugger-related clean-ups and renamings.

R=ulan@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21604 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2f04631d
......@@ -6905,7 +6905,7 @@ Local<Value> Debug::GetMirror(v8::Handle<v8::Value> obj) {
void Debug::ProcessDebugMessages() {
i::Execution::ProcessDebugMessages(i::Isolate::Current(), true);
i::Isolate::Current()->debug()->ProcessDebugMessages(true);
}
......
......@@ -1477,7 +1477,7 @@ bool Genesis::CompileNative(Isolate* isolate,
Vector<const char> name,
Handle<String> source) {
HandleScope scope(isolate);
Debug::IgnoreScope compiling_natives(isolate->debug());
SuppressDebug compiling_natives(isolate->debug());
// During genesis, the boilerplate for stack overflow won't work until the
// environment has been at least partially initialized. Add a stack check
// before entering JS code to catch overflow early.
......
This diff is collapsed.
This diff is collapsed.
......@@ -654,60 +654,6 @@ Handle<String> Execution::GetStackTraceLine(Handle<Object> recv,
}
void Execution::DebugBreakHelper(Isolate* isolate) {
// Just continue if breaks are disabled.
if (isolate->debug()->disable_break()) return;
// Ignore debug break during bootstrapping.
if (isolate->bootstrapper()->IsActive()) return;
// Ignore debug break if debugger is not active.
if (!isolate->debug()->is_active()) return;
StackLimitCheck check(isolate);
if (check.HasOverflowed()) return;
{ JavaScriptFrameIterator it(isolate);
ASSERT(!it.done());
Object* fun = it.frame()->function();
if (fun && fun->IsJSFunction()) {
// Don't stop in builtin functions.
if (JSFunction::cast(fun)->IsBuiltin()) return;
GlobalObject* global = JSFunction::cast(fun)->context()->global_object();
// Don't stop in debugger functions.
if (isolate->debug()->IsDebugGlobal(global)) return;
}
}
// Collect the break state before clearing the flags.
bool debug_command_only = isolate->stack_guard()->CheckDebugCommand() &&
!isolate->stack_guard()->CheckDebugBreak();
isolate->stack_guard()->ClearDebugBreak();
Execution::ProcessDebugMessages(isolate, debug_command_only);
}
void Execution::ProcessDebugMessages(Isolate* isolate,
bool debug_command_only) {
isolate->stack_guard()->ClearDebugCommand();
StackLimitCheck check(isolate);
if (check.HasOverflowed()) return;
HandleScope scope(isolate);
// Enter the debugger. Just continue if we fail to enter the debugger.
EnterDebugger debugger(isolate);
if (debugger.FailedToEnter()) return;
// Notify the debug event listeners. Indicate auto continue if the break was
// a debug command break.
isolate->debug()->OnDebugBreak(isolate->factory()->undefined_value(),
debug_command_only);
}
Object* StackGuard::HandleInterrupts() {
bool has_api_interrupt = false;
{
......@@ -721,7 +667,7 @@ Object* StackGuard::HandleInterrupts() {
}
if (CheckDebugBreak() || CheckDebugCommand()) {
Execution::DebugBreakHelper(isolate_);
isolate_->debug()->DebugBreakHelper();
}
if (CheckAndClearInterrupt(TERMINATE_EXECUTION, access)) {
......
......@@ -104,9 +104,6 @@ class Execution V8_FINAL : public AllStatic {
Handle<Object> pos,
Handle<Object> is_global);
static void DebugBreakHelper(Isolate* isolate);
static void ProcessDebugMessages(Isolate* isolate, bool debug_command_only);
// Get a function delegate (or undefined) for the given non-function
// object. Used for support calling objects as functions.
static Handle<Object> GetFunctionDelegate(Isolate* isolate,
......
......@@ -1324,7 +1324,7 @@ Handle<Context> Isolate::global_context() {
Handle<Context> Isolate::GetCallingNativeContext() {
JavaScriptFrameIterator it(this);
if (debug_->InDebugger()) {
if (debug_->is_entered()) {
while (!it.done()) {
JavaScriptFrame* frame = it.frame();
Context* context = Context::cast(frame->context());
......
......@@ -4248,7 +4248,7 @@ void MarkCompactCollector::ParallelSweepSpacesComplete() {
void MarkCompactCollector::EnableCodeFlushing(bool enable) {
if (isolate()->debug()->IsLoaded() ||
if (isolate()->debug()->is_loaded() ||
isolate()->debug()->has_break_points()) {
enable = false;
}
......
......@@ -10698,7 +10698,7 @@ RUNTIME_FUNCTION(Runtime_LookupAccessor) {
RUNTIME_FUNCTION(Runtime_DebugBreak) {
SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
Execution::DebugBreakHelper(isolate);
isolate->debug()->DebugBreakHelper();
return isolate->heap()->undefined_value();
}
......@@ -10815,7 +10815,7 @@ RUNTIME_FUNCTION(Runtime_DebugGetPropertyDetails) {
// could have the assumption that its own native context is the current
// context and not some internal debugger context.
SaveContext save(isolate);
if (isolate->debug()->InDebugger()) {
if (isolate->debug()->is_entered()) {
isolate->set_context(*isolate->debug()->debugger_entry()->GetContext());
}
......@@ -12862,7 +12862,7 @@ RUNTIME_FUNCTION(Runtime_DebugEvaluate) {
CONVERT_ARG_HANDLE_CHECKED(Object, context_extension, 5);
// Handle the processing of break.
DisableBreak disable_break_save(isolate, disable_break);
DisableBreak disable_break_scope(isolate->debug(), disable_break);
// Get the frame where the debugging is performed.
StackFrame::Id id = UnwrapFrameId(wrapped_id);
......@@ -12926,7 +12926,7 @@ RUNTIME_FUNCTION(Runtime_DebugEvaluateGlobal) {
CONVERT_ARG_HANDLE_CHECKED(Object, context_extension, 3);
// Handle the processing of break.
DisableBreak disable_break_save(isolate, disable_break);
DisableBreak disable_break_scope(isolate->debug(), disable_break);
// Enter the top context from before the debugger was invoked.
SaveContext save(isolate);
......
......@@ -4189,7 +4189,7 @@ TEST(DisableBreak) {
{
v8::Debug::DebugBreak(env->GetIsolate());
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(env->GetIsolate());
v8::internal::DisableBreak disable_break(isolate, true);
v8::internal::DisableBreak disable_break(isolate->debug(), true);
f->Call(env->Global(), 0, NULL);
CHECK_EQ(1, break_point_hit_count);
}
......
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