| 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/ast.h" | 10 #include "src/ast/ast.h" |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 | 404 |
| 405 // Platform-specific code for equality comparison with a nil-like value. | 405 // Platform-specific code for equality comparison with a nil-like value. |
| 406 void EmitLiteralCompareNil(CompareOperation* expr, | 406 void EmitLiteralCompareNil(CompareOperation* expr, |
| 407 Expression* sub_expr, | 407 Expression* sub_expr, |
| 408 NilValue nil); | 408 NilValue nil); |
| 409 | 409 |
| 410 // Bailout support. | 410 // Bailout support. |
| 411 void PrepareForBailout(Expression* node, Deoptimizer::BailoutState state); | 411 void PrepareForBailout(Expression* node, Deoptimizer::BailoutState state); |
| 412 void PrepareForBailoutForId(BailoutId id, Deoptimizer::BailoutState state); | 412 void PrepareForBailoutForId(BailoutId id, Deoptimizer::BailoutState state); |
| 413 | 413 |
| 414 // Returns the plain index for the FixedArray that backs the feedback vector. | |
| 415 int SlotToIndex(FeedbackVectorSlot slot) const { | |
| 416 return TypeFeedbackVector::GetIndexFromSpec( | |
| 417 literal()->feedback_vector_spec(), slot); | |
| 418 } | |
| 419 // Returns a smi for the index into the FixedArray that backs the feedback | 414 // Returns a smi for the index into the FixedArray that backs the feedback |
| 420 // vector | 415 // vector |
| 421 Smi* SmiFromSlot(FeedbackVectorSlot slot) const { | 416 Smi* SmiFromSlot(FeedbackVectorSlot slot) const { |
| 422 return Smi::FromInt(SlotToIndex(slot)); | 417 return Smi::FromInt(TypeFeedbackVector::GetIndexFromSpec( |
| 418 literal()->feedback_vector_spec(), slot)); |
| 423 } | 419 } |
| 424 | 420 |
| 425 // Record a call's return site offset, used to rebuild the frame if the | 421 // Record a call's return site offset, used to rebuild the frame if the |
| 426 // called function was inlined at the site. | 422 // called function was inlined at the site. |
| 427 void RecordJSReturnSite(Call* call); | 423 void RecordJSReturnSite(Call* call); |
| 428 | 424 |
| 429 // Prepare for bailout before a test (or compare) and branch. If | 425 // Prepare for bailout before a test (or compare) and branch. If |
| 430 // should_normalize, then the following comparison will not handle the | 426 // should_normalize, then the following comparison will not handle the |
| 431 // canonical JS true value so we will insert a (dead) test against true at | 427 // canonical JS true value so we will insert a (dead) test against true at |
| 432 // the actual bailout target from the optimized code. If not | 428 // the actual bailout target from the optimized code. If not |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 Address start_; | 1025 Address start_; |
| 1030 Address instruction_start_; | 1026 Address instruction_start_; |
| 1031 uint32_t length_; | 1027 uint32_t length_; |
| 1032 }; | 1028 }; |
| 1033 | 1029 |
| 1034 | 1030 |
| 1035 } // namespace internal | 1031 } // namespace internal |
| 1036 } // namespace v8 | 1032 } // namespace v8 |
| 1037 | 1033 |
| 1038 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 1034 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
| OLD | NEW |