changeset 59375:497fd9f9129c jdk-15+24

8245051: c1 is broken if it is compiled by gcc without -fno-lifetime-dse Summary: Initialize BlockBegin block id in constructor rather than operator new Reviewed-by: kbarrett, thartmann
author xliu
date Wed, 20 May 2020 11:29:11 -0700
parents a0d9d2e73ef2
children 8ef08563699c
files src/hotspot/share/c1/c1_Instruction.hpp src/hotspot/share/c1/c1_ValueMap.cpp
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/c1/c1_Instruction.hpp	Wed May 20 18:57:06 2020 +0100
+++ b/src/hotspot/share/c1/c1_Instruction.hpp	Wed May 20 11:29:11 2020 -0700
@@ -303,7 +303,6 @@
   XHandlers*   _exception_handlers;              // Flat list of exception handlers covering this instruction
 
   friend class UseCountComputer;
-  friend class BlockBegin;
 
   void update_exception_state(ValueStack* state);
 
@@ -349,7 +348,6 @@
   void* operator new(size_t size) throw() {
     Compilation* c = Compilation::current();
     void* res = c->arena()->Amalloc(size);
-    ((Instruction*)res)->_id = c->get_next_id();
     return res;
   }
 
@@ -410,7 +408,7 @@
 
   // creation
   Instruction(ValueType* type, ValueStack* state_before = NULL, bool type_is_constant = false)
-  :
+  : _id(Compilation::current()->get_next_id()),
 #ifndef PRODUCT
   _printable_bci(-99),
 #endif
@@ -1651,8 +1649,6 @@
    void* operator new(size_t size) throw() {
     Compilation* c = Compilation::current();
     void* res = c->arena()->Amalloc(size);
-    ((BlockBegin*)res)->_id = c->get_next_id();
-    ((BlockBegin*)res)->_block_id = c->get_next_block_id();
     return res;
   }
 
@@ -1664,6 +1660,7 @@
   // creation
   BlockBegin(int bci)
   : StateSplit(illegalType)
+  , _block_id(Compilation::current()->get_next_block_id())
   , _bci(bci)
   , _depth_first_number(-1)
   , _linear_scan_number(-1)
--- a/src/hotspot/share/c1/c1_ValueMap.cpp	Wed May 20 18:57:06 2020 +0100
+++ b/src/hotspot/share/c1/c1_ValueMap.cpp	Wed May 20 11:29:11 2020 -0700
@@ -488,6 +488,7 @@
   : _compilation(ir->compilation())
   , _current_map(NULL)
   , _value_maps(ir->linear_scan_order()->length(), ir->linear_scan_order()->length(), NULL)
+  , _has_substitutions(false)
 {
   TRACE_VALUE_NUMBERING(tty->print_cr("****** start of global value numbering"));