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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 PrintF("]\n"); | 101 PrintF("]\n"); |
102 } | 102 } |
103 | 103 |
104 function->AttemptConcurrentOptimization(); | 104 function->AttemptConcurrentOptimization(); |
105 } | 105 } |
106 | 106 |
107 | 107 |
108 void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function, | 108 void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function, |
109 int loop_nesting_levels) { | 109 int loop_nesting_levels) { |
110 SharedFunctionInfo* shared = function->shared(); | 110 SharedFunctionInfo* shared = function->shared(); |
111 if (!FLAG_use_osr || function->IsBuiltin()) { | 111 if (!FLAG_use_osr || function->shared()->IsBuiltin()) { |
112 return; | 112 return; |
113 } | 113 } |
114 | 114 |
115 // If the code is not optimizable, don't try OSR. | 115 // If the code is not optimizable, don't try OSR. |
116 if (shared->optimization_disabled()) return; | 116 if (shared->optimization_disabled()) return; |
117 | 117 |
118 // We are not prepared to do OSR for a function that already has an | 118 // We are not prepared to do OSR for a function that already has an |
119 // allocated arguments object. The optimized code would bypass it for | 119 // allocated arguments object. The optimized code would bypass it for |
120 // arguments accesses, which is unsound. Don't try OSR. | 120 // arguments accesses, which is unsound. Don't try OSR. |
121 if (shared->uses_arguments()) return; | 121 if (shared->uses_arguments()) return; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 } else { | 255 } else { |
256 shared_code->set_profiler_ticks(ticks + 1); | 256 shared_code->set_profiler_ticks(ticks + 1); |
257 } | 257 } |
258 } | 258 } |
259 any_ic_changed_ = false; | 259 any_ic_changed_ = false; |
260 } | 260 } |
261 | 261 |
262 | 262 |
263 } // namespace internal | 263 } // namespace internal |
264 } // namespace v8 | 264 } // namespace v8 |
OLD | NEW |