Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: runtime/vm/code_generator.cc

Issue 140793010: Eliminate another debugger stub (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/code_generator.h ('k') | runtime/vm/debugger_arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 ASSERT(caller_frame != NULL); 808 ASSERT(caller_frame != NULL);
809 uword orig_stub = 809 uword orig_stub =
810 isolate->debugger()->GetPatchedStubAddress(caller_frame->pc()); 810 isolate->debugger()->GetPatchedStubAddress(caller_frame->pc());
811 isolate->debugger()->SignalBpReached(); 811 isolate->debugger()->SignalBpReached();
812 ASSERT((orig_stub & kSmiTagMask) == kSmiTag); 812 ASSERT((orig_stub & kSmiTagMask) == kSmiTag);
813 arguments.SetReturn(Smi::Handle(reinterpret_cast<RawSmi*>(orig_stub))); 813 arguments.SetReturn(Smi::Handle(reinterpret_cast<RawSmi*>(orig_stub)));
814 } 814 }
815 815
816 816
817 // Gets called from debug stub when code reaches a breakpoint. 817 // Gets called from debug stub when code reaches a breakpoint.
818 DEFINE_RUNTIME_ENTRY(BreakpointStaticHandler, 0) {
819 ASSERT(isolate->debugger() != NULL);
820 isolate->debugger()->SignalBpReached();
821 // Make sure the static function that is about to be called is
822 // compiled. The stub will jump to the entry point without any
823 // further tests.
824 DartFrameIterator iterator;
825 StackFrame* caller_frame = iterator.NextFrame();
826 ASSERT(caller_frame != NULL);
827 const Code& code = Code::Handle(caller_frame->LookupDartCode());
828 ASSERT(!code.is_optimized());
829 const Function& function =
830 Function::Handle(CodePatcher::GetUnoptimizedStaticCallAt(
831 caller_frame->pc(), code, NULL));
832
833 if (!function.HasCode()) {
834 const Error& error = Error::Handle(Compiler::CompileFunction(function));
835 if (!error.IsNull()) {
836 Exceptions::PropagateError(error);
837 }
838 }
839 arguments.SetReturn(Code::ZoneHandle(function.CurrentCode()));
840 }
841
842
843 // Gets called from debug stub when code reaches a breakpoint.
844 DEFINE_RUNTIME_ENTRY(BreakpointDynamicHandler, 0) { 818 DEFINE_RUNTIME_ENTRY(BreakpointDynamicHandler, 0) {
845 ASSERT(isolate->debugger() != NULL); 819 ASSERT(isolate->debugger() != NULL);
846 isolate->debugger()->SignalBpReached(); 820 isolate->debugger()->SignalBpReached();
847 } 821 }
848 822
849 823
850 DEFINE_RUNTIME_ENTRY(SingleStepHandler, 0) { 824 DEFINE_RUNTIME_ENTRY(SingleStepHandler, 0) {
851 ASSERT(isolate->debugger() != NULL); 825 ASSERT(isolate->debugger() != NULL);
852 isolate->debugger()->SingleStepCallback(); 826 isolate->debugger()->SingleStepCallback();
853 } 827 }
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
1732 // of the given value. 1706 // of the given value.
1733 // Arg0: Field object; 1707 // Arg0: Field object;
1734 // Arg1: Value that is being stored. 1708 // Arg1: Value that is being stored.
1735 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { 1709 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) {
1736 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); 1710 const Field& field = Field::CheckedHandle(arguments.ArgAt(0));
1737 const Object& value = Object::Handle(arguments.ArgAt(1)); 1711 const Object& value = Object::Handle(arguments.ArgAt(1));
1738 field.UpdateGuardedCidAndLength(value); 1712 field.UpdateGuardedCidAndLength(value);
1739 } 1713 }
1740 1714
1741 } // namespace dart 1715 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.h ('k') | runtime/vm/debugger_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698