OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/runtime_entry.h" | 5 #include "vm/runtime_entry.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
9 #include "vm/code_patcher.h" | 9 #include "vm/code_patcher.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 } | 763 } |
764 | 764 |
765 // Result of an invoke may be an unhandled exception, in which case we | 765 // Result of an invoke may be an unhandled exception, in which case we |
766 // rethrow it. | 766 // rethrow it. |
767 static void CheckResultError(const Object& result) { | 767 static void CheckResultError(const Object& result) { |
768 if (result.IsError()) { | 768 if (result.IsError()) { |
769 Exceptions::PropagateError(Error::Cast(result)); | 769 Exceptions::PropagateError(Error::Cast(result)); |
770 } | 770 } |
771 } | 771 } |
772 | 772 |
773 #if !defined(TARGET_ARCH_DBC) | 773 #if defined(PRODUCT) |
| 774 DEFINE_RUNTIME_ENTRY(BreakpointRuntimeHandler, 0) { |
| 775 UNREACHABLE(); |
| 776 return; |
| 777 } |
| 778 #elif !defined(TARGET_ARCH_DBC) |
774 // Gets called from debug stub when code reaches a breakpoint | 779 // Gets called from debug stub when code reaches a breakpoint |
775 // set on a runtime stub call. | 780 // set on a runtime stub call. |
776 DEFINE_RUNTIME_ENTRY(BreakpointRuntimeHandler, 0) { | 781 DEFINE_RUNTIME_ENTRY(BreakpointRuntimeHandler, 0) { |
777 if (!FLAG_support_debugger) { | 782 if (!FLAG_support_debugger) { |
778 UNREACHABLE(); | 783 UNREACHABLE(); |
779 return; | 784 return; |
780 } | 785 } |
781 DartFrameIterator iterator(thread, | 786 DartFrameIterator iterator(thread, |
782 StackFrameIterator::kNoCrossThreadIteration); | 787 StackFrameIterator::kNoCrossThreadIteration); |
783 StackFrame* caller_frame = iterator.NextFrame(); | 788 StackFrame* caller_frame = iterator.NextFrame(); |
(...skipping 17 matching lines...) Expand all Loading... |
801 } | 806 } |
802 const Error& error = Error::Handle(isolate->debugger()->PauseBreakpoint()); | 807 const Error& error = Error::Handle(isolate->debugger()->PauseBreakpoint()); |
803 if (!error.IsNull()) { | 808 if (!error.IsNull()) { |
804 Exceptions::PropagateError(error); | 809 Exceptions::PropagateError(error); |
805 UNREACHABLE(); | 810 UNREACHABLE(); |
806 } | 811 } |
807 } | 812 } |
808 #endif // !defined(TARGET_ARCH_DBC) | 813 #endif // !defined(TARGET_ARCH_DBC) |
809 | 814 |
810 DEFINE_RUNTIME_ENTRY(SingleStepHandler, 0) { | 815 DEFINE_RUNTIME_ENTRY(SingleStepHandler, 0) { |
| 816 #if defined(PRODUCT) |
| 817 UNREACHABLE(); |
| 818 return; |
| 819 #else |
811 if (!FLAG_support_debugger) { | 820 if (!FLAG_support_debugger) { |
812 UNREACHABLE(); | 821 UNREACHABLE(); |
813 return; | 822 return; |
814 } | 823 } |
815 const Error& error = | 824 const Error& error = |
816 Error::Handle(zone, isolate->debugger()->PauseStepping()); | 825 Error::Handle(zone, isolate->debugger()->PauseStepping()); |
817 if (!error.IsNull()) { | 826 if (!error.IsNull()) { |
818 Exceptions::PropagateError(error); | 827 Exceptions::PropagateError(error); |
819 UNREACHABLE(); | 828 UNREACHABLE(); |
820 } | 829 } |
| 830 #endif |
821 } | 831 } |
822 | 832 |
823 // An instance call of the form o.f(...) could not be resolved. Check if | 833 // An instance call of the form o.f(...) could not be resolved. Check if |
824 // there is a getter with the same name. If so, invoke it. If the value is | 834 // there is a getter with the same name. If so, invoke it. If the value is |
825 // a closure, invoke it with the given arguments. If the value is a | 835 // a closure, invoke it with the given arguments. If the value is a |
826 // non-closure, attempt to invoke "call" on it. | 836 // non-closure, attempt to invoke "call" on it. |
827 static bool ResolveCallThroughGetter(const Instance& receiver, | 837 static bool ResolveCallThroughGetter(const Instance& receiver, |
828 const Class& receiver_class, | 838 const Class& receiver_class, |
829 const String& target_name, | 839 const String& target_name, |
830 const Array& arguments_descriptor, | 840 const Array& arguments_descriptor, |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1684 JSONStream js; | 1694 JSONStream js; |
1685 // Maybe adjust the rate of future reloads. | 1695 // Maybe adjust the rate of future reloads. |
1686 isolate->MaybeIncreaseReloadEveryNStackOverflowChecks(); | 1696 isolate->MaybeIncreaseReloadEveryNStackOverflowChecks(); |
1687 // Issue a reload. | 1697 // Issue a reload. |
1688 bool success = isolate->ReloadSources(&js, true /* force_reload */); | 1698 bool success = isolate->ReloadSources(&js, true /* force_reload */); |
1689 if (!success) { | 1699 if (!success) { |
1690 FATAL1("*** Isolate reload failed:\n%s\n", js.ToCString()); | 1700 FATAL1("*** Isolate reload failed:\n%s\n", js.ToCString()); |
1691 } | 1701 } |
1692 #endif | 1702 #endif |
1693 } | 1703 } |
| 1704 #if !defined(PRODUCT) |
1694 if (FLAG_support_debugger && do_stacktrace) { | 1705 if (FLAG_support_debugger && do_stacktrace) { |
1695 String& var_name = String::Handle(); | 1706 String& var_name = String::Handle(); |
1696 Instance& var_value = Instance::Handle(); | 1707 Instance& var_value = Instance::Handle(); |
1697 // Collecting the stack trace and accessing local variables | 1708 // Collecting the stack trace and accessing local variables |
1698 // of frames may trigger parsing of functions to compute | 1709 // of frames may trigger parsing of functions to compute |
1699 // variable descriptors of functions. Parsing may trigger | 1710 // variable descriptors of functions. Parsing may trigger |
1700 // code execution, e.g. to compute compile-time constants. Thus, | 1711 // code execution, e.g. to compute compile-time constants. Thus, |
1701 // disable FLAG_stacktrace_every during trace collection to prevent | 1712 // disable FLAG_stacktrace_every during trace collection to prevent |
1702 // recursive stack trace collection. | 1713 // recursive stack trace collection. |
1703 intptr_t saved_stacktrace_every = FLAG_stacktrace_every; | 1714 intptr_t saved_stacktrace_every = FLAG_stacktrace_every; |
(...skipping 12 matching lines...) Expand all Loading... |
1716 TokenPosition unused = TokenPosition::kNoSource; | 1727 TokenPosition unused = TokenPosition::kNoSource; |
1717 for (intptr_t v = 0; v < num_vars; v++) { | 1728 for (intptr_t v = 0; v < num_vars; v++) { |
1718 frame->VariableAt(v, &var_name, &unused, &unused, &unused, &var_value); | 1729 frame->VariableAt(v, &var_name, &unused, &unused, &unused, &var_value); |
1719 } | 1730 } |
1720 } | 1731 } |
1721 if (FLAG_stress_async_stacks) { | 1732 if (FLAG_stress_async_stacks) { |
1722 Debugger::CollectAwaiterReturnStackTrace(); | 1733 Debugger::CollectAwaiterReturnStackTrace(); |
1723 } | 1734 } |
1724 FLAG_stacktrace_every = saved_stacktrace_every; | 1735 FLAG_stacktrace_every = saved_stacktrace_every; |
1725 } | 1736 } |
| 1737 #endif // !defined(PRODUCT) |
1726 | 1738 |
1727 const Error& error = Error::Handle(thread->HandleInterrupts()); | 1739 const Error& error = Error::Handle(thread->HandleInterrupts()); |
1728 if (!error.IsNull()) { | 1740 if (!error.IsNull()) { |
1729 Exceptions::PropagateError(error); | 1741 Exceptions::PropagateError(error); |
1730 UNREACHABLE(); | 1742 UNREACHABLE(); |
1731 } | 1743 } |
1732 | 1744 |
1733 if ((stack_overflow_flags & Thread::kOsrRequest) != 0) { | 1745 if ((stack_overflow_flags & Thread::kOsrRequest) != 0) { |
1734 ASSERT(isolate->use_osr()); | 1746 ASSERT(isolate->use_osr()); |
1735 DartFrameIterator iterator(thread, | 1747 DartFrameIterator iterator(thread, |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2365 true /* is_float */, | 2377 true /* is_float */, |
2366 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&tan))); | 2378 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&tan))); |
2367 | 2379 |
2368 DEFINE_RAW_LEAF_RUNTIME_ENTRY( | 2380 DEFINE_RAW_LEAF_RUNTIME_ENTRY( |
2369 LibcAtan, | 2381 LibcAtan, |
2370 1, | 2382 1, |
2371 true /* is_float */, | 2383 true /* is_float */, |
2372 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&atan))); | 2384 reinterpret_cast<RuntimeFunction>(static_cast<UnaryMathCFunction>(&atan))); |
2373 | 2385 |
2374 } // namespace dart | 2386 } // namespace dart |
OLD | NEW |