| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/runtime-profiler.h" | 7 #include "src/runtime-profiler.h" |
| 8 | 8 |
| 9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 | 111 |
| 112 void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function, | 112 void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function, |
| 113 int loop_nesting_levels) { | 113 int loop_nesting_levels) { |
| 114 SharedFunctionInfo* shared = function->shared(); | 114 SharedFunctionInfo* shared = function->shared(); |
| 115 if (!FLAG_use_osr || function->IsBuiltin()) { | 115 if (!FLAG_use_osr || function->IsBuiltin()) { |
| 116 return; | 116 return; |
| 117 } | 117 } |
| 118 | 118 |
| 119 // If the code is not optimizable, don't try OSR. | 119 // If the code is not optimizable, don't try OSR. |
| 120 if (!shared->code()->optimizable()) return; | 120 if (shared->optimization_disabled()) return; |
| 121 | 121 |
| 122 // We are not prepared to do OSR for a function that already has an | 122 // We are not prepared to do OSR for a function that already has an |
| 123 // allocated arguments object. The optimized code would bypass it for | 123 // allocated arguments object. The optimized code would bypass it for |
| 124 // arguments accesses, which is unsound. Don't try OSR. | 124 // arguments accesses, which is unsound. Don't try OSR. |
| 125 if (shared->uses_arguments()) return; | 125 if (shared->uses_arguments()) return; |
| 126 | 126 |
| 127 // We're using on-stack replacement: patch the unoptimized code so that | 127 // We're using on-stack replacement: patch the unoptimized code so that |
| 128 // any back edge in any unoptimized frame will trigger on-stack | 128 // any back edge in any unoptimized frame will trigger on-stack |
| 129 // replacement for that frame. | 129 // replacement for that frame. |
| 130 if (FLAG_trace_osr) { | 130 if (FLAG_trace_osr) { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 } | 256 } |
| 257 } else { | 257 } else { |
| 258 shared_code->set_profiler_ticks(ticks + 1); | 258 shared_code->set_profiler_ticks(ticks + 1); |
| 259 } | 259 } |
| 260 } | 260 } |
| 261 any_ic_changed_ = false; | 261 any_ic_changed_ = false; |
| 262 } | 262 } |
| 263 | 263 |
| 264 | 264 |
| 265 } } // namespace v8::internal | 265 } } // namespace v8::internal |
| OLD | NEW |