changeset 1705:a28f5ad21234

2009-03-04 Gary Benson <gbenson@redhat.com> * ports/hotspot/src/share/vm/shark/sharkInliner.hpp: New file. * ports/hotspot/src/share/vm/shark/sharkInliner.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkBlock.hpp: Moved partly into... * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp: New file. * ports/hotspot/src/share/vm/shark/sharkBlock.cpp: Likewise into... * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp: New file. * ports/hotspot/src/share/vm/shark/sharkState.hpp: Merged SharkTrackingState into SharkState, and moved SharkEntryState into sharkFunction.cpp and SharkPHIState into sharkTopLevelBlock.cpp. * ports/hotspot/src/share/vm/shark/sharkState.inline.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkState.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp: s/SharkBlock/SharkTopLevelBlock/g * ports/hotspot/src/share/vm/shark/sharkMonitor.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkMonitor.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkFunction.hpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkFunction.cpp: Likewise. * ports/hotspot/src/share/vm/shark/shark_globals.hpp (SharkMaxInlineSize): New parameter. * ports/hotspot/src/share/vm/shark/sharkBuilder.hpp (SharkBuilder::GetBlockInsertionPoint): New method. (SharkBuilder::CreateBlock): Likewise. * ports/hotspot/src/share/vm/includeDB_shark: Updated. (transplanted from b593d3ef9dce396c5355ea00592750acbd9337a7)
author Gary Benson <gbenson@redhat.com>
date Wed, 04 Mar 2009 10:41:13 -0500
parents c8fd76f04b59
children e6271aa33a0c
files ports/hotspot/src/share/vm/includeDB_shark ports/hotspot/src/share/vm/shark/sharkFunction.cpp ports/hotspot/src/share/vm/shark/sharkState.cpp ports/hotspot/src/share/vm/shark/shark_globals.hpp
diffstat 4 files changed, 100 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ports/hotspot/src/share/vm/includeDB_shark	Wed Mar 04 10:41:13 2009 -0500
+++ b/ports/hotspot/src/share/vm/includeDB_shark	Wed Mar 04 10:41:13 2009 -0500
@@ -44,6 +44,25 @@
 sharkBlock.hpp                          sharkState.hpp
 sharkBlock.hpp                          sharkValue.hpp
 
+sharkBlock.cpp                          debug.hpp
+sharkBlock.cpp                          bytecodes.hpp
+sharkBlock.cpp                          llvmHeaders.hpp
+sharkBlock.cpp                          shark_globals.hpp
+sharkBlock.cpp                          sharkBlock.hpp
+sharkBlock.cpp                          sharkBuilder.hpp
+sharkBlock.cpp                          sharkRuntime.hpp
+sharkBlock.cpp                          sharkState.inline.hpp
+sharkBlock.cpp                          sharkValue.inline.hpp
+
+sharkBlock.hpp                          allocation.hpp
+sharkBlock.hpp                          ciMethod.hpp
+sharkBlock.hpp                          ciStreams.hpp
+sharkBlock.hpp                          debug.hpp
+sharkBlock.hpp                          llvmHeaders.hpp
+sharkBlock.hpp                          sharkBuilder.hpp
+sharkBlock.hpp                          sharkState.hpp
+sharkBlock.hpp                          sharkValue.hpp
+
 ciMethod.cpp                            ciTypeFlow.hpp
 ciMethod.cpp                            methodOop.hpp
 
--- a/ports/hotspot/src/share/vm/shark/sharkFunction.cpp	Wed Mar 04 10:41:13 2009 -0500
+++ b/ports/hotspot/src/share/vm/shark/sharkFunction.cpp	Wed Mar 04 10:41:13 2009 -0500
@@ -89,6 +89,65 @@
   }
 };
 
+class SharkEntryState : public SharkState {
+ public:
+  SharkEntryState(SharkTopLevelBlock* block, llvm::Value* method)
+    : SharkState(block, block->function(), method)
+  {
+    char name[18];
+
+    // Local variables
+    for (int i = 0; i < max_locals(); i++) {
+      ciType *type = block->local_type_at_entry(i);
+
+      SharkValue *value = NULL;
+      switch (type->basic_type()) {
+      case T_INT:
+      case T_LONG:
+      case T_FLOAT:
+      case T_DOUBLE:
+      case T_OBJECT:
+      case T_ARRAY:
+        if (i < function()->arg_size()) {
+          snprintf(name, sizeof(name), "local_%d_", i);
+          value = SharkValue::create_generic(
+            type,
+            builder()->CreateLoad(
+              function()->CreateAddressOfFrameEntry(
+                function()->locals_slots_offset()
+                + max_locals() - type->size() - i,
+                SharkType::to_stackType(type)),
+              name));
+        }
+        else {
+          Unimplemented();
+        }
+        break;
+      
+      case ciTypeFlow::StateVector::T_BOTTOM:
+        break;
+
+      case ciTypeFlow::StateVector::T_LONG2:
+      case ciTypeFlow::StateVector::T_DOUBLE2:
+        break;
+
+      default:
+        ShouldNotReachHere();
+      }
+      set_local(i, value);
+    }
+
+    // Non-static methods have a guaranteed non-null receiver
+    if (!function()->target()->is_static()) {
+      assert(local(0)->is_jobject(), "should be");
+      local(0)->set_zero_checked(true);
+    }
+
+    // Expression stack
+    assert(!block->stack_depth_at_entry(), "entry block shouldn't have stack");
+  }
+};
+
 void SharkFunction::initialize()
 {
   // Emit the entry point
--- a/ports/hotspot/src/share/vm/shark/sharkState.cpp	Wed Mar 04 10:41:13 2009 -0500
+++ b/ports/hotspot/src/share/vm/shark/sharkState.cpp	Wed Mar 04 10:41:13 2009 -0500
@@ -46,6 +46,24 @@
   initialize(state);
 }
 
+SharkState::SharkState(SharkBlock*    block,
+                       SharkFunction* function,
+                       llvm::Value*   method)
+  : _block(block),
+    _function(function),
+    _method(method)
+{
+  initialize(NULL);
+}
+
+SharkState::SharkState(const SharkState* state)
+  : _block(state->block()),
+    _function(state->function()),
+    _method(state->method())
+{
+  initialize(state);
+}
+
 void SharkState::initialize(const SharkState *state)
 {
   _locals = NEW_RESOURCE_ARRAY(SharkValue*, max_locals());
--- a/ports/hotspot/src/share/vm/shark/shark_globals.hpp	Wed Mar 04 10:41:13 2009 -0500
+++ b/ports/hotspot/src/share/vm/shark/shark_globals.hpp	Wed Mar 04 10:41:13 2009 -0500
@@ -36,6 +36,10 @@
   product(intx, SharkMaxInlineSize, 32,                                       \
           "Maximum bytecode size of methods to inline when using Shark")      \
                                                                               \
+  /* inlining */                                                              \
+  product(intx, SharkMaxInlineSize, 32,                                       \
+          "Maximum bytecode size of methods to inline when using Shark")      \
+                                                                              \
   /* compiler debugging */                                                    \
   develop(uintx, SharkStartAt, 0,                                             \
           "First method to consider when using Shark")                        \