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

Unified Diff: src/compiler/js-inlining.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 | « src/compiler/js-call-reducer.cc ('k') | src/compiler/js-native-context-specialization.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-inlining.cc
diff --git a/src/compiler/js-inlining.cc b/src/compiler/js-inlining.cc
index 622b09543c6758894855a089bb594570b13506ee..e891f43cbe5f08bd38b5a246875f3b0c6743aca1 100644
--- a/src/compiler/js-inlining.cc
+++ b/src/compiler/js-inlining.cc
@@ -305,45 +305,20 @@ bool NeedsConvertReceiver(Node* receiver, Node* effect) {
case IrOpcode::kJSCreateLiteralRegExp:
case IrOpcode::kJSConvertReceiver:
case IrOpcode::kJSGetSuperConstructor:
- case IrOpcode::kJSToObject:
- return false;
- default:
- break;
- }
- for (Node* dominator = effect;;) {
- if (dominator->opcode() == IrOpcode::kCheckMaps &&
- NodeProperties::IsSame(dominator->InputAt(0), receiver)) {
- // Check if all maps have the given {instance_type}.
- ZoneHandleSet<Map> const& maps =
- CheckMapsParametersOf(dominator->op()).maps();
- for (size_t i = 0; i < maps.size(); ++i) {
- if (!maps[i]->IsJSReceiverMap()) return true;
- }
+ case IrOpcode::kJSToObject: {
return false;
}
- switch (dominator->opcode()) {
- case IrOpcode::kStoreField: {
- FieldAccess const& access = FieldAccessOf(dominator->op());
- if (access.base_is_tagged == kTaggedBase &&
- access.offset == HeapObject::kMapOffset) {
- return true;
+ default: {
+ ZoneHandleSet<Map> maps;
+ if (NodeProperties::InferReceiverMaps(receiver, effect, &maps)) {
+ // Check if all {maps} are actually JSReceiver maps.
+ for (size_t i = 0; i < maps.size(); ++i) {
+ if (!maps[i]->IsJSReceiverMap()) return true;
}
- break;
- }
- case IrOpcode::kStoreElement:
- case IrOpcode::kStoreTypedElement:
- break;
- default: {
- DCHECK_EQ(1, dominator->op()->EffectOutputCount());
- if (dominator->op()->EffectInputCount() != 1 ||
- !dominator->op()->HasProperty(Operator::kNoWrite)) {
- // Didn't find any appropriate CheckMaps node.
- return true;
- }
- break;
+ return false;
}
+ return true;
}
- dominator = NodeProperties::GetEffectInput(dominator);
}
}
« no previous file with comments | « src/compiler/js-call-reducer.cc ('k') | src/compiler/js-native-context-specialization.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698