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 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1739 | 1739 |
1740 | 1740 |
1741 class CEntryStub : public PlatformCodeStub { | 1741 class CEntryStub : public PlatformCodeStub { |
1742 public: | 1742 public: |
1743 CEntryStub(Isolate* isolate, int result_size, | 1743 CEntryStub(Isolate* isolate, int result_size, |
1744 SaveFPRegsMode save_doubles = kDontSaveFPRegs, | 1744 SaveFPRegsMode save_doubles = kDontSaveFPRegs, |
1745 ArgvMode argv_mode = kArgvOnStack) | 1745 ArgvMode argv_mode = kArgvOnStack) |
1746 : PlatformCodeStub(isolate) { | 1746 : PlatformCodeStub(isolate) { |
1747 minor_key_ = SaveDoublesBits::encode(save_doubles == kSaveFPRegs) | | 1747 minor_key_ = SaveDoublesBits::encode(save_doubles == kSaveFPRegs) | |
1748 ArgvMode::encode(argv_mode == kArgvInRegister); | 1748 ArgvMode::encode(argv_mode == kArgvInRegister); |
1749 DCHECK(result_size == 1 || result_size == 2); | 1749 DCHECK(result_size == 1 || result_size == 2 || result_size == 3); |
1750 #if _WIN64 || V8_TARGET_ARCH_PPC | |
1751 minor_key_ = ResultSizeBits::update(minor_key_, result_size); | 1750 minor_key_ = ResultSizeBits::update(minor_key_, result_size); |
1752 #endif // _WIN64 | |
1753 } | 1751 } |
1754 | 1752 |
1755 // The version of this stub that doesn't save doubles is generated ahead of | 1753 // The version of this stub that doesn't save doubles is generated ahead of |
1756 // time, so it's OK to call it from other stubs that can't cope with GC during | 1754 // time, so it's OK to call it from other stubs that can't cope with GC during |
1757 // their code generation. On machines that always have gp registers (x64) we | 1755 // their code generation. On machines that always have gp registers (x64) we |
1758 // can generate both variants ahead of time. | 1756 // can generate both variants ahead of time. |
1759 static void GenerateAheadOfTime(Isolate* isolate); | 1757 static void GenerateAheadOfTime(Isolate* isolate); |
1760 | 1758 |
1761 private: | 1759 private: |
1762 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } | 1760 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } |
1763 bool argv_in_register() const { return ArgvMode::decode(minor_key_); } | 1761 bool argv_in_register() const { return ArgvMode::decode(minor_key_); } |
1764 #if _WIN64 || V8_TARGET_ARCH_PPC | |
1765 int result_size() const { return ResultSizeBits::decode(minor_key_); } | 1762 int result_size() const { return ResultSizeBits::decode(minor_key_); } |
1766 #endif // _WIN64 | |
1767 | 1763 |
1768 bool NeedsImmovableCode() override; | 1764 bool NeedsImmovableCode() override; |
1769 | 1765 |
1770 class SaveDoublesBits : public BitField<bool, 0, 1> {}; | 1766 class SaveDoublesBits : public BitField<bool, 0, 1> {}; |
1771 class ArgvMode : public BitField<bool, 1, 1> {}; | 1767 class ArgvMode : public BitField<bool, 1, 1> {}; |
1772 class ResultSizeBits : public BitField<int, 2, 3> {}; | 1768 class ResultSizeBits : public BitField<int, 2, 3> {}; |
1773 | 1769 |
1774 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 1770 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
1775 DEFINE_PLATFORM_CODE_STUB(CEntry, PlatformCodeStub); | 1771 DEFINE_PLATFORM_CODE_STUB(CEntry, PlatformCodeStub); |
1776 }; | 1772 }; |
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2974 #undef DEFINE_HYDROGEN_CODE_STUB | 2970 #undef DEFINE_HYDROGEN_CODE_STUB |
2975 #undef DEFINE_CODE_STUB | 2971 #undef DEFINE_CODE_STUB |
2976 #undef DEFINE_CODE_STUB_BASE | 2972 #undef DEFINE_CODE_STUB_BASE |
2977 | 2973 |
2978 extern Representation RepresentationFromType(Type* type); | 2974 extern Representation RepresentationFromType(Type* type); |
2979 | 2975 |
2980 } // namespace internal | 2976 } // namespace internal |
2981 } // namespace v8 | 2977 } // namespace v8 |
2982 | 2978 |
2983 #endif // V8_CODE_STUBS_H_ | 2979 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |