--- old/src/hotspot/share/oops/accessBackend.hpp 2019-09-26 16:22:13.641648955 +0200 +++ new/src/hotspot/share/oops/accessBackend.hpp 2019-09-26 16:22:13.433645387 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2019, 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 @@ -52,6 +52,14 @@ typedef typename Conditional::type type; }; +// This meta-function returns either oop or narrowOop depending on whether +// a back-end needs to consider compressed oops types or not. +template +struct ValueOopType: AllStatic { + static const bool needs_oop_compress = HasDecorator::value; + typedef typename Conditional::type type; +}; + namespace AccessInternal { enum BarrierType { BARRIER_STORE, @@ -64,6 +72,7 @@ BARRIER_ATOMIC_XCHG_AT, BARRIER_ARRAYCOPY, BARRIER_CLONE, + BARRIER_VALUE_COPY, BARRIER_RESOLVE }; @@ -114,6 +123,7 @@ arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw, size_t length); typedef void (*clone_func_t)(oop src, oop dst, size_t size); + typedef void (*value_copy_func_t)(void* src, void* dst, ValueKlass* md); typedef oop (*resolve_func_t)(oop obj); }; @@ -141,6 +151,7 @@ ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_ATOMIC_XCHG_AT, atomic_xchg_at_func_t); ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_ARRAYCOPY, arraycopy_func_t); ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_CLONE, clone_func_t); + ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_VALUE_COPY, value_copy_func_t); ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_RESOLVE, resolve_func_t); #undef ACCESS_GENERATE_ACCESS_FUNCTION @@ -406,6 +417,8 @@ static void clone(oop src, oop dst, size_t size); + static void value_copy(void* src, void* dst, ValueKlass* md); + static oop resolve(oop obj) { return obj; } }; @@ -589,6 +602,18 @@ }; template + struct RuntimeDispatch: AllStatic { + typedef typename AccessFunction::type func_t; + static func_t _value_copy_func; + + static void value_copy_init(void* src, void* dst, ValueKlass* md); + + static inline void value_copy(void* src, void* dst, ValueKlass* md) { + _value_copy_func(src, dst, md); + } + }; + + template struct RuntimeDispatch: AllStatic { typedef typename AccessFunction::type func_t; static func_t _resolve_func; @@ -642,6 +667,10 @@ RuntimeDispatch::_clone_func = &clone_init; template + typename AccessFunction::type + RuntimeDispatch::_value_copy_func = &value_copy_init; + + template typename AccessFunction::type RuntimeDispatch::_resolve_func = &resolve_init; @@ -963,6 +992,23 @@ template inline static typename EnableIf< + HasDecorator::value>::type + value_copy(void* src, void* dst, ValueKlass* md) { + typedef RawAccessBarrier Raw; + Raw::value_copy(src, dst, md); + } + + template + inline static typename EnableIf< + !HasDecorator::value>::type + value_copy(void* src, void* dst, ValueKlass* md) { + const DecoratorSet expanded_decorators = decorators; + RuntimeDispatch::value_copy(src, dst, md); + } + + + template + inline static typename EnableIf< HasDecorator::value, oop>::type resolve(oop obj) { typedef RawAccessBarrier Raw; @@ -1268,6 +1314,12 @@ } template + inline void value_copy(void* src, void* dst, ValueKlass* md) { + const DecoratorSet expanded_decorators = DecoratorFixup::value; + PreRuntimeDispatch::value_copy(src, dst, md); + } + + template inline oop resolve(oop obj) { const DecoratorSet expanded_decorators = DecoratorFixup::value; return PreRuntimeDispatch::resolve(obj);