OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 | 8 |
| 9 #include "src/ast-numbering.h" |
9 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 11 #include "src/codegen.h" |
11 #include "src/compilation-cache.h" | 12 #include "src/compilation-cache.h" |
12 #include "src/compiler/pipeline.h" | 13 #include "src/compiler/pipeline.h" |
13 #include "src/cpu-profiler.h" | 14 #include "src/cpu-profiler.h" |
14 #include "src/debug.h" | 15 #include "src/debug.h" |
15 #include "src/deoptimizer.h" | 16 #include "src/deoptimizer.h" |
16 #include "src/full-codegen.h" | 17 #include "src/full-codegen.h" |
17 #include "src/gdb-jit.h" | 18 #include "src/gdb-jit.h" |
18 #include "src/hydrogen.h" | 19 #include "src/hydrogen.h" |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 Handle<Script>(info->script()), Handle<Code>(info->code()), | 634 Handle<Script>(info->script()), Handle<Code>(info->code()), |
634 info)); | 635 info)); |
635 } | 636 } |
636 | 637 |
637 | 638 |
638 static bool CompileUnoptimizedCode(CompilationInfo* info) { | 639 static bool CompileUnoptimizedCode(CompilationInfo* info) { |
639 DCHECK(AllowCompilation::IsAllowed(info->isolate())); | 640 DCHECK(AllowCompilation::IsAllowed(info->isolate())); |
640 DCHECK(info->function() != NULL); | 641 DCHECK(info->function() != NULL); |
641 if (!Rewriter::Rewrite(info)) return false; | 642 if (!Rewriter::Rewrite(info)) return false; |
642 if (!Scope::Analyze(info)) return false; | 643 if (!Scope::Analyze(info)) return false; |
| 644 if (!AstNumbering::Renumber(info)) return false; |
643 DCHECK(info->scope() != NULL); | 645 DCHECK(info->scope() != NULL); |
644 | 646 |
645 if (!FullCodeGenerator::MakeCode(info)) { | 647 if (!FullCodeGenerator::MakeCode(info)) { |
646 Isolate* isolate = info->isolate(); | 648 Isolate* isolate = info->isolate(); |
647 if (!isolate->has_pending_exception()) isolate->StackOverflow(); | 649 if (!isolate->has_pending_exception()) isolate->StackOverflow(); |
648 return false; | 650 return false; |
649 } | 651 } |
650 return true; | 652 return true; |
651 } | 653 } |
652 | 654 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 732 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
731 literals, info->osr_ast_id()); | 733 literals, info->osr_ast_id()); |
732 } | 734 } |
733 } | 735 } |
734 | 736 |
735 | 737 |
736 static bool CompileOptimizedPrologue(CompilationInfo* info) { | 738 static bool CompileOptimizedPrologue(CompilationInfo* info) { |
737 if (!Parser::Parse(info)) return false; | 739 if (!Parser::Parse(info)) return false; |
738 if (!Rewriter::Rewrite(info)) return false; | 740 if (!Rewriter::Rewrite(info)) return false; |
739 if (!Scope::Analyze(info)) return false; | 741 if (!Scope::Analyze(info)) return false; |
| 742 if (!AstNumbering::Renumber(info)) return false; |
740 DCHECK(info->scope() != NULL); | 743 DCHECK(info->scope() != NULL); |
741 return true; | 744 return true; |
742 } | 745 } |
743 | 746 |
744 | 747 |
745 static bool GetOptimizedCodeNow(CompilationInfo* info) { | 748 static bool GetOptimizedCodeNow(CompilationInfo* info) { |
746 if (!CompileOptimizedPrologue(info)) return false; | 749 if (!CompileOptimizedPrologue(info)) return false; |
747 | 750 |
748 TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate()); | 751 TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate()); |
749 | 752 |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 AllowHandleDereference allow_deref; | 1441 AllowHandleDereference allow_deref; |
1439 bool tracing_on = info()->IsStub() | 1442 bool tracing_on = info()->IsStub() |
1440 ? FLAG_trace_hydrogen_stubs | 1443 ? FLAG_trace_hydrogen_stubs |
1441 : (FLAG_trace_hydrogen && | 1444 : (FLAG_trace_hydrogen && |
1442 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1445 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1443 return (tracing_on && | 1446 return (tracing_on && |
1444 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1447 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1445 } | 1448 } |
1446 | 1449 |
1447 } } // namespace v8::internal | 1450 } } // namespace v8::internal |
OLD | NEW |