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

Unified Diff: test/cctest/test-compiler.cc

Issue 650073002: vector-based ICs did not update type feedback counts correctly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 2 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 | « test/cctest/cctest.gyp ('k') | test/cctest/test-feedback-vector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-compiler.cc
diff --git a/test/cctest/test-compiler.cc b/test/cctest/test-compiler.cc
index 4d6e005a8b8cf3fe1b35f39e79310614310952b5..d3c06baa45e08198540d007c69db049c21781108 100644
--- a/test/cctest/test-compiler.cc
+++ b/test/cctest/test-compiler.cc
@@ -306,12 +306,15 @@ TEST(FeedbackVectorPreservedAcrossRecompiles) {
// We shouldn't have deoptimization support. We want to recompile and
// verify that our feedback vector preserves information.
CHECK(!f->shared()->has_deoptimization_support());
- Handle<FixedArray> feedback_vector(f->shared()->feedback_vector());
+ Handle<TypeFeedbackVector> feedback_vector(f->shared()->feedback_vector());
// Verify that we gathered feedback.
- int expected_count = FLAG_vector_ics ? 2 : 1;
- CHECK_EQ(expected_count, feedback_vector->length());
- CHECK(feedback_vector->get(expected_count - 1)->IsJSFunction());
+ int expected_slots = 0;
+ int expected_ic_slots = FLAG_vector_ics ? 2 : 1;
+ CHECK_EQ(expected_slots, feedback_vector->Slots());
+ CHECK_EQ(expected_ic_slots, feedback_vector->ICSlots());
+ FeedbackVectorICSlot slot_for_a(FLAG_vector_ics ? 1 : 0);
+ CHECK(feedback_vector->Get(slot_for_a)->IsJSFunction());
CompileRun("%OptimizeFunctionOnNextCall(f); f(fun1);");
@@ -319,8 +322,7 @@ TEST(FeedbackVectorPreservedAcrossRecompiles) {
// of the full code.
CHECK(f->IsOptimized());
CHECK(f->shared()->has_deoptimization_support());
- CHECK(f->shared()->feedback_vector()->
- get(expected_count - 1)->IsJSFunction());
+ CHECK(f->shared()->feedback_vector()->Get(slot_for_a)->IsJSFunction());
}
@@ -346,15 +348,19 @@ TEST(FeedbackVectorUnaffectedByScopeChanges) {
*v8::Handle<v8::Function>::Cast(
CcTest::global()->Get(v8_str("morphing_call"))));
- int expected_count = FLAG_vector_ics ? 2 : 1;
- CHECK_EQ(expected_count, f->shared()->feedback_vector()->length());
+ int expected_slots = 0;
+ int expected_ic_slots = FLAG_vector_ics ? 2 : 1;
+ CHECK_EQ(expected_slots, f->shared()->feedback_vector()->Slots());
+ CHECK_EQ(expected_ic_slots, f->shared()->feedback_vector()->ICSlots());
+
// And yet it's not compiled.
CHECK(!f->shared()->is_compiled());
CompileRun("morphing_call();");
// The vector should have the same size despite the new scoping.
- CHECK_EQ(expected_count, f->shared()->feedback_vector()->length());
+ CHECK_EQ(expected_slots, f->shared()->feedback_vector()->Slots());
+ CHECK_EQ(expected_ic_slots, f->shared()->feedback_vector()->ICSlots());
CHECK(f->shared()->is_compiled());
}
« no previous file with comments | « test/cctest/cctest.gyp ('k') | test/cctest/test-feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698