Index: src/asmjs/asm-js.cc |
diff --git a/src/asmjs/asm-js.cc b/src/asmjs/asm-js.cc |
index 191daed57f2d5fcafb9ea150cf969e9b746efd53..d9c85f1a2682cc39533dfce2a0ea719c23163419 100644 |
--- a/src/asmjs/asm-js.cc |
+++ b/src/asmjs/asm-js.cc |
@@ -153,17 +153,17 @@ bool IsStdlibMemberValid(i::Isolate* isolate, Handle<JSReceiver> stdlib, |
MaybeHandle<FixedArray> AsmJs::ConvertAsmToWasm(ParseInfo* info) { |
ErrorThrower thrower(info->isolate(), "Asm.js -> WebAssembly conversion"); |
- wasm::AsmTyper typer(info->isolate(), info->zone(), *(info->script()), |
- info->literal()); |
- if (!typer.Validate()) { |
- DCHECK(!info->isolate()->has_pending_exception()); |
- PrintF("Validation of asm.js module failed: %s\n", typer.error_message()); |
- return MaybeHandle<FixedArray>(); |
- } |
v8::internal::wasm::AsmWasmBuilder builder(info->isolate(), info->zone(), |
- info->literal(), &typer); |
+ info->ast_value_factory(), |
+ *info->script(), info->literal()); |
i::Handle<i::FixedArray> foreign_globals; |
auto asm_wasm_result = builder.Run(&foreign_globals); |
+ if (!asm_wasm_result.success) { |
+ DCHECK(!info->isolate()->has_pending_exception()); |
+ PrintF("Validation of asm.js module failed: %s\n", |
+ builder.typer()->error_message()); |
+ return MaybeHandle<FixedArray>(); |
+ } |
wasm::ZoneBuffer* module = asm_wasm_result.module_bytes; |
wasm::ZoneBuffer* asm_offsets = asm_wasm_result.asm_offset_table; |
@@ -173,7 +173,7 @@ MaybeHandle<FixedArray> AsmJs::ConvertAsmToWasm(ParseInfo* info) { |
asm_offsets->end()); |
DCHECK(!compiled.is_null()); |
- wasm::AsmTyper::StdlibSet uses = typer.StdlibUses(); |
+ wasm::AsmTyper::StdlibSet uses = builder.typer()->StdlibUses(); |
Handle<FixedArray> uses_array = |
info->isolate()->factory()->NewFixedArray(static_cast<int>(uses.size())); |
int count = 0; |