Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: src/full-codegen/full-codegen.h

Issue 2370693002: [compiler] Properly guard the speculative optimizations for instanceof. (Closed)
Patch Set: Fix registers on arm/arm64. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/full-codegen/arm64/full-codegen-arm64.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/full-codegen.h
diff --git a/src/full-codegen/full-codegen.h b/src/full-codegen/full-codegen.h
index aa1caaff98603834e94192e2a4712c2a5a5cbed0..617e5268baa0cc0a1c231dd5520fb56ce488b376 100644
--- a/src/full-codegen/full-codegen.h
+++ b/src/full-codegen/full-codegen.h
@@ -411,11 +411,15 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> {
void PrepareForBailout(Expression* node, Deoptimizer::BailoutState state);
void PrepareForBailoutForId(BailoutId id, Deoptimizer::BailoutState state);
+ // Returns the plain index for the FixedArray that backs the feedback vector.
+ int SlotToIndex(FeedbackVectorSlot slot) const {
+ return TypeFeedbackVector::GetIndexFromSpec(
+ literal()->feedback_vector_spec(), slot);
+ }
// Returns a smi for the index into the FixedArray that backs the feedback
// vector
Smi* SmiFromSlot(FeedbackVectorSlot slot) const {
- return Smi::FromInt(TypeFeedbackVector::GetIndexFromSpec(
- literal()->feedback_vector_spec(), slot));
+ return Smi::FromInt(SlotToIndex(slot));
}
// Record a call's return site offset, used to rebuild the frame if the
« no previous file with comments | « src/full-codegen/arm64/full-codegen-arm64.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698