| 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/asmjs/asm-js.h" | 9 #include "src/asmjs/asm-js.h" |
| 10 #include "src/asmjs/typing-asm.h" | 10 #include "src/asmjs/typing-asm.h" |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 if (!info->is_optimizing_from_bytecode()) { | 656 if (!info->is_optimizing_from_bytecode()) { |
| 657 if (!Compiler::ParseAndAnalyze(info->parse_info())) return false; | 657 if (!Compiler::ParseAndAnalyze(info->parse_info())) return false; |
| 658 EnsureFeedbackMetadata(info); | 658 EnsureFeedbackMetadata(info); |
| 659 } | 659 } |
| 660 | 660 |
| 661 JSFunction::EnsureLiterals(info->closure()); | 661 JSFunction::EnsureLiterals(info->closure()); |
| 662 | 662 |
| 663 TimerEventScope<TimerEventRecompileSynchronous> timer(isolate); | 663 TimerEventScope<TimerEventRecompileSynchronous> timer(isolate); |
| 664 RuntimeCallTimerScope runtimeTimer(isolate, | 664 RuntimeCallTimerScope runtimeTimer(isolate, |
| 665 &RuntimeCallStats::RecompileSynchronous); | 665 &RuntimeCallStats::RecompileSynchronous); |
| 666 TRACE_EVENT0("v8", "V8.RecompileSynchronous"); | 666 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), |
| 667 "V8.RecompileSynchronous"); |
| 667 | 668 |
| 668 if (job->CreateGraph() != CompilationJob::SUCCEEDED || | 669 if (job->CreateGraph() != CompilationJob::SUCCEEDED || |
| 669 job->OptimizeGraph() != CompilationJob::SUCCEEDED || | 670 job->OptimizeGraph() != CompilationJob::SUCCEEDED || |
| 670 job->GenerateCode() != CompilationJob::SUCCEEDED) { | 671 job->GenerateCode() != CompilationJob::SUCCEEDED) { |
| 671 if (FLAG_trace_opt) { | 672 if (FLAG_trace_opt) { |
| 672 PrintF("[aborted optimizing "); | 673 PrintF("[aborted optimizing "); |
| 673 info->closure()->ShortPrint(); | 674 info->closure()->ShortPrint(); |
| 674 PrintF(" because: %s]\n", GetBailoutReason(info->bailout_reason())); | 675 PrintF(" because: %s]\n", GetBailoutReason(info->bailout_reason())); |
| 675 } | 676 } |
| 676 return false; | 677 return false; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 | 710 |
| 710 JSFunction::EnsureLiterals(info->closure()); | 711 JSFunction::EnsureLiterals(info->closure()); |
| 711 | 712 |
| 712 // Reopen handles in the new CompilationHandleScope. | 713 // Reopen handles in the new CompilationHandleScope. |
| 713 info->ReopenHandlesInNewHandleScope(); | 714 info->ReopenHandlesInNewHandleScope(); |
| 714 info->parse_info()->ReopenHandlesInNewHandleScope(); | 715 info->parse_info()->ReopenHandlesInNewHandleScope(); |
| 715 | 716 |
| 716 TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate()); | 717 TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate()); |
| 717 RuntimeCallTimerScope runtimeTimer(info->isolate(), | 718 RuntimeCallTimerScope runtimeTimer(info->isolate(), |
| 718 &RuntimeCallStats::RecompileSynchronous); | 719 &RuntimeCallStats::RecompileSynchronous); |
| 719 TRACE_EVENT0("v8", "V8.RecompileSynchronous"); | 720 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), |
| 721 "V8.RecompileSynchronous"); |
| 720 | 722 |
| 721 if (job->CreateGraph() != CompilationJob::SUCCEEDED) return false; | 723 if (job->CreateGraph() != CompilationJob::SUCCEEDED) return false; |
| 722 isolate->optimizing_compile_dispatcher()->QueueForOptimization(job); | 724 isolate->optimizing_compile_dispatcher()->QueueForOptimization(job); |
| 723 | 725 |
| 724 if (FLAG_trace_concurrent_recompilation) { | 726 if (FLAG_trace_concurrent_recompilation) { |
| 725 PrintF(" ** Queued "); | 727 PrintF(" ** Queued "); |
| 726 info->closure()->ShortPrint(); | 728 info->closure()->ShortPrint(); |
| 727 PrintF(" for concurrent optimization.\n"); | 729 PrintF(" for concurrent optimization.\n"); |
| 728 } | 730 } |
| 729 return true; | 731 return true; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 const int kMaxOptCount = | 779 const int kMaxOptCount = |
| 778 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; | 780 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; |
| 779 if (info->shared_info()->opt_count() > kMaxOptCount) { | 781 if (info->shared_info()->opt_count() > kMaxOptCount) { |
| 780 info->AbortOptimization(kOptimizedTooManyTimes); | 782 info->AbortOptimization(kOptimizedTooManyTimes); |
| 781 return MaybeHandle<Code>(); | 783 return MaybeHandle<Code>(); |
| 782 } | 784 } |
| 783 | 785 |
| 784 CanonicalHandleScope canonical(isolate); | 786 CanonicalHandleScope canonical(isolate); |
| 785 TimerEventScope<TimerEventOptimizeCode> optimize_code_timer(isolate); | 787 TimerEventScope<TimerEventOptimizeCode> optimize_code_timer(isolate); |
| 786 RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::OptimizeCode); | 788 RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::OptimizeCode); |
| 787 TRACE_EVENT0("v8", "V8.OptimizeCode"); | 789 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.OptimizeCode"); |
| 788 | 790 |
| 789 // TurboFan can optimize directly from existing bytecode. | 791 // TurboFan can optimize directly from existing bytecode. |
| 790 if (FLAG_turbo_from_bytecode && use_turbofan && | 792 if (FLAG_turbo_from_bytecode && use_turbofan && |
| 791 info->shared_info()->HasBytecodeArray()) { | 793 info->shared_info()->HasBytecodeArray()) { |
| 792 info->MarkAsOptimizeFromBytecode(); | 794 info->MarkAsOptimizeFromBytecode(); |
| 793 } | 795 } |
| 794 | 796 |
| 795 if (IsEvalToplevel(shared)) { | 797 if (IsEvalToplevel(shared)) { |
| 796 parse_info->set_eval(); | 798 parse_info->set_eval(); |
| 797 if (function->context()->IsNativeContext()) parse_info->set_global(); | 799 if (function->context()->IsNativeContext()) parse_info->set_global(); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 return info.code(); | 969 return info.code(); |
| 968 } | 970 } |
| 969 | 971 |
| 970 MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) { | 972 MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) { |
| 971 Isolate* isolate = function->GetIsolate(); | 973 Isolate* isolate = function->GetIsolate(); |
| 972 DCHECK(!isolate->has_pending_exception()); | 974 DCHECK(!isolate->has_pending_exception()); |
| 973 DCHECK(!function->is_compiled()); | 975 DCHECK(!function->is_compiled()); |
| 974 TimerEventScope<TimerEventCompileCode> compile_timer(isolate); | 976 TimerEventScope<TimerEventCompileCode> compile_timer(isolate); |
| 975 RuntimeCallTimerScope runtimeTimer(isolate, | 977 RuntimeCallTimerScope runtimeTimer(isolate, |
| 976 &RuntimeCallStats::CompileCodeLazy); | 978 &RuntimeCallStats::CompileCodeLazy); |
| 977 TRACE_EVENT0("v8", "V8.CompileCode"); | 979 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode"); |
| 978 AggregatedHistogramTimerScope timer(isolate->counters()->compile_lazy()); | 980 AggregatedHistogramTimerScope timer(isolate->counters()->compile_lazy()); |
| 979 | 981 |
| 980 if (FLAG_turbo_cache_shared_code) { | 982 if (FLAG_turbo_cache_shared_code) { |
| 981 Handle<Code> cached_code; | 983 Handle<Code> cached_code; |
| 982 if (GetCodeFromOptimizedCodeMap(function, BailoutId::None()) | 984 if (GetCodeFromOptimizedCodeMap(function, BailoutId::None()) |
| 983 .ToHandle(&cached_code)) { | 985 .ToHandle(&cached_code)) { |
| 984 if (FLAG_trace_opt) { | 986 if (FLAG_trace_opt) { |
| 985 PrintF("[found optimized code for "); | 987 PrintF("[found optimized code for "); |
| 986 function->ShortPrint(); | 988 function->ShortPrint(); |
| 987 PrintF(" during unoptimized compile]\n"); | 989 PrintF(" during unoptimized compile]\n"); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1022 code, scope_info); | 1024 code, scope_info); |
| 1023 SharedFunctionInfo::InitFromFunctionLiteral(result, literal); | 1025 SharedFunctionInfo::InitFromFunctionLiteral(result, literal); |
| 1024 SharedFunctionInfo::SetScript(result, script); | 1026 SharedFunctionInfo::SetScript(result, script); |
| 1025 return result; | 1027 return result; |
| 1026 } | 1028 } |
| 1027 | 1029 |
| 1028 Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) { | 1030 Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) { |
| 1029 Isolate* isolate = info->isolate(); | 1031 Isolate* isolate = info->isolate(); |
| 1030 TimerEventScope<TimerEventCompileCode> timer(isolate); | 1032 TimerEventScope<TimerEventCompileCode> timer(isolate); |
| 1031 RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::CompileCode); | 1033 RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::CompileCode); |
| 1032 TRACE_EVENT0("v8", "V8.CompileCode"); | 1034 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode"); |
| 1033 PostponeInterruptsScope postpone(isolate); | 1035 PostponeInterruptsScope postpone(isolate); |
| 1034 DCHECK(!isolate->native_context().is_null()); | 1036 DCHECK(!isolate->native_context().is_null()); |
| 1035 ParseInfo* parse_info = info->parse_info(); | 1037 ParseInfo* parse_info = info->parse_info(); |
| 1036 Handle<Script> script = parse_info->script(); | 1038 Handle<Script> script = parse_info->script(); |
| 1037 | 1039 |
| 1038 // TODO(svenpanne) Obscure place for this, perhaps move to OnBeforeCompile? | 1040 // TODO(svenpanne) Obscure place for this, perhaps move to OnBeforeCompile? |
| 1039 FixedArray* array = isolate->native_context()->embedder_data(); | 1041 FixedArray* array = isolate->native_context()->embedder_data(); |
| 1040 script->set_context_data(array->get(v8::Context::kDebugIdIndex)); | 1042 script->set_context_data(array->get(v8::Context::kDebugIdIndex)); |
| 1041 | 1043 |
| 1042 isolate->debug()->OnBeforeCompile(script); | 1044 isolate->debug()->OnBeforeCompile(script); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 // Measure how long it takes to do the compilation; only take the | 1091 // Measure how long it takes to do the compilation; only take the |
| 1090 // rest of the function into account to avoid overlap with the | 1092 // rest of the function into account to avoid overlap with the |
| 1091 // parsing statistics. | 1093 // parsing statistics. |
| 1092 RuntimeCallTimerScope runtimeTimer( | 1094 RuntimeCallTimerScope runtimeTimer( |
| 1093 isolate, parse_info->is_eval() ? &RuntimeCallStats::CompileEval | 1095 isolate, parse_info->is_eval() ? &RuntimeCallStats::CompileEval |
| 1094 : &RuntimeCallStats::Compile); | 1096 : &RuntimeCallStats::Compile); |
| 1095 HistogramTimer* rate = parse_info->is_eval() | 1097 HistogramTimer* rate = parse_info->is_eval() |
| 1096 ? info->isolate()->counters()->compile_eval() | 1098 ? info->isolate()->counters()->compile_eval() |
| 1097 : info->isolate()->counters()->compile(); | 1099 : info->isolate()->counters()->compile(); |
| 1098 HistogramTimerScope timer(rate); | 1100 HistogramTimerScope timer(rate); |
| 1099 TRACE_EVENT0("v8", parse_info->is_eval() ? "V8.CompileEval" : "V8.Compile"); | 1101 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), |
| 1102 parse_info->is_eval() ? "V8.CompileEval" : "V8.Compile"); |
| 1100 | 1103 |
| 1101 // Allocate a shared function info object. | 1104 // Allocate a shared function info object. |
| 1102 DCHECK_EQ(kNoSourcePosition, lit->function_token_position()); | 1105 DCHECK_EQ(kNoSourcePosition, lit->function_token_position()); |
| 1103 result = NewSharedFunctionInfoForLiteral(isolate, lit, script); | 1106 result = NewSharedFunctionInfoForLiteral(isolate, lit, script); |
| 1104 result->set_is_toplevel(true); | 1107 result->set_is_toplevel(true); |
| 1105 if (parse_info->is_eval()) { | 1108 if (parse_info->is_eval()) { |
| 1106 // Eval scripts cannot be (re-)compiled without context. | 1109 // Eval scripts cannot be (re-)compiled without context. |
| 1107 result->set_allows_lazy_compilation_without_context(false); | 1110 result->set_allows_lazy_compilation_without_context(false); |
| 1108 } | 1111 } |
| 1109 parse_info->set_shared_info(result); | 1112 parse_info->set_shared_info(result); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1489 maybe_result = compilation_cache->LookupScript( | 1492 maybe_result = compilation_cache->LookupScript( |
| 1490 source, script_name, line_offset, column_offset, resource_options, | 1493 source, script_name, line_offset, column_offset, resource_options, |
| 1491 context, language_mode); | 1494 context, language_mode); |
| 1492 if (maybe_result.is_null() && FLAG_serialize_toplevel && | 1495 if (maybe_result.is_null() && FLAG_serialize_toplevel && |
| 1493 compile_options == ScriptCompiler::kConsumeCodeCache && | 1496 compile_options == ScriptCompiler::kConsumeCodeCache && |
| 1494 !isolate->debug()->is_loaded()) { | 1497 !isolate->debug()->is_loaded()) { |
| 1495 // Then check cached code provided by embedder. | 1498 // Then check cached code provided by embedder. |
| 1496 HistogramTimerScope timer(isolate->counters()->compile_deserialize()); | 1499 HistogramTimerScope timer(isolate->counters()->compile_deserialize()); |
| 1497 RuntimeCallTimerScope runtimeTimer(isolate, | 1500 RuntimeCallTimerScope runtimeTimer(isolate, |
| 1498 &RuntimeCallStats::CompileDeserialize); | 1501 &RuntimeCallStats::CompileDeserialize); |
| 1499 TRACE_EVENT0("v8", "V8.CompileDeserialize"); | 1502 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), |
| 1503 "V8.CompileDeserialize"); |
| 1500 Handle<SharedFunctionInfo> result; | 1504 Handle<SharedFunctionInfo> result; |
| 1501 if (CodeSerializer::Deserialize(isolate, *cached_data, source) | 1505 if (CodeSerializer::Deserialize(isolate, *cached_data, source) |
| 1502 .ToHandle(&result)) { | 1506 .ToHandle(&result)) { |
| 1503 // Promote to per-isolate compilation cache. | 1507 // Promote to per-isolate compilation cache. |
| 1504 compilation_cache->PutScript(source, context, language_mode, result); | 1508 compilation_cache->PutScript(source, context, language_mode, result); |
| 1505 return result; | 1509 return result; |
| 1506 } | 1510 } |
| 1507 // Deserializer failed. Fall through to compile. | 1511 // Deserializer failed. Fall through to compile. |
| 1508 } | 1512 } |
| 1509 } | 1513 } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1562 static_cast<LanguageMode>(parse_info.language_mode() | language_mode)); | 1566 static_cast<LanguageMode>(parse_info.language_mode() | language_mode)); |
| 1563 result = CompileToplevel(&info); | 1567 result = CompileToplevel(&info); |
| 1564 if (extension == NULL && !result.is_null()) { | 1568 if (extension == NULL && !result.is_null()) { |
| 1565 compilation_cache->PutScript(source, context, language_mode, result); | 1569 compilation_cache->PutScript(source, context, language_mode, result); |
| 1566 if (FLAG_serialize_toplevel && | 1570 if (FLAG_serialize_toplevel && |
| 1567 compile_options == ScriptCompiler::kProduceCodeCache) { | 1571 compile_options == ScriptCompiler::kProduceCodeCache) { |
| 1568 HistogramTimerScope histogram_timer( | 1572 HistogramTimerScope histogram_timer( |
| 1569 isolate->counters()->compile_serialize()); | 1573 isolate->counters()->compile_serialize()); |
| 1570 RuntimeCallTimerScope runtimeTimer(isolate, | 1574 RuntimeCallTimerScope runtimeTimer(isolate, |
| 1571 &RuntimeCallStats::CompileSerialize); | 1575 &RuntimeCallStats::CompileSerialize); |
| 1572 TRACE_EVENT0("v8", "V8.CompileSerialize"); | 1576 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), |
| 1577 "V8.CompileSerialize"); |
| 1573 *cached_data = CodeSerializer::Serialize(isolate, result, source); | 1578 *cached_data = CodeSerializer::Serialize(isolate, result, source); |
| 1574 if (FLAG_profile_deserialization) { | 1579 if (FLAG_profile_deserialization) { |
| 1575 PrintF("[Compiling and serializing took %0.3f ms]\n", | 1580 PrintF("[Compiling and serializing took %0.3f ms]\n", |
| 1576 timer.Elapsed().InMillisecondsF()); | 1581 timer.Elapsed().InMillisecondsF()); |
| 1577 } | 1582 } |
| 1578 } | 1583 } |
| 1579 } | 1584 } |
| 1580 | 1585 |
| 1581 if (result.is_null()) { | 1586 if (result.is_null()) { |
| 1582 isolate->ReportPendingMessages(); | 1587 isolate->ReportPendingMessages(); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1679 // Consider compiling eagerly when targeting the code cache. | 1684 // Consider compiling eagerly when targeting the code cache. |
| 1680 lazy &= !(FLAG_serialize_eager && info.will_serialize()); | 1685 lazy &= !(FLAG_serialize_eager && info.will_serialize()); |
| 1681 | 1686 |
| 1682 // Consider compiling eagerly when compiling bytecode for Ignition. | 1687 // Consider compiling eagerly when compiling bytecode for Ignition. |
| 1683 lazy &= | 1688 lazy &= |
| 1684 !(FLAG_ignition && FLAG_ignition_eager && !isolate->serializer_enabled()); | 1689 !(FLAG_ignition && FLAG_ignition_eager && !isolate->serializer_enabled()); |
| 1685 | 1690 |
| 1686 // Generate code | 1691 // Generate code |
| 1687 TimerEventScope<TimerEventCompileCode> timer(isolate); | 1692 TimerEventScope<TimerEventCompileCode> timer(isolate); |
| 1688 RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::CompileCode); | 1693 RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::CompileCode); |
| 1689 TRACE_EVENT0("v8", "V8.CompileCode"); | 1694 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode"); |
| 1690 if (lazy) { | 1695 if (lazy) { |
| 1691 info.SetCode(isolate->builtins()->CompileLazy()); | 1696 info.SetCode(isolate->builtins()->CompileLazy()); |
| 1692 } else if (Renumber(info.parse_info()) && GenerateUnoptimizedCode(&info)) { | 1697 } else if (Renumber(info.parse_info()) && GenerateUnoptimizedCode(&info)) { |
| 1693 // Code generation will ensure that the feedback vector is present and | 1698 // Code generation will ensure that the feedback vector is present and |
| 1694 // appropriately sized. | 1699 // appropriately sized. |
| 1695 DCHECK(!info.code().is_null()); | 1700 DCHECK(!info.code().is_null()); |
| 1696 if (literal->should_eager_compile() && | 1701 if (literal->should_eager_compile() && |
| 1697 literal->should_be_used_once_hint()) { | 1702 literal->should_be_used_once_hint()) { |
| 1698 info.code()->MarkToBeExecutedOnce(isolate); | 1703 info.code()->MarkToBeExecutedOnce(isolate); |
| 1699 } | 1704 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1754 void Compiler::FinalizeCompilationJob(CompilationJob* raw_job) { | 1759 void Compiler::FinalizeCompilationJob(CompilationJob* raw_job) { |
| 1755 // Take ownership of compilation job. Deleting job also tears down the zone. | 1760 // Take ownership of compilation job. Deleting job also tears down the zone. |
| 1756 base::SmartPointer<CompilationJob> job(raw_job); | 1761 base::SmartPointer<CompilationJob> job(raw_job); |
| 1757 CompilationInfo* info = job->info(); | 1762 CompilationInfo* info = job->info(); |
| 1758 Isolate* isolate = info->isolate(); | 1763 Isolate* isolate = info->isolate(); |
| 1759 | 1764 |
| 1760 VMState<COMPILER> state(isolate); | 1765 VMState<COMPILER> state(isolate); |
| 1761 TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate()); | 1766 TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate()); |
| 1762 RuntimeCallTimerScope runtimeTimer(isolate, | 1767 RuntimeCallTimerScope runtimeTimer(isolate, |
| 1763 &RuntimeCallStats::RecompileSynchronous); | 1768 &RuntimeCallStats::RecompileSynchronous); |
| 1764 TRACE_EVENT0("v8", "V8.RecompileSynchronous"); | 1769 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), |
| 1770 "V8.RecompileSynchronous"); |
| 1765 | 1771 |
| 1766 Handle<SharedFunctionInfo> shared = info->shared_info(); | 1772 Handle<SharedFunctionInfo> shared = info->shared_info(); |
| 1767 shared->code()->set_profiler_ticks(0); | 1773 shared->code()->set_profiler_ticks(0); |
| 1768 | 1774 |
| 1769 DCHECK(!shared->HasDebugInfo()); | 1775 DCHECK(!shared->HasDebugInfo()); |
| 1770 | 1776 |
| 1771 // 1) Optimization on the concurrent thread may have failed. | 1777 // 1) Optimization on the concurrent thread may have failed. |
| 1772 // 2) The function may have already been optimized by OSR. Simply continue. | 1778 // 2) The function may have already been optimized by OSR. Simply continue. |
| 1773 // Except when OSR already disabled optimization for some reason. | 1779 // Except when OSR already disabled optimization for some reason. |
| 1774 // 3) The code may have already been invalidated due to dependency change. | 1780 // 3) The code may have already been invalidated due to dependency change. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1825 DCHECK(shared->is_compiled()); | 1831 DCHECK(shared->is_compiled()); |
| 1826 function->set_literals(cached.literals); | 1832 function->set_literals(cached.literals); |
| 1827 } else if (shared->is_compiled()) { | 1833 } else if (shared->is_compiled()) { |
| 1828 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1834 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
| 1829 JSFunction::EnsureLiterals(function); | 1835 JSFunction::EnsureLiterals(function); |
| 1830 } | 1836 } |
| 1831 } | 1837 } |
| 1832 | 1838 |
| 1833 } // namespace internal | 1839 } // namespace internal |
| 1834 } // namespace v8 | 1840 } // namespace v8 |
| OLD | NEW |