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

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

Issue 1150723005: [turbofan] Optimized lowering of DYNAMIC_GLOBAL lookup slot loads. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/operator-properties.cc ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/js-typed-lowering-unittest.cc
diff --git a/test/unittests/compiler/js-typed-lowering-unittest.cc b/test/unittests/compiler/js-typed-lowering-unittest.cc
index 8a0cb175be640244f1fb8fbb53fdea96a2d428d1..2cc48e797dbbc2ea4ce7ec1089ef3f69e9488733 100644
--- a/test/unittests/compiler/js-typed-lowering-unittest.cc
+++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
@@ -896,6 +896,37 @@ TEST_F(JSTypedLoweringTest, JSLoadNamedGlobalConstants) {
}
}
+
+// -----------------------------------------------------------------------------
+// JSLoadDynamicGlobal
+
+
+TEST_F(JSTypedLoweringTest, JSLoadDynamicGlobal) {
+ Node* const context = Parameter(Type::Any());
+ Node* const frame_state = EmptyFrameState();
+ Node* const effect = graph()->start();
+ Node* const control = graph()->start();
+ Handle<String> name = factory()->object_string();
+ VectorSlotPair feedback(Handle<TypeFeedbackVector>::null(),
+ FeedbackVectorICSlot::Invalid());
+ for (int i = 0; i < DynamicGlobalAccess::kMaxCheckDepth; ++i) {
+ uint32_t bitset = 1 << i; // Only single check.
+ Reduction r = Reduce(graph()->NewNode(
+ javascript()->LoadDynamicGlobal(name, bitset, feedback, NOT_CONTEXTUAL),
+ context, context, frame_state, frame_state, effect, control));
+ ASSERT_TRUE(r.Changed());
+ EXPECT_THAT(
+ r.replacement(),
+ IsPhi(kMachAnyTagged, _, _,
+ IsMerge(IsIfTrue(IsBranch(
+ IsObjectIsSmi(IsLoadContext(
+ ContextAccess(i, Context::EXTENSION_INDEX, false),
+ context)),
+ control)),
+ _)));
+ }
+}
+
#if V8_TURBOFAN_TARGET
// -----------------------------------------------------------------------------
« no previous file with comments | « src/compiler/operator-properties.cc ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698