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