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

Unified Diff: src/compiler.cc

Issue 1161393007: OLD type Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 6 months 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 | « src/compiler.h ('k') | src/deoptimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/compiler.h ('k') | src/deoptimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698