changeset 19011:203c7256e123

Merge.
author Chris Seaton <chris.seaton@oracle.com>
date Thu, 29 Jan 2015 00:12:55 +0000
parents 3bf612703773 (current diff) 9c2396ef02db (diff)
children f5b83e7b2b4c
files
diffstat 5 files changed, 19 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.java	Thu Jan 29 00:12:30 2015 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.java	Thu Jan 29 00:12:55 2015 +0000
@@ -66,7 +66,12 @@
         }
         if (obj instanceof HotSpotResolvedJavaField) {
             HotSpotResolvedJavaFieldImpl that = (HotSpotResolvedJavaFieldImpl) obj;
-            return this.holder.equals(that.holder) && this.name.equals(that.name) && this.type.equals(that.type);
+            if (that.offset != this.offset) {
+                return false;
+            } else if (this.holder.equals(that.holder)) {
+                assert this.name.equals(that.name) && this.type.equals(that.type);
+                return true;
+            }
         }
         return false;
     }
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java	Thu Jan 29 00:12:30 2015 +0000
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java	Thu Jan 29 00:12:55 2015 +0000
@@ -1068,7 +1068,7 @@
     }
 
     private void addToLatestSorting(ValueNode i, SortState state) {
-        if (i == null || state.isVisited(i) || cfg.getNodeToBlock().get(i) != state.currentBlock() || i instanceof PhiNode) {
+        if (i == null || state.isVisited(i) || cfg.getNodeToBlock().get(i) != state.currentBlock() || i instanceof PhiNode || i instanceof ProxyNode) {
             return;
         }
 
@@ -1083,9 +1083,7 @@
                     addUnscheduledToLatestSorting((FrameState) input, state);
                 }
             } else {
-                if (!(i instanceof ProxyNode && input instanceof LoopExitNode)) {
-                    addToLatestSorting((ValueNode) input, state);
-                }
+                addToLatestSorting((ValueNode) input, state);
             }
         }
 
@@ -1130,7 +1128,7 @@
     private void addToEarliestSorting(Block b, ValueNode i, List<ValueNode> sortedInstructions, NodeBitMap visited) {
         ValueNode instruction = i;
         while (true) {
-            if (instruction == null || visited.isMarked(instruction) || cfg.getNodeToBlock().get(instruction) != b || instruction instanceof PhiNode) {
+            if (instruction == null || visited.isMarked(instruction) || cfg.getNodeToBlock().get(instruction) != b || instruction instanceof PhiNode || instruction instanceof ProxyNode) {
                 return;
             }
 
@@ -1139,11 +1137,7 @@
                 if (usage instanceof VirtualState) {
                     // only fixed nodes can have VirtualState -> no need to schedule them
                 } else {
-                    if (instruction instanceof LoopExitNode && usage instanceof ProxyNode) {
-                        // value proxies should be scheduled before the loopexit, not after
-                    } else {
-                        addToEarliestSorting(b, (ValueNode) usage, sortedInstructions, visited);
-                    }
+                    addToEarliestSorting(b, (ValueNode) usage, sortedInstructions, visited);
                 }
             }
 
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/GraphOrder.java	Thu Jan 29 00:12:30 2015 +0000
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/GraphOrder.java	Thu Jan 29 00:12:55 2015 +0000
@@ -180,13 +180,17 @@
                                 loopEntryStates.put((LoopBeginNode) node, currentState.copy());
                             }
                         } else if (node instanceof ProxyNode) {
-                            for (Node input : node.inputs()) {
-                                if (input != ((ProxyNode) node).proxyPoint()) {
-                                    assert currentState.isMarked(input) : input + " not available at " + node + " in block " + block + "\n" + list;
-                                }
-                            }
+                            assert false : "proxy nodes should not be in the schedule";
                         } else if (node instanceof LoopExitNode) {
                             if (graph.hasValueProxies()) {
+                                for (ProxyNode proxy : ((LoopExitNode) node).proxies()) {
+                                    for (Node input : proxy.inputs()) {
+                                        if (input != proxy.proxyPoint()) {
+                                            assert currentState.isMarked(input) : input + " not available at " + proxy + " in block " + block + "\n" + list;
+                                        }
+                                    }
+                                }
+
                                 // loop contents are only accessible via proxies at the exit
                                 currentState.clearAll();
                                 currentState.markAll(loopEntryStates.get(((LoopExitNode) node).loopBegin()));
--- a/src/share/vm/graal/graalRuntime.cpp	Thu Jan 29 00:12:30 2015 +0000
+++ b/src/share/vm/graal/graalRuntime.cpp	Thu Jan 29 00:12:55 2015 +0000
@@ -38,7 +38,6 @@
 #include "runtime/reflection.hpp"
 #include "utilities/debug.hpp"
 
-address GraalRuntime::_external_deopt_i2c_entry = NULL;
 jobject GraalRuntime::_HotSpotGraalRuntime_instance = NULL;
 bool GraalRuntime::_HotSpotGraalRuntime_initialized = false;
 bool GraalRuntime::_shutdown_called = false;
@@ -60,13 +59,6 @@
 
     graal_compute_offsets();
 
-#ifdef TARGET_ARCH_x86
-#ifdef _LP64
-    // Only supported on x86_64 for now
-    _external_deopt_i2c_entry = create_external_deopt_i2c();
-#endif
-#endif
-
     // Ensure _non_oop_bits is initialized
     Universe::non_oop_word();
 
@@ -89,39 +81,6 @@
   return buffer_blob;
 }
 
-address GraalRuntime::create_external_deopt_i2c() {
-  ResourceMark rm;
-  BufferBlob* buffer = BufferBlob::create("externalDeopt", 1*K);
-  CodeBuffer cb(buffer);
-  short buffer_locs[20];
-  cb.insts()->initialize_shared_locs((relocInfo*)buffer_locs, sizeof(buffer_locs)/sizeof(relocInfo));
-  MacroAssembler masm(&cb);
-
-  int total_args_passed = 6;
-
-  BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_args_passed);
-  VMRegPair* regs   = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed);
-  int i = 0;
-  sig_bt[i++] = T_INT;
-  sig_bt[i++] = T_LONG;
-  sig_bt[i++] = T_VOID; // long stakes 2 slots
-  sig_bt[i++] = T_INT;
-  sig_bt[i++] = T_OBJECT;
-  sig_bt[i++] = T_INT; // The number of actual arguments passed to the method.
-
-  int comp_args_on_stack = SharedRuntime::java_calling_convention(sig_bt, regs, total_args_passed, false);
-
-  SharedRuntime::gen_i2c_adapter(&masm, total_args_passed, comp_args_on_stack, sig_bt, regs, total_args_passed - 1);
-  masm.flush();
-
-  AdapterBlob* adapter = AdapterBlob::create(&cb);
-  if (PrintAdapterHandlers) {
-    tty->print_cr("Decoding external_deopt_i2c");
-    Disassembler::decode(adapter->code_begin(), adapter->code_end());
-  }
-  return adapter->code_begin();
-}
-
 BasicType GraalRuntime::kindToBasicType(jchar ch) {
   switch(ch) {
     case 'z': return T_BOOLEAN;
--- a/src/share/vm/graal/graalRuntime.hpp	Thu Jan 29 00:12:30 2015 +0000
+++ b/src/share/vm/graal/graalRuntime.hpp	Thu Jan 29 00:12:55 2015 +0000
@@ -33,7 +33,6 @@
 
   static jobject _HotSpotGraalRuntime_instance;
   static bool _HotSpotGraalRuntime_initialized;
-  static address _external_deopt_i2c_entry;
   static const char* _generated_sources_sha1;
 
   static bool _shutdown_called;
@@ -222,11 +221,6 @@
   static bool parse_arguments(KlassHandle hotSpotOptionsClass, TRAPS);
 
   static BasicType kindToBasicType(jchar ch);
-  static address create_external_deopt_i2c();
-  static address get_external_deopt_i2c_entry() {
-    guarantee(_external_deopt_i2c_entry != NULL, "unsupported");
-    return _external_deopt_i2c_entry;
-  }
 
   // The following routines are all called from compiled Graal code