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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 | 240 |
241 bool has_global_object() const { return has_native_context(); } | 241 bool has_global_object() const { return has_native_context(); } |
242 | 242 |
243 JSGlobalObject* global_object() const { | 243 JSGlobalObject* global_object() const { |
244 return has_global_object() ? native_context()->global_object() : nullptr; | 244 return has_global_object() ? native_context()->global_object() : nullptr; |
245 } | 245 } |
246 | 246 |
247 // Accessors for the different compilation modes. | 247 // Accessors for the different compilation modes. |
248 bool IsOptimizing() const { return mode_ == OPTIMIZE; } | 248 bool IsOptimizing() const { return mode_ == OPTIMIZE; } |
249 bool IsStub() const { return mode_ == STUB; } | 249 bool IsStub() const { return mode_ == STUB; } |
250 void SetOptimizing(BailoutId osr_ast_id, Handle<Code> unoptimized) { | 250 void SetOptimizing(BailoutId osr_ast_id = BailoutId::None(), |
251 Handle<Code> unoptimized = Handle<Code>::null()) { | |
rmcilroy
2016/02/09 22:06:07
nit - maybe remove these parameters, and instead a
Michael Starzinger
2016/02/10 10:01:11
Done. Nice idea, I like!
| |
251 DCHECK(has_shared_info()); | 252 DCHECK(has_shared_info()); |
252 SetMode(OPTIMIZE); | 253 SetMode(OPTIMIZE); |
253 osr_ast_id_ = osr_ast_id; | 254 osr_ast_id_ = osr_ast_id; |
254 unoptimized_code_ = unoptimized; | 255 unoptimized_code_ = unoptimized; |
255 optimization_id_ = isolate()->NextOptimizationId(); | 256 optimization_id_ = isolate()->NextOptimizationId(); |
256 code_flags_ = | 257 code_flags_ = |
257 Code::KindField::update(code_flags_, Code::OPTIMIZED_FUNCTION); | 258 Code::KindField::update(code_flags_, Code::OPTIMIZED_FUNCTION); |
258 } | 259 } |
259 | 260 |
260 // Deoptimization support. | 261 // Deoptimization support. |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
662 size_t info_zone_start_allocation_size_; | 663 size_t info_zone_start_allocation_size_; |
663 base::ElapsedTimer timer_; | 664 base::ElapsedTimer timer_; |
664 | 665 |
665 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 666 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
666 }; | 667 }; |
667 | 668 |
668 } // namespace internal | 669 } // namespace internal |
669 } // namespace v8 | 670 } // namespace v8 |
670 | 671 |
671 #endif // V8_COMPILER_H_ | 672 #endif // V8_COMPILER_H_ |
OLD | NEW |