| 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_H_ | 5 #ifndef V8_FULL_CODEGEN_H_ |
| 6 #define V8_FULL_CODEGEN_H_ | 6 #define V8_FULL_CODEGEN_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 void EmitLiteralCompareNil(CompareOperation* expr, | 422 void EmitLiteralCompareNil(CompareOperation* expr, |
| 423 Expression* sub_expr, | 423 Expression* sub_expr, |
| 424 NilValue nil); | 424 NilValue nil); |
| 425 | 425 |
| 426 // Bailout support. | 426 // Bailout support. |
| 427 void PrepareForBailout(Expression* node, State state); | 427 void PrepareForBailout(Expression* node, State state); |
| 428 void PrepareForBailoutForId(BailoutId id, State state); | 428 void PrepareForBailoutForId(BailoutId id, State state); |
| 429 | 429 |
| 430 // Feedback slot support. The feedback vector will be cleared during gc and | 430 // Feedback slot support. The feedback vector will be cleared during gc and |
| 431 // collected by the type-feedback oracle. | 431 // collected by the type-feedback oracle. |
| 432 Handle<FixedArray> FeedbackVector() { | 432 Handle<TypeFeedbackVector> FeedbackVector() const { |
| 433 return info_->feedback_vector(); | 433 return info_->feedback_vector(); |
| 434 } | 434 } |
| 435 void EnsureSlotContainsAllocationSite(FeedbackVectorSlot slot); | 435 void EnsureSlotContainsAllocationSite(FeedbackVectorSlot slot); |
| 436 void EnsureSlotContainsAllocationSite(FeedbackVectorICSlot slot); |
| 437 |
| 438 // Returns a smi for the index into the FixedArray that backs the feedback |
| 439 // vector |
| 436 Smi* SmiFromSlot(FeedbackVectorSlot slot) const { | 440 Smi* SmiFromSlot(FeedbackVectorSlot slot) const { |
| 437 return Smi::FromInt(slot.ToInt()); | 441 return Smi::FromInt(FeedbackVector()->GetIndex(slot)); |
| 442 } |
| 443 |
| 444 Smi* SmiFromSlot(FeedbackVectorICSlot slot) const { |
| 445 return Smi::FromInt(FeedbackVector()->GetIndex(slot)); |
| 438 } | 446 } |
| 439 | 447 |
| 440 // Record a call's return site offset, used to rebuild the frame if the | 448 // Record a call's return site offset, used to rebuild the frame if the |
| 441 // called function was inlined at the site. | 449 // called function was inlined at the site. |
| 442 void RecordJSReturnSite(Call* call); | 450 void RecordJSReturnSite(Call* call); |
| 443 | 451 |
| 444 // Prepare for bailout before a test (or compare) and branch. If | 452 // Prepare for bailout before a test (or compare) and branch. If |
| 445 // should_normalize, then the following comparison will not handle the | 453 // should_normalize, then the following comparison will not handle the |
| 446 // canonical JS true value so we will insert a (dead) test against true at | 454 // canonical JS true value so we will insert a (dead) test against true at |
| 447 // the actual bailout target from the optimized code. If not | 455 // the actual bailout target from the optimized code. If not |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 #undef DECLARE_VISIT | 668 #undef DECLARE_VISIT |
| 661 | 669 |
| 662 void VisitComma(BinaryOperation* expr); | 670 void VisitComma(BinaryOperation* expr); |
| 663 void VisitLogicalExpression(BinaryOperation* expr); | 671 void VisitLogicalExpression(BinaryOperation* expr); |
| 664 void VisitArithmeticExpression(BinaryOperation* expr); | 672 void VisitArithmeticExpression(BinaryOperation* expr); |
| 665 | 673 |
| 666 void VisitForTypeofValue(Expression* expr); | 674 void VisitForTypeofValue(Expression* expr); |
| 667 | 675 |
| 668 void Generate(); | 676 void Generate(); |
| 669 void PopulateDeoptimizationData(Handle<Code> code); | 677 void PopulateDeoptimizationData(Handle<Code> code); |
| 670 void PopulateTypeFeedbackInfo(Handle<Code> code); | 678 void PopulateTypeFeedbackInfo(Handle<Code> code, |
| 679 Handle<TypeFeedbackVector> vector); |
| 671 | 680 |
| 672 Handle<FixedArray> handler_table() { return handler_table_; } | 681 Handle<FixedArray> handler_table() { return handler_table_; } |
| 673 | 682 |
| 674 struct BailoutEntry { | 683 struct BailoutEntry { |
| 675 BailoutId id; | 684 BailoutId id; |
| 676 unsigned pc_and_state; | 685 unsigned pc_and_state; |
| 677 }; | 686 }; |
| 678 | 687 |
| 679 struct BackEdgeEntry { | 688 struct BackEdgeEntry { |
| 680 BailoutId id; | 689 BailoutId id; |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 | 992 |
| 984 Address start_; | 993 Address start_; |
| 985 Address instruction_start_; | 994 Address instruction_start_; |
| 986 uint32_t length_; | 995 uint32_t length_; |
| 987 }; | 996 }; |
| 988 | 997 |
| 989 | 998 |
| 990 } } // namespace v8::internal | 999 } } // namespace v8::internal |
| 991 | 1000 |
| 992 #endif // V8_FULL_CODEGEN_H_ | 1001 #endif // V8_FULL_CODEGEN_H_ |
| OLD | NEW |