@@ -603,30 +603,34 @@ DART_NOINLINE bool Interpreter::InvokeCompiled(Thread* thread,
603603 InterpreterSetjmpBuffer buffer (this );
604604 if (!DART_SETJMP (buffer.buffer_ )) {
605605#if defined(DART_INCLUDE_SIMULATOR)
606- // We need to beware that bouncing between the interpreter and the
607- // simulator may exhaust the C stack before exhausting either the
608- // interpreter or simulator stacks.
609- if (!thread->os_thread ()->HasStackHeadroom ()) {
610- thread->SetStackLimit (-1 );
611- }
612- result = bit_copy<ObjectPtr, int64_t >(Simulator::Current ()->Call (
613- reinterpret_cast <intptr_t >(entrypoint),
606+ if (FLAG_use_simulator) {
607+ // We need to beware that bouncing between the interpreter and the
608+ // simulator may exhaust the C stack before exhausting either the
609+ // interpreter or simulator stacks.
610+ if (!thread->os_thread ()->HasStackHeadroom ()) {
611+ thread->SetStackLimit (-1 );
612+ }
613+ result = bit_copy<ObjectPtr, int64_t >(Simulator::Current ()->Call (
614+ reinterpret_cast <intptr_t >(entrypoint),
614615#if defined(DART_PRECOMPILED_RUNTIME)
615- static_cast <intptr_t >(function->untag ()->entry_point_ ),
616+ static_cast <intptr_t >(function->untag ()->entry_point_ ),
616617#else
617- static_cast <intptr_t >(function->untag ()->code ()),
618+ static_cast <intptr_t >(function->untag ()->code ()),
618619#endif
619- static_cast <intptr_t >(argdesc_),
620- reinterpret_cast <intptr_t >(call_base),
621- reinterpret_cast <intptr_t >(thread)));
622- #else
623- result = static_cast <ObjectPtr>(entrypoint (
620+ static_cast <intptr_t >(argdesc_),
621+ reinterpret_cast <intptr_t >(call_base),
622+ reinterpret_cast <intptr_t >(thread)));
623+ } else {
624+ #endif
625+ result = static_cast <ObjectPtr>(entrypoint (
624626#if defined(DART_PRECOMPILED_RUNTIME)
625- function->untag ()->entry_point_ ,
627+ function->untag ()->entry_point_ ,
626628#else
627629 static_cast <uword>(function->untag ()->code ()),
628630#endif
629- static_cast <uword>(argdesc_), call_base, thread));
631+ static_cast <uword>(argdesc_), call_base, thread));
632+ #if defined(DART_INCLUDE_SIMULATOR)
633+ }
630634#endif
631635 ASSERT (thread->vm_tag () == VMTag::kDartInterpretedTagId );
632636 ASSERT (thread->execution_state () == Thread::kThreadInGenerated );
0 commit comments