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

Unified Diff: src/compiler/js-intrinsic-lowering.cc

Issue 1657863004: [turbofan] Introduce proper ObjectIsReceiver operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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-native-context-specialization.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-intrinsic-lowering.cc
diff --git a/src/compiler/js-intrinsic-lowering.cc b/src/compiler/js-intrinsic-lowering.cc
index 29b1ad9208202ada0919efaf8e098f5669b1ca25..34917ee553257c0a20641617bacb88841ec0a0cc 100644
--- a/src/compiler/js-intrinsic-lowering.cc
+++ b/src/compiler/js-intrinsic-lowering.cc
@@ -228,46 +228,7 @@ Reduction JSIntrinsicLowering::ReduceIsInstanceType(
Reduction JSIntrinsicLowering::ReduceIsJSReceiver(Node* node) {
- Node* value = NodeProperties::GetValueInput(node, 0);
- Type* value_type = NodeProperties::GetType(value);
- Node* effect = NodeProperties::GetEffectInput(node);
- Node* control = NodeProperties::GetControlInput(node);
- if (value_type->Is(Type::Receiver())) {
- value = jsgraph()->TrueConstant();
- } else if (!value_type->Maybe(Type::Receiver())) {
- value = jsgraph()->FalseConstant();
- } else {
- // if (%_IsSmi(value)) {
- // return false;
- // } else {
- // return FIRST_JS_RECEIVER_TYPE <= %_GetInstanceType(%_GetMap(value))
- // }
- STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE);
-
- Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), value);
- Node* branch = graph()->NewNode(common()->Branch(), check, control);
-
- Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
- Node* etrue = effect;
- Node* vtrue = jsgraph()->FalseConstant();
-
- Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
- Node* efalse = graph()->NewNode(
- simplified()->LoadField(AccessBuilder::ForMapInstanceType()),
- graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()),
- value, effect, if_false),
- effect, if_false);
- Node* vfalse = graph()->NewNode(
- machine()->Uint32LessThanOrEqual(),
- jsgraph()->Int32Constant(FIRST_JS_RECEIVER_TYPE), efalse);
-
- control = graph()->NewNode(common()->Merge(2), if_true, if_false);
- effect = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control);
- value = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
- vtrue, vfalse, control);
- }
- ReplaceWithValue(node, node, effect, control);
- return Replace(value);
+ return Change(node, simplified()->ObjectIsReceiver());
}
« no previous file with comments | « no previous file | src/compiler/js-native-context-specialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698