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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 bool IsOptimizable() const { return mode_ == BASE; } | 262 bool IsOptimizable() const { return mode_ == BASE; } |
263 bool IsStub() const { return mode_ == STUB; } | 263 bool IsStub() const { return mode_ == STUB; } |
264 void SetOptimizing(BailoutId osr_ast_id, Handle<Code> unoptimized) { | 264 void SetOptimizing(BailoutId osr_ast_id, Handle<Code> unoptimized) { |
265 DCHECK(!shared_info().is_null()); | 265 DCHECK(!shared_info().is_null()); |
266 SetMode(OPTIMIZE); | 266 SetMode(OPTIMIZE); |
267 osr_ast_id_ = osr_ast_id; | 267 osr_ast_id_ = osr_ast_id; |
268 unoptimized_code_ = unoptimized; | 268 unoptimized_code_ = unoptimized; |
269 optimization_id_ = isolate()->NextOptimizationId(); | 269 optimization_id_ = isolate()->NextOptimizationId(); |
270 } | 270 } |
271 | 271 |
| 272 void SetStub(CodeStub* code_stub) { |
| 273 SetMode(STUB); |
| 274 code_stub_ = code_stub; |
| 275 } |
| 276 |
272 // Deoptimization support. | 277 // Deoptimization support. |
273 bool HasDeoptimizationSupport() const { | 278 bool HasDeoptimizationSupport() const { |
274 return GetFlag(kDeoptimizationSupport); | 279 return GetFlag(kDeoptimizationSupport); |
275 } | 280 } |
276 void EnableDeoptimizationSupport() { | 281 void EnableDeoptimizationSupport() { |
277 DCHECK(IsOptimizable()); | 282 DCHECK(IsOptimizable()); |
278 SetFlag(kDeoptimizationSupport); | 283 SetFlag(kDeoptimizationSupport); |
279 } | 284 } |
280 | 285 |
281 // Determines whether or not to insert a self-optimization header. | 286 // Determines whether or not to insert a self-optimization header. |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 Zone zone_; | 697 Zone zone_; |
693 size_t info_zone_start_allocation_size_; | 698 size_t info_zone_start_allocation_size_; |
694 base::ElapsedTimer timer_; | 699 base::ElapsedTimer timer_; |
695 | 700 |
696 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 701 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
697 }; | 702 }; |
698 | 703 |
699 } } // namespace v8::internal | 704 } } // namespace v8::internal |
700 | 705 |
701 #endif // V8_COMPILER_H_ | 706 #endif // V8_COMPILER_H_ |
OLD | NEW |