/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_CODE_LOCATION_HPP
#define SHARE_VM_CODE_LOCATION_HPP
#include "asm/assembler.hpp"
#include "memory/allocation.hpp"
// A Location describes a concrete machine variable location
// (such as integer or floating point register or a stack-held
// variable). Used when generating debug-information for nmethods.
//
// Encoding:
//
// bits (use low bits for best compression):
// Type: [3..0]
// Where: [4]
// Offset: [31..5]
friend class VMStructs;
public:
enum Where {
};
enum Type {
};
private:
enum {
TYPE_SHIFT = 0,
};
// Create a bit-packed Location
}
(type_ << TYPE_SHIFT) |
}
public:
// Stack location Factory. Offset is 4-byte aligned; remove low bits
static Location new_stk_loc( Type t, int offset ) { return Location(on_stack,t,offset>>LogBytesPerInt); }
// Register location Factory
// Default constructor
// Bit field accessors
// Accessors
int stack_offset() const { assert(where() == on_stack, "wrong Where"); return offset()<<LogBytesPerInt; }
VMReg reg() const { assert(where() == in_register, "wrong Where"); return VMRegImpl::as_VMReg(offset()) ; }
// Printing
// Serialization of debugging information
// check
static bool legal_offset_in_bytes(int offset_in_bytes);
};
#endif // SHARE_VM_CODE_LOCATION_HPP