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

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

Issue 2363333003: [turbofan] Lower StringEqual and friends in EffectControlLinearizer. (Closed)
Patch Set: Preinitialize interface descriptors and drop TODO. Created 4 years, 2 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/pipeline.cc ('k') | src/isolate.cc » ('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/address-map.h" 9 #include "src/address-map.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after
2033 if (lower()) DeferReplacement(node, node->InputAt(0)); 2033 if (lower()) DeferReplacement(node, node->InputAt(0));
2034 return; 2034 return;
2035 } 2035 }
2036 case IrOpcode::kReferenceEqual: { 2036 case IrOpcode::kReferenceEqual: {
2037 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kBit); 2037 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kBit);
2038 if (lower()) { 2038 if (lower()) {
2039 NodeProperties::ChangeOp(node, lowering->machine()->WordEqual()); 2039 NodeProperties::ChangeOp(node, lowering->machine()->WordEqual());
2040 } 2040 }
2041 return; 2041 return;
2042 } 2042 }
2043 case IrOpcode::kStringEqual: { 2043 case IrOpcode::kStringEqual:
2044 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); 2044 case IrOpcode::kStringLessThan:
2045 if (lower()) {
2046 // StringEqual(x, y) => Call(StringEqualStub, x, y, no-context)
2047 Operator::Properties properties =
2048 Operator::kCommutative | Operator::kEliminatable;
2049 Callable callable = CodeFactory::StringEqual(jsgraph_->isolate());
2050 CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
2051 CallDescriptor* desc = Linkage::GetStubCallDescriptor(
2052 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0,
2053 flags, properties);
2054 node->InsertInput(jsgraph_->zone(), 0,
2055 jsgraph_->HeapConstant(callable.code()));
2056 node->AppendInput(jsgraph_->zone(), jsgraph_->NoContextConstant());
2057 node->AppendInput(jsgraph_->zone(), jsgraph_->graph()->start());
2058 NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc));
2059 }
2060 return;
2061 }
2062 case IrOpcode::kStringLessThan: {
2063 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
2064 if (lower()) {
2065 // StringLessThan(x, y) => Call(StringLessThanStub, x, y, no-context)
2066 Operator::Properties properties = Operator::kEliminatable;
2067 Callable callable = CodeFactory::StringLessThan(jsgraph_->isolate());
2068 CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
2069 CallDescriptor* desc = Linkage::GetStubCallDescriptor(
2070 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0,
2071 flags, properties);
2072 node->InsertInput(jsgraph_->zone(), 0,
2073 jsgraph_->HeapConstant(callable.code()));
2074 node->AppendInput(jsgraph_->zone(), jsgraph_->NoContextConstant());
2075 node->AppendInput(jsgraph_->zone(), jsgraph_->graph()->start());
2076 NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc));
2077 }
2078 return;
2079 }
2080 case IrOpcode::kStringLessThanOrEqual: { 2045 case IrOpcode::kStringLessThanOrEqual: {
2081 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); 2046 return VisitBinop(node, UseInfo::AnyTagged(),
2082 if (lower()) { 2047 MachineRepresentation::kTagged);
2083 // StringLessThanOrEqual(x, y)
2084 // => Call(StringLessThanOrEqualStub, x, y, no-context)
2085 Operator::Properties properties = Operator::kEliminatable;
2086 Callable callable =
2087 CodeFactory::StringLessThanOrEqual(jsgraph_->isolate());
2088 CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
2089 CallDescriptor* desc = Linkage::GetStubCallDescriptor(
2090 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0,
2091 flags, properties);
2092 node->InsertInput(jsgraph_->zone(), 0,
2093 jsgraph_->HeapConstant(callable.code()));
2094 node->AppendInput(jsgraph_->zone(), jsgraph_->NoContextConstant());
2095 node->AppendInput(jsgraph_->zone(), jsgraph_->graph()->start());
2096 NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc));
2097 }
2098 return;
2099 } 2048 }
2100 case IrOpcode::kStringCharCodeAt: { 2049 case IrOpcode::kStringCharCodeAt: {
2101 VisitBinop(node, UseInfo::AnyTagged(), UseInfo::TruncatingWord32(), 2050 VisitBinop(node, UseInfo::AnyTagged(), UseInfo::TruncatingWord32(),
2102 MachineRepresentation::kWord32); 2051 MachineRepresentation::kWord32);
2103 return; 2052 return;
2104 } 2053 }
2105 case IrOpcode::kStringFromCharCode: { 2054 case IrOpcode::kStringFromCharCode: {
2106 VisitUnop(node, UseInfo::TruncatingWord32(), 2055 VisitUnop(node, UseInfo::TruncatingWord32(),
2107 MachineRepresentation::kTagged); 2056 MachineRepresentation::kTagged);
2108 return; 2057 return;
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
3261 isolate(), graph()->zone(), callable.descriptor(), 0, flags, 3210 isolate(), graph()->zone(), callable.descriptor(), 0, flags,
3262 Operator::kNoProperties); 3211 Operator::kNoProperties);
3263 to_number_operator_.set(common()->Call(desc)); 3212 to_number_operator_.set(common()->Call(desc));
3264 } 3213 }
3265 return to_number_operator_.get(); 3214 return to_number_operator_.get();
3266 } 3215 }
3267 3216
3268 } // namespace compiler 3217 } // namespace compiler
3269 } // namespace internal 3218 } // namespace internal
3270 } // namespace v8 3219 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/pipeline.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698