changeset 50971:34872a21af82

8202769: jck test fails with C2: vm/jvmti/FollowReferences/fref001/fref00113/fref00113.html Reviewed-by: kvn, coleenp
author psandoz
date Mon, 02 Jul 2018 10:09:01 -0700
parents d30b4459b71b
children 833a291460b7
files src/hotspot/share/ci/ciStreams.cpp src/hotspot/share/oops/constantPool.cpp src/hotspot/share/oops/constantPool.hpp
diffstat 3 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);
 }
 
 // ------------------------------------------------------------------
--- 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() ||
--- 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.