OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/crankshaft/hydrogen-instructions.h" | 5 #include "src/crankshaft/hydrogen-instructions.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/safe_math.h" | 8 #include "src/base/safe_math.h" |
9 #include "src/crankshaft/hydrogen-infer-representation.h" | 9 #include "src/crankshaft/hydrogen-infer-representation.h" |
10 #include "src/double.h" | 10 #include "src/double.h" |
(...skipping 3220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3231 return false; | 3231 return false; |
3232 } | 3232 } |
3233 | 3233 |
3234 | 3234 |
3235 bool HIsUndetectableAndBranch::KnownSuccessorBlock(HBasicBlock** block) { | 3235 bool HIsUndetectableAndBranch::KnownSuccessorBlock(HBasicBlock** block) { |
3236 if (FLAG_fold_constants && value()->IsConstant()) { | 3236 if (FLAG_fold_constants && value()->IsConstant()) { |
3237 *block = HConstant::cast(value())->IsUndetectable() | 3237 *block = HConstant::cast(value())->IsUndetectable() |
3238 ? FirstSuccessor() : SecondSuccessor(); | 3238 ? FirstSuccessor() : SecondSuccessor(); |
3239 return true; | 3239 return true; |
3240 } | 3240 } |
| 3241 if (value()->type().IsNull() || value()->type().IsUndefined()) { |
| 3242 *block = FirstSuccessor(); |
| 3243 return true; |
| 3244 } |
| 3245 if (value()->type().IsBoolean() || |
| 3246 value()->type().IsSmi() || |
| 3247 value()->type().IsString() || |
| 3248 value()->type().IsJSReceiver()) { |
| 3249 *block = SecondSuccessor(); |
| 3250 return true; |
| 3251 } |
3241 *block = NULL; | 3252 *block = NULL; |
3242 return false; | 3253 return false; |
3243 } | 3254 } |
3244 | 3255 |
3245 | 3256 |
3246 bool HHasInstanceTypeAndBranch::KnownSuccessorBlock(HBasicBlock** block) { | 3257 bool HHasInstanceTypeAndBranch::KnownSuccessorBlock(HBasicBlock** block) { |
3247 if (FLAG_fold_constants && value()->IsConstant()) { | 3258 if (FLAG_fold_constants && value()->IsConstant()) { |
3248 InstanceType type = HConstant::cast(value())->GetInstanceType(); | 3259 InstanceType type = HConstant::cast(value())->GetInstanceType(); |
3249 *block = (from_ <= type) && (type <= to_) | 3260 *block = (from_ <= type) && (type <= to_) |
3250 ? FirstSuccessor() : SecondSuccessor(); | 3261 ? FirstSuccessor() : SecondSuccessor(); |
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4609 case HObjectAccess::kExternalMemory: | 4620 case HObjectAccess::kExternalMemory: |
4610 os << "[external-memory]"; | 4621 os << "[external-memory]"; |
4611 break; | 4622 break; |
4612 } | 4623 } |
4613 | 4624 |
4614 return os << "@" << access.offset(); | 4625 return os << "@" << access.offset(); |
4615 } | 4626 } |
4616 | 4627 |
4617 } // namespace internal | 4628 } // namespace internal |
4618 } // namespace v8 | 4629 } // namespace v8 |
OLD | NEW |