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/code-stub-assembler.h" | 10 #include "src/code-stub-assembler.h" |
(...skipping 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 | 2023 |
2024 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); | 2024 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
2025 DEFINE_PLATFORM_CODE_STUB(CompareIC, PlatformCodeStub); | 2025 DEFINE_PLATFORM_CODE_STUB(CompareIC, PlatformCodeStub); |
2026 }; | 2026 }; |
2027 | 2027 |
2028 | 2028 |
2029 class CEntryStub : public PlatformCodeStub { | 2029 class CEntryStub : public PlatformCodeStub { |
2030 public: | 2030 public: |
2031 CEntryStub(Isolate* isolate, int result_size, | 2031 CEntryStub(Isolate* isolate, int result_size, |
2032 SaveFPRegsMode save_doubles = kDontSaveFPRegs, | 2032 SaveFPRegsMode save_doubles = kDontSaveFPRegs, |
2033 ArgvMode argv_mode = kArgvOnStack) | 2033 ArgvMode argv_mode = kArgvOnStack, bool builtin_exit_frame = false) |
2034 : PlatformCodeStub(isolate) { | 2034 : PlatformCodeStub(isolate) { |
2035 minor_key_ = SaveDoublesBits::encode(save_doubles == kSaveFPRegs) | | 2035 minor_key_ = SaveDoublesBits::encode(save_doubles == kSaveFPRegs) | |
| 2036 FrameTypeBits::encode(builtin_exit_frame) | |
2036 ArgvMode::encode(argv_mode == kArgvInRegister); | 2037 ArgvMode::encode(argv_mode == kArgvInRegister); |
2037 DCHECK(result_size == 1 || result_size == 2 || result_size == 3); | 2038 DCHECK(result_size == 1 || result_size == 2 || result_size == 3); |
2038 minor_key_ = ResultSizeBits::update(minor_key_, result_size); | 2039 minor_key_ = ResultSizeBits::update(minor_key_, result_size); |
2039 } | 2040 } |
2040 | 2041 |
2041 // The version of this stub that doesn't save doubles is generated ahead of | 2042 // The version of this stub that doesn't save doubles is generated ahead of |
2042 // time, so it's OK to call it from other stubs that can't cope with GC during | 2043 // time, so it's OK to call it from other stubs that can't cope with GC during |
2043 // their code generation. On machines that always have gp registers (x64) we | 2044 // their code generation. On machines that always have gp registers (x64) we |
2044 // can generate both variants ahead of time. | 2045 // can generate both variants ahead of time. |
2045 static void GenerateAheadOfTime(Isolate* isolate); | 2046 static void GenerateAheadOfTime(Isolate* isolate); |
2046 | 2047 |
2047 private: | 2048 private: |
2048 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } | 2049 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } |
2049 bool argv_in_register() const { return ArgvMode::decode(minor_key_); } | 2050 bool argv_in_register() const { return ArgvMode::decode(minor_key_); } |
| 2051 bool is_builtin_exit() const { return FrameTypeBits::decode(minor_key_); } |
2050 int result_size() const { return ResultSizeBits::decode(minor_key_); } | 2052 int result_size() const { return ResultSizeBits::decode(minor_key_); } |
2051 | 2053 |
2052 bool NeedsImmovableCode() override; | 2054 bool NeedsImmovableCode() override; |
2053 | 2055 |
2054 class SaveDoublesBits : public BitField<bool, 0, 1> {}; | 2056 class SaveDoublesBits : public BitField<bool, 0, 1> {}; |
2055 class ArgvMode : public BitField<bool, 1, 1> {}; | 2057 class ArgvMode : public BitField<bool, 1, 1> {}; |
2056 class ResultSizeBits : public BitField<int, 2, 3> {}; | 2058 class FrameTypeBits : public BitField<bool, 2, 1> {}; |
| 2059 class ResultSizeBits : public BitField<int, 3, 3> {}; |
2057 | 2060 |
2058 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 2061 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
2059 DEFINE_PLATFORM_CODE_STUB(CEntry, PlatformCodeStub); | 2062 DEFINE_PLATFORM_CODE_STUB(CEntry, PlatformCodeStub); |
2060 }; | 2063 }; |
2061 | 2064 |
2062 | 2065 |
2063 class JSEntryStub : public PlatformCodeStub { | 2066 class JSEntryStub : public PlatformCodeStub { |
2064 public: | 2067 public: |
2065 JSEntryStub(Isolate* isolate, StackFrame::Type type) | 2068 JSEntryStub(Isolate* isolate, StackFrame::Type type) |
2066 : PlatformCodeStub(isolate) { | 2069 : PlatformCodeStub(isolate) { |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3113 #undef DEFINE_HYDROGEN_CODE_STUB | 3116 #undef DEFINE_HYDROGEN_CODE_STUB |
3114 #undef DEFINE_CODE_STUB | 3117 #undef DEFINE_CODE_STUB |
3115 #undef DEFINE_CODE_STUB_BASE | 3118 #undef DEFINE_CODE_STUB_BASE |
3116 | 3119 |
3117 extern Representation RepresentationFromType(Type* type); | 3120 extern Representation RepresentationFromType(Type* type); |
3118 | 3121 |
3119 } // namespace internal | 3122 } // namespace internal |
3120 } // namespace v8 | 3123 } // namespace v8 |
3121 | 3124 |
3122 #endif // V8_CODE_STUBS_H_ | 3125 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |