Commit c9f3d892 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

Move StackGuard::InterruptRequested into StackLimitCheck.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/1310253002

Cr-Commit-Position: refs/heads/master@{#30333}
parent c75af232
......@@ -626,7 +626,7 @@ Handle<String> Execution::GetStackTraceLine(Handle<Object> recv,
}
void StackGuard::CheckAndHandleGCInterrupt() {
void StackGuard::HandleGCInterrupt() {
if (CheckAndClearInterrupt(GC_REQUEST)) {
isolate_->heap()->HandleGCRequest();
}
......
......@@ -195,10 +195,7 @@ class StackGuard final {
// 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();
......
......@@ -1478,11 +1478,17 @@ class StackLimitCheck BASE_EMBEDDED {
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;
......
......@@ -263,10 +263,10 @@ Handle<Object> JsonParser<seq_one_byte>::ParseJsonValue() {
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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment