# HG changeset patch # User psandoz # Date 1530551341 25200 # Node ID 34872a21af8215cb580447ea3563d0fea3f10fc2 # Parent d30b4459b71bc1c3e0f814904be359bafaa35021 8202769: jck test fails with C2: vm/jvmti/FollowReferences/fref001/fref00113/fref00113.html Reviewed-by: kvn, coleenp diff -r d30b4459b71b -r 34872a21af82 src/hotspot/share/ci/ciStreams.cpp --- a/src/hotspot/share/ci/ciStreams.cpp Thu Jun 28 10:51:02 2018 -0700 +++ b/src/hotspot/share/ci/ciStreams.cpp Mon Jul 02 10:09:01 2018 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, 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 @@ -255,8 +255,7 @@ // constant. constantTag ciBytecodeStream::get_constant_pool_tag(int index) const { VM_ENTRY_MARK; - BasicType bt = _method->get_Method()->constants()->basic_type_for_constant_at(index); - return constantTag::ofBasicType(bt); + return _method->get_Method()->constants()->constant_tag_at(index); } // ------------------------------------------------------------------ diff -r d30b4459b71b -r 34872a21af82 src/hotspot/share/oops/constantPool.cpp --- a/src/hotspot/share/oops/constantPool.cpp Thu Jun 28 10:51:02 2018 -0700 +++ b/src/hotspot/share/oops/constantPool.cpp Mon Jul 02 10:09:01 2018 -0700 @@ -807,6 +807,17 @@ } } +constantTag ConstantPool::constant_tag_at(int which) { + constantTag tag = tag_at(which); + if (tag.is_dynamic_constant() || + tag.is_dynamic_constant_in_error()) { + // have to look at the signature for this one + Symbol* constant_type = uncached_signature_ref_at(which); + return constantTag::ofBasicType(FieldType::basic_type(constant_type)); + } + return tag; +} + BasicType ConstantPool::basic_type_for_constant_at(int which) { constantTag tag = tag_at(which); if (tag.is_dynamic_constant() || diff -r d30b4459b71b -r 34872a21af82 src/hotspot/share/oops/constantPool.hpp --- a/src/hotspot/share/oops/constantPool.hpp Thu Jun 28 10:51:02 2018 -0700 +++ b/src/hotspot/share/oops/constantPool.hpp Mon Jul 02 10:09:01 2018 -0700 @@ -719,6 +719,9 @@ enum { _no_index_sentinel = -1, _possible_index_sentinel = -2 }; public: + // Get the tag for a constant, which may involve a constant dynamic + constantTag constant_tag_at(int which); + // Get the basic type for a constant, which may involve a constant dynamic BasicType basic_type_for_constant_at(int which); // Resolve late bound constants.