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

Unified Diff: runtime/vm/code_generator.cc

Issue 8775060: Debugger step 2 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 1987)
+++ runtime/vm/code_generator.cc (working copy)
@@ -9,6 +9,7 @@
#include "vm/compiler.h"
#include "vm/dart_api_impl.h"
#include "vm/dart_entry.h"
+#include "vm/debugger.h"
#include "vm/exceptions.h"
#include "vm/ic_data.h"
#include "vm/object_store.h"
@@ -471,23 +472,31 @@
// Gets called from debug stub when code reaches a breakpoint.
-DEFINE_RUNTIME_ENTRY(BreakpointHandler, 0) {
- ASSERT(arguments.Count() == kBreakpointHandlerRuntimeEntry.argument_count());
- DartFrameIterator iterator;
- DartFrame* frame = iterator.NextFrame();
- Function& func = Function::Handle();
- ASSERT(frame != NULL);
- OS::Print(">>> Breakpoint at 0x%08x\n", frame->pc());
- while (frame != NULL) {
- ASSERT(frame->IsValid());
- ASSERT(frame->IsDartFrame());
- func = frame->LookupDartFunction();
- OS::Print(" func %s\n", String::Handle(func.name()).ToCString());
- frame = iterator.NextFrame();
+// Arg0: function object of the static function that was about to be called.
+DEFINE_RUNTIME_ENTRY(BreakpointStaticHandler, 1) {
+ ASSERT(arguments.Count() ==
+ kBreakpointStaticHandlerRuntimeEntry.argument_count());
+ ASSERT(isolate->debugger() != NULL);
+ isolate->debugger()->BreakpointCallback();
+ // Make sure the static function that is about to be called is
+ // compiled. The stub will jump to the entry point without any
+ // further tests.
+ const Function& function = Function::CheckedHandle(arguments.At(0));
+ if (!function.HasCode()) {
+ Compiler::CompileFunction(function);
}
}
+// Gets called from debug stub when code reaches a breakpoint.
+DEFINE_RUNTIME_ENTRY(BreakpointDynamicHandler, 0) {
+ ASSERT(arguments.Count() ==
+ kBreakpointDynamicHandlerRuntimeEntry.argument_count());
+ ASSERT(isolate->debugger() != NULL);
+ isolate->debugger()->BreakpointCallback();
+}
+
+
// Handles inline cache misses by updating the IC data array of the call
// site.
// Arg0: Receiver object.

Powered by Google App Engine
This is Rietveld 408576698