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

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

Issue 2337123003: [turbofan] Collect invocation counts and compute relative call frequencies. (Closed)
Patch Set: Address feedback. 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
« no previous file with comments | « test/cctest/test-compiler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 23 matching lines...) Expand all
34 TEST(VectorStructure) { 34 TEST(VectorStructure) {
35 LocalContext context; 35 LocalContext context;
36 v8::HandleScope scope(context->GetIsolate()); 36 v8::HandleScope scope(context->GetIsolate());
37 Isolate* isolate = CcTest::i_isolate(); 37 Isolate* isolate = CcTest::i_isolate();
38 Factory* factory = isolate->factory(); 38 Factory* factory = isolate->factory();
39 Zone zone(isolate->allocator()); 39 Zone zone(isolate->allocator());
40 40
41 // Empty vectors are the empty fixed array. 41 // Empty vectors are the empty fixed array.
42 StaticFeedbackVectorSpec empty; 42 StaticFeedbackVectorSpec empty;
43 Handle<TypeFeedbackVector> vector = NewTypeFeedbackVector(isolate, &empty); 43 Handle<TypeFeedbackVector> vector = NewTypeFeedbackVector(isolate, &empty);
44 CHECK(Handle<FixedArray>::cast(vector) 44 CHECK(Handle<FixedArray>::cast(vector).is_identical_to(
45 .is_identical_to(factory->empty_fixed_array())); 45 factory->empty_type_feedback_vector()));
46 // Which can nonetheless be queried. 46 // Which can nonetheless be queried.
47 CHECK(vector->is_empty()); 47 CHECK(vector->is_empty());
48 48
49 { 49 {
50 FeedbackVectorSpec one_slot(&zone); 50 FeedbackVectorSpec one_slot(&zone);
51 one_slot.AddGeneralSlot(); 51 one_slot.AddGeneralSlot();
52 vector = NewTypeFeedbackVector(isolate, &one_slot); 52 vector = NewTypeFeedbackVector(isolate, &one_slot);
53 FeedbackVectorHelper helper(vector); 53 FeedbackVectorHelper helper(vector);
54 CHECK_EQ(1, helper.slot_count()); 54 CHECK_EQ(1, helper.slot_count());
55 } 55 }
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 // There should be one IC slot. 584 // There should be one IC slot.
585 Handle<TypeFeedbackVector> feedback_vector(f->feedback_vector()); 585 Handle<TypeFeedbackVector> feedback_vector(f->feedback_vector());
586 FeedbackVectorHelper helper(feedback_vector); 586 FeedbackVectorHelper helper(feedback_vector);
587 CHECK_EQ(1, helper.slot_count()); 587 CHECK_EQ(1, helper.slot_count());
588 FeedbackVectorSlot slot(0); 588 FeedbackVectorSlot slot(0);
589 StoreICNexus nexus(feedback_vector, slot); 589 StoreICNexus nexus(feedback_vector, slot);
590 CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); 590 CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback());
591 } 591 }
592 592
593 } // namespace 593 } // namespace
OLDNEW
« no previous file with comments | « test/cctest/test-compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698