diff options
Diffstat (limited to 'deps/v8/test/cctest/compiler/test-js-context-specialization.cc')
-rw-r--r-- | deps/v8/test/cctest/compiler/test-js-context-specialization.cc | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/deps/v8/test/cctest/compiler/test-js-context-specialization.cc b/deps/v8/test/cctest/compiler/test-js-context-specialization.cc index 328b0aefdd..773d74170f 100644 --- a/deps/v8/test/cctest/compiler/test-js-context-specialization.cc +++ b/deps/v8/test/cctest/compiler/test-js-context-specialization.cc @@ -93,7 +93,7 @@ TEST(ReduceJSLoadContext) { Node* new_context_input = NodeProperties::GetValueInput(r.replacement(), 0); CHECK_EQ(IrOpcode::kHeapConstant, new_context_input->opcode()); HeapObjectMatcher match(new_context_input); - CHECK_EQ(*native, *match.Value().handle()); + CHECK_EQ(*native, *match.Value()); ContextAccess access = OpParameter<ContextAccess>(r.replacement()); CHECK_EQ(Context::GLOBAL_EVAL_FUN_INDEX, static_cast<int>(access.index())); CHECK_EQ(0, static_cast<int>(access.depth())); @@ -110,7 +110,7 @@ TEST(ReduceJSLoadContext) { HeapObjectMatcher match(r.replacement()); CHECK(match.HasValue()); - CHECK_EQ(*expected, *match.Value().handle()); + CHECK_EQ(*expected, *match.Value()); } // TODO(titzer): test with other kinds of contexts, e.g. a function context. @@ -140,24 +140,27 @@ TEST(ReduceJSStoreContext) { { // Mutable slot, constant context, depth = 0 => do nothing. - Node* load = t.graph()->NewNode(t.javascript()->StoreContext(0, 0), - const_context, const_context, start); + Node* load = + t.graph()->NewNode(t.javascript()->StoreContext(0, 0), const_context, + const_context, const_context, start, start); Reduction r = t.spec()->Reduce(load); CHECK(!r.Changed()); } { // Mutable slot, non-constant context, depth = 0 => do nothing. - Node* load = t.graph()->NewNode(t.javascript()->StoreContext(0, 0), - param_context, param_context, start); + Node* load = + t.graph()->NewNode(t.javascript()->StoreContext(0, 0), param_context, + param_context, const_context, start, start); Reduction r = t.spec()->Reduce(load); CHECK(!r.Changed()); } { // Immutable slot, constant context, depth = 0 => do nothing. - Node* load = t.graph()->NewNode(t.javascript()->StoreContext(0, slot), - const_context, const_context, start); + Node* load = + t.graph()->NewNode(t.javascript()->StoreContext(0, slot), const_context, + const_context, const_context, start, start); Reduction r = t.spec()->Reduce(load); CHECK(!r.Changed()); } @@ -166,13 +169,13 @@ TEST(ReduceJSStoreContext) { // Mutable slot, constant context, depth > 0 => fold-in parent context. Node* load = t.graph()->NewNode( t.javascript()->StoreContext(2, Context::GLOBAL_EVAL_FUN_INDEX), - deep_const_context, deep_const_context, start); + deep_const_context, deep_const_context, const_context, start, start); Reduction r = t.spec()->Reduce(load); CHECK(r.Changed()); Node* new_context_input = NodeProperties::GetValueInput(r.replacement(), 0); CHECK_EQ(IrOpcode::kHeapConstant, new_context_input->opcode()); HeapObjectMatcher match(new_context_input); - CHECK_EQ(*native, *match.Value().handle()); + CHECK_EQ(*native, *match.Value()); ContextAccess access = OpParameter<ContextAccess>(r.replacement()); CHECK_EQ(Context::GLOBAL_EVAL_FUN_INDEX, static_cast<int>(access.index())); CHECK_EQ(0, static_cast<int>(access.depth())); @@ -219,9 +222,10 @@ TEST(SpecializeToContext) { Node* other_use = t.graph()->NewNode(t.simplified()->ChangeTaggedToInt32(), other_load); - Node* add = - t.graph()->NewNode(t.javascript()->Add(LanguageMode::SLOPPY), value_use, - other_use, param_context, other_load, start); + Node* add = t.graph()->NewNode( + t.javascript()->Add(LanguageMode::SLOPPY), value_use, other_use, + param_context, t.jsgraph()->EmptyFrameState(), + t.jsgraph()->EmptyFrameState(), other_load, start); Node* ret = t.graph()->NewNode(t.common()->Return(), add, effect_use, start); @@ -249,7 +253,7 @@ TEST(SpecializeToContext) { Node* replacement = value_use->InputAt(0); HeapObjectMatcher match(replacement); CHECK(match.HasValue()); - CHECK_EQ(*expected, *match.Value().handle()); + CHECK_EQ(*expected, *match.Value()); } // TODO(titzer): clean up above test and test more complicated effects. } |