Chromium Code Reviews| Index: runtime/vm/isolate.cc |
| diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc |
| index 4b1124785de7ad9019f6e452420de901fca1c876..9b9722acbc25e85f6f1fc0631078fee3f1367cca 100644 |
| --- a/runtime/vm/isolate.cc |
| +++ b/runtime/vm/isolate.cc |
| @@ -982,8 +982,13 @@ Isolate* Isolate::Init(const char* name_prefix, |
| uword Isolate::GetCurrentStackPointer() { |
| // Since AddressSanitizer's detect_stack_use_after_return instruments the |
| // C++ code to give out fake stack addresses, we call a stub in that case. |
| - uword (*func)() = reinterpret_cast<uword (*)()>( |
| - StubCode::GetStackPointer_entry()->EntryPoint()); |
| + uword (*func)() = |
| +#if !defined(TARGET_ARCH_DBC) |
| + reinterpret_cast<uword (*)()>( |
| + StubCode::GetStackPointer_entry()->EntryPoint()); |
| +#else |
| + NULL; |
| +#endif |
| // But for performance (and to support simulators), we normally use a local. |
| #if defined(__has_feature) |
| #if __has_feature(address_sanitizer) |
| @@ -1056,14 +1061,18 @@ void Isolate::BuildName(const char* name_prefix) { |
| void Isolate::SetStackLimitFromStackBase(uword stack_base) { |
| // Set stack limit. |
| +#if !defined(TARGET_ARCH_DBC) |
| #if defined(USING_SIMULATOR) |
| // Ignore passed-in native stack top and use Simulator stack top. |
| Simulator* sim = Simulator::Current(); // May allocate a simulator. |
| ASSERT(simulator() == sim); // This isolate's simulator is the current one. |
| stack_base = sim->StackTop(); |
| // The overflow area is accounted for by the simulator. |
| -#endif |
| +#endif // defined(USING_SIMULATOR) |
| SetStackLimit(stack_base - OSThread::GetSpecifiedStackSize()); |
| +#else |
| + SetStackLimit(Simulator::Current()->StackTop()); |
| +#endif // !defined(TARGET_ARCH_DBC) |
| } |
| @@ -1502,7 +1511,13 @@ void Isolate::ScheduleInterrupts(uword interrupt_bits) { |
| } |
| if (stack_limit_ == saved_stack_limit_) { |
| + // On DBC stack is growing upwards so interrupt limit is 0 unlike on all |
| + // other architectures. |
| +#if !defined(TARGET_ARCH_DBC) |
|
zra
2016/04/14 18:27:49
Maybe instead of #if defined, add a function to s
Vyacheslav Egorov (Google)
2016/04/18 15:56:42
Done.
|
| stack_limit_ = (~static_cast<uword>(0)) & ~kInterruptsMask; |
| +#else |
| + stack_limit_ = 0; |
| +#endif |
| } |
| stack_limit_ |= interrupt_bits; |
| } |
| @@ -1549,7 +1564,13 @@ void Isolate::RestoreOOBMessageInterrupts() { |
| deferred_interrupts_mask_ = 0; |
| if (deferred_interrupts_ != 0) { |
| if (stack_limit_ == saved_stack_limit_) { |
| + // On DBC stack is growing upwards so interrupt limit is 0 unlike on all |
| + // other architectures. |
| +#if !defined(TARGET_ARCH_DBC) |
|
zra
2016/04/14 18:27:48
ditto
Vyacheslav Egorov (Google)
2016/04/18 15:56:42
Done.
|
| stack_limit_ = (~static_cast<uword>(0)) & ~kInterruptsMask; |
| +#else |
| + stack_limit_ = 0; |
| +#endif |
| } |
| stack_limit_ |= deferred_interrupts_; |
| deferred_interrupts_ = 0; |