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

Unified Diff: test/cctest/test-heap.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: Ports. 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
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index ee476db6cdc4729b1a65a560fe03734a65f2bfdb..5d370077381c4bb5e9be7198117b4a8d14fa487a 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -1464,6 +1464,9 @@ TEST(TestInternalWeakLists) {
// Mark compact handles the weak references.
isolate->compilation_cache()->Clear();
+ // We have to collect twice because the type feedback vector
+ // could be strongly walked before we clear ICs in it.
+ heap->CollectAllGarbage(Heap::kNoGCFlags);
heap->CollectAllGarbage(Heap::kNoGCFlags);
CHECK_EQ(opt ? 4 : 0, CountOptimizedUserFunctions(ctx[i]));
@@ -3138,7 +3141,7 @@ TEST(IncrementalMarkingClearsTypeFeedbackInfo) {
// originating from two different native contexts.
CcTest::global()->Set(v8_str("fun1"), fun1);
CcTest::global()->Set(v8_str("fun2"), fun2);
- CompileRun("function f(a, b) { a(); b(); } f(fun1, fun2);");
+ CompileRun("function f(a, b) { new a(); new b(); } f(fun1, fun2);");
Handle<JSFunction> f =
v8::Utils::OpenHandle(
@@ -3147,20 +3150,18 @@ TEST(IncrementalMarkingClearsTypeFeedbackInfo) {
Handle<TypeFeedbackVector> feedback_vector(f->shared()->feedback_vector());
- int expected_length = FLAG_vector_ics ? 4 : 2;
- CHECK_EQ(expected_length, feedback_vector->length());
- for (int i = 0; i < expected_length; i++) {
- if ((i % 2) == 1) {
- CHECK(feedback_vector->get(i)->IsJSFunction());
- }
+ int expected_slots = 2;
+ CHECK_EQ(expected_slots, feedback_vector->Slots());
+ for (int i = 0; i < expected_slots; i++) {
+ CHECK(feedback_vector->Get(FeedbackVectorSlot(i))->IsJSFunction());
}
SimulateIncrementalMarking(CcTest::heap());
CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags);
- CHECK_EQ(expected_length, feedback_vector->length());
- for (int i = 0; i < expected_length; i++) {
- CHECK_EQ(feedback_vector->get(i),
+ CHECK_EQ(expected_slots, feedback_vector->Slots());
+ for (int i = 0; i < expected_slots; i++) {
+ CHECK_EQ(feedback_vector->Get(FeedbackVectorSlot(i)),
*TypeFeedbackVector::UninitializedSentinel(CcTest::i_isolate()));
}
}

Powered by Google App Engine
This is Rietveld 408576698