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 #ifndef V8_COMPILER_H_ | 5 #ifndef V8_COMPILER_H_ |
6 #define V8_COMPILER_H_ | 6 #define V8_COMPILER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
380 | 380 |
381 Code::Kind output_code_kind() const { | 381 Code::Kind output_code_kind() const { |
382 return Code::ExtractKindFromFlags(code_flags_); | 382 return Code::ExtractKindFromFlags(code_flags_); |
383 } | 383 } |
384 | 384 |
385 protected: | 385 protected: |
386 ParseInfo* parse_info_; | 386 ParseInfo* parse_info_; |
387 | 387 |
388 void DisableFutureOptimization() { | 388 void DisableFutureOptimization() { |
389 if (GetFlag(kDisableFutureOptimization) && has_shared_info()) { | 389 if (GetFlag(kDisableFutureOptimization) && has_shared_info()) { |
390 shared_info()->DisableOptimization(bailout_reason()); | 390 // If Crankshaft tried to optimize this function, bailed out, and |
391 // doesn't want to try again, then use TurboFan next time. | |
392 if (!shared_info()->dont_crankshaft()) { | |
393 shared_info()->set_dont_crankshaft(true); | |
Michael Starzinger
2016/03/01 14:34:56
Just for posterity: This will also disable Cranksh
adamk
2016/03/01 19:15:44
The second one of these examples, kOptimizedTooMan
| |
394 if (FLAG_trace_opt) { | |
395 PrintF("[disabled Crankshaft for "); | |
396 shared_info()->ShortPrint(); | |
397 PrintF(", reason: %s]\n", GetBailoutReason(bailout_reason())); | |
398 } | |
399 } else { | |
400 shared_info()->DisableOptimization(bailout_reason()); | |
401 } | |
391 } | 402 } |
392 } | 403 } |
393 | 404 |
394 private: | 405 private: |
395 // Compilation mode. | 406 // Compilation mode. |
396 // BASE is generated by the full codegen, optionally prepared for bailouts. | 407 // BASE is generated by the full codegen, optionally prepared for bailouts. |
397 // OPTIMIZE is optimized code generated by the Hydrogen-based backend. | 408 // OPTIMIZE is optimized code generated by the Hydrogen-based backend. |
398 enum Mode { | 409 enum Mode { |
399 BASE, | 410 BASE, |
400 OPTIMIZE, | 411 OPTIMIZE, |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
677 size_t info_zone_start_allocation_size_; | 688 size_t info_zone_start_allocation_size_; |
678 base::ElapsedTimer timer_; | 689 base::ElapsedTimer timer_; |
679 | 690 |
680 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 691 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
681 }; | 692 }; |
682 | 693 |
683 } // namespace internal | 694 } // namespace internal |
684 } // namespace v8 | 695 } // namespace v8 |
685 | 696 |
686 #endif // V8_COMPILER_H_ | 697 #endif // V8_COMPILER_H_ |
OLD | NEW |