RFC: Change uint8 to uint16_t for _num_regs

Leslie Zhai zhaixiang at loongson.cn
Thu Apr 1 05:20:25 UTC 2021


Hi,

When lrg.set_num_regs(305) for `MachProjNode::fat_proj`, the value `305` 
is out of range of `uint8`, then failed:

...

49 [S0-A7_H,F0-YOURARCH_FLAG], #305 EffDeg: 0 Def: N34 Cost:   1 Area:   
0 Score:1e+35 Fat Lo Bound Trivial

^---

DEBUG: lrg.compute_mask_size: 305, lrg.num_regs: 49, chunk: 0
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc: SuppressErrorAt=/chaitin.cpp:1388
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (.../hotspot/src/share/vm/opto/chaitin.cpp:1388), 
pid=21742, tid=0x000000ffe11931e0
#  assert(lrg.compute_mask_size() == lrg.num_regs() || lrg.num_regs() == 
2) failed: fat projs exactly color


Patch:

diff --git a/hotspot/src/share/vm/opto/chaitin.hpp 
b/hotspot/src/share/vm/opto/chaitin.hpp
index de6d443..94f66b8 100644
--- a/hotspot/src/share/vm/opto/chaitin.hpp
+++ b/hotspot/src/share/vm/opto/chaitin.hpp
@@ -136,7 +136,7 @@ public:

    // Number of registers this live range uses when it colors
  private:
-  uint8 _num_regs;              // 2 for Longs and Doubles, 1 for all else
+  uint16_t _num_regs;           // 2 for Longs and Doubles, 1 for all else
                                  // except _num_regs is kill count for 
fat_proj
  public:
    int num_regs() const { return _num_regs; }


Thanks,

Leslie Zhai



More information about the jdk8u-dev mailing list