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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 bool is_first_compile() const { return GetFlag(kFirstCompile); } | 208 bool is_first_compile() const { return GetFlag(kFirstCompile); } |
209 | 209 |
210 bool GeneratePreagedPrologue() const { | 210 bool GeneratePreagedPrologue() const { |
211 // Generate a pre-aged prologue if we are optimizing for size, which | 211 // Generate a pre-aged prologue if we are optimizing for size, which |
212 // will make code flushing more aggressive. Only apply to Code::FUNCTION, | 212 // will make code flushing more aggressive. Only apply to Code::FUNCTION, |
213 // since StaticMarkingVisitor::IsFlushable only flushes proper functions. | 213 // since StaticMarkingVisitor::IsFlushable only flushes proper functions. |
214 return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() && | 214 return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() && |
215 !is_debug() && output_code_kind() == Code::FUNCTION; | 215 !is_debug() && output_code_kind() == Code::FUNCTION; |
216 } | 216 } |
217 | 217 |
218 void EnsureFeedbackMetadata(); | 218 void EnsureFeedbackVector(); |
219 Handle<TypeFeedbackMetadata> feedback_metadata() const { | 219 Handle<TypeFeedbackVector> feedback_vector() const { |
220 return feedback_metadata_; | 220 return feedback_vector_; |
221 } | 221 } |
222 void SetCode(Handle<Code> code) { code_ = code; } | 222 void SetCode(Handle<Code> code) { code_ = code; } |
223 | 223 |
224 void SetBytecodeArray(Handle<BytecodeArray> bytecode_array) { | 224 void SetBytecodeArray(Handle<BytecodeArray> bytecode_array) { |
225 bytecode_array_ = bytecode_array; | 225 bytecode_array_ = bytecode_array; |
226 } | 226 } |
227 | 227 |
228 bool ShouldTrapOnDeopt() const { | 228 bool ShouldTrapOnDeopt() const { |
229 return (FLAG_trap_on_deopt && IsOptimizing()) || | 229 return (FLAG_trap_on_deopt && IsOptimizing()) || |
230 (FLAG_trap_on_stub_deopt && IsStub()); | 230 (FLAG_trap_on_stub_deopt && IsStub()); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 bool GetFlag(Flag flag) const { return (flags_ & flag) != 0; } | 405 bool GetFlag(Flag flag) const { return (flags_ & flag) != 0; } |
406 | 406 |
407 unsigned flags_; | 407 unsigned flags_; |
408 | 408 |
409 Code::Flags code_flags_; | 409 Code::Flags code_flags_; |
410 | 410 |
411 // The compiled code. | 411 // The compiled code. |
412 Handle<Code> code_; | 412 Handle<Code> code_; |
413 | 413 |
414 // Used by codegen, ultimately kept rooted by the SharedFunctionInfo. | 414 // Used by codegen, ultimately kept rooted by the SharedFunctionInfo. |
415 Handle<TypeFeedbackMetadata> feedback_metadata_; | 415 Handle<TypeFeedbackVector> feedback_vector_; |
416 | 416 |
417 // Compilation mode flag and whether deoptimization is allowed. | 417 // Compilation mode flag and whether deoptimization is allowed. |
418 Mode mode_; | 418 Mode mode_; |
419 BailoutId osr_ast_id_; | 419 BailoutId osr_ast_id_; |
420 // The unoptimized code we patched for OSR may not be the shared code | 420 // The unoptimized code we patched for OSR may not be the shared code |
421 // afterwards, since we may need to compile it again to include deoptimization | 421 // afterwards, since we may need to compile it again to include deoptimization |
422 // data. Keep track which code we patched. | 422 // data. Keep track which code we patched. |
423 Handle<Code> unoptimized_code_; | 423 Handle<Code> unoptimized_code_; |
424 | 424 |
425 // Holds the bytecode array generated by the interpreter. | 425 // Holds the bytecode array generated by the interpreter. |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 size_t info_zone_start_allocation_size_; | 661 size_t info_zone_start_allocation_size_; |
662 base::ElapsedTimer timer_; | 662 base::ElapsedTimer timer_; |
663 | 663 |
664 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 664 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
665 }; | 665 }; |
666 | 666 |
667 } // namespace internal | 667 } // namespace internal |
668 } // namespace v8 | 668 } // namespace v8 |
669 | 669 |
670 #endif // V8_COMPILER_H_ | 670 #endif // V8_COMPILER_H_ |
OLD | NEW |