[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-zero-dev
Subject:    Shark tweak
From:       gbenson () redhat ! com (Gary Benson)
Date:       2009-11-11 14:03:45
Message-ID: 20091111140345.GF3256 () redhat ! com
[Download RAW message or body]

Hi all,

SharkType had two methods for referring to objects which represent
an oop in the JVM: oop_type and jobject_type.  HotSpot has C types
called oop and jobject, and I thought they were synonymous, but
they aren't; everything in Shark is an oop and not a jobject.  This
commit removes all references to jobject from Shark for clarity.

Cheers,
Gary

-- 
http://gbenson.net/
-------------- next part --------------
diff -r 3adabf9ea7ef -r 79079fb4d3b4 ChangeLog
--- a/ChangeLog	Wed Nov 11 10:34:05 2009 +0000
+++ b/ChangeLog	Wed Nov 11 13:52:48 2009 +0000
@@ -1,3 +1,32 @@
+2009-11-11  Gary Benson  <gbenson at redhat.com>
+
+	* ports/hotspot/src/share/vm/shark/sharkType.hpp
+	(SharkType::jobject_type): Removed.
+
+	* ports/hotspot/src/share/vm/shark/llvmValue.hpp
+	(LLVMValue::null): Use SharkType::oop_type() instead of
+	SharkType::jobject_type().
+	* ports/hotspot/src/share/vm/shark/sharkBuilder.cpp
+	(SharkBuilder::CreateInlineOop): Likewise.
+	* ports/hotspot/src/share/vm/shark/sharkIntrinsics.cpp
+	(SharkIntrinsics::do_Object_getClass): Likewise.
+	(SharkIntrinsics::do_Thread_currentThread): Likewise.
+	* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp
+	(SharkTopLevelBlock::pending_exception_address): Likewise.
+	(SharkTopLevelBlock::get_vm_result): Likewise.
+	* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
+	(SharkTopLevelBlock::call_register_finalizer): Likewise.
+	(SharkTopLevelBlock::get_virtual_callee): Likewise.
+	(SharkTopLevelBlock::get_interface_callee): Likewise.
+	(SharkTopLevelBlock::do_full_instance_check): Likewise.
+	(SharkTopLevelBlock::do_new): Likewise.
+	* ports/hotspot/src/share/vm/shark/sharkType.cpp
+	(SharkType::initialize): Likewise.
+	* ports/hotspot/src/share/vm/shark/sharkValue.hpp
+	(SharkValue::create_jobject): Likewise.
+	* ports/hotspot/src/share/vm/shark/sharkValue.cpp
+	(SharkNormalValue::is_jobject): Likewise.
+
 2009-11-11  Gary Benson  <gbenson at redhat.com>
 
 	* ports/hotspot/src/cpu/zero/vm/frame_zero.hpp
diff -r 3adabf9ea7ef -r 79079fb4d3b4 ports/hotspot/src/share/vm/shark/llvmValue.hpp
--- a/ports/hotspot/src/share/vm/shark/llvmValue.hpp	Wed Nov 11 10:34:05 2009 +0000
+++ b/ports/hotspot/src/share/vm/shark/llvmValue.hpp	Wed Nov 11 13:52:48 2009 +0000
@@ -55,7 +55,7 @@
   }
   static llvm::ConstantPointerNull* null()
   {
-    return llvm::ConstantPointerNull::get(SharkType::jobject_type());
+    return llvm::ConstantPointerNull::get(SharkType::oop_type());
   }
 
  public:
diff -r 3adabf9ea7ef -r 79079fb4d3b4 ports/hotspot/src/share/vm/shark/sharkBuilder.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp	Wed Nov 11 10:34:05 2009 +0000
+++ b/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp	Wed Nov 11 13:52:48 2009 +0000
@@ -577,7 +577,7 @@
   return CreateLoad(
     CreateIntToPtr(
       code_buffer_address(code_buffer()->inline_oop(object)),
-      PointerType::getUnqual(SharkType::jobject_type())),
+      PointerType::getUnqual(SharkType::oop_type())),
     name);
 }
 
diff -r 3adabf9ea7ef -r 79079fb4d3b4 ports/hotspot/src/share/vm/shark/sharkIntrinsics.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkIntrinsics.cpp	Wed Nov 11 10:34:05 2009 +0000
+++ b/ports/hotspot/src/share/vm/shark/sharkIntrinsics.cpp	Wed Nov 11 13:52:48 2009 +0000
@@ -212,7 +212,7 @@
   Value *klass = builder()->CreateValueOfStructEntry(
     state()->pop()->jobject_value(),
     in_ByteSize(oopDesc::klass_offset_in_bytes()),
-    SharkType::jobject_type(),
+    SharkType::oop_type(),
     "klass");
 
   Value *klass_part = builder()->CreateAddressOfStructEntry(
@@ -246,7 +246,7 @@
     SharkValue::create_jobject(
       builder()->CreateValueOfStructEntry(
         thread(), JavaThread::threadObj_offset(),
-        SharkType::jobject_type(),
+        SharkType::oop_type(),
         "threadObj"),
       true));
 }
diff -r 3adabf9ea7ef -r 79079fb4d3b4 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp	Wed Nov 11 10:34:05 2009 +0000
+++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp	Wed Nov 11 13:52:48 2009 +0000
@@ -580,7 +580,7 @@
   Value *klass = builder()->CreateValueOfStructEntry(
     receiver,
     in_ByteSize(oopDesc::klass_offset_in_bytes()),
-    SharkType::jobject_type(),
+    SharkType::oop_type(),
     "klass");
   
   Value *klass_part = builder()->CreateAddressOfStructEntry(
@@ -956,7 +956,7 @@
   Value *klass = builder()->CreateValueOfStructEntry(
     receiver->jobject_value(),
     in_ByteSize(oopDesc::klass_offset_in_bytes()),
-    SharkType::jobject_type(),
+    SharkType::oop_type(),
     "klass");
 
   return builder()->CreateLoad(
@@ -981,7 +981,7 @@
   // Locate the receiver's itable
   Value *object_klass = builder()->CreateValueOfStructEntry(
     receiver->jobject_value(), in_ByteSize(oopDesc::klass_offset_in_bytes()),
-    SharkType::jobject_type(),
+    SharkType::oop_type(),
     "object_klass");
 
   Value *vtable_start = builder()->CreateAdd(
@@ -1028,7 +1028,7 @@
   Value *itable_iklass = builder()->CreateValueOfStructEntry(
     itable_entry,
     in_ByteSize(itableOffsetEntry::interface_offset_in_bytes()),
-    SharkType::jobject_type(),
+    SharkType::oop_type(),
     "itable_iklass");
 
   builder()->CreateCondBr(
@@ -1328,7 +1328,7 @@
   // Get the class of the object being tested
   Value *object_klass = builder()->CreateValueOfStructEntry(
     object, in_ByteSize(oopDesc::klass_offset_in_bytes()),
-    SharkType::jobject_type(),
+    SharkType::oop_type(),
     "object_klass");
 
   // Perform the check
@@ -1486,7 +1486,7 @@
 
       builder()->SetInsertPoint(got_tlab);
       tlab_object = builder()->CreateIntToPtr(
-        old_top, SharkType::jobject_type(), "tlab_object");
+        old_top, SharkType::oop_type(), "tlab_object");
 
       builder()->CreateStore(new_top, top_addr);
       builder()->CreateBr(initialize);
@@ -1519,7 +1519,7 @@
 
     builder()->SetInsertPoint(got_heap);
     heap_object = builder()->CreateIntToPtr(
-      old_top, SharkType::jobject_type(), "heap_object");
+      old_top, SharkType::oop_type(), "heap_object");
 
     Value *check = builder()->CreateCmpxchgPtr(new_top, top_addr, old_top);
     builder()->CreateCondBr(
@@ -1530,7 +1530,7 @@
     builder()->SetInsertPoint(initialize);
     if (tlab_object) {
       PHINode *phi = builder()->CreatePHI(
-        SharkType::jobject_type(), "fast_object");
+        SharkType::oop_type(), "fast_object");
       phi->addIncoming(tlab_object, got_tlab);
       phi->addIncoming(heap_object, got_heap);
       fast_object = phi;
@@ -1553,7 +1553,7 @@
 
     Value *klass_addr = builder()->CreateAddressOfStructEntry(
       fast_object, in_ByteSize(oopDesc::klass_offset_in_bytes()),
-      PointerType::getUnqual(SharkType::jobject_type()),
+      PointerType::getUnqual(SharkType::oop_type()),
       "klass_addr");
 
     // Set the mark
@@ -1590,7 +1590,7 @@
     builder()->SetInsertPoint(push_object);
   }
   if (fast_object) {
-    PHINode *phi = builder()->CreatePHI(SharkType::jobject_type(), "object");
+    PHINode *phi = builder()->CreatePHI(SharkType::oop_type(), "object");
     phi->addIncoming(fast_object, got_fast);
     phi->addIncoming(slow_object, got_slow);
     object = phi;
diff -r 3adabf9ea7ef -r 79079fb4d3b4 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp
--- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp	Wed Nov 11 10:34:05 2009 +0000
+++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp	Wed Nov 11 13:52:48 2009 +0000
@@ -245,7 +245,7 @@
   {
     return builder()->CreateAddressOfStructEntry(
       thread(), Thread::pending_exception_offset(),
-      llvm::PointerType::getUnqual(SharkType::jobject_type()),
+      llvm::PointerType::getUnqual(SharkType::oop_type()),
       "pending_exception_addr");
   }
   llvm::LoadInst* get_pending_exception() const
@@ -349,7 +349,7 @@
   {
     llvm::Value *addr = builder()->CreateAddressOfStructEntry(
       thread(), JavaThread::vm_result_offset(),
-      llvm::PointerType::getUnqual(SharkType::jobject_type()),
+      llvm::PointerType::getUnqual(SharkType::oop_type()),
       "vm_result_addr");
     llvm::LoadInst *result = builder()->CreateLoad(addr, "vm_result");
     builder()->CreateStore(LLVMValue::null(), addr);
diff -r 3adabf9ea7ef -r 79079fb4d3b4 ports/hotspot/src/share/vm/shark/sharkType.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkType.cpp	Wed Nov 11 10:34:05 2009 +0000
+++ b/ports/hotspot/src/share/vm/shark/sharkType.cpp	Wed Nov 11 13:52:48 2009 +0000
@@ -168,8 +168,8 @@
 
     case T_OBJECT:
     case T_ARRAY:
-      _to_stackType_tab[i] = jobject_type();
-      _to_arrayType_tab[i] = jobject_type();
+      _to_stackType_tab[i] = oop_type();
+      _to_arrayType_tab[i] = oop_type();
       break;
 
     case T_ADDRESS:
diff -r 3adabf9ea7ef -r 79079fb4d3b4 ports/hotspot/src/share/vm/shark/sharkType.hpp
--- a/ports/hotspot/src/share/vm/shark/sharkType.hpp	Wed Nov 11 10:34:05 2009 +0000
+++ b/ports/hotspot/src/share/vm/shark/sharkType.hpp	Wed Nov 11 13:52:48 2009 +0000
@@ -1,6 +1,6 @@
 /*
  * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008 Red Hat, Inc.
+ * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -161,10 +161,6 @@
     return llvm::Type::DoubleTy;
 #endif
   }
-  static const llvm::PointerType* jobject_type()
-  {
-    return oop_type();
-  }
 
   // Java types as they appear on the stack and in fields
  private:
diff -r 3adabf9ea7ef -r 79079fb4d3b4 ports/hotspot/src/share/vm/shark/sharkValue.cpp
--- a/ports/hotspot/src/share/vm/shark/sharkValue.cpp	Wed Nov 11 10:34:05 2009 +0000
+++ b/ports/hotspot/src/share/vm/shark/sharkValue.cpp	Wed Nov 11 13:52:48 2009 +0000
@@ -151,7 +151,7 @@
 }
 bool SharkNormalValue::is_jobject() const
 {
-  return llvm_value()->getType() == SharkType::jobject_type();
+  return llvm_value()->getType() == SharkType::oop_type();
 }
 bool SharkNormalValue::is_jarray() const
 {
diff -r 3adabf9ea7ef -r 79079fb4d3b4 ports/hotspot/src/share/vm/shark/sharkValue.hpp
--- a/ports/hotspot/src/share/vm/shark/sharkValue.hpp	Wed Nov 11 10:34:05 2009 +0000
+++ b/ports/hotspot/src/share/vm/shark/sharkValue.hpp	Wed Nov 11 13:52:48 2009 +0000
@@ -118,7 +118,7 @@
   }
   static SharkValue* create_jobject(llvm::Value* value, bool zero_checked)
   {
-    assert(value->getType() == SharkType::jobject_type(), "should be");
+    assert(value->getType() == SharkType::oop_type(), "should be");
     return create_generic(ciType::make(T_OBJECT), value, zero_checked);
   }
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic