Chromium Code Reviews| 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" |
| 11 #include "src/compilation-dependencies.h" | 11 #include "src/compilation-dependencies.h" |
| 12 #include "src/signature.h" | |
| 12 #include "src/zone.h" | 13 #include "src/zone.h" |
| 13 | 14 |
| 14 namespace v8 { | 15 namespace v8 { |
| 15 namespace internal { | 16 namespace internal { |
| 16 | 17 |
| 17 class AstValueFactory; | 18 class AstValueFactory; |
| 18 class HydrogenCodeStub; | 19 class HydrogenCodeStub; |
| 19 class ParseInfo; | 20 class ParseInfo; |
| 20 class ScriptData; | 21 class ScriptData; |
| 21 | 22 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 bool IsOptimizable() const { return mode_ == BASE; } | 282 bool IsOptimizable() const { return mode_ == BASE; } |
| 282 bool IsStub() const { return mode_ == STUB; } | 283 bool IsStub() const { return mode_ == STUB; } |
| 283 void SetOptimizing(BailoutId osr_ast_id, Handle<Code> unoptimized) { | 284 void SetOptimizing(BailoutId osr_ast_id, Handle<Code> unoptimized) { |
| 284 DCHECK(!shared_info().is_null()); | 285 DCHECK(!shared_info().is_null()); |
| 285 SetMode(OPTIMIZE); | 286 SetMode(OPTIMIZE); |
| 286 osr_ast_id_ = osr_ast_id; | 287 osr_ast_id_ = osr_ast_id; |
| 287 unoptimized_code_ = unoptimized; | 288 unoptimized_code_ = unoptimized; |
| 288 optimization_id_ = isolate()->NextOptimizationId(); | 289 optimization_id_ = isolate()->NextOptimizationId(); |
| 289 } | 290 } |
| 290 | 291 |
| 292 void SetFunctionType(Type::FunctionType* function_type) { | |
|
Benedikt Meurer
2015/06/22 05:27:28
Nit: I think Type::FunctionType is an implementati
danno
2015/06/23 14:39:44
As discussed over chat with you and Jaro, I'm goin
rossberg
2015/06/29 12:29:34
FunctionType is not an implementation detail -- it
| |
| 293 function_type_ = function_type; | |
| 294 } | |
| 295 Type::FunctionType* function_type() const { return function_type_; } | |
| 296 | |
| 291 void SetStub(CodeStub* code_stub) { | 297 void SetStub(CodeStub* code_stub) { |
| 292 SetMode(STUB); | 298 SetMode(STUB); |
| 293 code_stub_ = code_stub; | 299 code_stub_ = code_stub; |
| 294 } | 300 } |
| 295 | 301 |
| 296 // Deoptimization support. | 302 // Deoptimization support. |
| 297 bool HasDeoptimizationSupport() const { | 303 bool HasDeoptimizationSupport() const { |
| 298 return GetFlag(kDeoptimizationSupport); | 304 return GetFlag(kDeoptimizationSupport); |
| 299 } | 305 } |
| 300 void EnableDeoptimizationSupport() { | 306 void EnableDeoptimizationSupport() { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 472 // during graph optimization. | 478 // during graph optimization. |
| 473 int opt_count_; | 479 int opt_count_; |
| 474 | 480 |
| 475 // Number of parameters used for compilation of stubs that require arguments. | 481 // Number of parameters used for compilation of stubs that require arguments. |
| 476 int parameter_count_; | 482 int parameter_count_; |
| 477 | 483 |
| 478 int optimization_id_; | 484 int optimization_id_; |
| 479 | 485 |
| 480 int osr_expr_stack_height_; | 486 int osr_expr_stack_height_; |
| 481 | 487 |
| 488 Type::FunctionType* function_type_; | |
|
Benedikt Meurer
2015/06/22 05:27:28
See above.
| |
| 489 | |
| 482 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); | 490 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); |
| 483 }; | 491 }; |
| 484 | 492 |
| 485 | 493 |
| 486 // A wrapper around a CompilationInfo that detaches the Handles from | 494 // A wrapper around a CompilationInfo that detaches the Handles from |
| 487 // the underlying DeferredHandleScope and stores them in info_ on | 495 // the underlying DeferredHandleScope and stores them in info_ on |
| 488 // destruction. | 496 // destruction. |
| 489 class CompilationHandleScope BASE_EMBEDDED { | 497 class CompilationHandleScope BASE_EMBEDDED { |
| 490 public: | 498 public: |
| 491 explicit CompilationHandleScope(CompilationInfo* info) | 499 explicit CompilationHandleScope(CompilationInfo* info) |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 682 Zone zone_; | 690 Zone zone_; |
| 683 size_t info_zone_start_allocation_size_; | 691 size_t info_zone_start_allocation_size_; |
| 684 base::ElapsedTimer timer_; | 692 base::ElapsedTimer timer_; |
| 685 | 693 |
| 686 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 694 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
| 687 }; | 695 }; |
| 688 | 696 |
| 689 } } // namespace v8::internal | 697 } } // namespace v8::internal |
| 690 | 698 |
| 691 #endif // V8_COMPILER_H_ | 699 #endif // V8_COMPILER_H_ |
| OLD | NEW |