2362N/A * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 829N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 829N/A * This code is free software; you can redistribute it and/or modify it 829N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. 2362N/A * This code is distributed in the hope that it will be useful, but WITHOUT 829N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 829N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 829N/A * version 2 for more details (a copy is included in the LICENSE file that 829N/A * accompanied this code). 829N/A * You should have received a copy of the GNU General Public License version 829N/A * 2 along with this work; if not, write to the Free Software Foundation, 829N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 829N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 829N/A// Use AbstractRegister as shortcut 829N/A// The super class for platform specific registers. Instead of using value objects, 829N/A// registers are implemented as pointers. Subclassing is used so all registers can 829N/A// use the debugging suport below. No virtual functions are used for efficiency. 829N/A// They are canonicalized; i.e., registers are equal if their pointers are equal, 829N/A// and vice versa. A concrete implementation may just map the register onto 'this'. 829N/A// Macros for use in defining Register instances. We'd like to be 829N/A// able to simply define const instances of the RegisterImpl* for each 829N/A// of the registers needed on a system in a header file. However many 829N/A// compilers don't handle this very well and end up producing a 829N/A// private definition in every file which includes the header file. 829N/A// Along with the static constructors necessary for initialization it 829N/A// can consume a significant amount of space in the result library. 829N/A// The following macros allow us to declare the instance in a .hpp and 829N/A// produce an enumeration value which has the same number. Then in a 829N/A// .cpp the the register instance can be defined using the enumeration 829N/A// value. This avoids the use of static constructors and multiple 829N/A// definitions per .cpp. In addition #defines for the register can be 829N/A// produced so that the constant registers can be inlined. These 829N/A// macros should not be used inside other macros, because you may get 829N/A// multiple evaluations of the macros which can give bad results. 829N/A// Here are some example uses and expansions. Note that the macro 829N/A// invocation is terminated with a ;. 829N/A// CONSTANT_REGISTER_DECLARATION(Register, G0, 0); 829N/A// extern const Register G0 ; 829N/A// enum { G0_RegisterEnumValue = 0 } ; 829N/A// REGISTER_DECLARATION(Register, Gmethod, G5); // extern const Register Gmethod ; // enum { Gmethod_RegisterEnumValue = G5_RegisterEnumValue } ; // REGISTER_DEFINITION(Register, G0); // const Register G0 = ( ( Register ) G0_RegisterEnumValue ) ; err_msg_res(
"registers must be different: a=%d, b=%d, c=%d",
a != b && a != c && a != d
err_msg_res(
"registers must be different: a=%d, b=%d, c=%d, d=%d",
a != b && a != c && a != d && a != e
&& b != c && b != d && b != e
err_msg_res(
"registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d",
a != b && a != c && a != d && a != e && a != f
&& b != c && b != d && b != e && b != f
&& c != d && c != e && c != f
err_msg_res(
"registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d",
a != b && a != c && a != d && a != e && a != f && a != g
&& b != c && b != d && b != e && b != f && b != g
&& c != d && c != e && c != f && c != g
&& d != e && d != f && d != g
err_msg_res(
"registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d",
a != b && a != c && a != d && a != e && a != f && a != g && a != h
&& b != c && b != d && b != e && b != f && b != g && b != h
&& c != d && c != e && c != f && c != g && c != h
&& d != e && d != f && d != g && d != h
&& e != f && e != g && e != h
err_msg_res(
"registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d",
a != b && a != c && a != d && a != e && a != f && a != g && a != h && a != i
&& b != c && b != d && b != e && b != f && b != g && b != h && b != i
&& c != d && c != e && c != f && c != g && c != h && c != i
&& d != e && d != f && d != g && d != h && d != i
&& e != f && e != g && e != h && e != i
&& f != g && f != h && f != i
err_msg_res(
"registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d, i=%d",
a, b, c, d, e, f, g, h, i)
#
endif // SHARE_VM_ASM_REGISTER_HPP