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

Unified Diff: src/compiler/simplified-operator-reducer.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/simplified-operator-reducer.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-operator-reducer.cc
diff --git a/src/compiler/simplified-operator-reducer.cc b/src/compiler/simplified-operator-reducer.cc
index ad48379f4c11f3d874b7158165305a12aa2db946..047d251bf3c6100fa1c8b49a21019d71ba56779b 100644
--- a/src/compiler/simplified-operator-reducer.cc
+++ b/src/compiler/simplified-operator-reducer.cc
@@ -4,11 +4,9 @@
#include "src/compiler/simplified-operator-reducer.h"
-#include "src/compiler/access-builder.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties.h"
#include "src/compiler/operator-properties.h"
namespace v8 {
@@ -24,8 +22,6 @@ SimplifiedOperatorReducer::~SimplifiedOperatorReducer() {}
Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
switch (node->opcode()) {
- case IrOpcode::kAnyToBoolean:
- return ReduceAnyToBoolean(node);
case IrOpcode::kBooleanNot: {
HeapObjectMatcher<HeapObject> m(node->InputAt(0));
if (m.Is(Unique<HeapObject>::CreateImmovable(factory()->false_value()))) {
@@ -111,32 +107,6 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
}
-Reduction SimplifiedOperatorReducer::ReduceAnyToBoolean(Node* node) {
- Node* const input = NodeProperties::GetValueInput(node, 0);
- Type* const input_type = NodeProperties::GetBounds(input).upper;
- if (input_type->Is(Type::Boolean())) {
- // AnyToBoolean(x:boolean) => x
- return Replace(input);
- }
- if (input_type->Is(Type::OrderedNumber())) {
- // AnyToBoolean(x:ordered-number) => BooleanNot(NumberEqual(x, #0))
- Node* compare = graph()->NewNode(simplified()->NumberEqual(), input,
- jsgraph()->ZeroConstant());
- return Change(node, simplified()->BooleanNot(), compare);
- }
- if (input_type->Is(Type::String())) {
- // AnyToBoolean(x:string) => BooleanNot(NumberEqual(x.length, #0))
- FieldAccess const access = AccessBuilder::ForStringLength();
- Node* length = graph()->NewNode(simplified()->LoadField(access), input,
- graph()->start(), graph()->start());
- Node* compare = graph()->NewNode(simplified()->NumberEqual(), length,
- jsgraph()->ZeroConstant());
- return Change(node, simplified()->BooleanNot(), compare);
- }
- return NoChange();
-}
-
-
Reduction SimplifiedOperatorReducer::Change(Node* node, const Operator* op,
Node* a) {
DCHECK_EQ(node->InputCount(), OperatorProperties::GetTotalInputCount(op));
@@ -175,11 +145,6 @@ Factory* SimplifiedOperatorReducer::factory() const {
}
-CommonOperatorBuilder* SimplifiedOperatorReducer::common() const {
- return jsgraph()->common();
-}
-
-
MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const {
return jsgraph()->machine();
}
« no previous file with comments | « src/compiler/simplified-operator-reducer.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698