Commit 1ce0faed authored by jgruber's avatar jgruber Committed by Commit Bot

Extend Builtins::IsLazy with continuations

Continuations are called directly from the deoptimizer, and thus cannot
be lazy. This also changes the corresponding assertion to an
unconditional CHECK in order to catch this type of mistake early.

Drive-by: Sort Builtins::IsLazy.

Bug: chromium:823292
Change-Id: I739429ef574e40d7b9ba40cd209175054eb73349
Reviewed-on: https://chromium-review.googlesource.com/972282Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52094}
parent 79e6f35e
...@@ -230,32 +230,28 @@ bool Builtins::IsLazy(int index) { ...@@ -230,32 +230,28 @@ bool Builtins::IsLazy(int index) {
// TODO(wasm): Remove wasm builtins once immovability is no longer required. // TODO(wasm): Remove wasm builtins once immovability is no longer required.
switch (index) { switch (index) {
case kAbort: // Required by wasm. case kAbort: // Required by wasm.
case kArrayFindLoopEagerDeoptContinuation: // https://crbug.com/v8/6786. case kArrayEveryLoopEagerDeoptContinuation:
case kArrayFindLoopLazyDeoptContinuation: // https://crbug.com/v8/6786. case kArrayEveryLoopLazyDeoptContinuation:
// https://crbug.com/v8/6786. case kArrayFilterLoopEagerDeoptContinuation:
case kArrayFindLoopAfterCallbackLazyDeoptContinuation: case kArrayFilterLoopLazyDeoptContinuation:
// https://crbug.com/v8/6786. case kArrayFindIndexLoopAfterCallbackLazyDeoptContinuation:
case kArrayFindIndexLoopEagerDeoptContinuation: case kArrayFindIndexLoopEagerDeoptContinuation:
// https://crbug.com/v8/6786.
case kArrayFindIndexLoopLazyDeoptContinuation: case kArrayFindIndexLoopLazyDeoptContinuation:
// https://crbug.com/v8/6786. case kArrayFindLoopAfterCallbackLazyDeoptContinuation:
case kArrayFindIndexLoopAfterCallbackLazyDeoptContinuation: case kArrayFindLoopEagerDeoptContinuation:
case kArrayForEachLoopEagerDeoptContinuation: // https://crbug.com/v8/6786. case kArrayFindLoopLazyDeoptContinuation:
case kArrayForEachLoopLazyDeoptContinuation: // https://crbug.com/v8/6786. case kArrayForEachLoopEagerDeoptContinuation:
case kArrayMapLoopEagerDeoptContinuation: // https://crbug.com/v8/6786. case kArrayForEachLoopLazyDeoptContinuation:
case kArrayMapLoopLazyDeoptContinuation: // https://crbug.com/v8/6786. case kArrayMapLoopEagerDeoptContinuation:
case kArrayEveryLoopEagerDeoptContinuation: // https://crbug.com/v8/6786. case kArrayMapLoopLazyDeoptContinuation:
case kArrayEveryLoopLazyDeoptContinuation: // https://crbug.com/v8/6786. case kArrayReduceLoopEagerDeoptContinuation:
case kArrayFilterLoopEagerDeoptContinuation: // https://crbug.com/v8/6786. case kArrayReduceLoopLazyDeoptContinuation:
case kArrayFilterLoopLazyDeoptContinuation: // https://crbug.com/v8/6786.
case kArrayReducePreLoopEagerDeoptContinuation: case kArrayReducePreLoopEagerDeoptContinuation:
case kArrayReduceLoopEagerDeoptContinuation: // https://crbug.com/v8/6786.
case kArrayReduceLoopLazyDeoptContinuation: // https://crbug.com/v8/6786.
case kArrayReduceRightPreLoopEagerDeoptContinuation:
case kArrayReduceRightLoopEagerDeoptContinuation: case kArrayReduceRightLoopEagerDeoptContinuation:
case kArrayReduceRightLoopLazyDeoptContinuation: case kArrayReduceRightLoopLazyDeoptContinuation:
case kArraySomeLoopEagerDeoptContinuation: // https://crbug.com/v8/6786. case kArrayReduceRightPreLoopEagerDeoptContinuation:
case kArraySomeLoopLazyDeoptContinuation: // https://crbug.com/v8/6786. case kArraySomeLoopEagerDeoptContinuation:
case kArraySomeLoopLazyDeoptContinuation:
case kAsyncGeneratorAwaitCaught: // https://crbug.com/v8/6786. case kAsyncGeneratorAwaitCaught: // https://crbug.com/v8/6786.
case kAsyncGeneratorAwaitUncaught: // https://crbug.com/v8/6786. case kAsyncGeneratorAwaitUncaught: // https://crbug.com/v8/6786.
case kCompileLazy: case kCompileLazy:
...@@ -267,7 +263,7 @@ bool Builtins::IsLazy(int index) { ...@@ -267,7 +263,7 @@ bool Builtins::IsLazy(int index) {
case kInterpreterEnterBytecodeAdvance: case kInterpreterEnterBytecodeAdvance:
case kInterpreterEnterBytecodeDispatch: case kInterpreterEnterBytecodeDispatch:
case kInterpreterEntryTrampoline: case kInterpreterEntryTrampoline:
case kPromiseConstructorLazyDeoptContinuation: // https://crbug/v8/6786. case kPromiseConstructorLazyDeoptContinuation:
case kRecordWrite: // https://crbug.com/chromium/765301. case kRecordWrite: // https://crbug.com/chromium/765301.
case kThrowWasmTrapDivByZero: // Required by wasm. case kThrowWasmTrapDivByZero: // Required by wasm.
case kThrowWasmTrapDivUnrepresentable: // Required by wasm. case kThrowWasmTrapDivUnrepresentable: // Required by wasm.
...@@ -277,7 +273,9 @@ bool Builtins::IsLazy(int index) { ...@@ -277,7 +273,9 @@ bool Builtins::IsLazy(int index) {
case kThrowWasmTrapMemOutOfBounds: // Required by wasm. case kThrowWasmTrapMemOutOfBounds: // Required by wasm.
case kThrowWasmTrapRemByZero: // Required by wasm. case kThrowWasmTrapRemByZero: // Required by wasm.
case kThrowWasmTrapUnreachable: // Required by wasm. case kThrowWasmTrapUnreachable: // Required by wasm.
case kToBooleanLazyDeoptContinuation:
case kToNumber: // Required by wasm. case kToNumber: // Required by wasm.
case kTypedArrayConstructorLazyDeoptContinuation:
case kWasmCompileLazy: // Required by wasm. case kWasmCompileLazy: // Required by wasm.
case kWasmStackGuard: // Required by wasm. case kWasmStackGuard: // Required by wasm.
return false; return false;
......
...@@ -1398,7 +1398,7 @@ void Deoptimizer::DoComputeBuiltinContinuation( ...@@ -1398,7 +1398,7 @@ void Deoptimizer::DoComputeBuiltinContinuation(
BailoutId bailout_id = translated_frame->node_id(); BailoutId bailout_id = translated_frame->node_id();
Builtins::Name builtin_name = Builtins::GetBuiltinFromBailoutId(bailout_id); Builtins::Name builtin_name = Builtins::GetBuiltinFromBailoutId(bailout_id);
DCHECK(!Builtins::IsLazy(builtin_name)); CHECK(!Builtins::IsLazy(builtin_name));
Code* builtin = isolate()->builtins()->builtin(builtin_name); Code* builtin = isolate()->builtins()->builtin(builtin_name);
Callable continuation_callable = Callable continuation_callable =
Builtins::CallableFor(isolate(), builtin_name); Builtins::CallableFor(isolate(), builtin_name);
......
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