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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } | 287 } |
288 | 288 |
289 GlobalObject* global_object() const { | 289 GlobalObject* global_object() const { |
290 return has_global_object() ? closure()->context()->global_object() : NULL; | 290 return has_global_object() ? closure()->context()->global_object() : NULL; |
291 } | 291 } |
292 | 292 |
293 // Accessors for the different compilation modes. | 293 // Accessors for the different compilation modes. |
294 bool IsOptimizing() const { return mode_ == OPTIMIZE; } | 294 bool IsOptimizing() const { return mode_ == OPTIMIZE; } |
295 bool IsStub() const { return mode_ == STUB; } | 295 bool IsStub() const { return mode_ == STUB; } |
296 void SetOptimizing(BailoutId osr_ast_id, Handle<Code> unoptimized) { | 296 void SetOptimizing(BailoutId osr_ast_id, Handle<Code> unoptimized) { |
297 DCHECK(!shared_info().is_null()); | 297 DCHECK(has_shared_info()); |
298 SetMode(OPTIMIZE); | 298 SetMode(OPTIMIZE); |
299 osr_ast_id_ = osr_ast_id; | 299 osr_ast_id_ = osr_ast_id; |
300 unoptimized_code_ = unoptimized; | 300 unoptimized_code_ = unoptimized; |
301 optimization_id_ = isolate()->NextOptimizationId(); | 301 optimization_id_ = isolate()->NextOptimizationId(); |
302 } | 302 } |
303 | 303 |
304 void SetFunctionType(Type::FunctionType* function_type) { | 304 void SetFunctionType(Type::FunctionType* function_type) { |
305 function_type_ = function_type; | 305 function_type_ = function_type; |
306 } | 306 } |
307 Type::FunctionType* function_type() const { return function_type_; } | 307 Type::FunctionType* function_type() const { return function_type_; } |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 Zone zone_; | 701 Zone zone_; |
702 size_t info_zone_start_allocation_size_; | 702 size_t info_zone_start_allocation_size_; |
703 base::ElapsedTimer timer_; | 703 base::ElapsedTimer timer_; |
704 | 704 |
705 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 705 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
706 }; | 706 }; |
707 | 707 |
708 } } // namespace v8::internal | 708 } } // namespace v8::internal |
709 | 709 |
710 #endif // V8_COMPILER_H_ | 710 #endif // V8_COMPILER_H_ |
OLD | NEW |