diff options
Diffstat (limited to '3rdparty/asmjit/src/asmjit/core/rastack_p.h')
-rw-r--r-- | 3rdparty/asmjit/src/asmjit/core/rastack_p.h | 79 |
1 files changed, 29 insertions, 50 deletions
diff --git a/3rdparty/asmjit/src/asmjit/core/rastack_p.h b/3rdparty/asmjit/src/asmjit/core/rastack_p.h index 33d4e1d15e8..15db8e97948 100644 --- a/3rdparty/asmjit/src/asmjit/core/rastack_p.h +++ b/3rdparty/asmjit/src/asmjit/core/rastack_p.h @@ -1,25 +1,7 @@ -// AsmJit - Machine code generation for C++ +// This file is part of AsmJit project <https://asmjit.com> // -// * Official AsmJit Home Page: https://asmjit.com -// * Official Github Repository: https://github.com/asmjit/asmjit -// -// Copyright (c) 2008-2020 The AsmJit Authors -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. +// See asmjit.h or LICENSE.md for license and copyright information +// SPDX-License-Identifier: Zlib #ifndef ASMJIT_CORE_RASTACK_P_H_INCLUDED #define ASMJIT_CORE_RASTACK_P_H_INCLUDED @@ -35,26 +17,25 @@ ASMJIT_BEGIN_NAMESPACE //! \addtogroup asmjit_ra //! \{ -// ============================================================================ -// [asmjit::RAStackSlot] -// ============================================================================ - //! Stack slot. struct RAStackSlot { //! Stack slot flags. //! //! TODO: kFlagStackArg is not used by the current implementation, do we need to keep it? - enum Flags : uint32_t { + enum Flags : uint16_t { //! Stack slot is register home slot. kFlagRegHome = 0x0001u, //! Stack slot position matches argument passed via stack. - kFlagStackArg = 0x0002u + kFlagStackArg = 0x0002u }; enum ArgIndex : uint32_t { kNoArgIndex = 0xFF }; + //! \name Members + //! \{ + //! Base register used to address the stack. uint8_t _baseRegId; //! Minimum alignment required by the slot. @@ -71,6 +52,8 @@ struct RAStackSlot { //! Stack offset, calculated by \ref RAStackAllocator::calculateStackFrame(). int32_t _offset; + //! \} + //! \name Accessors //! \{ @@ -101,10 +84,6 @@ struct RAStackSlot { typedef ZoneVector<RAStackSlot*> RAStackSlots; -// ============================================================================ -// [asmjit::RAStackAllocator] -// ============================================================================ - //! Stack allocator. class RAStackAllocator { public: @@ -121,28 +100,28 @@ public: kSizeCount = 7 }; + //! \name Members + //! \{ + //! Allocator used to allocate internal data. - ZoneAllocator* _allocator; + ZoneAllocator* _allocator {}; //! Count of bytes used by all slots. - uint32_t _bytesUsed; + uint32_t _bytesUsed {}; //! Calculated stack size (can be a bit greater than `_bytesUsed`). - uint32_t _stackSize; + uint32_t _stackSize {}; //! Minimum stack alignment. - uint32_t _alignment; + uint32_t _alignment = 1; //! Stack slots vector. RAStackSlots _slots; - //! \name Construction / Destruction + //! \} + + //! \name Construction & Destruction //! \{ - inline RAStackAllocator() noexcept - : _allocator(nullptr), - _bytesUsed(0), - _stackSize(0), - _alignment(1), - _slots() {} + ASMJIT_INLINE_NODEBUG RAStackAllocator() noexcept {} - inline void reset(ZoneAllocator* allocator) noexcept { + ASMJIT_INLINE_NODEBUG void reset(ZoneAllocator* allocator) noexcept { _allocator = allocator; _bytesUsed = 0; _stackSize = 0; @@ -155,15 +134,15 @@ public: //! \name Accessors //! \{ - inline ZoneAllocator* allocator() const noexcept { return _allocator; } + ASMJIT_INLINE_NODEBUG ZoneAllocator* allocator() const noexcept { return _allocator; } - inline uint32_t bytesUsed() const noexcept { return _bytesUsed; } - inline uint32_t stackSize() const noexcept { return _stackSize; } - inline uint32_t alignment() const noexcept { return _alignment; } + ASMJIT_INLINE_NODEBUG uint32_t bytesUsed() const noexcept { return _bytesUsed; } + ASMJIT_INLINE_NODEBUG uint32_t stackSize() const noexcept { return _stackSize; } + ASMJIT_INLINE_NODEBUG uint32_t alignment() const noexcept { return _alignment; } - inline RAStackSlots& slots() noexcept { return _slots; } - inline const RAStackSlots& slots() const noexcept { return _slots; } - inline uint32_t slotCount() const noexcept { return _slots.size(); } + ASMJIT_INLINE_NODEBUG RAStackSlots& slots() noexcept { return _slots; } + ASMJIT_INLINE_NODEBUG const RAStackSlots& slots() const noexcept { return _slots; } + ASMJIT_INLINE_NODEBUG uint32_t slotCount() const noexcept { return _slots.size(); } //! \} |