OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 // The function may have already been optimized by OSR. Simply continue. | 1060 // The function may have already been optimized by OSR. Simply continue. |
1061 // Except when OSR already disabled optimization for some reason. | 1061 // Except when OSR already disabled optimization for some reason. |
1062 if (info->shared_info()->optimization_disabled()) { | 1062 if (info->shared_info()->optimization_disabled()) { |
1063 info->AbortOptimization(); | 1063 info->AbortOptimization(); |
1064 InstallFullCode(*info); | 1064 InstallFullCode(*info); |
1065 if (FLAG_trace_concurrent_recompilation) { | 1065 if (FLAG_trace_concurrent_recompilation) { |
1066 PrintF(" ** aborting optimization for "); | 1066 PrintF(" ** aborting optimization for "); |
1067 info->closure()->PrintName(); | 1067 info->closure()->PrintName(); |
1068 PrintF(" as it has been disabled.\n"); | 1068 PrintF(" as it has been disabled.\n"); |
1069 } | 1069 } |
1070 ASSERT(!info->closure()->IsMarkedForInstallingRecompiledCode()); | 1070 ASSERT(!info->closure()->IsInRecompileQueue()); |
1071 return Handle<Code>::null(); | 1071 return Handle<Code>::null(); |
1072 } | 1072 } |
1073 | 1073 |
1074 Isolate* isolate = info->isolate(); | 1074 Isolate* isolate = info->isolate(); |
1075 VMState<COMPILER> state(isolate); | 1075 VMState<COMPILER> state(isolate); |
1076 Logger::TimerEventScope timer( | 1076 Logger::TimerEventScope timer( |
1077 isolate, Logger::TimerEventScope::v8_recompile_synchronous); | 1077 isolate, Logger::TimerEventScope::v8_recompile_synchronous); |
1078 // If crankshaft succeeded, install the optimized code else install | 1078 // If crankshaft succeeded, install the optimized code else install |
1079 // the unoptimized code. | 1079 // the unoptimized code. |
1080 OptimizingCompiler::Status status = optimizing_compiler->last_status(); | 1080 OptimizingCompiler::Status status = optimizing_compiler->last_status(); |
(...skipping 26 matching lines...) Expand all Loading... |
1107 info->closure()->PrintName(); | 1107 info->closure()->PrintName(); |
1108 PrintF(" installed.\n"); | 1108 PrintF(" installed.\n"); |
1109 } | 1109 } |
1110 } else { | 1110 } else { |
1111 info->AbortOptimization(); | 1111 info->AbortOptimization(); |
1112 InstallFullCode(*info); | 1112 InstallFullCode(*info); |
1113 } | 1113 } |
1114 // Optimized code is finally replacing unoptimized code. Reset the latter's | 1114 // Optimized code is finally replacing unoptimized code. Reset the latter's |
1115 // profiler ticks to prevent too soon re-opt after a deopt. | 1115 // profiler ticks to prevent too soon re-opt after a deopt. |
1116 info->shared_info()->code()->set_profiler_ticks(0); | 1116 info->shared_info()->code()->set_profiler_ticks(0); |
1117 ASSERT(!info->closure()->IsMarkedForInstallingRecompiledCode()); | 1117 ASSERT(!info->closure()->IsInRecompileQueue()); |
1118 return (status == OptimizingCompiler::SUCCEEDED) ? info->code() | 1118 return (status == OptimizingCompiler::SUCCEEDED) ? info->code() |
1119 : Handle<Code>::null(); | 1119 : Handle<Code>::null(); |
1120 } | 1120 } |
1121 | 1121 |
1122 | 1122 |
1123 Handle<SharedFunctionInfo> Compiler::BuildFunctionInfo(FunctionLiteral* literal, | 1123 Handle<SharedFunctionInfo> Compiler::BuildFunctionInfo(FunctionLiteral* literal, |
1124 Handle<Script> script) { | 1124 Handle<Script> script) { |
1125 // Precondition: code has been parsed and scopes have been analyzed. | 1125 // Precondition: code has been parsed and scopes have been analyzed. |
1126 CompilationInfoWithZone info(script); | 1126 CompilationInfoWithZone info(script); |
1127 info.SetFunction(literal); | 1127 info.SetFunction(literal); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1282 AllowHandleDereference allow_deref; | 1282 AllowHandleDereference allow_deref; |
1283 bool tracing_on = info()->IsStub() | 1283 bool tracing_on = info()->IsStub() |
1284 ? FLAG_trace_hydrogen_stubs | 1284 ? FLAG_trace_hydrogen_stubs |
1285 : (FLAG_trace_hydrogen && | 1285 : (FLAG_trace_hydrogen && |
1286 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1286 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1287 return (tracing_on && | 1287 return (tracing_on && |
1288 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1288 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1289 } | 1289 } |
1290 | 1290 |
1291 } } // namespace v8::internal | 1291 } } // namespace v8::internal |
OLD | NEW |