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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 334 |
335 // Platform-specific code for equality comparison with a nil-like value. | 335 // Platform-specific code for equality comparison with a nil-like value. |
336 void EmitLiteralCompareNil(CompareOperation* expr, | 336 void EmitLiteralCompareNil(CompareOperation* expr, |
337 Expression* sub_expr, | 337 Expression* sub_expr, |
338 NilValue nil); | 338 NilValue nil); |
339 | 339 |
340 // Bailout support. | 340 // Bailout support. |
341 void PrepareForBailout(Expression* node, Deoptimizer::BailoutState state); | 341 void PrepareForBailout(Expression* node, Deoptimizer::BailoutState state); |
342 void PrepareForBailoutForId(BailoutId id, Deoptimizer::BailoutState state); | 342 void PrepareForBailoutForId(BailoutId id, Deoptimizer::BailoutState state); |
343 | 343 |
| 344 // Returns an int32 for the index into the FixedArray that backs the feedback |
| 345 // vector |
| 346 int32_t IntFromSlot(FeedbackVectorSlot slot) const { |
| 347 return TypeFeedbackVector::GetIndex(slot); |
| 348 } |
| 349 |
344 // Returns a smi for the index into the FixedArray that backs the feedback | 350 // Returns a smi for the index into the FixedArray that backs the feedback |
345 // vector | 351 // vector |
346 Smi* SmiFromSlot(FeedbackVectorSlot slot) const { | 352 Smi* SmiFromSlot(FeedbackVectorSlot slot) const { |
347 return Smi::FromInt(TypeFeedbackVector::GetIndex(slot)); | 353 return Smi::FromInt(IntFromSlot(slot)); |
348 } | 354 } |
349 | 355 |
350 // Record a call's return site offset, used to rebuild the frame if the | 356 // Record a call's return site offset, used to rebuild the frame if the |
351 // called function was inlined at the site. | 357 // called function was inlined at the site. |
352 void RecordJSReturnSite(Call* call); | 358 void RecordJSReturnSite(Call* call); |
353 | 359 |
354 // Prepare for bailout before a test (or compare) and branch. If | 360 // Prepare for bailout before a test (or compare) and branch. If |
355 // should_normalize, then the following comparison will not handle the | 361 // should_normalize, then the following comparison will not handle the |
356 // canonical JS true value so we will insert a (dead) test against true at | 362 // canonical JS true value so we will insert a (dead) test against true at |
357 // the actual bailout target from the optimized code. If not | 363 // the actual bailout target from the optimized code. If not |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 Address start_; | 895 Address start_; |
890 Address instruction_start_; | 896 Address instruction_start_; |
891 uint32_t length_; | 897 uint32_t length_; |
892 }; | 898 }; |
893 | 899 |
894 | 900 |
895 } // namespace internal | 901 } // namespace internal |
896 } // namespace v8 | 902 } // namespace v8 |
897 | 903 |
898 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 904 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
OLD | NEW |