Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1413)

Unified Diff: src/wasm/wasm-js.cc

Issue 2299873002: [wasm] consolidate wasm and asm.js module compilation sequence (Closed)
Patch Set: [wasm] consolidate wasm and asm.js module compilation sequence Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | src/wasm/wasm-module.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-js.cc
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc
index 853a77f3ccaedfdb094c22b462885392812112a3..3c92223f9f6c9b5174be1b06fed81c9a2e2867d1 100644
--- a/src/wasm/wasm-js.cc
+++ b/src/wasm/wasm-js.cc
@@ -195,20 +195,9 @@ static i::MaybeHandle<i::JSObject> CreateModuleObject(
if (buffer.start == nullptr) return i::MaybeHandle<i::JSObject>();
DCHECK(source->IsArrayBuffer() || source->IsTypedArray());
- i::Zone zone(i_isolate->allocator());
- i::wasm::ModuleResult result = i::wasm::DecodeWasmModule(
- i_isolate, &zone, buffer.start, buffer.end, false, i::wasm::kWasmOrigin);
- std::unique_ptr<const i::wasm::WasmModule> decoded_module(result.val);
- if (result.failed()) {
- thrower->Failed("", result);
- return nothing;
- }
- i::MaybeHandle<i::FixedArray> compiled_module =
- decoded_module->CompileFunctions(i_isolate, thrower);
- if (compiled_module.is_null()) return nothing;
-
- return i::wasm::CreateCompiledModuleObject(i_isolate,
- compiled_module.ToHandleChecked());
+ return i::wasm::CreateModuleObjectFromBytes(
+ i_isolate, buffer.start, buffer.end, thrower,
+ i::wasm::ModuleOrigin::kWasmOrigin);
}
void WebAssemblyCompile(const v8::FunctionCallbackInfo<v8::Value>& args) {
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698