OLD | NEW |
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 2222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2233 case IrOpcode::kStringFromCharCode: { | 2233 case IrOpcode::kStringFromCharCode: { |
2234 VisitUnop(node, UseInfo::TruncatingWord32(), | 2234 VisitUnop(node, UseInfo::TruncatingWord32(), |
2235 MachineRepresentation::kTaggedPointer); | 2235 MachineRepresentation::kTaggedPointer); |
2236 return; | 2236 return; |
2237 } | 2237 } |
2238 case IrOpcode::kStringFromCodePoint: { | 2238 case IrOpcode::kStringFromCodePoint: { |
2239 VisitUnop(node, UseInfo::TruncatingWord32(), | 2239 VisitUnop(node, UseInfo::TruncatingWord32(), |
2240 MachineRepresentation::kTaggedPointer); | 2240 MachineRepresentation::kTaggedPointer); |
2241 return; | 2241 return; |
2242 } | 2242 } |
| 2243 case IrOpcode::kStringIndexOf: { |
| 2244 ProcessInput(node, 0, UseInfo::AnyTagged()); |
| 2245 ProcessInput(node, 1, UseInfo::AnyTagged()); |
| 2246 ProcessInput(node, 2, UseInfo::TaggedSigned()); |
| 2247 SetOutput(node, MachineRepresentation::kTaggedSigned); |
| 2248 return; |
| 2249 } |
2243 | 2250 |
2244 case IrOpcode::kCheckBounds: { | 2251 case IrOpcode::kCheckBounds: { |
2245 Type* index_type = TypeOf(node->InputAt(0)); | 2252 Type* index_type = TypeOf(node->InputAt(0)); |
2246 Type* length_type = TypeOf(node->InputAt(1)); | 2253 Type* length_type = TypeOf(node->InputAt(1)); |
2247 if (index_type->Is(Type::Unsigned32())) { | 2254 if (index_type->Is(Type::Unsigned32())) { |
2248 VisitBinop(node, UseInfo::TruncatingWord32(), | 2255 VisitBinop(node, UseInfo::TruncatingWord32(), |
2249 MachineRepresentation::kWord32); | 2256 MachineRepresentation::kWord32); |
2250 if (lower() && index_type->Max() < length_type->Min()) { | 2257 if (lower() && index_type->Max() < length_type->Min()) { |
2251 // The bounds check is redundant if we already know that | 2258 // The bounds check is redundant if we already know that |
2252 // the index is within the bounds of [0.0, length[. | 2259 // the index is within the bounds of [0.0, length[. |
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3507 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3514 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
3508 Operator::kNoProperties); | 3515 Operator::kNoProperties); |
3509 to_number_operator_.set(common()->Call(desc)); | 3516 to_number_operator_.set(common()->Call(desc)); |
3510 } | 3517 } |
3511 return to_number_operator_.get(); | 3518 return to_number_operator_.get(); |
3512 } | 3519 } |
3513 | 3520 |
3514 } // namespace compiler | 3521 } // namespace compiler |
3515 } // namespace internal | 3522 } // namespace internal |
3516 } // namespace v8 | 3523 } // namespace v8 |
OLD | NEW |