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.h" | 9 #include "src/ast.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 | 323 |
324 void SaveHandles() { | 324 void SaveHandles() { |
325 SaveHandle(&closure_); | 325 SaveHandle(&closure_); |
326 SaveHandle(&shared_info_); | 326 SaveHandle(&shared_info_); |
327 SaveHandle(&context_); | 327 SaveHandle(&context_); |
328 SaveHandle(&script_); | 328 SaveHandle(&script_); |
329 SaveHandle(&unoptimized_code_); | 329 SaveHandle(&unoptimized_code_); |
330 } | 330 } |
331 | 331 |
332 void AbortOptimization(BailoutReason reason) { | 332 void AbortOptimization(BailoutReason reason) { |
333 if (bailout_reason_ != kNoReason) bailout_reason_ = reason; | 333 DCHECK(reason != kNoReason); |
wingo
2015/01/12 18:06:50
Because bailout_reason_ is initialized to kUnknown
| |
334 if (bailout_reason_ == kNoReason) bailout_reason_ = reason; | |
334 SetFlag(kDisableFutureOptimization); | 335 SetFlag(kDisableFutureOptimization); |
335 } | 336 } |
336 | 337 |
337 void RetryOptimization(BailoutReason reason) { | 338 void RetryOptimization(BailoutReason reason) { |
338 if (bailout_reason_ != kNoReason) bailout_reason_ = reason; | 339 DCHECK(reason != kNoReason); |
340 if (GetFlag(kDisableFutureOptimization)) return; | |
341 bailout_reason_ = reason; | |
339 } | 342 } |
340 | 343 |
341 BailoutReason bailout_reason() const { return bailout_reason_; } | 344 BailoutReason bailout_reason() const { return bailout_reason_; } |
342 | 345 |
343 int prologue_offset() const { | 346 int prologue_offset() const { |
344 DCHECK_NE(Code::kPrologueOffsetNotSet, prologue_offset_); | 347 DCHECK_NE(Code::kPrologueOffsetNotSet, prologue_offset_); |
345 return prologue_offset_; | 348 return prologue_offset_; |
346 } | 349 } |
347 | 350 |
348 void set_prologue_offset(int prologue_offset) { | 351 void set_prologue_offset(int prologue_offset) { |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
751 Zone zone_; | 754 Zone zone_; |
752 unsigned info_zone_start_allocation_size_; | 755 unsigned info_zone_start_allocation_size_; |
753 base::ElapsedTimer timer_; | 756 base::ElapsedTimer timer_; |
754 | 757 |
755 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 758 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
756 }; | 759 }; |
757 | 760 |
758 } } // namespace v8::internal | 761 } } // namespace v8::internal |
759 | 762 |
760 #endif // V8_COMPILER_H_ | 763 #endif // V8_COMPILER_H_ |
OLD | NEW |