| 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 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1613 } | 1613 } |
| 1614 | 1614 |
| 1615 return Prepend(HMathFloorOfDiv::New( | 1615 return Prepend(HMathFloorOfDiv::New( |
| 1616 block()->graph()->isolate(), block()->zone(), context(), left, right)); | 1616 block()->graph()->isolate(), block()->zone(), context(), left, right)); |
| 1617 } | 1617 } |
| 1618 return this; | 1618 return this; |
| 1619 } | 1619 } |
| 1620 | 1620 |
| 1621 | 1621 |
| 1622 HValue* HCheckInstanceType::Canonicalize() { | 1622 HValue* HCheckInstanceType::Canonicalize() { |
| 1623 if ((check_ == IS_SPEC_OBJECT && value()->type().IsJSObject()) || | 1623 if ((check_ == IS_JS_RECEIVER && value()->type().IsJSObject()) || |
| 1624 (check_ == IS_JS_ARRAY && value()->type().IsJSArray()) || | 1624 (check_ == IS_JS_ARRAY && value()->type().IsJSArray()) || |
| 1625 (check_ == IS_STRING && value()->type().IsString())) { | 1625 (check_ == IS_STRING && value()->type().IsString())) { |
| 1626 return value(); | 1626 return value(); |
| 1627 } | 1627 } |
| 1628 | 1628 |
| 1629 if (check_ == IS_INTERNALIZED_STRING && value()->IsConstant()) { | 1629 if (check_ == IS_INTERNALIZED_STRING && value()->IsConstant()) { |
| 1630 if (HConstant::cast(value())->HasInternalizedStringValue()) { | 1630 if (HConstant::cast(value())->HasInternalizedStringValue()) { |
| 1631 return value(); | 1631 return value(); |
| 1632 } | 1632 } |
| 1633 } | 1633 } |
| 1634 return this; | 1634 return this; |
| 1635 } | 1635 } |
| 1636 | 1636 |
| 1637 | 1637 |
| 1638 void HCheckInstanceType::GetCheckInterval(InstanceType* first, | 1638 void HCheckInstanceType::GetCheckInterval(InstanceType* first, |
| 1639 InstanceType* last) { | 1639 InstanceType* last) { |
| 1640 DCHECK(is_interval_check()); | 1640 DCHECK(is_interval_check()); |
| 1641 switch (check_) { | 1641 switch (check_) { |
| 1642 case IS_SPEC_OBJECT: | 1642 case IS_JS_RECEIVER: |
| 1643 *first = FIRST_JS_RECEIVER_TYPE; | 1643 *first = FIRST_JS_RECEIVER_TYPE; |
| 1644 *last = LAST_JS_RECEIVER_TYPE; | 1644 *last = LAST_JS_RECEIVER_TYPE; |
| 1645 return; | 1645 return; |
| 1646 case IS_JS_ARRAY: | 1646 case IS_JS_ARRAY: |
| 1647 *first = *last = JS_ARRAY_TYPE; | 1647 *first = *last = JS_ARRAY_TYPE; |
| 1648 return; | 1648 return; |
| 1649 case IS_JS_DATE: | 1649 case IS_JS_DATE: |
| 1650 *first = *last = JS_DATE_TYPE; | 1650 *first = *last = JS_DATE_TYPE; |
| 1651 return; | 1651 return; |
| 1652 default: | 1652 default: |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1709 | 1709 |
| 1710 | 1710 |
| 1711 HValue* HCheckValue::Canonicalize() { | 1711 HValue* HCheckValue::Canonicalize() { |
| 1712 return (value()->IsConstant() && | 1712 return (value()->IsConstant() && |
| 1713 HConstant::cast(value())->EqualsUnique(object_)) ? NULL : this; | 1713 HConstant::cast(value())->EqualsUnique(object_)) ? NULL : this; |
| 1714 } | 1714 } |
| 1715 | 1715 |
| 1716 | 1716 |
| 1717 const char* HCheckInstanceType::GetCheckName() const { | 1717 const char* HCheckInstanceType::GetCheckName() const { |
| 1718 switch (check_) { | 1718 switch (check_) { |
| 1719 case IS_SPEC_OBJECT: return "object"; | 1719 case IS_JS_RECEIVER: return "object"; |
| 1720 case IS_JS_ARRAY: return "array"; | 1720 case IS_JS_ARRAY: return "array"; |
| 1721 case IS_JS_DATE: | 1721 case IS_JS_DATE: |
| 1722 return "date"; | 1722 return "date"; |
| 1723 case IS_STRING: return "string"; | 1723 case IS_STRING: return "string"; |
| 1724 case IS_INTERNALIZED_STRING: return "internalized_string"; | 1724 case IS_INTERNALIZED_STRING: return "internalized_string"; |
| 1725 } | 1725 } |
| 1726 UNREACHABLE(); | 1726 UNREACHABLE(); |
| 1727 return ""; | 1727 return ""; |
| 1728 } | 1728 } |
| 1729 | 1729 |
| (...skipping 2965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4695 case HObjectAccess::kExternalMemory: | 4695 case HObjectAccess::kExternalMemory: |
| 4696 os << "[external-memory]"; | 4696 os << "[external-memory]"; |
| 4697 break; | 4697 break; |
| 4698 } | 4698 } |
| 4699 | 4699 |
| 4700 return os << "@" << access.offset(); | 4700 return os << "@" << access.offset(); |
| 4701 } | 4701 } |
| 4702 | 4702 |
| 4703 } // namespace internal | 4703 } // namespace internal |
| 4704 } // namespace v8 | 4704 } // namespace v8 |
| OLD | NEW |