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

Unified Diff: test/unittests/compiler/js-create-lowering-unittest.cc

Issue 2504153002: [TypeFeedbackVector] Root literal arrays in function literals slots (Closed)
Patch Set: REBASE. Created 4 years 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/unittests/compiler/js-create-lowering-unittest.cc
diff --git a/test/unittests/compiler/js-create-lowering-unittest.cc b/test/unittests/compiler/js-create-lowering-unittest.cc
index f4a1192abf167bfae8f6a5c7ef497c7e54dcba31..de3feb8bb1b730267b88359fe97c46f7eb133fb5 100644
--- a/test/unittests/compiler/js-create-lowering-unittest.cc
+++ b/test/unittests/compiler/js-create-lowering-unittest.cc
@@ -142,9 +142,22 @@ TEST_F(JSCreateLoweringTest, JSCreateClosureViaInlinedAllocation) {
Node* const effect = graph()->start();
Node* const control = graph()->start();
Handle<SharedFunctionInfo> shared(isolate()->number_function()->shared());
- Reduction r =
- Reduce(graph()->NewNode(javascript()->CreateClosure(shared, NOT_TENURED),
- context, effect, control));
+
+ // Create a mock feedback vector.
+ Zone zone(isolate()->allocator(), ZONE_NAME);
+ FeedbackVectorSpec spec(&zone);
+ spec.AddCreateClosureSlot(1);
+ Handle<TypeFeedbackMetadata> metadata =
+ TypeFeedbackMetadata::New(isolate(), &spec);
+ Handle<TypeFeedbackVector> vector =
+ TypeFeedbackVector::New(isolate(), metadata);
+ DCHECK(vector->slot_count() == 1);
+ FeedbackVectorSlot slot(0);
+ VectorSlotPair pair(vector, slot);
+
+ Reduction r = Reduce(
+ graph()->NewNode(javascript()->CreateClosure(shared, pair, NOT_TENURED),
+ context, effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(),
IsFinishRegion(IsAllocate(IsNumberConstant(JSFunction::kSize),

Powered by Google App Engine
This is Rietveld 408576698