| 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 #ifndef V8_CODE_STUBS_H_ | 5 #ifndef V8_CODE_STUBS_H_ |
| 6 #define V8_CODE_STUBS_H_ | 6 #define V8_CODE_STUBS_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1778 | 1778 |
| 1779 class ArgumentsAccessStub: public PlatformCodeStub { | 1779 class ArgumentsAccessStub: public PlatformCodeStub { |
| 1780 public: | 1780 public: |
| 1781 enum Type { | 1781 enum Type { |
| 1782 READ_ELEMENT, | 1782 READ_ELEMENT, |
| 1783 NEW_SLOPPY_FAST, | 1783 NEW_SLOPPY_FAST, |
| 1784 NEW_SLOPPY_SLOW, | 1784 NEW_SLOPPY_SLOW, |
| 1785 NEW_STRICT | 1785 NEW_STRICT |
| 1786 }; | 1786 }; |
| 1787 | 1787 |
| 1788 enum HasNewTarget { NO_NEW_TARGET, HAS_NEW_TARGET }; | 1788 ArgumentsAccessStub(Isolate* isolate, Type type) : PlatformCodeStub(isolate) { |
| 1789 | 1789 minor_key_ = TypeBits::encode(type); |
| 1790 ArgumentsAccessStub(Isolate* isolate, Type type, | |
| 1791 HasNewTarget has_new_target = NO_NEW_TARGET) | |
| 1792 : PlatformCodeStub(isolate) { | |
| 1793 minor_key_ = | |
| 1794 TypeBits::encode(type) | HasNewTargetBits::encode(has_new_target); | |
| 1795 } | 1790 } |
| 1796 | 1791 |
| 1797 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { | 1792 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { |
| 1798 if (type() == READ_ELEMENT) { | 1793 if (type() == READ_ELEMENT) { |
| 1799 return ArgumentsAccessReadDescriptor(isolate()); | 1794 return ArgumentsAccessReadDescriptor(isolate()); |
| 1800 } | 1795 } |
| 1801 return ContextOnlyDescriptor(isolate()); | 1796 return ContextOnlyDescriptor(isolate()); |
| 1802 } | 1797 } |
| 1803 | 1798 |
| 1804 private: | 1799 private: |
| 1805 Type type() const { return TypeBits::decode(minor_key_); } | 1800 Type type() const { return TypeBits::decode(minor_key_); } |
| 1806 bool has_new_target() const { | |
| 1807 return HasNewTargetBits::decode(minor_key_) == HAS_NEW_TARGET; | |
| 1808 } | |
| 1809 | 1801 |
| 1810 void GenerateReadElement(MacroAssembler* masm); | 1802 void GenerateReadElement(MacroAssembler* masm); |
| 1811 void GenerateNewStrict(MacroAssembler* masm); | 1803 void GenerateNewStrict(MacroAssembler* masm); |
| 1812 void GenerateNewSloppyFast(MacroAssembler* masm); | 1804 void GenerateNewSloppyFast(MacroAssembler* masm); |
| 1813 void GenerateNewSloppySlow(MacroAssembler* masm); | 1805 void GenerateNewSloppySlow(MacroAssembler* masm); |
| 1814 | 1806 |
| 1815 void PrintName(std::ostream& os) const override; // NOLINT | 1807 void PrintName(std::ostream& os) const override; // NOLINT |
| 1816 | 1808 |
| 1817 class TypeBits : public BitField<Type, 0, 2> {}; | 1809 class TypeBits : public BitField<Type, 0, 2> {}; |
| 1818 class HasNewTargetBits : public BitField<HasNewTarget, 2, 1> {}; | |
| 1819 | 1810 |
| 1820 DEFINE_PLATFORM_CODE_STUB(ArgumentsAccess, PlatformCodeStub); | 1811 DEFINE_PLATFORM_CODE_STUB(ArgumentsAccess, PlatformCodeStub); |
| 1821 }; | 1812 }; |
| 1822 | 1813 |
| 1823 | 1814 |
| 1824 class RestParamAccessStub: public PlatformCodeStub { | 1815 class RestParamAccessStub: public PlatformCodeStub { |
| 1825 public: | 1816 public: |
| 1826 explicit RestParamAccessStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 1817 explicit RestParamAccessStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
| 1827 | 1818 |
| 1828 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { | 1819 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { |
| (...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2969 | 2960 |
| 2970 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2961 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
| 2971 #undef DEFINE_PLATFORM_CODE_STUB | 2962 #undef DEFINE_PLATFORM_CODE_STUB |
| 2972 #undef DEFINE_HANDLER_CODE_STUB | 2963 #undef DEFINE_HANDLER_CODE_STUB |
| 2973 #undef DEFINE_HYDROGEN_CODE_STUB | 2964 #undef DEFINE_HYDROGEN_CODE_STUB |
| 2974 #undef DEFINE_CODE_STUB | 2965 #undef DEFINE_CODE_STUB |
| 2975 #undef DEFINE_CODE_STUB_BASE | 2966 #undef DEFINE_CODE_STUB_BASE |
| 2976 } } // namespace v8::internal | 2967 } } // namespace v8::internal |
| 2977 | 2968 |
| 2978 #endif // V8_CODE_STUBS_H_ | 2969 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |