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

Unified Diff: test/cctest/compiler/test-js-context-specialization.cc

Issue 2006423003: [turbofan] Remove the EmptyFrameState caching on JSGraph. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/js-intrinsic-lowering-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c7cd47a55cd57e32b5bf00be2f91e6d73784e31e..9c024f8816d24e4f10b0283f2d5a7f9086525594 100644
--- a/test/cctest/compiler/test-js-context-specialization.cc
+++ b/test/cctest/compiler/test-js-context-specialization.cc
@@ -186,81 +186,6 @@ TEST(ReduceJSStoreContext) {
}
-// TODO(titzer): factor out common code with effects checking in typed lowering.
-static void CheckEffectInput(Node* effect, Node* use) {
- CHECK_EQ(effect, NodeProperties::GetEffectInput(use));
-}
-
-
-TEST(SpecializeToContext) {
- ContextSpecializationTester t;
-
- Node* start = t.graph()->NewNode(t.common()->Start(0));
- t.graph()->SetStart(start);
-
- // Make a context and initialize it a bit for this test.
- Handle<Context> native = t.factory()->NewNativeContext();
- Handle<Object> expected = t.factory()->InternalizeUtf8String("gboy!");
- const int slot = Context::NATIVE_CONTEXT_INDEX;
- native->set(slot, *expected);
-
- Node* const_context = t.jsgraph()->Constant(native);
- Node* param_context = t.graph()->NewNode(t.common()->Parameter(0), start);
-
- {
- // Check that specialization replaces values and forwards effects
- // correctly, and folds values from constant and non-constant contexts
- Node* effect_in = start;
- Node* load = t.graph()->NewNode(t.javascript()->LoadContext(0, slot, true),
- const_context, const_context, effect_in);
-
-
- Node* value_use =
- t.graph()->NewNode(t.simplified()->ChangeTaggedToInt32(), load);
- Node* other_load =
- t.graph()->NewNode(t.javascript()->LoadContext(0, slot, true),
- param_context, param_context, load);
- Node* effect_use = other_load;
- Node* other_use =
- t.graph()->NewNode(t.simplified()->ChangeTaggedToInt32(), other_load);
-
- Node* add = t.graph()->NewNode(
- t.javascript()->Add(BinaryOperationHints::Any()), 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);
- Node* end = t.graph()->NewNode(t.common()->End(1), ret);
- USE(end);
- t.graph()->SetEnd(end);
-
- // Double check the above graph is what we expect, or the test is broken.
- CheckEffectInput(effect_in, load);
- CheckEffectInput(load, effect_use);
-
- // Perform the reduction on the entire graph.
- GraphReducer graph_reducer(t.main_zone(), t.graph());
- JSContextSpecialization spec(&graph_reducer, t.jsgraph(),
- MaybeHandle<Context>());
- graph_reducer.AddReducer(&spec);
- graph_reducer.ReduceGraph();
-
- // Effects should have been forwarded (not replaced with a value).
- CheckEffectInput(effect_in, effect_use);
-
- // Use of {other_load} should not have been replaced.
- CHECK_EQ(other_load, other_use->InputAt(0));
-
- Node* replacement = value_use->InputAt(0);
- HeapObjectMatcher match(replacement);
- CHECK(match.HasValue());
- CHECK_EQ(*expected, *match.Value());
- }
- // TODO(titzer): clean up above test and test more complicated effects.
-}
-
-
TEST(SpecializeJSFunction_ToConstant1) {
FunctionTester T(
"(function() { var x = 1; function inc(a)"
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | test/unittests/compiler/js-intrinsic-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698