| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 290 |
| 291 // We should never arrive here if optimization has been disabled on the | 291 // We should never arrive here if optimization has been disabled on the |
| 292 // shared function info. | 292 // shared function info. |
| 293 ASSERT(!info()->shared_info()->optimization_disabled()); | 293 ASSERT(!info()->shared_info()->optimization_disabled()); |
| 294 | 294 |
| 295 // Fall back to using the full code generator if it's not possible | 295 // Fall back to using the full code generator if it's not possible |
| 296 // to use the Hydrogen-based optimizing compiler. We already have | 296 // to use the Hydrogen-based optimizing compiler. We already have |
| 297 // generated code for this from the shared function object. | 297 // generated code for this from the shared function object. |
| 298 if (FLAG_always_full_compiler) return AbortOptimization(); | 298 if (FLAG_always_full_compiler) return AbortOptimization(); |
| 299 | 299 |
| 300 // Do not use crankshaft if compiling for debugging. | 300 // Do not use crankshaft if we need to be able to set break points. |
| 301 if (info()->is_debug()) return AbortOptimization(kDebuggerIsActive); | 301 if (isolate()->DebuggerHasBreakPoints()) { |
| 302 return AbortOptimization(kDebuggerHasBreakPoints); |
| 303 } |
| 302 | 304 |
| 303 // Limit the number of times we re-compile a functions with | 305 // Limit the number of times we re-compile a functions with |
| 304 // the optimizing compiler. | 306 // the optimizing compiler. |
| 305 const int kMaxOptCount = | 307 const int kMaxOptCount = |
| 306 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; | 308 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; |
| 307 if (info()->opt_count() > kMaxOptCount) { | 309 if (info()->opt_count() > kMaxOptCount) { |
| 308 return AbortAndDisableOptimization(kOptimizedTooManyTimes); | 310 return AbortAndDisableOptimization(kOptimizedTooManyTimes); |
| 309 } | 311 } |
| 310 | 312 |
| 311 // Due to an encoding limit on LUnallocated operands in the Lithium | 313 // Due to an encoding limit on LUnallocated operands in the Lithium |
| (...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1296 AllowHandleDereference allow_deref; | 1298 AllowHandleDereference allow_deref; |
| 1297 bool tracing_on = info()->IsStub() | 1299 bool tracing_on = info()->IsStub() |
| 1298 ? FLAG_trace_hydrogen_stubs | 1300 ? FLAG_trace_hydrogen_stubs |
| 1299 : (FLAG_trace_hydrogen && | 1301 : (FLAG_trace_hydrogen && |
| 1300 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1302 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
| 1301 return (tracing_on && | 1303 return (tracing_on && |
| 1302 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1304 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
| 1303 } | 1305 } |
| 1304 | 1306 |
| 1305 } } // namespace v8::internal | 1307 } } // namespace v8::internal |
| OLD | NEW |