Chromium Code Reviews| Index: runtime/vm/code_generator.cc |
| diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc |
| index 652cdc25a7e6126c09cc072d077260351e0000fa..921bca2e71567c7f015b558bdfafa454ee90cc38 100644 |
| --- a/runtime/vm/code_generator.cc |
| +++ b/runtime/vm/code_generator.cc |
| @@ -677,6 +677,7 @@ static void CheckResultError(const Object& result) { |
| } |
| +#if !defined(TARGET_ARCH_DBC) |
| // Gets called from debug stub when code reaches a breakpoint |
| // set on a runtime stub call. |
| DEFINE_RUNTIME_ENTRY(BreakpointRuntimeHandler, 0) { |
| @@ -696,6 +697,20 @@ DEFINE_RUNTIME_ENTRY(BreakpointRuntimeHandler, 0) { |
| } |
| arguments.SetReturn(orig_stub); |
| } |
| +#else |
| +// Gets called from the simulator when the breakpoint is reached. |
| +DEFINE_RUNTIME_ENTRY(BreakpointRuntimeHandler, 0) { |
| + if (!FLAG_support_debugger) { |
| + UNREACHABLE(); |
| + return; |
| + } |
| + const Error& error = Error::Handle(isolate->debugger()->SignalBpReached()); |
| + if (!error.IsNull()) { |
| + Exceptions::PropagateError(error); |
| + UNREACHABLE(); |
| + } |
| +} |
| +#endif // !defined(TARGET_ARCH_DBC) |
| DEFINE_RUNTIME_ENTRY(SingleStepHandler, 0) { |
| @@ -1023,7 +1038,12 @@ DEFINE_RUNTIME_ENTRY(MegamorphicCacheMissHandler, 3) { |
| ASSERT(caller_frame->IsDartFrame()); |
| const Code& code = Code::Handle(zone, caller_frame->LookupDartCode()); |
| const Code& stub = |
| +#if !defined(TARGET_ARCH_DBC) |
| Code::Handle(zone, StubCode::MegamorphicLookup_entry()->code()); |
| +#else |
| + Code::Handle(); |
| + UNREACHABLE(); |
| +#endif |
| CodePatcher::PatchSwitchableCallAt(caller_frame->pc(), |
| code, ic_data, cache, stub); |
| } |
| @@ -1212,6 +1232,7 @@ DEFINE_RUNTIME_ENTRY(InvokeClosureNoSuchMethod, 3) { |
| } |
| +#if !defined(TARGET_ARCH_DBC) |
| static bool CanOptimizeFunction(const Function& function, Thread* thread) { |
| if (FLAG_support_debugger) { |
| Isolate* isolate = thread->isolate(); |
| @@ -1273,10 +1294,13 @@ static bool CanOptimizeFunction(const Function& function, Thread* thread) { |
| } |
| return true; |
| } |
| +#endif |
| DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { |
| -#if defined(USING_SIMULATOR) |
| +#if defined(TARGET_ARCH_DBC) |
| + uword stack_pos = Simulator::Current()->sp(); |
|
Florian Schneider
2016/04/12 02:29:58
Maybe just add a helper sp() to the other simulato
Vyacheslav Egorov (Google)
2016/04/12 09:01:21
Done.
|
| +#elif defined(USING_SIMULATOR) |
| uword stack_pos = Simulator::Current()->get_register(SPREG); |
| #else |
| uword stack_pos = Isolate::GetCurrentStackPointer(); |
| @@ -1289,7 +1313,7 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { |
| // If an interrupt happens at the same time as a stack overflow, we |
| // process the stack overflow now and leave the interrupt for next |
| // time. |
| - if (stack_pos < isolate->saved_stack_limit()) { |
| + if (IsCalleeFrameOf(isolate->saved_stack_limit(), stack_pos)) { |
| // Use the preallocated stack overflow exception to avoid calling |
| // into dart code. |
| const Instance& exception = |
| @@ -1369,6 +1393,7 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { |
| if ((stack_overflow_flags & Isolate::kOsrRequest) != 0) { |
| ASSERT(FLAG_use_osr); |
| +#if !defined(TARGET_ARCH_DBC) |
| DartFrameIterator iterator; |
| StackFrame* frame = iterator.NextFrame(); |
| ASSERT(frame != NULL); |
| @@ -1421,6 +1446,7 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { |
| frame->set_pc(optimized_entry); |
| frame->set_pc_marker(optimized_code.raw()); |
| } |
| +#endif |
|
Florian Schneider
2016/04/12 02:29:58
Maybe add TODO to add OSR support in the future?
Vyacheslav Egorov (Google)
2016/04/12 09:01:21
Done.
|
| } |
| } |
| @@ -1445,7 +1471,7 @@ DEFINE_RUNTIME_ENTRY(TraceICCall, 2) { |
| // The requesting function can be already optimized (reoptimization). |
| // Returns the Code object where to continue execution. |
| DEFINE_RUNTIME_ENTRY(OptimizeInvokedFunction, 1) { |
| -#if !defined(DART_PRECOMPILED_RUNTIME) |
| +#if !defined(DART_PRECOMPILED_RUNTIME) && !defined(TARGET_ARCH_DBC) |
| const Function& function = Function::CheckedHandle(zone, |
| arguments.ArgAt(0)); |
| ASSERT(!function.IsNull()); |