Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 5fd30eb12a513da0e70dd11b579708c553d7aca7..9ec3c9b2896b4bc294853e6cd82b929d55b51547 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -2344,4 +2344,16 @@ void Isolate::RunMicrotasks() { |
} |
+bool StackLimitCheck::JsHasOverflowed() const { |
+ StackGuard* stack_guard = isolate_->stack_guard(); |
+#ifdef USE_SIMULATOR |
+ // The simulator uses a separate JS stack. |
+ Address jssp_address = Simulator::current(isolate_)->get_sp(); |
+ uintptr_t jssp = reinterpret_cast<uintptr_t>(jssp_address); |
+ if (jssp < stack_guard->real_jslimit()) return true; |
+#endif // USE_SIMULATOR |
+ return reinterpret_cast<uintptr_t>(this) < stack_guard->real_climit(); |
+} |
+ |
+ |
} } // namespace v8::internal |