| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 315 } |
| 316 | 316 |
| 317 bool GeneratePreagedPrologue() const { | 317 bool GeneratePreagedPrologue() const { |
| 318 // Generate a pre-aged prologue if we are optimizing for size, which | 318 // Generate a pre-aged prologue if we are optimizing for size, which |
| 319 // will make code flushing more aggressive. Only apply to Code::FUNCTION, | 319 // will make code flushing more aggressive. Only apply to Code::FUNCTION, |
| 320 // since StaticMarkingVisitor::IsFlushable only flushes proper functions. | 320 // since StaticMarkingVisitor::IsFlushable only flushes proper functions. |
| 321 return FLAG_optimize_for_size && FLAG_age_code && !is_debug() && | 321 return FLAG_optimize_for_size && FLAG_age_code && !is_debug() && |
| 322 output_code_kind() == Code::FUNCTION; | 322 output_code_kind() == Code::FUNCTION; |
| 323 } | 323 } |
| 324 | 324 |
| 325 void EnsureFeedbackVector(); | |
| 326 Handle<TypeFeedbackVector> feedback_vector() const { | |
| 327 return feedback_vector_; | |
| 328 } | |
| 329 void SetCode(Handle<Code> code) { code_ = code; } | 325 void SetCode(Handle<Code> code) { code_ = code; } |
| 330 | 326 |
| 331 void SetBytecodeArray(Handle<BytecodeArray> bytecode_array) { | 327 void SetBytecodeArray(Handle<BytecodeArray> bytecode_array) { |
| 332 bytecode_array_ = bytecode_array; | 328 bytecode_array_ = bytecode_array; |
| 333 } | 329 } |
| 334 | 330 |
| 335 bool ShouldTrapOnDeopt() const { | 331 bool ShouldTrapOnDeopt() const { |
| 336 return (FLAG_trap_on_deopt && IsOptimizing()) || | 332 return (FLAG_trap_on_deopt && IsOptimizing()) || |
| 337 (FLAG_trap_on_stub_deopt && IsStub()); | 333 (FLAG_trap_on_stub_deopt && IsStub()); |
| 338 } | 334 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 523 |
| 528 bool GetFlag(Flag flag) const { return (flags_ & flag) != 0; } | 524 bool GetFlag(Flag flag) const { return (flags_ & flag) != 0; } |
| 529 | 525 |
| 530 unsigned flags_; | 526 unsigned flags_; |
| 531 | 527 |
| 532 Code::Flags code_flags_; | 528 Code::Flags code_flags_; |
| 533 | 529 |
| 534 // The compiled code. | 530 // The compiled code. |
| 535 Handle<Code> code_; | 531 Handle<Code> code_; |
| 536 | 532 |
| 537 // Used by codegen, ultimately kept rooted by the SharedFunctionInfo. | |
| 538 Handle<TypeFeedbackVector> feedback_vector_; | |
| 539 | |
| 540 // Compilation mode flag and whether deoptimization is allowed. | 533 // Compilation mode flag and whether deoptimization is allowed. |
| 541 Mode mode_; | 534 Mode mode_; |
| 542 BailoutId osr_ast_id_; | 535 BailoutId osr_ast_id_; |
| 543 | 536 |
| 544 // Holds the bytecode array generated by the interpreter. | 537 // Holds the bytecode array generated by the interpreter. |
| 545 // TODO(rmcilroy/mstarzinger): Temporary work-around until compiler.cc is | 538 // TODO(rmcilroy/mstarzinger): Temporary work-around until compiler.cc is |
| 546 // refactored to avoid us needing to carry the BytcodeArray around. | 539 // refactored to avoid us needing to carry the BytcodeArray around. |
| 547 Handle<BytecodeArray> bytecode_array_; | 540 Handle<BytecodeArray> bytecode_array_; |
| 548 | 541 |
| 549 // The zone from which the compilation pipeline working on this | 542 // The zone from which the compilation pipeline working on this |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 OptimizedCompileJob* job_; | 642 OptimizedCompileJob* job_; |
| 650 base::ElapsedTimer timer_; | 643 base::ElapsedTimer timer_; |
| 651 base::TimeDelta* location_; | 644 base::TimeDelta* location_; |
| 652 }; | 645 }; |
| 653 }; | 646 }; |
| 654 | 647 |
| 655 } // namespace internal | 648 } // namespace internal |
| 656 } // namespace v8 | 649 } // namespace v8 |
| 657 | 650 |
| 658 #endif // V8_COMPILER_H_ | 651 #endif // V8_COMPILER_H_ |
| OLD | NEW |