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/runtime-profiler.h" | 5 #include "src/runtime-profiler.h" |
6 | 6 |
7 #include "src/assembler.h" | 7 #include "src/assembler.h" |
8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 DCHECK_NE(reason, OptimizationReason::kDoNotOptimize); | 157 DCHECK_NE(reason, OptimizationReason::kDoNotOptimize); |
158 TraceRecompile(function, OptimizationReasonToString(reason), "baseline"); | 158 TraceRecompile(function, OptimizationReasonToString(reason), "baseline"); |
159 DCHECK(function->shared()->IsInterpreted()); | 159 DCHECK(function->shared()->IsInterpreted()); |
160 function->MarkForBaseline(); | 160 function->MarkForBaseline(); |
161 } | 161 } |
162 | 162 |
163 void RuntimeProfiler::AttemptOnStackReplacement(JavaScriptFrame* frame, | 163 void RuntimeProfiler::AttemptOnStackReplacement(JavaScriptFrame* frame, |
164 int loop_nesting_levels) { | 164 int loop_nesting_levels) { |
165 JSFunction* function = frame->function(); | 165 JSFunction* function = frame->function(); |
166 SharedFunctionInfo* shared = function->shared(); | 166 SharedFunctionInfo* shared = function->shared(); |
167 if (!FLAG_use_osr || !function->shared()->IsUserJavaScript()) { | 167 if (!FLAG_use_osr || function->shared()->IsBuiltin()) { |
168 return; | 168 return; |
169 } | 169 } |
170 | 170 |
171 // If the code is not optimizable, don't try OSR. | 171 // If the code is not optimizable, don't try OSR. |
172 if (shared->optimization_disabled()) return; | 172 if (shared->optimization_disabled()) return; |
173 | 173 |
174 // We are not prepared to do OSR for a function that already has an | 174 // We are not prepared to do OSR for a function that already has an |
175 // allocated arguments object. The optimized code would bypass it for | 175 // allocated arguments object. The optimized code would bypass it for |
176 // arguments accesses, which is unsound. Don't try OSR. | 176 // arguments accesses, which is unsound. Don't try OSR. |
177 if (shared->uses_arguments()) return; | 177 if (shared->uses_arguments()) return; |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 if (ticks < Smi::kMaxValue) { | 472 if (ticks < Smi::kMaxValue) { |
473 shared_function_info->set_profiler_ticks(ticks + 1); | 473 shared_function_info->set_profiler_ticks(ticks + 1); |
474 } | 474 } |
475 } | 475 } |
476 } | 476 } |
477 any_ic_changed_ = false; | 477 any_ic_changed_ = false; |
478 } | 478 } |
479 | 479 |
480 } // namespace internal | 480 } // namespace internal |
481 } // namespace v8 | 481 } // namespace v8 |
OLD | NEW |