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

Unified Diff: test/cctest/test-feedback-vector.cc

Issue 2333243004: CallConstruct also gets call count information if megamorphic. (Closed)
Patch Set: Compile/runtime fixes. 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
« src/compiler/js-call-reducer.cc ('K') | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-feedback-vector.cc
diff --git a/test/cctest/test-feedback-vector.cc b/test/cctest/test-feedback-vector.cc
index 6194a47090863c54cbfa2f01f7de0c2febf42838..119761be3970ac6a3793e1190d9e635b378098da 100644
--- a/test/cctest/test-feedback-vector.cc
+++ b/test/cctest/test-feedback-vector.cc
@@ -290,13 +290,21 @@ TEST(VectorConstructCounts) {
Handle<JSFunction> f = GetFunction("f");
Handle<TypeFeedbackVector> feedback_vector =
Handle<TypeFeedbackVector>(f->feedback_vector(), isolate);
+
FeedbackVectorSlot slot(0);
+ CallICNexus nexus(feedback_vector, slot);
+ CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback());
+
CHECK(feedback_vector->Get(slot)->IsWeakCell());
CompileRun("f(Foo); f(Foo);");
- FeedbackVectorSlot cslot(1);
- CHECK(feedback_vector->Get(cslot)->IsSmi());
- CHECK_EQ(3, Smi::cast(feedback_vector->Get(cslot))->value());
+ CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback());
+ CHECK_EQ(3, nexus.ExtractCallCount());
+
+ // Send the IC megamorphic, but we should still have incrementing counts.
+ CompileRun("f(function() {});");
+ CHECK_EQ(GENERIC, nexus.StateFromFeedback());
+ CHECK_EQ(4, nexus.ExtractCallCount());
}
TEST(VectorLoadICStates) {
« src/compiler/js-call-reducer.cc ('K') | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698