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

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

Issue 2299873002: [wasm] consolidate wasm and asm.js module compilation sequence (Closed)
Patch Set: 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
Index: src/wasm/wasm-js.cc
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc
index 853a77f3ccaedfdb094c22b462885392812112a3..020996e2e18f3f4869f5e3faefb337d5f92591c8 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, false,
+ i::wasm::ModuleOrigin::kWasmOrigin);
}
void WebAssemblyCompile(const v8::FunctionCallbackInfo<v8::Value>& args) {
@@ -350,10 +339,6 @@ void WasmJs::Install(Isolate* isolate, Handle<JSGlobalObject> global) {
Handle<Context> context(global->native_context(), isolate);
InstallWasmFunctionMap(isolate, context);
- if (!FLAG_expose_wasm) {
bradnelson 2016/09/01 03:48:31 I don't think you want to drop this. This will mak
Mircea Trofin 2016/09/01 04:36:17 Done.
- return;
- }
-
// Bind the experimental WASM object.
// TODO(rossberg, titzer): remove once it's no longer needed.
{
« no previous file with comments | « src/asmjs/asm-js.cc ('k') | src/wasm/wasm-module.h » ('j') | src/wasm/wasm-module.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698