diff src/share/vm/opto/chaitin.hpp @ 22815:9df0d8f65fea

8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init> Summary: Use MachMerge to hook together defs of the same multidef value in a block Reviewed-by: kvn, vlivanov
author iveresov
date Tue, 20 Jan 2015 13:56:02 -0800
parents 55fb97c4c58d
children dd9cc155639c
line wrap: on
line diff
--- a/src/share/vm/opto/chaitin.hpp	Mon Jan 12 15:24:29 2015 +0100
+++ b/src/share/vm/opto/chaitin.hpp	Tue Jan 20 13:56:02 2015 -0800
@@ -578,6 +578,32 @@
   // Extend the node to LRG mapping
   void add_reference( const Node *node, const Node *old_node);
 
+  // Record the first use of a def in the block for a register.
+  class RegDefUse {
+    Node* _def;
+    Node* _first_use;
+  public:
+    RegDefUse() : _def(NULL), _first_use(NULL) { }
+    Node* def() const       { return _def;       }
+    Node* first_use() const { return _first_use; }
+
+    void update(Node* def, Node* use) {
+      if (_def != def) {
+        _def = def;
+        _first_use = use;
+      }
+    }
+    void clear() {
+      _def = NULL;
+      _first_use = NULL;
+    }
+  };
+  typedef GrowableArray<RegDefUse> RegToDefUseMap;
+  int possibly_merge_multidef(Node *n, uint k, Block *block, RegToDefUseMap& reg2defuse);
+
+  // Merge nodes that are a part of a multidef lrg and produce the same value within a block.
+  void merge_multidefs();
+
 private:
 
   static int _final_loads, _final_stores, _final_copies, _final_memoves;