| 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 3254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3265 return false; | 3265 return false; |
| 3266 } | 3266 } |
| 3267 | 3267 |
| 3268 | 3268 |
| 3269 bool HIsUndetectableAndBranch::KnownSuccessorBlock(HBasicBlock** block) { | 3269 bool HIsUndetectableAndBranch::KnownSuccessorBlock(HBasicBlock** block) { |
| 3270 if (FLAG_fold_constants && value()->IsConstant()) { | 3270 if (FLAG_fold_constants && value()->IsConstant()) { |
| 3271 *block = HConstant::cast(value())->IsUndetectable() | 3271 *block = HConstant::cast(value())->IsUndetectable() |
| 3272 ? FirstSuccessor() : SecondSuccessor(); | 3272 ? FirstSuccessor() : SecondSuccessor(); |
| 3273 return true; | 3273 return true; |
| 3274 } | 3274 } |
| 3275 if (value()->type().IsNull() || value()->type().IsUndefined()) { | |
| 3276 *block = FirstSuccessor(); | |
| 3277 return true; | |
| 3278 } | |
| 3279 if (value()->type().IsBoolean() || | |
| 3280 value()->type().IsSmi() || | |
| 3281 value()->type().IsString() || | |
| 3282 value()->type().IsJSReceiver()) { | |
| 3283 *block = SecondSuccessor(); | |
| 3284 return true; | |
| 3285 } | |
| 3286 *block = NULL; | 3275 *block = NULL; |
| 3287 return false; | 3276 return false; |
| 3288 } | 3277 } |
| 3289 | 3278 |
| 3290 | 3279 |
| 3291 bool HHasInstanceTypeAndBranch::KnownSuccessorBlock(HBasicBlock** block) { | 3280 bool HHasInstanceTypeAndBranch::KnownSuccessorBlock(HBasicBlock** block) { |
| 3292 if (FLAG_fold_constants && value()->IsConstant()) { | 3281 if (FLAG_fold_constants && value()->IsConstant()) { |
| 3293 InstanceType type = HConstant::cast(value())->GetInstanceType(); | 3282 InstanceType type = HConstant::cast(value())->GetInstanceType(); |
| 3294 *block = (from_ <= type) && (type <= to_) | 3283 *block = (from_ <= type) && (type <= to_) |
| 3295 ? FirstSuccessor() : SecondSuccessor(); | 3284 ? FirstSuccessor() : SecondSuccessor(); |
| (...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4654 case HObjectAccess::kExternalMemory: | 4643 case HObjectAccess::kExternalMemory: |
| 4655 os << "[external-memory]"; | 4644 os << "[external-memory]"; |
| 4656 break; | 4645 break; |
| 4657 } | 4646 } |
| 4658 | 4647 |
| 4659 return os << "@" << access.offset(); | 4648 return os << "@" << access.offset(); |
| 4660 } | 4649 } |
| 4661 | 4650 |
| 4662 } // namespace internal | 4651 } // namespace internal |
| 4663 } // namespace v8 | 4652 } // namespace v8 |
| OLD | NEW |