| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 virtual void InitializeInterfaceDescriptor( | 490 virtual void InitializeInterfaceDescriptor( |
| 491 Isolate* isolate, | 491 Isolate* isolate, |
| 492 CodeStubInterfaceDescriptor* descriptor); | 492 CodeStubInterfaceDescriptor* descriptor); |
| 493 | 493 |
| 494 private: | 494 private: |
| 495 Major MajorKey() { return ToNumber; } | 495 Major MajorKey() { return ToNumber; } |
| 496 int NotMissMinorKey() { return 0; } | 496 int NotMissMinorKey() { return 0; } |
| 497 }; | 497 }; |
| 498 | 498 |
| 499 | 499 |
| 500 class FastNewClosureStub : public PlatformCodeStub { | 500 class FastNewClosureStub : public HydrogenCodeStub { |
| 501 public: | 501 public: |
| 502 explicit FastNewClosureStub(LanguageMode language_mode, bool is_generator) | 502 explicit FastNewClosureStub(LanguageMode language_mode, bool is_generator) |
| 503 : language_mode_(language_mode), | 503 : language_mode_(language_mode), |
| 504 is_generator_(is_generator) { } | 504 is_generator_(is_generator) { } |
| 505 | 505 |
| 506 void Generate(MacroAssembler* masm); | 506 virtual Handle<Code> GenerateCode(); |
| 507 |
| 508 virtual void InitializeInterfaceDescriptor( |
| 509 Isolate* isolate, |
| 510 CodeStubInterfaceDescriptor* descriptor); |
| 511 |
| 512 static void InstallDescriptors(Isolate* isolate); |
| 513 |
| 514 LanguageMode language_mode() const { return language_mode_; } |
| 515 bool is_generator() const { return is_generator_; } |
| 507 | 516 |
| 508 private: | 517 private: |
| 509 class StrictModeBits: public BitField<bool, 0, 1> {}; | 518 class StrictModeBits: public BitField<bool, 0, 1> {}; |
| 510 class IsGeneratorBits: public BitField<bool, 1, 1> {}; | 519 class IsGeneratorBits: public BitField<bool, 1, 1> {}; |
| 511 | 520 |
| 512 Major MajorKey() { return FastNewClosure; } | 521 Major MajorKey() { return FastNewClosure; } |
| 513 int MinorKey() { | 522 int NotMissMinorKey() { |
| 514 return StrictModeBits::encode(language_mode_ != CLASSIC_MODE) | | 523 return StrictModeBits::encode(language_mode_ != CLASSIC_MODE) | |
| 515 IsGeneratorBits::encode(is_generator_); | 524 IsGeneratorBits::encode(is_generator_); |
| 516 } | 525 } |
| 517 | 526 |
| 518 LanguageMode language_mode_; | 527 LanguageMode language_mode_; |
| 519 bool is_generator_; | 528 bool is_generator_; |
| 520 }; | 529 }; |
| 521 | 530 |
| 522 | 531 |
| 523 class FastNewContextStub : public PlatformCodeStub { | 532 class FastNewContextStub : public PlatformCodeStub { |
| (...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1705 | 1714 |
| 1706 DISALLOW_COPY_AND_ASSIGN(KeyedLoadDictionaryElementStub); | 1715 DISALLOW_COPY_AND_ASSIGN(KeyedLoadDictionaryElementStub); |
| 1707 }; | 1716 }; |
| 1708 | 1717 |
| 1709 | 1718 |
| 1710 class DoubleToIStub : public PlatformCodeStub { | 1719 class DoubleToIStub : public PlatformCodeStub { |
| 1711 public: | 1720 public: |
| 1712 DoubleToIStub(Register source, | 1721 DoubleToIStub(Register source, |
| 1713 Register destination, | 1722 Register destination, |
| 1714 int offset, | 1723 int offset, |
| 1715 bool is_truncating) : bit_field_(0) { | 1724 bool is_truncating, |
| 1725 bool skip_fastpath = false) : bit_field_(0) { |
| 1716 #if V8_TARGET_ARCH_A64 | 1726 #if V8_TARGET_ARCH_A64 |
| 1717 // TODO(jbramley): Make A64's Register type compatible with the normal code, | 1727 // TODO(jbramley): Make A64's Register type compatible with the normal code, |
| 1718 // so we don't need this special case. | 1728 // so we don't need this special case. |
| 1719 bit_field_ = SourceRegisterBits::encode(source.code()) | | 1729 bit_field_ = SourceRegisterBits::encode(source.code()) | |
| 1720 DestinationRegisterBits::encode(destination.code()) | | 1730 DestinationRegisterBits::encode(destination.code()) | |
| 1721 OffsetBits::encode(offset) | | 1731 OffsetBits::encode(offset) | |
| 1722 IsTruncatingBits::encode(is_truncating); | 1732 IsTruncatingBits::encode(is_truncating) | |
| 1733 SkipFastPathBits::encode(skip_fastpath); |
| 1723 #else | 1734 #else |
| 1724 bit_field_ = SourceRegisterBits::encode(source.code_) | | 1735 bit_field_ = SourceRegisterBits::encode(source.code_) | |
| 1725 DestinationRegisterBits::encode(destination.code_) | | 1736 DestinationRegisterBits::encode(destination.code_) | |
| 1726 OffsetBits::encode(offset) | | 1737 OffsetBits::encode(offset) | |
| 1727 IsTruncatingBits::encode(is_truncating); | 1738 IsTruncatingBits::encode(is_truncating) | |
| 1739 SkipFastPathBits::encode(skip_fastpath); |
| 1728 #endif | 1740 #endif |
| 1729 } | 1741 } |
| 1730 | 1742 |
| 1731 Register source() { | 1743 Register source() { |
| 1732 #if V8_TARGET_ARCH_A64 | 1744 #if V8_TARGET_ARCH_A64 |
| 1733 // TODO(jbramley): Make A64's Register type compatible with the normal code, | 1745 // TODO(jbramley): Make A64's Register type compatible with the normal code, |
| 1734 // so we don't need this special case. | 1746 // so we don't need this special case. |
| 1735 return Register::XRegFromCode(SourceRegisterBits::decode(bit_field_)); | 1747 return Register::XRegFromCode(SourceRegisterBits::decode(bit_field_)); |
| 1736 #else | 1748 #else |
| 1737 Register result = { SourceRegisterBits::decode(bit_field_) }; | 1749 Register result = { SourceRegisterBits::decode(bit_field_) }; |
| 1738 return result; | 1750 return result; |
| 1739 #endif | 1751 #endif |
| 1740 } | 1752 } |
| 1741 | 1753 |
| 1742 Register destination() { | 1754 Register destination() { |
| 1743 #if V8_TARGET_ARCH_A64 | 1755 #if V8_TARGET_ARCH_A64 |
| 1744 // TODO(jbramley): Make A64's Register type compatible with the normal code, | 1756 // TODO(jbramley): Make A64's Register type compatible with the normal code, |
| 1745 // so we don't need this special case. | 1757 // so we don't need this special case. |
| 1746 return Register::XRegFromCode(DestinationRegisterBits::decode(bit_field_)); | 1758 return Register::XRegFromCode(DestinationRegisterBits::decode(bit_field_)); |
| 1747 #else | 1759 #else |
| 1748 Register result = { DestinationRegisterBits::decode(bit_field_) }; | 1760 Register result = { DestinationRegisterBits::decode(bit_field_) }; |
| 1749 return result; | 1761 return result; |
| 1750 #endif | 1762 #endif |
| 1751 } | 1763 } |
| 1752 | 1764 |
| 1753 bool is_truncating() { | 1765 bool is_truncating() { |
| 1754 return IsTruncatingBits::decode(bit_field_); | 1766 return IsTruncatingBits::decode(bit_field_); |
| 1755 } | 1767 } |
| 1756 | 1768 |
| 1769 bool skip_fastpath() { |
| 1770 return SkipFastPathBits::decode(bit_field_); |
| 1771 } |
| 1772 |
| 1757 int offset() { | 1773 int offset() { |
| 1758 return OffsetBits::decode(bit_field_); | 1774 return OffsetBits::decode(bit_field_); |
| 1759 } | 1775 } |
| 1760 | 1776 |
| 1761 void Generate(MacroAssembler* masm); | 1777 void Generate(MacroAssembler* masm); |
| 1762 | 1778 |
| 1779 virtual bool SometimesSetsUpAFrame() { return false; } |
| 1780 |
| 1763 private: | 1781 private: |
| 1764 static const int kBitsPerRegisterNumber = 6; | 1782 static const int kBitsPerRegisterNumber = 6; |
| 1765 STATIC_ASSERT((1L << kBitsPerRegisterNumber) >= Register::kNumRegisters); | 1783 STATIC_ASSERT((1L << kBitsPerRegisterNumber) >= Register::kNumRegisters); |
| 1766 class SourceRegisterBits: | 1784 class SourceRegisterBits: |
| 1767 public BitField<int, 0, kBitsPerRegisterNumber> {}; // NOLINT | 1785 public BitField<int, 0, kBitsPerRegisterNumber> {}; // NOLINT |
| 1768 class DestinationRegisterBits: | 1786 class DestinationRegisterBits: |
| 1769 public BitField<int, kBitsPerRegisterNumber, | 1787 public BitField<int, kBitsPerRegisterNumber, |
| 1770 kBitsPerRegisterNumber> {}; // NOLINT | 1788 kBitsPerRegisterNumber> {}; // NOLINT |
| 1771 class IsTruncatingBits: | 1789 class IsTruncatingBits: |
| 1772 public BitField<bool, 2 * kBitsPerRegisterNumber, 1> {}; // NOLINT | 1790 public BitField<bool, 2 * kBitsPerRegisterNumber, 1> {}; // NOLINT |
| 1773 class OffsetBits: | 1791 class OffsetBits: |
| 1774 public BitField<int, 2 * kBitsPerRegisterNumber + 1, 3> {}; // NOLINT | 1792 public BitField<int, 2 * kBitsPerRegisterNumber + 1, 3> {}; // NOLINT |
| 1793 class SkipFastPathBits: |
| 1794 public BitField<int, 2 * kBitsPerRegisterNumber + 4, 1> {}; // NOLINT |
| 1775 | 1795 |
| 1776 Major MajorKey() { return DoubleToI; } | 1796 Major MajorKey() { return DoubleToI; } |
| 1777 int MinorKey() { return bit_field_; } | 1797 int MinorKey() { return bit_field_; } |
| 1778 | 1798 |
| 1779 int bit_field_; | 1799 int bit_field_; |
| 1780 | 1800 |
| 1781 DISALLOW_COPY_AND_ASSIGN(DoubleToIStub); | 1801 DISALLOW_COPY_AND_ASSIGN(DoubleToIStub); |
| 1782 }; | 1802 }; |
| 1783 | 1803 |
| 1784 | 1804 |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2336 int MinorKey() { return 0; } | 2356 int MinorKey() { return 0; } |
| 2337 | 2357 |
| 2338 void Generate(MacroAssembler* masm); | 2358 void Generate(MacroAssembler* masm); |
| 2339 | 2359 |
| 2340 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 2360 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
| 2341 }; | 2361 }; |
| 2342 | 2362 |
| 2343 } } // namespace v8::internal | 2363 } } // namespace v8::internal |
| 2344 | 2364 |
| 2345 #endif // V8_CODE_STUBS_H_ | 2365 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |