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

Unified Diff: src/asmjs/asm-js.cc

Issue 2398023002: [wasm] asm.js - Parse and convert asm.js to wasm a function at a time. (Closed)
Patch Set: Fix DCHECKS Created 4 years, 1 month 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 | « no previous file | src/asmjs/asm-typer.h » ('j') | src/asmjs/asm-typer.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(),
titzer 2016/11/29 14:57:37 Can you drop the v8::internal:: qualifiers?
bradn 2016/11/29 22:09:06 Done.
- info->literal(), &typer);
+ info->ast_value_factory(),
+ *info->script(), info->literal());
i::Handle<i::FixedArray> foreign_globals;
titzer 2016/11/29 14:57:37 I think you can drop the i::FixedArray qualificati
bradn 2016/11/29 22:09:06 Done.
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;
« no previous file with comments | « no previous file | src/asmjs/asm-typer.h » ('j') | src/asmjs/asm-typer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698