| Index: src/compiler/simplified-lowering.cc
|
| diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
|
| index fe0280b393c03cd6bf4d2b3c79f48eb4fdd6fcec..6892879f7cc0c6154fbb561c00e5822f44379bbc 100644
|
| --- a/src/compiler/simplified-lowering.cc
|
| +++ b/src/compiler/simplified-lowering.cc
|
| @@ -355,6 +355,41 @@ class RepresentationSelector {
|
| }
|
| }
|
|
|
| + void VisitIsSmi(Node* node) {
|
| + ProcessInput(node, 0, kMachAnyTagged);
|
| + if (lower()) {
|
| + Node* is_tagged = jsgraph_->graph()->NewNode(
|
| + jsgraph_->machine()->WordAnd(), node->InputAt(0),
|
| + jsgraph_->Int32Constant(static_cast<int>(kSmiTagMask)));
|
| + Node* is_smi = jsgraph_->graph()->NewNode(
|
| + jsgraph_->machine()->WordEqual(), is_tagged,
|
| + jsgraph_->Int32Constant(kSmiTag));
|
| + DeferReplacement(node, is_smi);
|
| + }
|
| + SetOutput(node, kRepBit | kTypeBool);
|
| + }
|
| +
|
| + void VisitIsNonNegativeSmi(Node* node) {
|
| + ProcessInput(node, 0, kMachAnyTagged);
|
| + if (lower()) {
|
| + Node* is_tagged = jsgraph_->graph()->NewNode(
|
| + jsgraph_->machine()->WordAnd(), node->InputAt(0),
|
| + jsgraph_->Int32Constant(static_cast<int>(kSmiTagMask)));
|
| + Node* is_smi = jsgraph_->graph()->NewNode(
|
| + jsgraph_->machine()->WordEqual(), is_tagged,
|
| + jsgraph_->Int32Constant(kSmiTag));
|
| + Node* is_non_neg = jsgraph_->graph()->NewNode(
|
| + jsgraph_->machine()->Is32()
|
| + ? jsgraph_->machine()->Int32LessThanOrEqual()
|
| + : jsgraph_->machine()->Int64LessThanOrEqual(),
|
| + jsgraph_->Int32Constant(0), node->InputAt(0));
|
| + Node* is_non_neg_smi = jsgraph_->graph()->NewNode(
|
| + jsgraph_->machine()->Word32And(), is_smi, is_non_neg);
|
| + DeferReplacement(node, is_non_neg_smi);
|
| + }
|
| + SetOutput(node, kRepBit | kTypeBool);
|
| + }
|
| +
|
| const Operator* Int32Op(Node* node) {
|
| return changer_->Int32OperatorFor(node->opcode());
|
| }
|
| @@ -833,6 +868,10 @@ class RepresentationSelector {
|
| }
|
| SetOutput(node, kMachAnyTagged);
|
| break;
|
| + case IrOpcode::kIsSmi:
|
| + return VisitIsSmi(node);
|
| + case IrOpcode::kIsNonNegativeSmi:
|
| + return VisitIsNonNegativeSmi(node);
|
| default:
|
| VisitInputs(node);
|
| break;
|
| @@ -947,7 +986,6 @@ void SimplifiedLowering::DoLoadField(Node* node) {
|
| node->set_op(machine()->Load(access.machine_type));
|
| Node* offset = jsgraph()->Int32Constant(access.offset - access.tag());
|
| node->InsertInput(zone(), 1, offset);
|
| - node->AppendInput(zone(), graph()->start());
|
| }
|
|
|
|
|
|
|