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/compiler.h" | 7 #include "src/compiler.h" |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 // We should never arrive here if optimization has been disabled on the | 300 // We should never arrive here if optimization has been disabled on the |
301 // shared function info. | 301 // shared function info. |
302 ASSERT(!info()->shared_info()->optimization_disabled()); | 302 ASSERT(!info()->shared_info()->optimization_disabled()); |
303 | 303 |
304 // Fall back to using the full code generator if it's not possible | 304 // Fall back to using the full code generator if it's not possible |
305 // to use the Hydrogen-based optimizing compiler. We already have | 305 // to use the Hydrogen-based optimizing compiler. We already have |
306 // generated code for this from the shared function object. | 306 // generated code for this from the shared function object. |
307 if (FLAG_always_full_compiler) return AbortOptimization(); | 307 if (FLAG_always_full_compiler) return AbortOptimization(); |
308 | 308 |
309 // Do not use crankshaft if compiling for debugging. | 309 // Do not use crankshaft if compiling for debugging. |
310 if (info()->is_debug()) return AbortOptimization(kDebuggerIsActive); | 310 if (isolate()->DebuggerHasBreakPoints()) { |
| 311 return AbortOptimization(kDebuggerIsActive); |
| 312 } |
311 | 313 |
312 // Limit the number of times we re-compile a functions with | 314 // Limit the number of times we re-compile a functions with |
313 // the optimizing compiler. | 315 // the optimizing compiler. |
314 const int kMaxOptCount = | 316 const int kMaxOptCount = |
315 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; | 317 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; |
316 if (info()->opt_count() > kMaxOptCount) { | 318 if (info()->opt_count() > kMaxOptCount) { |
317 return AbortAndDisableOptimization(kOptimizedTooManyTimes); | 319 return AbortAndDisableOptimization(kOptimizedTooManyTimes); |
318 } | 320 } |
319 | 321 |
320 // Due to an encoding limit on LUnallocated operands in the Lithium | 322 // Due to an encoding limit on LUnallocated operands in the Lithium |
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 AllowHandleDereference allow_deref; | 1311 AllowHandleDereference allow_deref; |
1310 bool tracing_on = info()->IsStub() | 1312 bool tracing_on = info()->IsStub() |
1311 ? FLAG_trace_hydrogen_stubs | 1313 ? FLAG_trace_hydrogen_stubs |
1312 : (FLAG_trace_hydrogen && | 1314 : (FLAG_trace_hydrogen && |
1313 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1315 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1314 return (tracing_on && | 1316 return (tracing_on && |
1315 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1317 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1316 } | 1318 } |
1317 | 1319 |
1318 } } // namespace v8::internal | 1320 } } // namespace v8::internal |
OLD | NEW |