15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "asm/assembler.hpp"
27 #include "asm/assembler.inline.hpp"
28 #include "compiler/disassembler.hpp"
29 #include "gc/shared/cardTableModRefBS.hpp"
30 #include "gc/shared/collectedHeap.inline.hpp"
31 #include "interpreter/interpreter.hpp"
32 #include "memory/resourceArea.hpp"
33 #include "memory/universe.hpp"
34 #include "oops/klass.inline.hpp"
35 #include "prims/methodHandles.hpp"
36 #include "runtime/biasedLocking.hpp"
37 #include "runtime/interfaceSupport.hpp"
38 #include "runtime/objectMonitor.hpp"
39 #include "runtime/os.hpp"
40 #include "runtime/sharedRuntime.hpp"
41 #include "runtime/stubRoutines.hpp"
42 #include "runtime/thread.hpp"
43 #include "utilities/macros.hpp"
44 #if INCLUDE_ALL_GCS
45 #include "gc/g1/g1CollectedHeap.inline.hpp"
46 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
47 #include "gc/g1/heapRegion.hpp"
48 #endif // INCLUDE_ALL_GCS
49 #include "crc32c.h"
50 #ifdef COMPILER2
51 #include "opto/intrinsicnode.hpp"
52 #endif
53
54 #ifdef PRODUCT
3621
3622 void MacroAssembler::null_check(Register reg, int offset) {
3623 if (needs_explicit_null_check(offset)) {
3624 // provoke OS NULL exception if reg = NULL by
3625 // accessing M[reg] w/o changing any (non-CC) registers
3626 // NOTE: cmpl is plenty here to provoke a segv
3627 cmpptr(rax, Address(reg, 0));
3628 // Note: should probably use testl(rax, Address(reg, 0));
3629 // may be shorter code (however, this version of
3630 // testl needs to be implemented first)
3631 } else {
3632 // nothing to do, (later) access of M[reg + offset]
3633 // will provoke OS NULL exception if reg = NULL
3634 }
3635 }
3636
3637 void MacroAssembler::os_breakpoint() {
3638 // instead of directly emitting a breakpoint, call os:breakpoint for better debugability
3639 // (e.g., MSVC can't call ps() otherwise)
3640 call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint)));
3641 }
3642
3643 #ifdef _LP64
3644 #define XSTATE_BV 0x200
3645 #endif
3646
3647 void MacroAssembler::pop_CPU_state() {
3648 pop_FPU_state();
3649 pop_IU_state();
3650 }
3651
3652 void MacroAssembler::pop_FPU_state() {
3653 #ifndef _LP64
3654 frstor(Address(rsp, 0));
3655 #else
3656 fxrstor(Address(rsp, 0));
3657 #endif
3658 addptr(rsp, FPUStateSizeInWords * wordSize);
3659 }
3660
|
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "asm/assembler.hpp"
27 #include "asm/assembler.inline.hpp"
28 #include "compiler/disassembler.hpp"
29 #include "gc/shared/cardTableModRefBS.hpp"
30 #include "gc/shared/collectedHeap.inline.hpp"
31 #include "interpreter/interpreter.hpp"
32 #include "memory/resourceArea.hpp"
33 #include "memory/universe.hpp"
34 #include "oops/klass.inline.hpp"
35 #include "prims/jvm.h"
36 #include "prims/methodHandles.hpp"
37 #include "runtime/biasedLocking.hpp"
38 #include "runtime/interfaceSupport.hpp"
39 #include "runtime/objectMonitor.hpp"
40 #include "runtime/os.hpp"
41 #include "runtime/sharedRuntime.hpp"
42 #include "runtime/stubRoutines.hpp"
43 #include "runtime/thread.hpp"
44 #include "utilities/macros.hpp"
45 #if INCLUDE_ALL_GCS
46 #include "gc/g1/g1CollectedHeap.inline.hpp"
47 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
48 #include "gc/g1/heapRegion.hpp"
49 #endif // INCLUDE_ALL_GCS
50 #include "crc32c.h"
51 #ifdef COMPILER2
52 #include "opto/intrinsicnode.hpp"
53 #endif
54
55 #ifdef PRODUCT
3622
3623 void MacroAssembler::null_check(Register reg, int offset) {
3624 if (needs_explicit_null_check(offset)) {
3625 // provoke OS NULL exception if reg = NULL by
3626 // accessing M[reg] w/o changing any (non-CC) registers
3627 // NOTE: cmpl is plenty here to provoke a segv
3628 cmpptr(rax, Address(reg, 0));
3629 // Note: should probably use testl(rax, Address(reg, 0));
3630 // may be shorter code (however, this version of
3631 // testl needs to be implemented first)
3632 } else {
3633 // nothing to do, (later) access of M[reg + offset]
3634 // will provoke OS NULL exception if reg = NULL
3635 }
3636 }
3637
3638 void MacroAssembler::os_breakpoint() {
3639 // instead of directly emitting a breakpoint, call os:breakpoint for better debugability
3640 // (e.g., MSVC can't call ps() otherwise)
3641 call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint)));
3642 }
3643
3644 void MacroAssembler::unimplemented(const char* what) {
3645 char* b = new char[1024];
3646 jio_snprintf(b, 1024, "unimplemented: %s", what);
3647 stop(b);
3648 }
3649
3650 #ifdef _LP64
3651 #define XSTATE_BV 0x200
3652 #endif
3653
3654 void MacroAssembler::pop_CPU_state() {
3655 pop_FPU_state();
3656 pop_IU_state();
3657 }
3658
3659 void MacroAssembler::pop_FPU_state() {
3660 #ifndef _LP64
3661 frstor(Address(rsp, 0));
3662 #else
3663 fxrstor(Address(rsp, 0));
3664 #endif
3665 addptr(rsp, FPUStateSizeInWords * wordSize);
3666 }
3667
|