Commit 4529cb7b authored by bradnelson's avatar bradnelson Committed by Commit bot

Adding flag for simd.js + asm->wasm.

Make it possible to switch on simd.js support when combined with asm.js
in the asm->wasm path.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=test-asm-validator
R=gdeepti@chromium.org,titzer@chromium.org
LOG=N

Review URL: https://codereview.chromium.org/1643333002

Cr-Commit-Position: refs/heads/master@{#33644}
parent 8f89ad74
......@@ -483,6 +483,8 @@ DEFINE_BOOL(trace_wasm_ast, false, "dump AST after WASM decode")
DEFINE_BOOL(wasm_break_on_decoder_error, false,
"debug break when wasm decoder encounters an error")
DEFINE_BOOL(enable_simd_asmjs, false, "enable SIMD.js in asm.js stdlib")
DEFINE_INT(typed_array_max_size_in_heap, 64,
"threshold for in-heap typed array")
......
......@@ -22,7 +22,7 @@ class AsmTyper : public AstVisitor {
explicit AsmTyper(Isolate* isolate, Zone* zone, Script* script,
FunctionLiteral* root);
bool Validate();
void set_allow_simd(bool simd);
void set_allow_simd(bool simd) { allow_simd_ = simd; }
const char* error_message() { return error_message_; }
enum StandardMember {
......
......@@ -141,6 +141,9 @@ v8::internal::wasm::WasmModuleIndex* TranslateAsmModule(i::ParseInfo* info,
v8::internal::AsmTyper typer(info->isolate(), info->zone(), *(info->script()),
info->literal());
if (i::FLAG_enable_simd_asmjs) {
typer.set_allow_simd(true);
}
if (!typer.Validate()) {
thrower->Error("Asm.js validation failed: %s", typer.error_message());
return nullptr;
......
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