| 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..ef66f98eef50c4f69f42b8fe1cbaaed5393bccae 100644
|
| --- a/test/unittests/compiler/js-typed-lowering-unittest.cc
|
| +++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
|
| @@ -927,6 +927,36 @@ 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(
|
| + IsObjectIsSmi(IsLoadContext(
|
| + ContextAccess(i, Context::EXTENSION_INDEX, false),
|
| + context)),
|
| + control)),
|
| + _)));
|
| + }
|
| +}
|
| +
|
| #if V8_TURBOFAN_TARGET
|
|
|
| // -----------------------------------------------------------------------------
|
|
|