Commit bd63de9c authored by Mircea Trofin's avatar Mircea Trofin Committed by Commit Bot

[wasm] Ensure serializability of JS_TO_WASM wrappers

On x64, we optimize out EmbeddedReferences, unless we explicitly
indicate serialization is enabled. We serialize js-to-wasm wrappers,
which include such references.

Bug: v8:7083
Change-Id: I976da4af74bf7ee3245e1465b8e47f2c042ec3b4
Reviewed-on: https://chromium-review.googlesource.com/780207Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Reviewed-by: 's avatarEric Holk <eholk@chromium.org>
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49546}
parent 09323a6a
......@@ -78,6 +78,11 @@ CodeGenerator::CodeGenerator(
CreateFrameAccessState(frame);
CHECK_EQ(info->is_osr(), osr_helper_.has_value());
tasm_.set_jump_optimization_info(jump_opt);
Code::Kind code_kind = info_->code_kind();
if (code_kind == Code::JS_TO_WASM_FUNCTION ||
code_kind == Code::WASM_FUNCTION) {
tasm_.enable_serializer();
}
}
void CodeGenerator::AddProtectedInstructionLanding(uint32_t instr_offset,
......
......@@ -1015,9 +1015,6 @@ class Isolate {
}
bool serializer_enabled() const { return serializer_enabled_; }
void set_serializer_enabled_for_test(bool serializer_enabled) {
serializer_enabled_ = serializer_enabled;
}
bool snapshot_available() const {
return snapshot_blob_ != nullptr && snapshot_blob_->raw_size != 0;
}
......
......@@ -321,10 +321,6 @@ class WasmSerializationTest {
WasmSerializationTest::BuildWireBytes(zone(), &buffer);
Isolate* serialization_isolate = CcTest::InitIsolateOnce();
// Isolates do not have serialization enabled by default. We must enable it
// here or else the assembler will not mark external references so that the
// serializer can handle them correctly.
serialization_isolate->set_serializer_enabled_for_test(true);
ErrorThrower thrower(serialization_isolate, "");
uint8_t* bytes = nullptr;
size_t bytes_size = 0;
......
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