Commit b1fb83d5 authored by mtrofin's avatar mtrofin Committed by Commit bot

Fix build error due to conflicting changes.

Strongly typing module_bytes needs a patch for the
serialization code.

Serialization bypasses module bytes, so their presence can't
be compulsory.

BUG=

Review-Url: https://codereview.chromium.org/2397303002
Cr-Commit-Position: refs/heads/master@{#40063}
parent 8c7a413c
......@@ -7189,7 +7189,8 @@ Local<String> WasmCompiledModule::GetUncompiledBytes() {
i::Handle<i::JSObject>::cast(Utils::OpenHandle(this));
i::Handle<i::wasm::WasmCompiledModule> compiled_part =
i::handle(i::wasm::WasmCompiledModule::cast(obj->GetInternalField(0)));
return Local<String>::Cast(Utils::ToLocal(compiled_part->module_bytes()));
i::Handle<i::String> module_bytes = compiled_part->module_bytes();
return Local<String>::Cast(Utils::ToLocal(module_bytes));
}
WasmCompiledModule::SerializedModule WasmCompiledModule::Serialize() {
......@@ -7198,7 +7199,8 @@ WasmCompiledModule::SerializedModule WasmCompiledModule::Serialize() {
i::Handle<i::wasm::WasmCompiledModule> compiled_part =
i::handle(i::wasm::WasmCompiledModule::cast(obj->GetInternalField(0)));
i::Handle<i::String> uncompiled_bytes = compiled_part->module_bytes();
i::Handle<i::SeqOneByteString> uncompiled_bytes =
compiled_part->module_bytes();
compiled_part->reset_module_bytes();
std::unique_ptr<i::ScriptData> script_data =
i::WasmCompiledModuleSerializer::SerializeWasmModule(obj->GetIsolate(),
......
......@@ -1892,13 +1892,6 @@ bool WasmCompiledModule::IsWasmCompiledModule(Object* obj) {
WCM_PROPERTY_TABLE(WCM_CHECK)
#undef WCM_CHECK
WasmCompiledModule* compiled_module =
reinterpret_cast<WasmCompiledModule*>(obj);
if (!compiled_module->has_module_bytes()) return false;
SeqOneByteString* module_bytes = compiled_module->ptr_to_module_bytes();
if (module_bytes->length() < 4) return false;
if (memcmp(module_bytes->GetChars(), "\0asm", 4)) return false;
// All checks passed.
return true;
}
......
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