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

Unified Diff: src/compiler/js-builtin-reducer.cc

Issue 2703133003: [turbofan] Unify NodeProperties::InferReceiverMaps. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | src/compiler/js-call-reducer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-builtin-reducer.cc
diff --git a/src/compiler/js-builtin-reducer.cc b/src/compiler/js-builtin-reducer.cc
index 7b85d4fdda60f1932d53ca314042ee63c5071303..a9af93c80ce9cb6e661d72ab5ff189ca6aa49884 100644
--- a/src/compiler/js-builtin-reducer.cc
+++ b/src/compiler/js-builtin-reducer.cc
@@ -110,26 +110,13 @@ JSBuiltinReducer::JSBuiltinReducer(Editor* editor, JSGraph* jsgraph,
namespace {
MaybeHandle<Map> GetMapWitness(Node* node) {
+ ZoneHandleSet<Map> maps;
Node* receiver = NodeProperties::GetValueInput(node, 1);
Node* effect = NodeProperties::GetEffectInput(node);
- // Check if the {node} is dominated by a CheckMaps with a single map
- // for the {receiver}, and if so use that map for the lowering below.
- for (Node* dominator = effect;;) {
- if (dominator->opcode() == IrOpcode::kCheckMaps &&
- NodeProperties::IsSame(dominator->InputAt(0), receiver)) {
- ZoneHandleSet<Map> const& maps =
- CheckMapsParametersOf(dominator->op()).maps();
- return (maps.size() == 1) ? MaybeHandle<Map>(maps[0])
- : MaybeHandle<Map>();
- }
- DCHECK_EQ(1, dominator->op()->EffectOutputCount());
- if (dominator->op()->EffectInputCount() != 1 ||
- !dominator->op()->HasProperty(Operator::kNoWrite)) {
- // Didn't find any appropriate CheckMaps node.
- return MaybeHandle<Map>();
- }
- dominator = NodeProperties::GetEffectInput(dominator);
+ if (NodeProperties::InferReceiverMaps(receiver, effect, &maps)) {
+ if (maps.size() == 1) return MaybeHandle<Map>(maps[0]);
}
+ return MaybeHandle<Map>();
}
// TODO(turbofan): This was copied from Crankshaft, might be too restrictive.
« no previous file with comments | « no previous file | src/compiler/js-call-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698