Commit 6d6d65a9 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[wasm] Prevent emitting calls to Abort in WasmCode.

This makes sure debug code in WasmCode traps immediately instead of
embedding a call to the Abort builtin, which would be Isolate specific.

R=clemensh@chromium.org
BUG=v8:7424

Change-Id: I08799d41b5e8d21b9f7af97d65f80a1594d9a613
Reviewed-on: https://chromium-review.googlesource.com/1095113
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53667}
parent faf64532
...@@ -90,6 +90,11 @@ CodeGenerator::CodeGenerator(Zone* codegen_zone, Frame* frame, Linkage* linkage, ...@@ -90,6 +90,11 @@ CodeGenerator::CodeGenerator(Zone* codegen_zone, Frame* frame, Linkage* linkage,
code_kind == Code::WASM_FUNCTION) { code_kind == Code::WASM_FUNCTION) {
tasm_.enable_serializer(); tasm_.enable_serializer();
} }
if (code_kind == Code::WASM_FUNCTION ||
code_kind == Code::WASM_TO_JS_FUNCTION ||
code_kind == Code::WASM_INTERPRETER_ENTRY) {
tasm_.set_trap_on_abort(true);
}
} }
bool CodeGenerator::wasm_runtime_exception_support() const { bool CodeGenerator::wasm_runtime_exception_support() const {
......
...@@ -337,7 +337,9 @@ void LiftoffAssembler::CacheState::Split(const CacheState& source) { ...@@ -337,7 +337,9 @@ void LiftoffAssembler::CacheState::Split(const CacheState& source) {
// TODO(clemensh): Provide a reasonably sized buffer, based on wasm function // TODO(clemensh): Provide a reasonably sized buffer, based on wasm function
// size. // size.
LiftoffAssembler::LiftoffAssembler(Isolate* isolate) LiftoffAssembler::LiftoffAssembler(Isolate* isolate)
: TurboAssembler(isolate, nullptr, 0, CodeObjectRequired::kNo) {} : TurboAssembler(isolate, nullptr, 0, CodeObjectRequired::kNo) {
set_trap_on_abort(true); // Avoid calls to Abort.
}
LiftoffAssembler::~LiftoffAssembler() { LiftoffAssembler::~LiftoffAssembler() {
if (num_locals_ > kInlineLocalTypes) { if (num_locals_ > kInlineLocalTypes) {
......
...@@ -225,8 +225,7 @@ void WasmCode::Validate() const { ...@@ -225,8 +225,7 @@ void WasmCode::Validate() const {
// limited set of builtins. This code will eventually be completely free // limited set of builtins. This code will eventually be completely free
// of {RelocInfo::CODE_TARGET} relocation entries altogether. // of {RelocInfo::CODE_TARGET} relocation entries altogether.
int builtin_index = code->builtin_index(); int builtin_index = code->builtin_index();
CHECK(builtin_index == Builtins::kAbort || CHECK(builtin_index == Builtins::kAllocateHeapNumber ||
builtin_index == Builtins::kAllocateHeapNumber ||
builtin_index == Builtins::kArgumentsAdaptorTrampoline || builtin_index == Builtins::kArgumentsAdaptorTrampoline ||
builtin_index == Builtins::kCall_ReceiverIsAny || builtin_index == Builtins::kCall_ReceiverIsAny ||
builtin_index == Builtins::kDoubleToI || builtin_index == Builtins::kDoubleToI ||
......
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