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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 for (int i = 0; i < loop_nesting_levels; i++) { | 142 for (int i = 0; i < loop_nesting_levels; i++) { |
143 BackEdgeTable::Patch(isolate_, shared->code()); | 143 BackEdgeTable::Patch(isolate_, shared->code()); |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 | 147 |
148 void RuntimeProfiler::OptimizeNow() { | 148 void RuntimeProfiler::OptimizeNow() { |
149 HandleScope scope(isolate_); | 149 HandleScope scope(isolate_); |
150 | 150 |
151 if (isolate_->DebuggerHasBreakPoints()) return; | 151 if (!isolate_->use_crankshaft() || isolate_->DebuggerHasBreakPoints()) return; |
152 | 152 |
153 DisallowHeapAllocation no_gc; | 153 DisallowHeapAllocation no_gc; |
154 | 154 |
155 // Run through the JavaScript frames and collect them. If we already | 155 // Run through the JavaScript frames and collect them. If we already |
156 // have a sample of the function, we mark it for optimizations | 156 // have a sample of the function, we mark it for optimizations |
157 // (eagerly or lazily). | 157 // (eagerly or lazily). |
158 int frame_count = 0; | 158 int frame_count = 0; |
159 int frame_count_limit = FLAG_frame_count; | 159 int frame_count_limit = FLAG_frame_count; |
160 for (JavaScriptFrameIterator it(isolate_); | 160 for (JavaScriptFrameIterator it(isolate_); |
161 frame_count++ < frame_count_limit && !it.done(); | 161 frame_count++ < frame_count_limit && !it.done(); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 } | 262 } |
263 } else { | 263 } else { |
264 shared_code->set_profiler_ticks(ticks + 1); | 264 shared_code->set_profiler_ticks(ticks + 1); |
265 } | 265 } |
266 } | 266 } |
267 any_ic_changed_ = false; | 267 any_ic_changed_ = false; |
268 } | 268 } |
269 | 269 |
270 | 270 |
271 } } // namespace v8::internal | 271 } } // namespace v8::internal |
OLD | NEW |