| 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 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2119 // the index is within the bounds of [0.0, length[. | 2119 // the index is within the bounds of [0.0, length[. |
| 2120 DeferReplacement(node, node->InputAt(0)); | 2120 DeferReplacement(node, node->InputAt(0)); |
| 2121 } | 2121 } |
| 2122 } else { | 2122 } else { |
| 2123 VisitBinop(node, UseInfo::CheckedSigned32AsWord32(), | 2123 VisitBinop(node, UseInfo::CheckedSigned32AsWord32(), |
| 2124 UseInfo::TruncatingWord32(), | 2124 UseInfo::TruncatingWord32(), |
| 2125 MachineRepresentation::kWord32); | 2125 MachineRepresentation::kWord32); |
| 2126 } | 2126 } |
| 2127 return; | 2127 return; |
| 2128 } | 2128 } |
| 2129 case IrOpcode::kCheckHeapObject: { |
| 2130 if (InputCannotBe(node, Type::SignedSmall())) { |
| 2131 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); |
| 2132 if (lower()) DeferReplacement(node, node->InputAt(0)); |
| 2133 } else { |
| 2134 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); |
| 2135 } |
| 2136 return; |
| 2137 } |
| 2129 case IrOpcode::kCheckIf: { | 2138 case IrOpcode::kCheckIf: { |
| 2130 ProcessInput(node, 0, UseInfo::Bool()); | 2139 ProcessInput(node, 0, UseInfo::Bool()); |
| 2131 ProcessRemainingInputs(node, 1); | 2140 ProcessRemainingInputs(node, 1); |
| 2132 SetOutput(node, MachineRepresentation::kNone); | 2141 SetOutput(node, MachineRepresentation::kNone); |
| 2133 return; | 2142 return; |
| 2134 } | 2143 } |
| 2135 case IrOpcode::kCheckNumber: { | 2144 case IrOpcode::kCheckNumber: { |
| 2136 if (InputIs(node, Type::Number())) { | 2145 if (InputIs(node, Type::Number())) { |
| 2137 if (truncation.IsUsedAsWord32()) { | 2146 if (truncation.IsUsedAsWord32()) { |
| 2138 VisitUnop(node, UseInfo::TruncatingWord32(), | 2147 VisitUnop(node, UseInfo::TruncatingWord32(), |
| 2139 MachineRepresentation::kWord32); | 2148 MachineRepresentation::kWord32); |
| 2140 } else { | 2149 } else { |
| 2141 // TODO(jarin,bmeurer): We need to go to Tagged here, because | 2150 // TODO(jarin,bmeurer): We need to go to Tagged here, because |
| 2142 // otherwise we cannot distinguish the hole NaN (which might need to | 2151 // otherwise we cannot distinguish the hole NaN (which might need to |
| 2143 // be treated as undefined). We should have a dedicated Type for | 2152 // be treated as undefined). We should have a dedicated Type for |
| 2144 // that at some point, and maybe even a dedicated truncation. | 2153 // that at some point, and maybe even a dedicated truncation. |
| 2145 VisitUnop(node, UseInfo::AnyTagged(), | 2154 VisitUnop(node, UseInfo::AnyTagged(), |
| 2146 MachineRepresentation::kTagged); | 2155 MachineRepresentation::kTagged); |
| 2147 } | 2156 } |
| 2148 if (lower()) DeferReplacement(node, node->InputAt(0)); | 2157 if (lower()) DeferReplacement(node, node->InputAt(0)); |
| 2149 } else { | 2158 } else { |
| 2150 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); | 2159 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); |
| 2151 } | 2160 } |
| 2152 return; | 2161 return; |
| 2153 } | 2162 } |
| 2163 case IrOpcode::kCheckSmi: { |
| 2164 if (SmiValuesAre32Bits() && truncation.IsUsedAsWord32()) { |
| 2165 VisitUnop(node, UseInfo::CheckedSignedSmallAsWord32(), |
| 2166 MachineRepresentation::kWord32); |
| 2167 } else { |
| 2168 VisitUnop(node, UseInfo::CheckedSignedSmallAsTaggedSigned(), |
| 2169 MachineRepresentation::kTaggedSigned); |
| 2170 } |
| 2171 if (lower()) DeferReplacement(node, node->InputAt(0)); |
| 2172 return; |
| 2173 } |
| 2154 case IrOpcode::kCheckString: { | 2174 case IrOpcode::kCheckString: { |
| 2155 if (InputIs(node, Type::String())) { | 2175 if (InputIs(node, Type::String())) { |
| 2156 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); | 2176 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); |
| 2157 if (lower()) DeferReplacement(node, node->InputAt(0)); | 2177 if (lower()) DeferReplacement(node, node->InputAt(0)); |
| 2158 } else { | 2178 } else { |
| 2159 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); | 2179 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); |
| 2160 } | |
| 2161 return; | |
| 2162 } | |
| 2163 case IrOpcode::kCheckTaggedPointer: { | |
| 2164 if (InputCannotBe(node, Type::SignedSmall())) { | |
| 2165 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); | |
| 2166 if (lower()) DeferReplacement(node, node->InputAt(0)); | |
| 2167 } else { | |
| 2168 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); | |
| 2169 } | |
| 2170 return; | |
| 2171 } | |
| 2172 case IrOpcode::kCheckTaggedSigned: { | |
| 2173 if (SmiValuesAre32Bits() && truncation.IsUsedAsWord32()) { | |
| 2174 VisitUnop(node, UseInfo::CheckedSignedSmallAsWord32(), | |
| 2175 MachineRepresentation::kWord32); | |
| 2176 if (lower()) DeferReplacement(node, node->InputAt(0)); | |
| 2177 } else { | |
| 2178 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); | |
| 2179 } | 2180 } |
| 2180 return; | 2181 return; |
| 2181 } | 2182 } |
| 2182 | 2183 |
| 2183 case IrOpcode::kAllocate: { | 2184 case IrOpcode::kAllocate: { |
| 2184 ProcessInput(node, 0, UseInfo::TruncatingWord32()); | 2185 ProcessInput(node, 0, UseInfo::TruncatingWord32()); |
| 2185 ProcessRemainingInputs(node, 1); | 2186 ProcessRemainingInputs(node, 1); |
| 2186 SetOutput(node, MachineRepresentation::kTagged); | 2187 SetOutput(node, MachineRepresentation::kTagged); |
| 2187 return; | 2188 return; |
| 2188 } | 2189 } |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3260 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3261 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
| 3261 Operator::kNoProperties); | 3262 Operator::kNoProperties); |
| 3262 to_number_operator_.set(common()->Call(desc)); | 3263 to_number_operator_.set(common()->Call(desc)); |
| 3263 } | 3264 } |
| 3264 return to_number_operator_.get(); | 3265 return to_number_operator_.get(); |
| 3265 } | 3266 } |
| 3266 | 3267 |
| 3267 } // namespace compiler | 3268 } // namespace compiler |
| 3268 } // namespace internal | 3269 } // namespace internal |
| 3269 } // namespace v8 | 3270 } // namespace v8 |
| OLD | NEW |