Chromium Code Reviews| Index: src/compiler.cc |
| diff --git a/src/compiler.cc b/src/compiler.cc |
| index af71a313fd4b573318df2360fbdd201c05d70386..5f4b0f459f4005f5ed9f4033829bce59c8822b5a 100644 |
| --- a/src/compiler.cc |
| +++ b/src/compiler.cc |
| @@ -476,7 +476,8 @@ int CodeAndMetadataSize(CompilationInfo* info) { |
| bool GenerateUnoptimizedCode(CompilationInfo* info) { |
| bool success; |
| EnsureFeedbackMetadata(info); |
| - if (FLAG_validate_asm && info->scope()->asm_module()) { |
| + if (FLAG_validate_asm && info->scope()->asm_module() && |
| + !info->shared_info()->HasAsmWasmData()) { |
|
Michael Starzinger
2016/08/11 11:44:10
As mentioned in my previous comment, we could go w
bradn
2016/08/12 01:17:09
Done.
|
| MaybeHandle<FixedArray> wasm_data; |
| wasm_data = AsmJs::ConvertAsmToWasm(info->parse_info()); |
| if (!wasm_data.is_null()) { |
| @@ -485,6 +486,9 @@ bool GenerateUnoptimizedCode(CompilationInfo* info) { |
| return true; |
| } |
| } |
| + if (info->shared_info()->HasAsmWasmData()) { |
| + info->shared_info()->ClearAsmWasmData(); |
| + } |
| if (ShouldUseIgnition(info)) { |
| success = interpreter::Interpreter::MakeBytecode(info); |
| } else { |
| @@ -1009,7 +1013,10 @@ MaybeHandle<Code> GetBaselineCode(Handle<JSFunction> function) { |
| MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) { |
| Isolate* isolate = function->GetIsolate(); |
| DCHECK(!isolate->has_pending_exception()); |
| - DCHECK(!function->is_compiled()); |
| + DCHECK(!function->is_compiled() || |
| + function->code() == |
| + function->GetIsolate()->builtins()->builtin( |
|
Michael Starzinger
2016/08/11 11:44:10
This can be avoided by adding the following to the
bradn
2016/08/12 01:17:09
Done.
|
| + Builtins::kInstantiateAsmJs)); |
| TimerEventScope<TimerEventCompileCode> compile_timer(isolate); |
| RuntimeCallTimerScope runtimeTimer(isolate, |
| &RuntimeCallStats::CompileCodeLazy); |
| @@ -1031,7 +1038,10 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) { |
| } |
| } |
| - if (function->shared()->is_compiled()) { |
| + if (function->shared()->is_compiled() && |
|
Michael Starzinger
2016/08/11 11:44:10
This can be avoided by adding the following to the
bradn
2016/08/12 01:17:09
Done.
|
| + function->code() != |
| + function->GetIsolate()->builtins()->builtin( |
| + Builtins::kInstantiateAsmJs)) { |
| return Handle<Code>(function->shared()->code()); |
| } |
| @@ -1211,7 +1221,11 @@ bool Compiler::ParseAndAnalyze(ParseInfo* info) { |
| } |
| bool Compiler::Compile(Handle<JSFunction> function, ClearExceptionFlag flag) { |
| - if (function->is_compiled()) return true; |
| + if (function->is_compiled() && |
|
Michael Starzinger
2016/08/11 11:44:10
Likewise.
bradn
2016/08/12 01:17:09
Done.
|
| + function->code() != |
| + function->GetIsolate()->builtins()->builtin( |
| + Builtins::kInstantiateAsmJs)) |
| + return true; |
| Isolate* isolate = function->GetIsolate(); |
| DCHECK(AllowCompilation::IsAllowed(isolate)); |