}
-void StackGuard::CheckAndHandleGCInterrupt() {
+void StackGuard::HandleGCInterrupt() {
if (CheckAndClearInterrupt(GC_REQUEST)) {
isolate_->heap()->HandleGCRequest();
}
// If the stack guard is triggered, but it is not an actual
// stack overflow, then handle the interruption accordingly.
Object* HandleInterrupts();
-
- bool InterruptRequested() { return GetCurrentStackPosition() < climit(); }
-
- void CheckAndHandleGCInterrupt();
+ void HandleGCInterrupt();
private:
StackGuard();
explicit StackLimitCheck(Isolate* isolate) : isolate_(isolate) { }
// Use this to check for stack-overflows in C++ code.
- inline bool HasOverflowed() const {
+ bool HasOverflowed() const {
StackGuard* stack_guard = isolate_->stack_guard();
return GetCurrentStackPosition() < stack_guard->real_climit();
}
+ // Use this to check for interrupt request in C++ code.
+ bool InterruptRequested() {
+ StackGuard* stack_guard = isolate_->stack_guard();
+ return GetCurrentStackPosition() < stack_guard->climit();
+ }
+
// Use this to check for stack-overflow when entering runtime from JS code.
bool JsHasOverflowed(uintptr_t gap = 0) const;
return Handle<Object>::null();
}
- if (isolate_->stack_guard()->InterruptRequested()) {
+ if (stack_check.InterruptRequested()) {
ExecutionAccess access(isolate_);
// Avoid blocking GC in long running parser (v8:3974).
- isolate_->stack_guard()->CheckAndHandleGCInterrupt();
+ isolate_->stack_guard()->HandleGCInterrupt();
}
if (c0_ == '"') return ParseJsonString();