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

Unified Diff: src/compiler/change-lowering.cc

Issue 1722193002: [compiler] Drop the CompareNilIC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 4 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/change-lowering.h ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/change-lowering.cc
diff --git a/src/compiler/change-lowering.cc b/src/compiler/change-lowering.cc
index e217f3786b02c43ee5278b1c2555108857d24832..907b36a93b7dd860c2a32e27a6b685444c9baf33 100644
--- a/src/compiler/change-lowering.cc
+++ b/src/compiler/change-lowering.cc
@@ -55,6 +55,8 @@ Reduction ChangeLowering::Reduce(Node* node) {
return ObjectIsSmi(node);
case IrOpcode::kObjectIsNumber:
return ObjectIsNumber(node);
+ case IrOpcode::kObjectIsUndetectable:
+ return ObjectIsUndetectable(node);
default:
return NoChange();
}
@@ -603,6 +605,13 @@ Node* ChangeLowering::LoadHeapObjectMap(Node* object, Node* control) {
graph()->start(), control);
}
+Node* ChangeLowering::LoadMapBitField(Node* map) {
+ return graph()->NewNode(
+ machine()->Load(MachineType::Uint8()), map,
+ jsgraph()->IntPtrConstant(Map::kBitFieldOffset - kHeapObjectTag),
+ graph()->start(), graph()->start());
+}
+
Node* ChangeLowering::LoadMapInstanceType(Node* map) {
return graph()->NewNode(
machine()->Load(MachineType::Uint8()), map,
@@ -650,6 +659,31 @@ Reduction ChangeLowering::ObjectIsReceiver(Node* node) {
return Changed(node);
}
+Reduction ChangeLowering::ObjectIsUndetectable(Node* node) {
+ Node* input = NodeProperties::GetValueInput(node, 0);
+ // TODO(bmeurer): Optimize somewhat based on input type.
+ Node* check = IsSmi(input);
+ Node* branch = graph()->NewNode(common()->Branch(), check, graph()->start());
+ Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
+ Node* vtrue = jsgraph()->Int32Constant(0);
+ Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
+ Node* vfalse = graph()->NewNode(
+ machine()->Word32Equal(),
+ graph()->NewNode(
+ machine()->Word32Equal(),
+ graph()->NewNode(machine()->Word32And(),
+ jsgraph()->Uint32Constant(1 << Map::kIsUndetectable),
+ LoadMapBitField(LoadHeapObjectMap(input, if_false))),
+ jsgraph()->Int32Constant(0)),
+ jsgraph()->Int32Constant(0));
+ Node* control = graph()->NewNode(common()->Merge(2), if_true, if_false);
+ node->ReplaceInput(0, vtrue);
+ node->AppendInput(graph()->zone(), vfalse);
+ node->AppendInput(graph()->zone(), control);
+ NodeProperties::ChangeOp(node, common()->Phi(MachineRepresentation::kBit, 2));
+ return Changed(node);
+}
+
Reduction ChangeLowering::ObjectIsSmi(Node* node) {
node->ReplaceInput(0,
graph()->NewNode(machine()->WordAnd(), node->InputAt(0),
« no previous file with comments | « src/compiler/change-lowering.h ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698