| 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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, shared); | 668 RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, shared); |
| 669 | 669 |
| 670 // Update the shared function info with the scope info. Allocating the | 670 // Update the shared function info with the scope info. Allocating the |
| 671 // ScopeInfo object may cause a GC. | 671 // ScopeInfo object may cause a GC. |
| 672 Handle<ScopeInfo> scope_info = | 672 Handle<ScopeInfo> scope_info = |
| 673 ScopeInfo::Create(info->isolate(), info->zone(), info->scope()); | 673 ScopeInfo::Create(info->isolate(), info->zone(), info->scope()); |
| 674 shared->set_scope_info(*scope_info); | 674 shared->set_scope_info(*scope_info); |
| 675 | 675 |
| 676 // Update the code and feedback vector for the shared function info. | 676 // Update the code and feedback vector for the shared function info. |
| 677 shared->ReplaceCode(*info->code()); | 677 shared->ReplaceCode(*info->code()); |
| 678 if (shared->optimization_disabled()) info->code()->set_optimizable(false); | |
| 679 shared->set_feedback_vector(*info->feedback_vector()); | 678 shared->set_feedback_vector(*info->feedback_vector()); |
| 680 | 679 |
| 681 return info->code(); | 680 return info->code(); |
| 682 } | 681 } |
| 683 | 682 |
| 684 | 683 |
| 685 MUST_USE_RESULT static MaybeHandle<Code> GetCodeFromOptimizedCodeMap( | 684 MUST_USE_RESULT static MaybeHandle<Code> GetCodeFromOptimizedCodeMap( |
| 686 Handle<JSFunction> function, BailoutId osr_ast_id) { | 685 Handle<JSFunction> function, BailoutId osr_ast_id) { |
| 687 if (FLAG_cache_optimized_code) { | 686 if (FLAG_cache_optimized_code) { |
| 688 Handle<SharedFunctionInfo> shared(function->shared()); | 687 Handle<SharedFunctionInfo> shared(function->shared()); |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1563 } | 1562 } |
| 1564 | 1563 |
| 1565 | 1564 |
| 1566 #if DEBUG | 1565 #if DEBUG |
| 1567 void CompilationInfo::PrintAstForTesting() { | 1566 void CompilationInfo::PrintAstForTesting() { |
| 1568 PrintF("--- Source from AST ---\n%s\n", | 1567 PrintF("--- Source from AST ---\n%s\n", |
| 1569 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1568 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
| 1570 } | 1569 } |
| 1571 #endif | 1570 #endif |
| 1572 } } // namespace v8::internal | 1571 } } // namespace v8::internal |
| OLD | NEW |