Index: src/compiler/js-native-context-specialization.cc |
diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc |
index e6f4194cfeb5173a767ec7b21d5d48b738a9d56b..d95b2101789f4781899e9441c32513d8712417a2 100644 |
--- a/src/compiler/js-native-context-specialization.cc |
+++ b/src/compiler/js-native-context-specialization.cc |
@@ -161,7 +161,8 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess( |
receiver, effect, control); |
} else { |
// Monomorphic property access. |
- effect = BuildCheckHeapObject(receiver, effect, control); |
+ receiver = effect = graph()->NewNode(simplified()->CheckHeapObject(), |
+ receiver, effect, control); |
effect = BuildCheckMaps(receiver, effect, control, |
access_info.receiver_maps()); |
} |
@@ -199,7 +200,8 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess( |
receiverissmi_control = graph()->NewNode(common()->IfTrue(), branch); |
receiverissmi_effect = effect; |
} else { |
- effect = BuildCheckHeapObject(receiver, effect, control); |
+ receiver = effect = graph()->NewNode(simplified()->CheckHeapObject(), |
+ receiver, effect, control); |
} |
// Load the {receiver} map. The resulting effect is the dominating effect |
@@ -507,7 +509,8 @@ Reduction JSNativeContextSpecialization::ReduceElementAccess( |
} |
// Ensure that {receiver} is a heap object. |
- effect = BuildCheckHeapObject(receiver, effect, control); |
+ receiver = effect = graph()->NewNode(simplified()->CheckHeapObject(), |
+ receiver, effect, control); |
// Check for the monomorphic case. |
if (access_infos.size() == 1) { |
@@ -1449,33 +1452,6 @@ Node* JSNativeContextSpecialization::BuildCheckMaps( |
inputs); |
} |
-Node* JSNativeContextSpecialization::BuildCheckHeapObject(Node* receiver, |
- Node* effect, |
- Node* control) { |
- switch (receiver->opcode()) { |
- case IrOpcode::kHeapConstant: |
- case IrOpcode::kJSCreate: |
- case IrOpcode::kJSCreateArguments: |
- case IrOpcode::kJSCreateArray: |
- case IrOpcode::kJSCreateClosure: |
- case IrOpcode::kJSCreateIterResultObject: |
- case IrOpcode::kJSCreateLiteralArray: |
- case IrOpcode::kJSCreateLiteralObject: |
- case IrOpcode::kJSCreateLiteralRegExp: |
- case IrOpcode::kJSConvertReceiver: |
- case IrOpcode::kJSToName: |
- case IrOpcode::kJSToString: |
- case IrOpcode::kJSToObject: |
- case IrOpcode::kJSTypeOf: { |
- return effect; |
- } |
- default: { |
- return graph()->NewNode(simplified()->CheckHeapObject(), receiver, effect, |
- control); |
- } |
- } |
-} |
- |
void JSNativeContextSpecialization::AssumePrototypesStable( |
std::vector<Handle<Map>> const& receiver_maps, Handle<JSObject> holder) { |
// Determine actual holder and perform prototype chain checks. |