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

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

Issue 2674593003: [TypeFeedbackVector] Root feedback vectors at function literal site. (Closed)
Patch Set: REBASE+liveedit fix. Created 3 years, 10 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') | test/cctest/test-heap-profiler.cc » ('j') | 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 { 99 {
100 FeedbackVectorSpec spec(&zone); 100 FeedbackVectorSpec spec(&zone);
101 spec.AddGeneralSlot(); 101 spec.AddGeneralSlot();
102 spec.AddCreateClosureSlot(); 102 spec.AddCreateClosureSlot();
103 spec.AddGeneralSlot(); 103 spec.AddGeneralSlot();
104 vector = NewTypeFeedbackVector(isolate, &spec); 104 vector = NewTypeFeedbackVector(isolate, &spec);
105 FeedbackVectorHelper helper(vector); 105 FeedbackVectorHelper helper(vector);
106 CHECK_EQ(1, TypeFeedbackMetadata::GetSlotSize( 106 CHECK_EQ(1, TypeFeedbackMetadata::GetSlotSize(
107 FeedbackVectorSlotKind::CREATE_CLOSURE)); 107 FeedbackVectorSlotKind::CREATE_CLOSURE));
108 FeedbackVectorSlot slot = helper.slot(1); 108 FeedbackVectorSlot slot = helper.slot(1);
109 FixedArray* array = FixedArray::cast(vector->Get(slot)); 109 Cell* cell = Cell::cast(vector->Get(slot));
110 CHECK_EQ(array, *factory->empty_type_feedback_vector()); 110 CHECK_EQ(cell->value(), *factory->undefined_value());
111 } 111 }
112 } 112 }
113 113
114 114
115 // IC slots need an encoding to recognize what is in there. 115 // IC slots need an encoding to recognize what is in there.
116 TEST(VectorICMetadata) { 116 TEST(VectorICMetadata) {
117 LocalContext context; 117 LocalContext context;
118 v8::HandleScope scope(context->GetIsolate()); 118 v8::HandleScope scope(context->GetIsolate());
119 Isolate* isolate = CcTest::i_isolate(); 119 Isolate* isolate = CcTest::i_isolate();
120 Zone zone(isolate->allocator(), ZONE_NAME); 120 Zone zone(isolate->allocator(), ZONE_NAME);
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 // There should be one IC slot. 620 // There should be one IC slot.
621 Handle<TypeFeedbackVector> feedback_vector(f->feedback_vector()); 621 Handle<TypeFeedbackVector> feedback_vector(f->feedback_vector());
622 FeedbackVectorHelper helper(feedback_vector); 622 FeedbackVectorHelper helper(feedback_vector);
623 CHECK_EQ(1, helper.slot_count()); 623 CHECK_EQ(1, helper.slot_count());
624 FeedbackVectorSlot slot(0); 624 FeedbackVectorSlot slot(0);
625 StoreICNexus nexus(feedback_vector, slot); 625 StoreICNexus nexus(feedback_vector, slot);
626 CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); 626 CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback());
627 } 627 }
628 628
629 } // namespace 629 } // namespace
OLDNEW
« no previous file with comments | « test/cctest/test-compiler.cc ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698