comparison src/share/vm/c1x/c1x_CodeInstaller.cpp @ 1470:ef7761803480

Fixes to get running again after C1X changes to pointer maps and register configuration.
author Thomas Wuerthinger <wuerthinger@ssw.jku.at>
date Tue, 23 Nov 2010 15:45:45 +0100
parents 52bb06250d35
children cd18e3072ea5
comparison
equal deleted inserted replaced
1469:52bb06250d35 1470:ef7761803480
45 return XMM_REGS[c1x_reg - NUM_CPU_REGS]->as_VMReg(); 45 return XMM_REGS[c1x_reg - NUM_CPU_REGS]->as_VMReg();
46 } 46 }
47 } 47 }
48 48
49 static bool is_bit_set(oop bit_map, int i) { 49 static bool is_bit_set(oop bit_map, int i) {
50 if (i < 64) { 50 const int MapWordBits = 64;
51 if (i < MapWordBits) {
51 jlong low = CiBitMap::low(bit_map); 52 jlong low = CiBitMap::low(bit_map);
52 return (low & (1 << i)) != 0; 53 return (low & (1L << i)) != 0;
53 } else { 54 } else {
54 const unsigned int MapWordBits = 64;
55 jint extra_idx = (i - MapWordBits) / MapWordBits; 55 jint extra_idx = (i - MapWordBits) / MapWordBits;
56 arrayOop extra = (arrayOop) CiBitMap::extra(bit_map); 56 arrayOop extra = (arrayOop) CiBitMap::extra(bit_map);
57 assert(extra_idx >= 0 && extra_idx < extra->length(), "unexpected index"); 57 assert(extra_idx >= 0 && extra_idx < extra->length(), "unexpected index");
58 jlong word = ((jlong*) extra->base(T_LONG))[extra_idx]; 58 jlong word = ((jlong*) extra->base(T_LONG))[extra_idx];
59 return (word & (1 << (i % MapWordBits))) != 0; 59 return (word & (1L << (i % MapWordBits))) != 0;
60 } 60 }
61 } 61 }
62 62
63 // creates a hotspot oop map out of the byte arrays provided by CiDebugInfo 63 // creates a hotspot oop map out of the byte arrays provided by CiDebugInfo
64 static OopMap* create_oop_map(jint frame_size, jint parameter_count, oop debug_info) { 64 static OopMap* create_oop_map(jint frame_size, jint parameter_count, oop debug_info) {
86 for (jint i = 0; i < frame_size / HeapWordSize; i++) { 86 for (jint i = 0; i < frame_size / HeapWordSize; i++) {
87 bool is_oop = is_bit_set(frame_map, i); 87 bool is_oop = is_bit_set(frame_map, i);
88 // hotspot stack slots are 4 bytes 88 // hotspot stack slots are 4 bytes
89 VMReg reg = VMRegImpl::stack2reg(i * 2); 89 VMReg reg = VMRegImpl::stack2reg(i * 2);
90 if (is_oop) { 90 if (is_oop) {
91 tty->print_cr("oop is set at %d (%d)", i, i*8);
91 map->set_oop(reg); 92 map->set_oop(reg);
92 } else { 93 } else {
93 map->set_value(reg); 94 map->set_value(reg);
94 } 95 }
95 } 96 }