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 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1817 DEFINE_HYDROGEN_CODE_STUB(CompareNilIC, HydrogenCodeStub); | 1817 DEFINE_HYDROGEN_CODE_STUB(CompareNilIC, HydrogenCodeStub); |
1818 }; | 1818 }; |
1819 | 1819 |
1820 | 1820 |
1821 std::ostream& operator<<(std::ostream& os, const CompareNilICStub::State& s); | 1821 std::ostream& operator<<(std::ostream& os, const CompareNilICStub::State& s); |
1822 | 1822 |
1823 | 1823 |
1824 class CEntryStub : public PlatformCodeStub { | 1824 class CEntryStub : public PlatformCodeStub { |
1825 public: | 1825 public: |
1826 CEntryStub(Isolate* isolate, int result_size, | 1826 CEntryStub(Isolate* isolate, int result_size, |
1827 SaveFPRegsMode save_doubles = kDontSaveFPRegs, | 1827 SaveFPRegsMode save_doubles = kDontSaveFPRegs) |
1828 ArgvMode argv_mode = kArgvOnStack) | |
1829 : PlatformCodeStub(isolate) { | 1828 : PlatformCodeStub(isolate) { |
1830 minor_key_ = SaveDoublesBits::encode(save_doubles == kSaveFPRegs) | | 1829 minor_key_ = SaveDoublesBits::encode(save_doubles == kSaveFPRegs); |
1831 ArgvMode::encode(argv_mode == kArgvInRegister); | |
1832 DCHECK(result_size == 1 || result_size == 2); | 1830 DCHECK(result_size == 1 || result_size == 2); |
1833 #if _WIN64 || V8_TARGET_ARCH_PPC | 1831 #if _WIN64 || V8_TARGET_ARCH_PPC |
1834 minor_key_ = ResultSizeBits::update(minor_key_, result_size); | 1832 minor_key_ = ResultSizeBits::update(minor_key_, result_size); |
1835 #endif // _WIN64 | 1833 #endif // _WIN64 |
1836 } | 1834 } |
1837 | 1835 |
1838 // The version of this stub that doesn't save doubles is generated ahead of | 1836 // The version of this stub that doesn't save doubles is generated ahead of |
1839 // time, so it's OK to call it from other stubs that can't cope with GC during | 1837 // time, so it's OK to call it from other stubs that can't cope with GC during |
1840 // their code generation. On machines that always have gp registers (x64) we | 1838 // their code generation. On machines that always have gp registers (x64) we |
1841 // can generate both variants ahead of time. | 1839 // can generate both variants ahead of time. |
1842 static void GenerateAheadOfTime(Isolate* isolate); | 1840 static void GenerateAheadOfTime(Isolate* isolate); |
1843 | 1841 |
1844 private: | 1842 private: |
1845 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } | 1843 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } |
1846 bool argv_in_register() const { return ArgvMode::decode(minor_key_); } | |
1847 #if _WIN64 || V8_TARGET_ARCH_PPC | 1844 #if _WIN64 || V8_TARGET_ARCH_PPC |
1848 int result_size() const { return ResultSizeBits::decode(minor_key_); } | 1845 int result_size() const { return ResultSizeBits::decode(minor_key_); } |
1849 #endif // _WIN64 | 1846 #endif // _WIN64 |
1850 | 1847 |
1851 bool NeedsImmovableCode() override; | 1848 bool NeedsImmovableCode() override; |
1852 | 1849 |
1853 class SaveDoublesBits : public BitField<bool, 0, 1> {}; | 1850 class SaveDoublesBits : public BitField<bool, 0, 1> {}; |
1854 class ArgvMode : public BitField<bool, 1, 1> {}; | 1851 class ResultSizeBits : public BitField<int, 1, 3> {}; |
1855 class ResultSizeBits : public BitField<int, 2, 3> {}; | |
1856 | 1852 |
1857 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 1853 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
1858 DEFINE_PLATFORM_CODE_STUB(CEntry, PlatformCodeStub); | 1854 DEFINE_PLATFORM_CODE_STUB(CEntry, PlatformCodeStub); |
1859 }; | 1855 }; |
1860 | 1856 |
1861 | 1857 |
1862 class JSEntryStub : public PlatformCodeStub { | 1858 class JSEntryStub : public PlatformCodeStub { |
1863 public: | 1859 public: |
1864 JSEntryStub(Isolate* isolate, StackFrame::Type type) | 1860 JSEntryStub(Isolate* isolate, StackFrame::Type type) |
1865 : PlatformCodeStub(isolate) { | 1861 : PlatformCodeStub(isolate) { |
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3096 #undef DEFINE_HYDROGEN_CODE_STUB | 3092 #undef DEFINE_HYDROGEN_CODE_STUB |
3097 #undef DEFINE_CODE_STUB | 3093 #undef DEFINE_CODE_STUB |
3098 #undef DEFINE_CODE_STUB_BASE | 3094 #undef DEFINE_CODE_STUB_BASE |
3099 | 3095 |
3100 extern Representation RepresentationFromType(Type* type); | 3096 extern Representation RepresentationFromType(Type* type); |
3101 | 3097 |
3102 } // namespace internal | 3098 } // namespace internal |
3103 } // namespace v8 | 3099 } // namespace v8 |
3104 | 3100 |
3105 #endif // V8_CODE_STUBS_H_ | 3101 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |