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/compiler.h" | 5 #include "src/compiler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/ast-numbering.h" | 9 #include "src/ast-numbering.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 if (FLAG_trace_opt) { | 698 if (FLAG_trace_opt) { |
699 PrintF("[found optimized code for "); | 699 PrintF("[found optimized code for "); |
700 function->ShortPrint(); | 700 function->ShortPrint(); |
701 if (!osr_ast_id.IsNone()) { | 701 if (!osr_ast_id.IsNone()) { |
702 PrintF(" at OSR AST id %d", osr_ast_id.ToInt()); | 702 PrintF(" at OSR AST id %d", osr_ast_id.ToInt()); |
703 } | 703 } |
704 PrintF("]\n"); | 704 PrintF("]\n"); |
705 } | 705 } |
706 FixedArray* literals = shared->GetLiteralsFromOptimizedCodeMap(index); | 706 FixedArray* literals = shared->GetLiteralsFromOptimizedCodeMap(index); |
707 if (literals != NULL) function->set_literals(literals); | 707 if (literals != NULL) function->set_literals(literals); |
708 return Handle<Code>(shared->GetCodeFromOptimizedCodeMap(index)); | 708 Code* code = shared->GetCodeFromOptimizedCodeMap(index); |
| 709 DCHECK(!code->marked_for_deoptimization()); |
| 710 DCHECK(function->shared()->is_compiled()); |
| 711 return Handle<Code>(code); |
709 } | 712 } |
710 } | 713 } |
711 return MaybeHandle<Code>(); | 714 return MaybeHandle<Code>(); |
712 } | 715 } |
713 | 716 |
714 | 717 |
715 static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) { | 718 static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) { |
716 Handle<Code> code = info->code(); | 719 Handle<Code> code = info->code(); |
717 if (code->kind() != Code::OPTIMIZED_FUNCTION) return; // Nothing to do. | 720 if (code->kind() != Code::OPTIMIZED_FUNCTION) return; // Nothing to do. |
718 | 721 |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1568 | 1571 |
1569 | 1572 |
1570 #if DEBUG | 1573 #if DEBUG |
1571 void CompilationInfo::PrintAstForTesting() { | 1574 void CompilationInfo::PrintAstForTesting() { |
1572 PrintF("--- Source from AST ---\n%s\n", | 1575 PrintF("--- Source from AST ---\n%s\n", |
1573 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1576 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
1574 } | 1577 } |
1575 #endif | 1578 #endif |
1576 } // namespace internal | 1579 } // namespace internal |
1577 } // namespace v8 | 1580 } // namespace v8 |
OLD | NEW |