| Index: src/debug.cc
|
| diff --git a/src/debug.cc b/src/debug.cc
|
| index 87afe34f44b67dc9b9142482873230bd79de45cf..c0a500786253285b47b99335135bfb8137d5de87 100644
|
| --- a/src/debug.cc
|
| +++ b/src/debug.cc
|
| @@ -914,24 +914,20 @@ void Debug::Iterate(ObjectVisitor* v) {
|
| }
|
|
|
|
|
| -// This remains a static method so that generated code can call it.
|
| -Object* Debug::Break(RUNTIME_CALLING_CONVENTION) {
|
| - RUNTIME_GET_ISOLATE;
|
| -
|
| - Debug* debug = isolate->debug();
|
| - Heap* heap = isolate->heap();
|
| - HandleScope scope;
|
| +Object* Debug::Break(Arguments args) {
|
| + Heap* heap = isolate_->heap();
|
| + HandleScope scope(isolate_);
|
| ASSERT(args.length() == 0);
|
|
|
| - debug->thread_local_.frame_drop_mode_ = FRAMES_UNTOUCHED;
|
| + thread_local_.frame_drop_mode_ = FRAMES_UNTOUCHED;
|
|
|
| // Get the top-most JavaScript frame.
|
| JavaScriptFrameIterator it;
|
| JavaScriptFrame* frame = it.frame();
|
|
|
| // Just continue if breaks are disabled or debugger cannot be loaded.
|
| - if (debug->disable_break() || !debug->Load()) {
|
| - debug->SetAfterBreakTarget(frame);
|
| + if (disable_break() || !Load()) {
|
| + SetAfterBreakTarget(frame);
|
| return heap->undefined_value();
|
| }
|
|
|
| @@ -942,7 +938,7 @@ Object* Debug::Break(RUNTIME_CALLING_CONVENTION) {
|
| }
|
|
|
| // Postpone interrupt during breakpoint processing.
|
| - PostponeInterruptsScope postpone(isolate);
|
| + PostponeInterruptsScope postpone(isolate_);
|
|
|
| // Get the debug info (create it if it does not exist).
|
| Handle<SharedFunctionInfo> shared =
|
| @@ -955,10 +951,10 @@ Object* Debug::Break(RUNTIME_CALLING_CONVENTION) {
|
| break_location_iterator.FindBreakLocationFromAddress(frame->pc());
|
|
|
| // Check whether step next reached a new statement.
|
| - if (!debug->StepNextContinue(&break_location_iterator, frame)) {
|
| + if (!StepNextContinue(&break_location_iterator, frame)) {
|
| // Decrease steps left if performing multiple steps.
|
| - if (debug->thread_local_.step_count_ > 0) {
|
| - debug->thread_local_.step_count_--;
|
| + if (thread_local_.step_count_ > 0) {
|
| + thread_local_.step_count_--;
|
| }
|
| }
|
|
|
| @@ -968,56 +964,55 @@ Object* Debug::Break(RUNTIME_CALLING_CONVENTION) {
|
| if (break_location_iterator.HasBreakPoint()) {
|
| Handle<Object> break_point_objects =
|
| Handle<Object>(break_location_iterator.BreakPointObjects());
|
| - break_points_hit = debug->CheckBreakPoints(break_point_objects);
|
| + break_points_hit = CheckBreakPoints(break_point_objects);
|
| }
|
|
|
| // If step out is active skip everything until the frame where we need to step
|
| // out to is reached, unless real breakpoint is hit.
|
| - if (debug->StepOutActive() && frame->fp() != debug->step_out_fp() &&
|
| + if (StepOutActive() && frame->fp() != step_out_fp() &&
|
| break_points_hit->IsUndefined() ) {
|
| // Step count should always be 0 for StepOut.
|
| - ASSERT(debug->thread_local_.step_count_ == 0);
|
| + ASSERT(thread_local_.step_count_ == 0);
|
| } else if (!break_points_hit->IsUndefined() ||
|
| - (debug->thread_local_.last_step_action_ != StepNone &&
|
| - debug->thread_local_.step_count_ == 0)) {
|
| + (thread_local_.last_step_action_ != StepNone &&
|
| + thread_local_.step_count_ == 0)) {
|
| // Notify debugger if a real break point is triggered or if performing
|
| // single stepping with no more steps to perform. Otherwise do another step.
|
|
|
| // Clear all current stepping setup.
|
| - debug->ClearStepping();
|
| + ClearStepping();
|
|
|
| // Notify the debug event listeners.
|
| - isolate->debugger()->OnDebugBreak(break_points_hit, false);
|
| - } else if (debug->thread_local_.last_step_action_ != StepNone) {
|
| + isolate_->debugger()->OnDebugBreak(break_points_hit, false);
|
| + } else if (thread_local_.last_step_action_ != StepNone) {
|
| // Hold on to last step action as it is cleared by the call to
|
| // ClearStepping.
|
| - StepAction step_action = debug->thread_local_.last_step_action_;
|
| - int step_count = debug->thread_local_.step_count_;
|
| + StepAction step_action = thread_local_.last_step_action_;
|
| + int step_count = thread_local_.step_count_;
|
|
|
| // Clear all current stepping setup.
|
| - debug->ClearStepping();
|
| + ClearStepping();
|
|
|
| // Set up for the remaining steps.
|
| - debug->PrepareStep(step_action, step_count);
|
| + PrepareStep(step_action, step_count);
|
| }
|
|
|
| - if (debug->thread_local_.frame_drop_mode_ == FRAMES_UNTOUCHED) {
|
| - debug->SetAfterBreakTarget(frame);
|
| - } else if (debug->thread_local_.frame_drop_mode_ ==
|
| + if (thread_local_.frame_drop_mode_ == FRAMES_UNTOUCHED) {
|
| + SetAfterBreakTarget(frame);
|
| + } else if (thread_local_.frame_drop_mode_ ==
|
| FRAME_DROPPED_IN_IC_CALL) {
|
| // We must have been calling IC stub. Do not go there anymore.
|
| - Code* plain_return =
|
| - Isolate::Current()->builtins()->builtin(
|
| - Builtins::kPlainReturn_LiveEdit);
|
| - debug->thread_local_.after_break_target_ = plain_return->entry();
|
| - } else if (debug->thread_local_.frame_drop_mode_ ==
|
| + Code* plain_return = isolate_->builtins()->builtin(
|
| + Builtins::kPlainReturn_LiveEdit);
|
| + thread_local_.after_break_target_ = plain_return->entry();
|
| + } else if (thread_local_.frame_drop_mode_ ==
|
| FRAME_DROPPED_IN_DEBUG_SLOT_CALL) {
|
| // Debug break slot stub does not return normally, instead it manually
|
| // cleans the stack and jumps. We should patch the jump address.
|
| - Code* plain_return = Isolate::Current()->builtins()->builtin(
|
| + Code* plain_return = isolate_->builtins()->builtin(
|
| Builtins::kFrameDropper_LiveEdit);
|
| - debug->thread_local_.after_break_target_ = plain_return->entry();
|
| - } else if (debug->thread_local_.frame_drop_mode_ ==
|
| + thread_local_.after_break_target_ = plain_return->entry();
|
| + } else if (thread_local_.frame_drop_mode_ ==
|
| FRAME_DROPPED_IN_DIRECT_CALL) {
|
| // Nothing to do, after_break_target is not used here.
|
| } else {
|
| @@ -1028,6 +1023,11 @@ Object* Debug::Break(RUNTIME_CALLING_CONVENTION) {
|
| }
|
|
|
|
|
| +RUNTIME_FUNCTION(Object*, Debug_Break) {
|
| + return isolate->debug()->Break(args);
|
| +}
|
| +
|
| +
|
| // Check the break point objects for whether one or more are actually
|
| // triggered. This function returns a JSArray with the break point objects
|
| // which is triggered.
|
|
|