Skip to content

Commit

Permalink
Add modified files
Browse files Browse the repository at this point in the history
  • Loading branch information
mcimadamore committed Oct 7, 2020
1 parent dc186e3 commit e4eb2c7
Show file tree
Hide file tree
Showing 65 changed files with 2,076 additions and 2,443 deletions.
1 change: 1 addition & 0 deletions make/modules/java.base/Gensrc.gmk
Expand Up @@ -35,6 +35,7 @@ include gensrc/GensrcExceptions.gmk
include gensrc/GensrcVarHandles.gmk
include gensrc/GensrcModuleLoaderMap.gmk
include gensrc/GensrcEmojiData.gmk
include gensrc/GensrcScopedMemoryAccess.gmk

# GensrcLocaleData.gmk does not set TARGETS, so we must choose which targets
# to include.
Expand Down
8 changes: 8 additions & 0 deletions src/hotspot/share/classfile/classFileParser.cpp
Expand Up @@ -1079,6 +1079,7 @@ class AnnotationCollector : public ResourceObj{
_method_InjectedProfile,
_method_LambdaForm_Compiled,
_method_Hidden,
_method_Scoped,
_method_IntrinsicCandidate,
_jdk_internal_vm_annotation_Contended,
_field_Stable,
Expand Down Expand Up @@ -2102,6 +2103,11 @@ AnnotationCollector::annotation_index(const ClassLoaderData* loader_data,
if (!privileged) break; // only allow in privileged code
return _method_Hidden;
}
case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_misc_Scoped_signature): {
if (_location != _in_method) break; // only allow for methods
if (!privileged) break; // only allow in privileged code
return _method_Scoped;
}
case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_vm_annotation_IntrinsicCandidate_signature): {
if (_location != _in_method) break; // only allow for methods
if (!privileged) break; // only allow in privileged code
Expand Down Expand Up @@ -2159,6 +2165,8 @@ void MethodAnnotationCollector::apply_to(const methodHandle& m) {
m->set_intrinsic_id(vmIntrinsics::_compiledLambdaForm);
if (has_annotation(_method_Hidden))
m->set_hidden(true);
if (has_annotation(_method_Scoped))
m->set_scoped(true);
if (has_annotation(_method_IntrinsicCandidate) && !m->is_synthetic())
m->set_intrinsic_candidate(true);
if (has_annotation(_jdk_internal_vm_annotation_ReservedStackAccess))
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/classfile/vmSymbols.hpp
Expand Up @@ -287,6 +287,7 @@
template(jdk_internal_vm_annotation_DontInline_signature, "Ljdk/internal/vm/annotation/DontInline;") \
template(jdk_internal_vm_annotation_ForceInline_signature, "Ljdk/internal/vm/annotation/ForceInline;") \
template(jdk_internal_vm_annotation_Hidden_signature, "Ljdk/internal/vm/annotation/Hidden;") \
template(jdk_internal_misc_Scoped_signature, "Ljdk/internal/misc/ScopedMemoryAccess$Scoped;") \
template(jdk_internal_vm_annotation_IntrinsicCandidate_signature, "Ljdk/internal/vm/annotation/IntrinsicCandidate;") \
template(jdk_internal_vm_annotation_Stable_signature, "Ljdk/internal/vm/annotation/Stable;") \
\
Expand Down
11 changes: 10 additions & 1 deletion src/hotspot/share/oops/method.hpp
Expand Up @@ -90,7 +90,8 @@ class Method : public Metadata {
_has_injected_profile = 1 << 4,
_running_emcp = 1 << 5,
_intrinsic_candidate = 1 << 6,
_reserved_stack_access = 1 << 7
_reserved_stack_access = 1 << 7,
_scoped = 1 << 8
};
mutable u2 _flags;

Expand Down Expand Up @@ -900,6 +901,14 @@ class Method : public Metadata {
_flags = x ? (_flags | _hidden) : (_flags & ~_hidden);
}

bool is_scoped() const {
return (_flags & _scoped) != 0;
}

void set_scoped(bool x) {
_flags = x ? (_flags | _scoped) : (_flags & ~_scoped);
}

bool intrinsic_candidate() {
return (_flags & _intrinsic_candidate) != 0;
}
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/prims/nativeLookup.cpp
Expand Up @@ -38,6 +38,7 @@
#include "prims/jvm_misc.hpp"
#include "prims/nativeLookup.hpp"
#include "prims/unsafe.hpp"
#include "prims/scopedMemoryAccess.hpp"
#include "runtime/arguments.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/interfaceSupport.inline.hpp"
Expand Down Expand Up @@ -139,6 +140,7 @@ static JNINativeMethod lookup_special_native_methods[] = {
#if INCLUDE_JFR
{ CC"Java_jdk_jfr_internal_JVM_registerNatives", NULL, FN_PTR(jfr_register_natives) },
#endif
{ CC"Java_jdk_internal_misc_ScopedMemoryAccess_registerNatives", NULL, FN_PTR(JVM_RegisterJDKInternalMiscScopedMemoryAccessMethods) },
};

static address lookup_special_native(const char* jni_name) {
Expand Down
Expand Up @@ -36,28 +36,21 @@ abstract class MemoryAccessVarHandleBase extends VarHandle {
/** access size (in bytes, computed from var handle carrier type) **/
final long length;

/** access offset (in bytes); must be compatible with {@code alignmentMask} **/
final long offset;

/** alignment constraint (in bytes, expressed as a bit mask) **/
final long alignmentMask;

MemoryAccessVarHandleBase(VarForm form, boolean be, long length, long offset, long alignmentMask) {
/** if true, only the base part of the address will be checked for alignment **/
final boolean skipAlignmentMaskCheck;

MemoryAccessVarHandleBase(VarForm form, boolean skipOffetCheck, boolean be, long length, long alignmentMask) {
super(form);
this.skipAlignmentMaskCheck = skipOffetCheck;
this.be = be;
this.length = length;
this.offset = offset;
this.alignmentMask = alignmentMask;
}

static IllegalStateException newIllegalStateExceptionForMisalignedAccess(long address) {
return new IllegalStateException("Misaligned access at address: " + address);
}

/**
* Strides used for multi-dimensional access; each stride must be compatible with {@code alignmentMask}.
*/
abstract long[] strides();

abstract Class<?> carrier();
}

0 comments on commit e4eb2c7

Please sign in to comment.