| 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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 // The existing unoptimized code was replaced with the new one. | 962 // The existing unoptimized code was replaced with the new one. |
| 963 RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, &unoptimized, shared); | 963 RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, &unoptimized, shared); |
| 964 } | 964 } |
| 965 return true; | 965 return true; |
| 966 } | 966 } |
| 967 | 967 |
| 968 | 968 |
| 969 MaybeHandle<Code> CompileForDebugging(CompilationInfo* info) { | 969 MaybeHandle<Code> CompileForDebugging(CompilationInfo* info) { |
| 970 info->MarkAsDebug(); | 970 info->MarkAsDebug(); |
| 971 VMState<COMPILER> state(info->isolate()); | 971 VMState<COMPILER> state(info->isolate()); |
| 972 if (info->shared_info()->is_compiled()) { | |
| 973 if (info->shared_info()->code()->is_compiled_optimizable()) { | |
| 974 info->EnableDeoptimizationSupport(); | |
| 975 } else { | |
| 976 info->MarkNonOptimizable(); | |
| 977 } | |
| 978 } | |
| 979 MaybeHandle<Code> maybe_new_code = GetUnoptimizedCodeCommon(info); | 972 MaybeHandle<Code> maybe_new_code = GetUnoptimizedCodeCommon(info); |
| 980 Handle<Code> new_code; | 973 Handle<Code> new_code; |
| 981 if (!maybe_new_code.ToHandle(&new_code)) { | 974 if (!maybe_new_code.ToHandle(&new_code)) { |
| 982 info->isolate()->clear_pending_exception(); | 975 info->isolate()->clear_pending_exception(); |
| 983 } | 976 } |
| 984 return maybe_new_code; | 977 return maybe_new_code; |
| 985 } | 978 } |
| 986 | 979 |
| 987 | 980 |
| 988 MaybeHandle<Code> Compiler::GetDebugCode(Handle<JSFunction> function) { | 981 MaybeHandle<Code> Compiler::GetDebugCode(Handle<JSFunction> function) { |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1625 | 1618 |
| 1626 | 1619 |
| 1627 #if DEBUG | 1620 #if DEBUG |
| 1628 void CompilationInfo::PrintAstForTesting() { | 1621 void CompilationInfo::PrintAstForTesting() { |
| 1629 PrintF("--- Source from AST ---\n%s\n", | 1622 PrintF("--- Source from AST ---\n%s\n", |
| 1630 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1623 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
| 1631 } | 1624 } |
| 1632 #endif | 1625 #endif |
| 1633 } // namespace internal | 1626 } // namespace internal |
| 1634 } // namespace v8 | 1627 } // namespace v8 |
| OLD | NEW |