Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: src/code-stubs.h

Issue 2090723005: [builtins] New frame type for exits to C++ builtins (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing condition in SafeStackFrameIter::frame() Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/builtins.cc ('k') | src/counters.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2010 matching lines...) Expand 10 before | Expand all | Expand 10 after
2021 2021
2022 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); 2022 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp);
2023 DEFINE_PLATFORM_CODE_STUB(CompareIC, PlatformCodeStub); 2023 DEFINE_PLATFORM_CODE_STUB(CompareIC, PlatformCodeStub);
2024 }; 2024 };
2025 2025
2026 2026
2027 class CEntryStub : public PlatformCodeStub { 2027 class CEntryStub : public PlatformCodeStub {
2028 public: 2028 public:
2029 CEntryStub(Isolate* isolate, int result_size, 2029 CEntryStub(Isolate* isolate, int result_size,
2030 SaveFPRegsMode save_doubles = kDontSaveFPRegs, 2030 SaveFPRegsMode save_doubles = kDontSaveFPRegs,
2031 ArgvMode argv_mode = kArgvOnStack) 2031 ArgvMode argv_mode = kArgvOnStack, bool builtin_exit_frame = false)
2032 : PlatformCodeStub(isolate) { 2032 : PlatformCodeStub(isolate) {
2033 minor_key_ = SaveDoublesBits::encode(save_doubles == kSaveFPRegs) | 2033 minor_key_ = SaveDoublesBits::encode(save_doubles == kSaveFPRegs) |
2034 FrameTypeBits::encode(builtin_exit_frame) |
2034 ArgvMode::encode(argv_mode == kArgvInRegister); 2035 ArgvMode::encode(argv_mode == kArgvInRegister);
2035 DCHECK(result_size == 1 || result_size == 2 || result_size == 3); 2036 DCHECK(result_size == 1 || result_size == 2 || result_size == 3);
2036 minor_key_ = ResultSizeBits::update(minor_key_, result_size); 2037 minor_key_ = ResultSizeBits::update(minor_key_, result_size);
2037 } 2038 }
2038 2039
2039 // The version of this stub that doesn't save doubles is generated ahead of 2040 // The version of this stub that doesn't save doubles is generated ahead of
2040 // time, so it's OK to call it from other stubs that can't cope with GC during 2041 // time, so it's OK to call it from other stubs that can't cope with GC during
2041 // their code generation. On machines that always have gp registers (x64) we 2042 // their code generation. On machines that always have gp registers (x64) we
2042 // can generate both variants ahead of time. 2043 // can generate both variants ahead of time.
2043 static void GenerateAheadOfTime(Isolate* isolate); 2044 static void GenerateAheadOfTime(Isolate* isolate);
2044 2045
2045 private: 2046 private:
2046 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } 2047 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); }
2047 bool argv_in_register() const { return ArgvMode::decode(minor_key_); } 2048 bool argv_in_register() const { return ArgvMode::decode(minor_key_); }
2049 bool is_builtin_exit() const { return FrameTypeBits::decode(minor_key_); }
2048 int result_size() const { return ResultSizeBits::decode(minor_key_); } 2050 int result_size() const { return ResultSizeBits::decode(minor_key_); }
2049 2051
2050 bool NeedsImmovableCode() override; 2052 bool NeedsImmovableCode() override;
2051 2053
2052 class SaveDoublesBits : public BitField<bool, 0, 1> {}; 2054 class SaveDoublesBits : public BitField<bool, 0, 1> {};
2053 class ArgvMode : public BitField<bool, 1, 1> {}; 2055 class ArgvMode : public BitField<bool, 1, 1> {};
2054 class ResultSizeBits : public BitField<int, 2, 3> {}; 2056 class FrameTypeBits : public BitField<bool, 2, 1> {};
2057 class ResultSizeBits : public BitField<int, 3, 3> {};
2055 2058
2056 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); 2059 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR();
2057 DEFINE_PLATFORM_CODE_STUB(CEntry, PlatformCodeStub); 2060 DEFINE_PLATFORM_CODE_STUB(CEntry, PlatformCodeStub);
2058 }; 2061 };
2059 2062
2060 2063
2061 class JSEntryStub : public PlatformCodeStub { 2064 class JSEntryStub : public PlatformCodeStub {
2062 public: 2065 public:
2063 JSEntryStub(Isolate* isolate, StackFrame::Type type) 2066 JSEntryStub(Isolate* isolate, StackFrame::Type type)
2064 : PlatformCodeStub(isolate) { 2067 : PlatformCodeStub(isolate) {
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
3111 #undef DEFINE_HYDROGEN_CODE_STUB 3114 #undef DEFINE_HYDROGEN_CODE_STUB
3112 #undef DEFINE_CODE_STUB 3115 #undef DEFINE_CODE_STUB
3113 #undef DEFINE_CODE_STUB_BASE 3116 #undef DEFINE_CODE_STUB_BASE
3114 3117
3115 extern Representation RepresentationFromType(Type* type); 3118 extern Representation RepresentationFromType(Type* type);
3116 3119
3117 } // namespace internal 3120 } // namespace internal
3118 } // namespace v8 3121 } // namespace v8
3119 3122
3120 #endif // V8_CODE_STUBS_H_ 3123 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698