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

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

Issue 1155543003: [turbofan] Optimized lowering of DYNAMIC_LOCAL lookup slot loads. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. 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/js-typed-lowering.cc ('k') | test/unittests/compiler/node-test-utils.cc » ('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 2cc48e797dbbc2ea4ce7ec1089ef3f69e9488733..0a8c8487ed901ef43c6afab0adf47edbe61765ed 100644
--- a/test/unittests/compiler/js-typed-lowering-unittest.cc
+++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
@@ -927,6 +927,40 @@ TEST_F(JSTypedLoweringTest, JSLoadDynamicGlobal) {
}
}
+
+// -----------------------------------------------------------------------------
+// JSLoadDynamicContext
+
+
+TEST_F(JSTypedLoweringTest, JSLoadDynamicContext) {
+ 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();
+ for (int i = 0; i < DynamicContextAccess::kMaxCheckDepth; ++i) {
+ uint32_t bitset = 1 << i; // Only single check.
+ Reduction r = Reduce(
+ graph()->NewNode(javascript()->LoadDynamicContext(name, bitset, 23, 42),
+ context, context, frame_state, effect, control));
+ ASSERT_TRUE(r.Changed());
+ EXPECT_THAT(
+ r.replacement(),
+ IsPhi(kMachAnyTagged,
+ IsLoadContext(ContextAccess(23, 42, false), context), _,
+ IsMerge(
+ IsIfTrue(IsBranch(
+ IsReferenceEqual(
+ Type::Tagged(),
+ IsLoadContext(
+ ContextAccess(i, Context::EXTENSION_INDEX, false),
+ context),
+ IsNumberConstant(BitEq(0.0))),
+ control)),
+ _)));
+ }
+}
+
#if V8_TURBOFAN_TARGET
// -----------------------------------------------------------------------------
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | test/unittests/compiler/node-test-utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698