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 945 matching lines...) Loading... |
956 } | 956 } |
957 | 957 |
958 if (isolate->has_pending_exception()) { | 958 if (isolate->has_pending_exception()) { |
959 isolate->clear_pending_exception(); | 959 isolate->clear_pending_exception(); |
960 } | 960 } |
961 } | 961 } |
962 | 962 |
963 | 963 |
964 void Compiler::InstallOptimizedCode(OptimizingCompiler* optimizing_compiler) { | 964 void Compiler::InstallOptimizedCode(OptimizingCompiler* optimizing_compiler) { |
965 SmartPointer<CompilationInfo> info(optimizing_compiler->info()); | 965 SmartPointer<CompilationInfo> info(optimizing_compiler->info()); |
| 966 // Function may have been optimized meanwhile by OSR. |
| 967 if (FLAG_use_osr) { |
| 968 // Function may have already been optimized meanwhile by OSR. |
| 969 if (!info->code().is_null() && |
| 970 info->code()->kind() == Code::OPTIMIZED_FUNCTION) { |
| 971 return; |
| 972 } |
| 973 // OSR may also have caused optimization to be disabled. |
| 974 if (info->shared_info()->optimization_disabled()) return; |
| 975 } |
| 976 |
966 Isolate* isolate = info->isolate(); | 977 Isolate* isolate = info->isolate(); |
967 VMState state(isolate, PARALLEL_COMPILER); | 978 VMState state(isolate, PARALLEL_COMPILER); |
968 Logger::TimerEventScope timer( | 979 Logger::TimerEventScope timer( |
969 isolate, Logger::TimerEventScope::v8_recompile_synchronous); | 980 isolate, Logger::TimerEventScope::v8_recompile_synchronous); |
970 // If crankshaft succeeded, install the optimized code else install | 981 // If crankshaft succeeded, install the optimized code else install |
971 // the unoptimized code. | 982 // the unoptimized code. |
972 OptimizingCompiler::Status status = optimizing_compiler->last_status(); | 983 OptimizingCompiler::Status status = optimizing_compiler->last_status(); |
973 if (status != OptimizingCompiler::SUCCEEDED) { | 984 if (status != OptimizingCompiler::SUCCEEDED) { |
974 optimizing_compiler->info()->set_bailout_reason( | 985 optimizing_compiler->info()->set_bailout_reason( |
975 "failed/bailed out last time"); | 986 "failed/bailed out last time"); |
(...skipping 144 matching lines...) Loading... |
1120 } | 1131 } |
1121 } | 1132 } |
1122 | 1133 |
1123 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 1134 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
1124 Handle<Script>(info->script()), | 1135 Handle<Script>(info->script()), |
1125 Handle<Code>(info->code()), | 1136 Handle<Code>(info->code()), |
1126 info)); | 1137 info)); |
1127 } | 1138 } |
1128 | 1139 |
1129 } } // namespace v8::internal | 1140 } } // namespace v8::internal |
OLD | NEW |