changeset in /hg/icedtea6: 2009-06-19 Gary Benson <gbenson at red...

Gary Benson gbenson at redhat.com
Fri Jun 19 05:51:09 PDT 2009


changeset 2861671c8434 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=2861671c8434
description:
	2009-06-19  Gary Benson  <gbenson at redhat.com>

		* ports/hotspot/src/share/vm/shark/sharkConstant.cpp
		(SharkConstant::for_ldc): Set type for object constants.
		(SharkConstant::SharkConstant): Updated.

diffstat:

2 files changed, 18 insertions(+), 2 deletions(-)
ChangeLog                                          |    6 ++++++
ports/hotspot/src/share/vm/shark/sharkConstant.cpp |   14 ++++++++++++--

diffs (51 lines):

diff -r 2bd8742661b3 -r 2861671c8434 ChangeLog
--- a/ChangeLog	Fri Jun 19 06:03:31 2009 -0400
+++ b/ChangeLog	Fri Jun 19 08:48:56 2009 -0400
@@ -1,3 +1,9 @@ 2009-06-19  Gary Benson  <gbenson at redhat
+2009-06-19  Gary Benson  <gbenson at redhat.com>
+
+	* ports/hotspot/src/share/vm/shark/sharkConstant.cpp
+	(SharkConstant::for_ldc): Set type for object constants.
+	(SharkConstant::SharkConstant): Updated.
+
 2009-06-19  Gary Benson  <gbenson at redhat.com>
 
 	* ports/hotspot/src/share/vm/shark/sharkCompiler.hpp
diff -r 2bd8742661b3 -r 2861671c8434 ports/hotspot/src/share/vm/shark/sharkConstant.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkConstant.cpp	Fri Jun 19 06:03:31 2009 -0400
+++ b/ports/hotspot/src/share/vm/shark/sharkConstant.cpp	Fri Jun 19 08:48:56 2009 -0400
@@ -30,7 +30,16 @@ using namespace llvm;
 
 SharkConstant* SharkConstant::for_ldc(ciBytecodeStream *iter)
 {
-  return new SharkConstant(iter->get_constant(), NULL);
+  ciConstant constant = iter->get_constant();
+  ciType *type = NULL;
+  if (constant.basic_type() == T_OBJECT) {
+    ciEnv *env = ciEnv::current();
+    if (constant.as_object()->is_klass())
+      type = env->Class_klass();
+    else
+      type = env->String_klass();
+  }
+  return new SharkConstant(constant, type);
 }
 
 SharkConstant* SharkConstant::for_field(ciBytecodeStream *iter)
@@ -97,6 +106,7 @@ SharkConstant::SharkConstant(ciConstant 
   // have yet to be created.  We need to spot the unloaded
   // objects (which differ between ldc* and get*, thanks!)
   ciObject *object = constant.as_object();
+  assert(type != NULL, "shouldn't be");
   if (object->is_klass()) {
     // The constant returned for a klass is the ciKlass
     // for the entry, but we want the java_mirror.
@@ -114,7 +124,7 @@ SharkConstant::SharkConstant(ciConstant 
 
   _value       = NULL;
   _object      = object;
-  _type        = type ? type : ciType::make(T_OBJECT);
+  _type        = type;
   _is_loaded   = true;
   _is_nonzero  = true;
   _is_two_word = false;



More information about the distro-pkg-dev mailing list