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

Side by Side Diff: src/compiler/simplified-lowering.cc

Issue 999173003: [turbofan] Remove indirection in JSToBoolean/JSUnaryNot lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comment. Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/compiler/opcodes.h ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/simplified-lowering.h" 5 #include "src/compiler/simplified-lowering.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 // but that responsibility really lies in the typed lowering phase. 531 // but that responsibility really lies in the typed lowering phase.
532 #define DEFINE_JS_CASE(x) case IrOpcode::k##x: 532 #define DEFINE_JS_CASE(x) case IrOpcode::k##x:
533 JS_OP_LIST(DEFINE_JS_CASE) 533 JS_OP_LIST(DEFINE_JS_CASE)
534 #undef DEFINE_JS_CASE 534 #undef DEFINE_JS_CASE
535 VisitInputs(node); 535 VisitInputs(node);
536 return SetOutput(node, kRepTagged); 536 return SetOutput(node, kRepTagged);
537 537
538 //------------------------------------------------------------------ 538 //------------------------------------------------------------------
539 // Simplified operators. 539 // Simplified operators.
540 //------------------------------------------------------------------ 540 //------------------------------------------------------------------
541 case IrOpcode::kAnyToBoolean: {
542 VisitUnop(node, kMachAnyTagged, kTypeBool | kRepTagged);
543 if (lower()) {
544 // AnyToBoolean(x) => Call(ToBooleanStub, x, no-context)
545 Operator::Properties properties = node->op()->properties();
546 Callable callable = CodeFactory::ToBoolean(
547 jsgraph_->isolate(), ToBooleanStub::RESULT_AS_ODDBALL);
548 CallDescriptor::Flags flags = CallDescriptor::kPatchableCallSite;
549 CallDescriptor* desc = Linkage::GetStubCallDescriptor(
550 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0,
551 flags, properties);
552 node->set_op(jsgraph_->common()->Call(desc));
553 node->InsertInput(jsgraph_->zone(), 0,
554 jsgraph_->HeapConstant(callable.code()));
555 node->AppendInput(jsgraph_->zone(), jsgraph_->NoContextConstant());
556 }
557 break;
558 }
559 case IrOpcode::kBooleanNot: { 541 case IrOpcode::kBooleanNot: {
560 if (lower()) { 542 if (lower()) {
561 MachineTypeUnion input = GetInfo(node->InputAt(0))->output; 543 MachineTypeUnion input = GetInfo(node->InputAt(0))->output;
562 if (input & kRepBit) { 544 if (input & kRepBit) {
563 // BooleanNot(x: kRepBit) => Word32Equal(x, #0) 545 // BooleanNot(x: kRepBit) => Word32Equal(x, #0)
564 node->set_op(lowering->machine()->Word32Equal()); 546 node->set_op(lowering->machine()->Word32Equal());
565 node->AppendInput(jsgraph_->zone(), jsgraph_->Int32Constant(0)); 547 node->AppendInput(jsgraph_->zone(), jsgraph_->Int32Constant(0));
566 } else { 548 } else {
567 // BooleanNot(x: kRepTagged) => WordEqual(x, #false) 549 // BooleanNot(x: kRepTagged) => WordEqual(x, #false)
568 node->set_op(lowering->machine()->WordEqual()); 550 node->set_op(lowering->machine()->WordEqual());
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 1576
1595 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { 1577 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) {
1596 node->set_op(machine()->IntLessThanOrEqual()); 1578 node->set_op(machine()->IntLessThanOrEqual());
1597 node->ReplaceInput(0, StringComparison(node, true)); 1579 node->ReplaceInput(0, StringComparison(node, true));
1598 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); 1580 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL));
1599 } 1581 }
1600 1582
1601 } // namespace compiler 1583 } // namespace compiler
1602 } // namespace internal 1584 } // namespace internal
1603 } // namespace v8 1585 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/opcodes.h ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698