OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "execution.h" | 5 #include "execution.h" |
6 | 6 |
7 #include "bootstrapper.h" | 7 #include "bootstrapper.h" |
8 #include "codegen.h" | 8 #include "codegen.h" |
9 #include "deoptimizer.h" | 9 #include "deoptimizer.h" |
10 #include "isolate-inl.h" | 10 #include "isolate-inl.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 #ifdef VERIFY_HEAP | 97 #ifdef VERIFY_HEAP |
98 value->ObjectVerify(); | 98 value->ObjectVerify(); |
99 #endif | 99 #endif |
100 | 100 |
101 // Update the pending exception flag and return the value. | 101 // Update the pending exception flag and return the value. |
102 bool has_exception = value->IsException(); | 102 bool has_exception = value->IsException(); |
103 ASSERT(has_exception == isolate->has_pending_exception()); | 103 ASSERT(has_exception == isolate->has_pending_exception()); |
104 if (has_exception) { | 104 if (has_exception) { |
105 isolate->ReportPendingMessages(); | 105 isolate->ReportPendingMessages(); |
106 // Reset stepping state when script exits with uncaught exception. | 106 // Reset stepping state when script exits with uncaught exception. |
107 if (isolate->debugger()->is_active()) { | 107 if (isolate->debug()->is_active()) { |
108 isolate->debug()->ClearStepping(); | 108 isolate->debug()->ClearStepping(); |
109 } | 109 } |
110 return MaybeHandle<Object>(); | 110 return MaybeHandle<Object>(); |
111 } else { | 111 } else { |
112 isolate->clear_pending_message(); | 112 isolate->clear_pending_message(); |
113 } | 113 } |
114 | 114 |
115 return Handle<Object>(value, isolate); | 115 return Handle<Object>(value, isolate); |
116 } | 116 } |
117 | 117 |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 | 655 |
656 | 656 |
657 void Execution::DebugBreakHelper(Isolate* isolate) { | 657 void Execution::DebugBreakHelper(Isolate* isolate) { |
658 // Just continue if breaks are disabled. | 658 // Just continue if breaks are disabled. |
659 if (isolate->debug()->disable_break()) return; | 659 if (isolate->debug()->disable_break()) return; |
660 | 660 |
661 // Ignore debug break during bootstrapping. | 661 // Ignore debug break during bootstrapping. |
662 if (isolate->bootstrapper()->IsActive()) return; | 662 if (isolate->bootstrapper()->IsActive()) return; |
663 | 663 |
664 // Ignore debug break if debugger is not active. | 664 // Ignore debug break if debugger is not active. |
665 if (!isolate->debugger()->is_active()) return; | 665 if (!isolate->debug()->is_active()) return; |
666 | 666 |
667 StackLimitCheck check(isolate); | 667 StackLimitCheck check(isolate); |
668 if (check.HasOverflowed()) return; | 668 if (check.HasOverflowed()) return; |
669 | 669 |
670 { JavaScriptFrameIterator it(isolate); | 670 { JavaScriptFrameIterator it(isolate); |
671 ASSERT(!it.done()); | 671 ASSERT(!it.done()); |
672 Object* fun = it.frame()->function(); | 672 Object* fun = it.frame()->function(); |
673 if (fun && fun->IsJSFunction()) { | 673 if (fun && fun->IsJSFunction()) { |
674 // Don't stop in builtin functions. | 674 // Don't stop in builtin functions. |
675 if (JSFunction::cast(fun)->IsBuiltin()) return; | 675 if (JSFunction::cast(fun)->IsBuiltin()) return; |
(...skipping 20 matching lines...) Expand all Loading... |
696 StackLimitCheck check(isolate); | 696 StackLimitCheck check(isolate); |
697 if (check.HasOverflowed()) return; | 697 if (check.HasOverflowed()) return; |
698 | 698 |
699 HandleScope scope(isolate); | 699 HandleScope scope(isolate); |
700 // Enter the debugger. Just continue if we fail to enter the debugger. | 700 // Enter the debugger. Just continue if we fail to enter the debugger. |
701 EnterDebugger debugger(isolate); | 701 EnterDebugger debugger(isolate); |
702 if (debugger.FailedToEnter()) return; | 702 if (debugger.FailedToEnter()) return; |
703 | 703 |
704 // Notify the debug event listeners. Indicate auto continue if the break was | 704 // Notify the debug event listeners. Indicate auto continue if the break was |
705 // a debug command break. | 705 // a debug command break. |
706 isolate->debugger()->OnDebugBreak(isolate->factory()->undefined_value(), | 706 isolate->debug()->OnDebugBreak(isolate->factory()->undefined_value(), |
707 debug_command_only); | 707 debug_command_only); |
708 } | 708 } |
709 | 709 |
710 | 710 |
711 Object* StackGuard::HandleInterrupts() { | 711 Object* StackGuard::HandleInterrupts() { |
712 bool has_api_interrupt = false; | 712 bool has_api_interrupt = false; |
713 { | 713 { |
714 ExecutionAccess access(isolate_); | 714 ExecutionAccess access(isolate_); |
715 if (should_postpone_interrupts(access)) { | 715 if (should_postpone_interrupts(access)) { |
716 return isolate_->heap()->undefined_value(); | 716 return isolate_->heap()->undefined_value(); |
717 } | 717 } |
(...skipping 28 matching lines...) Expand all Loading... |
746 | 746 |
747 if (has_api_interrupt) { | 747 if (has_api_interrupt) { |
748 // Callback must be invoked outside of ExecusionAccess lock. | 748 // Callback must be invoked outside of ExecusionAccess lock. |
749 isolate_->InvokeApiInterruptCallback(); | 749 isolate_->InvokeApiInterruptCallback(); |
750 } | 750 } |
751 | 751 |
752 return isolate_->heap()->undefined_value(); | 752 return isolate_->heap()->undefined_value(); |
753 } | 753 } |
754 | 754 |
755 } } // namespace v8::internal | 755 } } // namespace v8::internal |
OLD | NEW |