| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/code_generator.h" | 5 #include "vm/code_generator.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/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 | 800 |
| 801 // Result of an invoke may be an unhandled exception, in which case we | 801 // Result of an invoke may be an unhandled exception, in which case we |
| 802 // rethrow it. | 802 // rethrow it. |
| 803 static void CheckResultError(const Object& result) { | 803 static void CheckResultError(const Object& result) { |
| 804 if (result.IsError()) { | 804 if (result.IsError()) { |
| 805 Exceptions::PropagateError(Error::Cast(result)); | 805 Exceptions::PropagateError(Error::Cast(result)); |
| 806 } | 806 } |
| 807 } | 807 } |
| 808 | 808 |
| 809 | 809 |
| 810 // Gets called from debug stub when code reaches a breakpoint before | |
| 811 // calling a closure. | |
| 812 DEFINE_RUNTIME_ENTRY(BreakpointClosureHandler, 0) { | |
| 813 ASSERT(arguments.ArgCount() == | |
| 814 kBreakpointClosureHandlerRuntimeEntry.argument_count()); | |
| 815 ASSERT(isolate->debugger() != NULL); | |
| 816 isolate->debugger()->SignalBpReached(); | |
| 817 } | |
| 818 | |
| 819 | |
| 820 // Gets called from debug stub when code reaches a breakpoint | 810 // Gets called from debug stub when code reaches a breakpoint |
| 821 // at the stub call to update the ic cache on equality comparison | 811 // set on a runtime stub call. |
| 822 // with null. | 812 DEFINE_RUNTIME_ENTRY(BreakpointRuntimeHandler, 0) { |
| 823 DEFINE_RUNTIME_ENTRY(BreakpointEqualNullHandler, 0) { | |
| 824 ASSERT(arguments.ArgCount() == | 813 ASSERT(arguments.ArgCount() == |
| 825 kBreakpointEqualNullHandlerRuntimeEntry.argument_count()); | 814 kBreakpointRuntimeHandlerRuntimeEntry.argument_count()); |
| 826 ASSERT(isolate->debugger() != NULL); | 815 ASSERT(isolate->debugger() != NULL); |
| 816 DartFrameIterator iterator; |
| 817 StackFrame* caller_frame = iterator.NextFrame(); |
| 818 ASSERT(caller_frame != NULL); |
| 819 uword orig_stub = |
| 820 isolate->debugger()->GetPatchedStubAddress(caller_frame->pc()); |
| 827 isolate->debugger()->SignalBpReached(); | 821 isolate->debugger()->SignalBpReached(); |
| 822 ASSERT((orig_stub & kSmiTagMask) == kSmiTag); |
| 823 arguments.SetReturn(Smi::Handle(reinterpret_cast<RawSmi*>(orig_stub))); |
| 828 } | 824 } |
| 829 | 825 |
| 830 | 826 |
| 831 // Gets called from debug stub when code reaches a breakpoint. | 827 // Gets called from debug stub when code reaches a breakpoint. |
| 832 DEFINE_RUNTIME_ENTRY(BreakpointStaticHandler, 0) { | 828 DEFINE_RUNTIME_ENTRY(BreakpointStaticHandler, 0) { |
| 833 ASSERT(arguments.ArgCount() == | 829 ASSERT(arguments.ArgCount() == |
| 834 kBreakpointStaticHandlerRuntimeEntry.argument_count()); | 830 kBreakpointStaticHandlerRuntimeEntry.argument_count()); |
| 835 ASSERT(isolate->debugger() != NULL); | 831 ASSERT(isolate->debugger() != NULL); |
| 836 isolate->debugger()->SignalBpReached(); | 832 isolate->debugger()->SignalBpReached(); |
| 837 // Make sure the static function that is about to be called is | 833 // Make sure the static function that is about to be called is |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1772 // Arg1: Value that is being stored. | 1768 // Arg1: Value that is being stored. |
| 1773 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { | 1769 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { |
| 1774 ASSERT(arguments.ArgCount() == kUpdateFieldCidRuntimeEntry.argument_count()); | 1770 ASSERT(arguments.ArgCount() == kUpdateFieldCidRuntimeEntry.argument_count()); |
| 1775 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); | 1771 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); |
| 1776 const Object& value = Object::Handle(arguments.ArgAt(1)); | 1772 const Object& value = Object::Handle(arguments.ArgAt(1)); |
| 1777 | 1773 |
| 1778 field.UpdateCid(value.GetClassId()); | 1774 field.UpdateCid(value.GetClassId()); |
| 1779 } | 1775 } |
| 1780 | 1776 |
| 1781 } // namespace dart | 1777 } // namespace dart |
| OLD | NEW |