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

Side by Side Diff: test/cctest/test-feedback-vector.cc

Issue 2342853002: [TypeFeedbackVector] special ic slots for interpreter compare/binary ops. (Closed)
Patch Set: Code comments. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 #include "test/cctest/cctest.h" 6 #include "test/cctest/cctest.h"
7 7
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/execution.h" 10 #include "src/execution.h"
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 // of x.old and x.young. 552 // of x.old and x.young.
553 Handle<TypeFeedbackVector> feedback_vector(f->feedback_vector()); 553 Handle<TypeFeedbackVector> feedback_vector(f->feedback_vector());
554 FeedbackVectorHelper helper(feedback_vector); 554 FeedbackVectorHelper helper(feedback_vector);
555 CHECK_EQ(7, helper.slot_count()); 555 CHECK_EQ(7, helper.slot_count());
556 CHECK_SLOT_KIND(helper, 0, FeedbackVectorSlotKind::LOAD_GLOBAL_IC); 556 CHECK_SLOT_KIND(helper, 0, FeedbackVectorSlotKind::LOAD_GLOBAL_IC);
557 CHECK_SLOT_KIND(helper, 1, FeedbackVectorSlotKind::STORE_IC); 557 CHECK_SLOT_KIND(helper, 1, FeedbackVectorSlotKind::STORE_IC);
558 CHECK_SLOT_KIND(helper, 2, FeedbackVectorSlotKind::STORE_IC); 558 CHECK_SLOT_KIND(helper, 2, FeedbackVectorSlotKind::STORE_IC);
559 CHECK_SLOT_KIND(helper, 3, FeedbackVectorSlotKind::STORE_IC); 559 CHECK_SLOT_KIND(helper, 3, FeedbackVectorSlotKind::STORE_IC);
560 CHECK_SLOT_KIND(helper, 4, FeedbackVectorSlotKind::LOAD_IC); 560 CHECK_SLOT_KIND(helper, 4, FeedbackVectorSlotKind::LOAD_IC);
561 CHECK_SLOT_KIND(helper, 5, FeedbackVectorSlotKind::LOAD_IC); 561 CHECK_SLOT_KIND(helper, 5, FeedbackVectorSlotKind::LOAD_IC);
562 // Binary operation feedback is a general slot. 562 CHECK_SLOT_KIND(helper, 6, FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC);
563 CHECK_SLOT_KIND(helper, 6, FeedbackVectorSlotKind::GENERAL);
564 } 563 }
565 } 564 }
566 565
567 566
568 TEST(VectorStoreICBasic) { 567 TEST(VectorStoreICBasic) {
569 if (i::FLAG_always_opt) return; 568 if (i::FLAG_always_opt) return;
570 569
571 CcTest::InitializeVM(); 570 CcTest::InitializeVM();
572 LocalContext context; 571 LocalContext context;
573 v8::HandleScope scope(context->GetIsolate()); 572 v8::HandleScope scope(context->GetIsolate());
(...skipping 10 matching lines...) Expand all
584 // There should be one IC slot. 583 // There should be one IC slot.
585 Handle<TypeFeedbackVector> feedback_vector(f->feedback_vector()); 584 Handle<TypeFeedbackVector> feedback_vector(f->feedback_vector());
586 FeedbackVectorHelper helper(feedback_vector); 585 FeedbackVectorHelper helper(feedback_vector);
587 CHECK_EQ(1, helper.slot_count()); 586 CHECK_EQ(1, helper.slot_count());
588 FeedbackVectorSlot slot(0); 587 FeedbackVectorSlot slot(0);
589 StoreICNexus nexus(feedback_vector, slot); 588 StoreICNexus nexus(feedback_vector, slot);
590 CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); 589 CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback());
591 } 590 }
592 591
593 } // namespace 592 } // namespace
OLDNEW
« src/type-feedback-vector-inl.h ('K') | « test/cctest/interpreter/test-interpreter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698