Chromium Code Reviews| Index: src/compiler.cc |
| diff --git a/src/compiler.cc b/src/compiler.cc |
| index 2a0eda0a551229eface54be75d02400b6c0be6ff..8eb37453c4ad31352fa7eb37a58236003aa526a2 100644 |
| --- a/src/compiler.cc |
| +++ b/src/compiler.cc |
| @@ -31,6 +31,7 @@ |
| #include "src/snapshot/code-serializer.h" |
| #include "src/typing-asm.h" |
| #include "src/vm-state-inl.h" |
| +#include "src/wasm/wasm-js.h" |
| namespace v8 { |
| namespace internal { |
| @@ -470,17 +471,17 @@ int CodeAndMetadataSize(CompilationInfo* info) { |
| bool GenerateUnoptimizedCode(CompilationInfo* info) { |
| bool success; |
| EnsureFeedbackMetadata(info); |
| +#if defined(V8_TARGET_ARCH_X64) |
| + // TODO(bradnelson): Implement builtin and enable for other arches. |
| if (FLAG_validate_asm && info->scope()->asm_module()) { |
| - AsmTyper typer(info->isolate(), info->zone(), *(info->script()), |
| - info->literal()); |
| - if (FLAG_enable_simd_asmjs) { |
| - typer.set_allow_simd(true); |
| - } |
| - if (!typer.Validate()) { |
| - DCHECK(!info->isolate()->has_pending_exception()); |
| - PrintF("Validation of asm.js module failed: %s", typer.error_message()); |
| + Handle<FixedArray> wasm_data; |
| + if (WasmJs::ConvertAsmToWasm(info->parse_info(), true, &wasm_data)) { |
| + info->shared_info()->set_asm_wasm_data(*wasm_data); |
| + info->SetCode(info->isolate()->builtins()->InstantiateAsmJs()); |
| + return true; |
| } |
| } |
| +#endif |
| if (FLAG_ignition && UseIgnition(info)) { |
| success = interpreter::Interpreter::MakeBytecode(info); |
| } else { |
| @@ -731,6 +732,10 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function, |
| Isolate* isolate = function->GetIsolate(); |
| Handle<SharedFunctionInfo> shared(function->shared(), isolate); |
| + if (shared->HasAsmWasmData()) { |
|
Michael Starzinger
2016/06/29 08:29:23
Can you elaborate on this guard. Is this needed fo
bradn
2016/06/30 07:59:36
Not needed. Leftover from prior ignorance on my pa
|
| + return MaybeHandle<Code>(); |
| + } |
| + |
| Handle<Code> cached_code; |
| if (GetCodeFromOptimizedCodeMap(function, osr_ast_id) |
| .ToHandle(&cached_code)) { |