| 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_FULL_CODEGEN_FULL_CODEGEN_H_ | 5 #ifndef V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
| 6 #define V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 6 #define V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
| 10 #include "src/ast.h" | 10 #include "src/ast.h" |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 | 413 |
| 414 // Platform-specific code for equality comparison with a nil-like value. | 414 // Platform-specific code for equality comparison with a nil-like value. |
| 415 void EmitLiteralCompareNil(CompareOperation* expr, | 415 void EmitLiteralCompareNil(CompareOperation* expr, |
| 416 Expression* sub_expr, | 416 Expression* sub_expr, |
| 417 NilValue nil); | 417 NilValue nil); |
| 418 | 418 |
| 419 // Bailout support. | 419 // Bailout support. |
| 420 void PrepareForBailout(Expression* node, State state); | 420 void PrepareForBailout(Expression* node, State state); |
| 421 void PrepareForBailoutForId(BailoutId id, State state); | 421 void PrepareForBailoutForId(BailoutId id, State state); |
| 422 | 422 |
| 423 // Feedback slot support. The feedback vector will be cleared during gc and | |
| 424 // collected by the type-feedback oracle. | |
| 425 Handle<TypeFeedbackVector> FeedbackVector() const { | |
| 426 return info_->feedback_vector(); | |
| 427 } | |
| 428 void EnsureSlotContainsAllocationSite(FeedbackVectorSlot slot); | |
| 429 void EnsureSlotContainsAllocationSite(FeedbackVectorICSlot slot); | |
| 430 | |
| 431 // Returns a smi for the index into the FixedArray that backs the feedback | 423 // Returns a smi for the index into the FixedArray that backs the feedback |
| 432 // vector | 424 // vector |
| 433 Smi* SmiFromSlot(FeedbackVectorSlot slot) const { | 425 Smi* SmiFromSlot(FeedbackVectorSlot slot) const { |
| 434 return Smi::FromInt(FeedbackVector()->GetIndex(slot)); | 426 return Smi::FromInt(TypeFeedbackVector::GetIndexFromSpec( |
| 427 literal()->feedback_vector_spec(), slot)); |
| 435 } | 428 } |
| 436 | 429 |
| 437 Smi* SmiFromSlot(FeedbackVectorICSlot slot) const { | 430 Smi* SmiFromSlot(FeedbackVectorICSlot slot) const { |
| 438 return Smi::FromInt(FeedbackVector()->GetIndex(slot)); | 431 return Smi::FromInt(TypeFeedbackVector::GetIndexFromSpec( |
| 432 literal()->feedback_vector_spec(), slot)); |
| 439 } | 433 } |
| 440 | 434 |
| 441 // Record a call's return site offset, used to rebuild the frame if the | 435 // Record a call's return site offset, used to rebuild the frame if the |
| 442 // called function was inlined at the site. | 436 // called function was inlined at the site. |
| 443 void RecordJSReturnSite(Call* call); | 437 void RecordJSReturnSite(Call* call); |
| 444 | 438 |
| 445 // Prepare for bailout before a test (or compare) and branch. If | 439 // Prepare for bailout before a test (or compare) and branch. If |
| 446 // should_normalize, then the following comparison will not handle the | 440 // should_normalize, then the following comparison will not handle the |
| 447 // canonical JS true value so we will insert a (dead) test against true at | 441 // canonical JS true value so we will insert a (dead) test against true at |
| 448 // the actual bailout target from the optimized code. If not | 442 // the actual bailout target from the optimized code. If not |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 | 689 |
| 696 class ExpressionContext; | 690 class ExpressionContext; |
| 697 const ExpressionContext* context() { return context_; } | 691 const ExpressionContext* context() { return context_; } |
| 698 void set_new_context(const ExpressionContext* context) { context_ = context; } | 692 void set_new_context(const ExpressionContext* context) { context_ = context; } |
| 699 | 693 |
| 700 Handle<Script> script() { return info_->script(); } | 694 Handle<Script> script() { return info_->script(); } |
| 701 bool is_eval() { return info_->is_eval(); } | 695 bool is_eval() { return info_->is_eval(); } |
| 702 bool is_native() { return info_->is_native(); } | 696 bool is_native() { return info_->is_native(); } |
| 703 LanguageMode language_mode() { return literal()->language_mode(); } | 697 LanguageMode language_mode() { return literal()->language_mode(); } |
| 704 bool has_simple_parameters() { return info_->has_simple_parameters(); } | 698 bool has_simple_parameters() { return info_->has_simple_parameters(); } |
| 705 FunctionLiteral* literal() { return info_->literal(); } | 699 FunctionLiteral* literal() const { return info_->literal(); } |
| 706 Scope* scope() { return scope_; } | 700 Scope* scope() { return scope_; } |
| 707 | 701 |
| 708 static Register result_register(); | 702 static Register result_register(); |
| 709 static Register context_register(); | 703 static Register context_register(); |
| 710 | 704 |
| 711 // Set fields in the stack frame. Offsets are the frame pointer relative | 705 // Set fields in the stack frame. Offsets are the frame pointer relative |
| 712 // offsets defined in, e.g., StandardFrameConstants. | 706 // offsets defined in, e.g., StandardFrameConstants. |
| 713 void StoreToFrameField(int frame_offset, Register value); | 707 void StoreToFrameField(int frame_offset, Register value); |
| 714 | 708 |
| 715 // Load a value from the current context. Indices are defined as an enum | 709 // Load a value from the current context. Indices are defined as an enum |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 | 1076 |
| 1083 Address start_; | 1077 Address start_; |
| 1084 Address instruction_start_; | 1078 Address instruction_start_; |
| 1085 uint32_t length_; | 1079 uint32_t length_; |
| 1086 }; | 1080 }; |
| 1087 | 1081 |
| 1088 | 1082 |
| 1089 } } // namespace v8::internal | 1083 } } // namespace v8::internal |
| 1090 | 1084 |
| 1091 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 1085 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
| OLD | NEW |