| Index: src/compiler.cc
|
| diff --git a/src/compiler.cc b/src/compiler.cc
|
| index ef21f1f46f9e65ff227bdefb703fe4132101c59e..ae17857c17c9df7df1fdab97641a372d7a2f71f8 100644
|
| --- a/src/compiler.cc
|
| +++ b/src/compiler.cc
|
| @@ -29,6 +29,7 @@
|
| #include "src/scopes.h"
|
| #include "src/snapshot/serialize.h"
|
| #include "src/typing.h"
|
| +#include "src/typing-asm.h"
|
| #include "src/vm-state-inl.h"
|
|
|
| namespace v8 {
|
| @@ -442,8 +443,44 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
|
| isolate()->GetHTracer()->TraceCompilation(info());
|
| }
|
|
|
| +#if 0
|
| // Type-check the function.
|
| - AstTyper::Run(info());
|
| + switch (scope->asm_mode()) {
|
| + case ASM_MODULE:
|
| + if (FLAG_trace_asm) {
|
| + OFStream os(stdout);
|
| + os << "[asm: compiling module "
|
| + << info()->function()->debug_name()->ToCString().get()
|
| + << "]" << std::endl;
|
| + }
|
| + if (AsmTyper::Run(info())) break;
|
| + // Fall through.
|
| + {
|
| + OFStream os(stdout);
|
| + os << "asm: could not type module "
|
| + << info()->function()->debug_name()->ToCString().get()
|
| + <<", falling back to normal typing" << std::endl;
|
| + }
|
| + case ASM_NO:
|
| + AstTyper::Run(info());
|
| + break;
|
| + case ASM_FUNCTION:
|
| + if (FLAG_trace_asm) {
|
| + OFStream os(stdout);
|
| + os << "[asm: compiling function "
|
| + << info()->function()->debug_name()->ToCString().get()
|
| + << "]" << std::endl;
|
| + }
|
| +#ifdef DEBUG
|
| + if (FLAG_print_asm_env) scope->Print();
|
| +#endif
|
| + case ASM_END:
|
| + DCHECK(false);
|
| + break;
|
| + }
|
| +#else
|
| + AstTyper::Run(info());
|
| +#endif
|
|
|
| // Optimization could have been disabled by the parser. Note that this check
|
| // is only needed because the Hydrogen graph builder is missing some bailouts.
|
| @@ -881,7 +918,7 @@ MaybeHandle<Code> Compiler::GetLazyCode(Handle<JSFunction> function) {
|
| ASSIGN_RETURN_ON_EXCEPTION(isolate, result, GetUnoptimizedCodeCommon(&info),
|
| Code);
|
|
|
| - if (FLAG_always_opt) {
|
| + if (FLAG_always_opt || info.scope()->asm_mode() != ASM_NO) {
|
| Handle<Code> opt_code;
|
| if (Compiler::GetOptimizedCode(
|
| function, result,
|
|
|