8141491: Unaligned memory access in Bits.c

Introduce alignment-safe Copy::conjoint_swap and j.i.m.Unsafe.copySwapMemory

Reviewed-by: jrose, dholmes, psandoz
This commit is contained in:
Mikael Vidstedt 2016-02-10 15:20:38 -08:00
parent 3fc0fa269a
commit 4e53f48812
4 changed files with 230 additions and 4 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -417,6 +417,14 @@ class RuntimeHistogramElement : public HistogramElement {
os::verify_stack_alignment(); \
/* begin of body */
#define VM_ENTRY_BASE_FROM_LEAF(result_type, header, thread) \
TRACE_CALL(result_type, header) \
debug_only(ResetNoHandleMark __rnhm;) \
HandleMarkCleaner __hm(thread); \
Thread* THREAD = thread; \
os::verify_stack_alignment(); \
/* begin of body */
// ENTRY routines may lock, GC and throw exceptions
@ -584,6 +592,14 @@ extern "C" { \
VM_LEAF_BASE(result_type, header)
#define JVM_ENTRY_FROM_LEAF(env, result_type, header) \
{ { \
JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
ThreadInVMfromNative __tiv(thread); \
debug_only(VMNativeEntryWrapper __vew;) \
VM_ENTRY_BASE_FROM_LEAF(result_type, header, thread)
#define JVM_END } }
#endif // SHARE_VM_RUNTIME_INTERFACESUPPORT_HPP