diff options
Diffstat (limited to 'deps/v8/test/cctest/test-feedback-vector.cc')
-rw-r--r-- | deps/v8/test/cctest/test-feedback-vector.cc | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/deps/v8/test/cctest/test-feedback-vector.cc b/deps/v8/test/cctest/test-feedback-vector.cc index c241ac6b7d..c8ffddbf7b 100644 --- a/deps/v8/test/cctest/test-feedback-vector.cc +++ b/deps/v8/test/cctest/test-feedback-vector.cc @@ -176,14 +176,14 @@ TEST(VectorCallICStates) { Handle<FeedbackVector>(f->feedback_vector(), isolate); FeedbackSlot slot(0); FeedbackNexus nexus(feedback_vector, slot); - CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(MONOMORPHIC, nexus.ic_state()); CompileRun("f(function() { return 16; })"); - CHECK_EQ(GENERIC, nexus.StateFromFeedback()); + CHECK_EQ(GENERIC, nexus.ic_state()); // After a collection, state should remain GENERIC. CcTest::CollectAllGarbage(); - CHECK_EQ(GENERIC, nexus.StateFromFeedback()); + CHECK_EQ(GENERIC, nexus.ic_state()); } TEST(VectorCallFeedback) { @@ -206,14 +206,14 @@ TEST(VectorCallFeedback) { FeedbackSlot slot(0); FeedbackNexus nexus(feedback_vector, slot); - CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(MONOMORPHIC, nexus.ic_state()); HeapObject heap_object; CHECK(nexus.GetFeedback()->GetHeapObjectIfWeak(&heap_object)); CHECK_EQ(*foo, heap_object); CcTest::CollectAllGarbage(); // It should stay monomorphic even after a GC. - CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(MONOMORPHIC, nexus.ic_state()); } TEST(VectorCallFeedbackForArray) { @@ -233,14 +233,14 @@ TEST(VectorCallFeedbackForArray) { FeedbackSlot slot(0); FeedbackNexus nexus(feedback_vector, slot); - CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(MONOMORPHIC, nexus.ic_state()); HeapObject heap_object; CHECK(nexus.GetFeedback()->GetHeapObjectIfWeak(&heap_object)); CHECK_EQ(*isolate->array_function(), heap_object); CcTest::CollectAllGarbage(); // It should stay monomorphic even after a GC. - CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(MONOMORPHIC, nexus.ic_state()); } size_t GetFeedbackVectorLength(Isolate* isolate, const char* src, @@ -326,15 +326,15 @@ TEST(VectorCallCounts) { Handle<FeedbackVector>(f->feedback_vector(), isolate); FeedbackSlot slot(0); FeedbackNexus nexus(feedback_vector, slot); - CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(MONOMORPHIC, nexus.ic_state()); CompileRun("f(foo); f(foo);"); - CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(MONOMORPHIC, nexus.ic_state()); CHECK_EQ(3, nexus.GetCallCount()); // Send the IC megamorphic, but we should still have incrementing counts. CompileRun("f(function() { return 12; });"); - CHECK_EQ(GENERIC, nexus.StateFromFeedback()); + CHECK_EQ(GENERIC, nexus.ic_state()); CHECK_EQ(4, nexus.GetCallCount()); } @@ -357,17 +357,17 @@ TEST(VectorConstructCounts) { FeedbackSlot slot(0); FeedbackNexus nexus(feedback_vector, slot); - CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(MONOMORPHIC, nexus.ic_state()); CHECK(feedback_vector->Get(slot)->IsWeak()); CompileRun("f(Foo); f(Foo);"); - CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(MONOMORPHIC, nexus.ic_state()); CHECK_EQ(3, nexus.GetCallCount()); // Send the IC megamorphic, but we should still have incrementing counts. CompileRun("f(function() {});"); - CHECK_EQ(GENERIC, nexus.StateFromFeedback()); + CHECK_EQ(GENERIC, nexus.ic_state()); CHECK_EQ(4, nexus.GetCallCount()); } @@ -424,40 +424,40 @@ TEST(VectorLoadICStates) { Handle<FeedbackVector>(f->feedback_vector(), isolate); FeedbackSlot slot(0); FeedbackNexus nexus(feedback_vector, slot); - CHECK_EQ(PREMONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(PREMONOMORPHIC, nexus.ic_state()); CompileRun("f(o)"); - CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(MONOMORPHIC, nexus.ic_state()); // Verify that the monomorphic map is the one we expect. v8::MaybeLocal<v8::Value> v8_o = CcTest::global()->Get(context.local(), v8_str("o")); Handle<JSObject> o = Handle<JSObject>::cast(v8::Utils::OpenHandle(*v8_o.ToLocalChecked())); - CHECK_EQ(o->map(), nexus.FindFirstMap()); + CHECK_EQ(o->map(), nexus.GetFirstMap()); // Now go polymorphic. CompileRun("f({ blarg: 3, foo: 2 })"); - CHECK_EQ(POLYMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(POLYMORPHIC, nexus.ic_state()); CompileRun( "delete o.foo;" "f(o)"); - CHECK_EQ(POLYMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(POLYMORPHIC, nexus.ic_state()); CompileRun("f({ blarg: 3, torino: 10, foo: 2 })"); - CHECK_EQ(POLYMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(POLYMORPHIC, nexus.ic_state()); MapHandles maps; nexus.ExtractMaps(&maps); CHECK_EQ(4, maps.size()); // Finally driven megamorphic. CompileRun("f({ blarg: 3, gran: 3, torino: 10, foo: 2 })"); - CHECK_EQ(MEGAMORPHIC, nexus.StateFromFeedback()); - CHECK(nexus.FindFirstMap().is_null()); + CHECK_EQ(MEGAMORPHIC, nexus.ic_state()); + CHECK(nexus.GetFirstMap().is_null()); // After a collection, state should not be reset to PREMONOMORPHIC. CcTest::CollectAllGarbage(); - CHECK_EQ(MEGAMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(MEGAMORPHIC, nexus.ic_state()); } TEST(VectorLoadGlobalICSlotSharing) { @@ -490,10 +490,8 @@ TEST(VectorLoadGlobalICSlotSharing) { CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::kLoadGlobalInsideTypeof); FeedbackSlot slot1 = helper.slot(0); FeedbackSlot slot2 = helper.slot(1); - CHECK_EQ(MONOMORPHIC, - FeedbackNexus(feedback_vector, slot1).StateFromFeedback()); - CHECK_EQ(MONOMORPHIC, - FeedbackNexus(feedback_vector, slot2).StateFromFeedback()); + CHECK_EQ(MONOMORPHIC, FeedbackNexus(feedback_vector, slot1).ic_state()); + CHECK_EQ(MONOMORPHIC, FeedbackNexus(feedback_vector, slot2).ic_state()); } @@ -517,17 +515,17 @@ TEST(VectorLoadICOnSmi) { Handle<FeedbackVector>(f->feedback_vector(), isolate); FeedbackSlot slot(0); FeedbackNexus nexus(feedback_vector, slot); - CHECK_EQ(PREMONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(PREMONOMORPHIC, nexus.ic_state()); CompileRun("f(34)"); - CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(MONOMORPHIC, nexus.ic_state()); // Verify that the monomorphic map is the one we expect. Map number_map = ReadOnlyRoots(heap).heap_number_map(); - CHECK_EQ(number_map, nexus.FindFirstMap()); + CHECK_EQ(number_map, nexus.GetFirstMap()); // Now go polymorphic on o. CompileRun("f(o)"); - CHECK_EQ(POLYMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(POLYMORPHIC, nexus.ic_state()); MapHandles maps; nexus.ExtractMaps(&maps); @@ -550,7 +548,7 @@ TEST(VectorLoadICOnSmi) { // The degree of polymorphism doesn't change. CompileRun("f(100)"); - CHECK_EQ(POLYMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(POLYMORPHIC, nexus.ic_state()); MapHandles maps2; nexus.ExtractMaps(&maps2); CHECK_EQ(2, maps2.size()); @@ -720,7 +718,7 @@ TEST(VectorStoreICBasic) { CHECK_EQ(1, helper.slot_count()); FeedbackSlot slot(0); FeedbackNexus nexus(feedback_vector, slot); - CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(MONOMORPHIC, nexus.ic_state()); } TEST(StoreOwnIC) { @@ -746,7 +744,7 @@ TEST(StoreOwnIC) { CHECK_SLOT_KIND(helper, 0, FeedbackSlotKind::kLiteral); CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::kStoreOwnNamed); FeedbackNexus nexus(feedback_vector, helper.slot(1)); - CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); + CHECK_EQ(MONOMORPHIC, nexus.ic_state()); } } // namespace |