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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 int num_parameters() const; | 166 int num_parameters() const; |
167 int num_parameters_including_this() const; | 167 int num_parameters_including_this() const; |
168 bool is_this_defined() const; | 168 bool is_this_defined() const; |
169 int num_heap_slots() const; | 169 int num_heap_slots() const; |
170 | 170 |
171 void set_parameter_count(int parameter_count) { | 171 void set_parameter_count(int parameter_count) { |
172 DCHECK(IsStub()); | 172 DCHECK(IsStub()); |
173 parameter_count_ = parameter_count; | 173 parameter_count_ = parameter_count; |
174 } | 174 } |
175 | 175 |
| 176 bool has_bytecode_array() const { return !bytecode_array_.is_null(); } |
| 177 Handle<BytecodeArray> bytecode_array() const { return bytecode_array_; } |
| 178 |
176 bool is_tracking_positions() const { return track_positions_; } | 179 bool is_tracking_positions() const { return track_positions_; } |
177 | 180 |
178 bool is_calling() const { | 181 bool is_calling() const { |
179 return GetFlag(kDeferredCalling) || GetFlag(kNonDeferredCalling); | 182 return GetFlag(kDeferredCalling) || GetFlag(kNonDeferredCalling); |
180 } | 183 } |
181 | 184 |
182 void MarkAsDeferredCalling() { SetFlag(kDeferredCalling); } | 185 void MarkAsDeferredCalling() { SetFlag(kDeferredCalling); } |
183 | 186 |
184 bool is_deferred_calling() const { return GetFlag(kDeferredCalling); } | 187 bool is_deferred_calling() const { return GetFlag(kDeferredCalling); } |
185 | 188 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() && | 270 return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() && |
268 !is_debug(); | 271 !is_debug(); |
269 } | 272 } |
270 | 273 |
271 void EnsureFeedbackVector(); | 274 void EnsureFeedbackVector(); |
272 Handle<TypeFeedbackVector> feedback_vector() const { | 275 Handle<TypeFeedbackVector> feedback_vector() const { |
273 return feedback_vector_; | 276 return feedback_vector_; |
274 } | 277 } |
275 void SetCode(Handle<Code> code) { code_ = code; } | 278 void SetCode(Handle<Code> code) { code_ = code; } |
276 | 279 |
| 280 void SetBytecodeArray(Handle<BytecodeArray> bytecode_array) { |
| 281 bytecode_array_ = bytecode_array; |
| 282 } |
| 283 |
277 bool ShouldTrapOnDeopt() const { | 284 bool ShouldTrapOnDeopt() const { |
278 return (FLAG_trap_on_deopt && IsOptimizing()) || | 285 return (FLAG_trap_on_deopt && IsOptimizing()) || |
279 (FLAG_trap_on_stub_deopt && IsStub()); | 286 (FLAG_trap_on_stub_deopt && IsStub()); |
280 } | 287 } |
281 | 288 |
282 bool has_global_object() const { | 289 bool has_global_object() const { |
283 return !closure().is_null() && | 290 return !closure().is_null() && |
284 (closure()->context()->global_object() != NULL); | 291 (closure()->context()->global_object() != NULL); |
285 } | 292 } |
286 | 293 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 Handle<TypeFeedbackVector> feedback_vector_; | 459 Handle<TypeFeedbackVector> feedback_vector_; |
453 | 460 |
454 // Compilation mode flag and whether deoptimization is allowed. | 461 // Compilation mode flag and whether deoptimization is allowed. |
455 Mode mode_; | 462 Mode mode_; |
456 BailoutId osr_ast_id_; | 463 BailoutId osr_ast_id_; |
457 // The unoptimized code we patched for OSR may not be the shared code | 464 // The unoptimized code we patched for OSR may not be the shared code |
458 // afterwards, since we may need to compile it again to include deoptimization | 465 // afterwards, since we may need to compile it again to include deoptimization |
459 // data. Keep track which code we patched. | 466 // data. Keep track which code we patched. |
460 Handle<Code> unoptimized_code_; | 467 Handle<Code> unoptimized_code_; |
461 | 468 |
| 469 // Holds the bytecode array generated by the interpreter. |
| 470 // TODO(rmcilroy/mstarzinger): Temporary work-around until compiler.cc is |
| 471 // refactored to avoid us needing to carry the BytcodeArray around. |
| 472 Handle<BytecodeArray> bytecode_array_; |
| 473 |
462 // The zone from which the compilation pipeline working on this | 474 // The zone from which the compilation pipeline working on this |
463 // CompilationInfo allocates. | 475 // CompilationInfo allocates. |
464 Zone* zone_; | 476 Zone* zone_; |
465 | 477 |
466 DeferredHandles* deferred_handles_; | 478 DeferredHandles* deferred_handles_; |
467 | 479 |
468 // Dependencies for this compilation, e.g. stable maps. | 480 // Dependencies for this compilation, e.g. stable maps. |
469 CompilationDependencies dependencies_; | 481 CompilationDependencies dependencies_; |
470 | 482 |
471 BailoutReason bailout_reason_; | 483 BailoutReason bailout_reason_; |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 size_t info_zone_start_allocation_size_; | 705 size_t info_zone_start_allocation_size_; |
694 base::ElapsedTimer timer_; | 706 base::ElapsedTimer timer_; |
695 | 707 |
696 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 708 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
697 }; | 709 }; |
698 | 710 |
699 } // namespace internal | 711 } // namespace internal |
700 } // namespace v8 | 712 } // namespace v8 |
701 | 713 |
702 #endif // V8_COMPILER_H_ | 714 #endif // V8_COMPILER_H_ |
OLD | NEW |