| Index: test/cctest/compiler/test-js-context-specialization.cc
|
| diff --git a/test/cctest/compiler/test-js-context-specialization.cc b/test/cctest/compiler/test-js-context-specialization.cc
|
| index 47c660ae0d796907791b44c32647bec6c91c1434..d78f2f22a935b82912fb8c374d4ff97dc72f36ba 100644
|
| --- a/test/cctest/compiler/test-js-context-specialization.cc
|
| +++ b/test/cctest/compiler/test-js-context-specialization.cc
|
| @@ -69,7 +69,7 @@ TEST(ReduceJSLoadContext) {
|
|
|
| {
|
| // Mutable slot, constant context, depth = 0 => do nothing.
|
| - Node* load = t.NewNode(t.javascript()->LoadContext(0, 0, false),
|
| + Node* load = t.NewNode(t.javascript()->LoadContext(ContextAccess(0, 0)),
|
| const_context, const_context, start);
|
| Reduction r = spec.ReduceJSLoadContext(load);
|
| CHECK(!r.Changed());
|
| @@ -77,7 +77,7 @@ TEST(ReduceJSLoadContext) {
|
|
|
| {
|
| // Mutable slot, non-constant context, depth = 0 => do nothing.
|
| - Node* load = t.NewNode(t.javascript()->LoadContext(0, 0, false),
|
| + Node* load = t.NewNode(t.javascript()->LoadContext(ContextAccess(0, 0)),
|
| param_context, param_context, start);
|
| Reduction r = spec.ReduceJSLoadContext(load);
|
| CHECK(!r.Changed());
|
| @@ -85,9 +85,9 @@ TEST(ReduceJSLoadContext) {
|
|
|
| {
|
| // Mutable slot, constant context, depth > 0 => fold-in parent context.
|
| - Node* load = t.NewNode(
|
| - t.javascript()->LoadContext(2, Context::GLOBAL_EVAL_FUN_INDEX, false),
|
| - deep_const_context, deep_const_context, start);
|
| + Node* load = t.NewNode(t.javascript()->LoadContext(ContextAccess(
|
| + 2, Context::GLOBAL_EVAL_FUN_INDEX)),
|
| + deep_const_context, deep_const_context, start);
|
| Reduction r = spec.ReduceJSLoadContext(load);
|
| CHECK(r.Changed());
|
| Node* new_context_input = NodeProperties::GetValueInput(r.replacement(), 0);
|
| @@ -102,8 +102,9 @@ TEST(ReduceJSLoadContext) {
|
|
|
| {
|
| // Immutable slot, constant context, depth = 0 => specialize.
|
| - Node* load = t.NewNode(t.javascript()->LoadContext(0, slot, true),
|
| - const_context, const_context, start);
|
| + Node* load =
|
| + t.NewNode(t.javascript()->LoadContext(ContextAccess(0, slot, true)),
|
| + const_context, const_context, start);
|
| Reduction r = spec.ReduceJSLoadContext(load);
|
| CHECK(r.Changed());
|
| CHECK(r.replacement() != load);
|
| @@ -141,33 +142,33 @@ TEST(ReduceJSStoreContext) {
|
|
|
| {
|
| // Mutable slot, constant context, depth = 0 => do nothing.
|
| - Node* load = t.NewNode(t.javascript()->StoreContext(0, 0), const_context,
|
| - const_context, start);
|
| + Node* load = t.NewNode(t.javascript()->StoreContext(ContextAccess(0, 0)),
|
| + const_context, const_context, start);
|
| Reduction r = spec.ReduceJSStoreContext(load);
|
| CHECK(!r.Changed());
|
| }
|
|
|
| {
|
| // Mutable slot, non-constant context, depth = 0 => do nothing.
|
| - Node* load = t.NewNode(t.javascript()->StoreContext(0, 0), param_context,
|
| - param_context, start);
|
| + Node* load = t.NewNode(t.javascript()->StoreContext(ContextAccess(0, 0)),
|
| + param_context, param_context, start);
|
| Reduction r = spec.ReduceJSStoreContext(load);
|
| CHECK(!r.Changed());
|
| }
|
|
|
| {
|
| // Immutable slot, constant context, depth = 0 => do nothing.
|
| - Node* load = t.NewNode(t.javascript()->StoreContext(0, slot), const_context,
|
| - const_context, start);
|
| + Node* load = t.NewNode(t.javascript()->StoreContext(ContextAccess(0, slot)),
|
| + const_context, const_context, start);
|
| Reduction r = spec.ReduceJSStoreContext(load);
|
| CHECK(!r.Changed());
|
| }
|
|
|
| {
|
| // Mutable slot, constant context, depth > 0 => fold-in parent context.
|
| - Node* load = t.NewNode(
|
| - t.javascript()->StoreContext(2, Context::GLOBAL_EVAL_FUN_INDEX),
|
| - deep_const_context, deep_const_context, start);
|
| + Node* load = t.NewNode(t.javascript()->StoreContext(ContextAccess(
|
| + 2, Context::GLOBAL_EVAL_FUN_INDEX)),
|
| + deep_const_context, deep_const_context, start);
|
| Reduction r = spec.ReduceJSStoreContext(load);
|
| CHECK(r.Changed());
|
| Node* new_context_input = NodeProperties::GetValueInput(r.replacement(), 0);
|
| @@ -209,13 +210,15 @@ TEST(SpecializeToContext) {
|
| // Check that SpecializeToContext() replaces values and forwards effects
|
| // correctly, and folds values from constant and non-constant contexts
|
| Node* effect_in = start;
|
| - Node* load = t.NewNode(t.javascript()->LoadContext(0, slot, true),
|
| - const_context, const_context, effect_in);
|
| + Node* load =
|
| + t.NewNode(t.javascript()->LoadContext(ContextAccess(0, slot, true)),
|
| + const_context, const_context, effect_in);
|
|
|
|
|
| Node* value_use = t.NewNode(t.simplified()->ChangeTaggedToInt32(), load);
|
| - Node* other_load = t.NewNode(t.javascript()->LoadContext(0, slot, true),
|
| - param_context, param_context, load);
|
| + Node* other_load =
|
| + t.NewNode(t.javascript()->LoadContext(ContextAccess(0, slot, true)),
|
| + param_context, param_context, load);
|
| Node* effect_use = other_load;
|
| Node* other_use =
|
| t.NewNode(t.simplified()->ChangeTaggedToInt32(), other_load);
|
|
|