Mercurial > hg > truffle
comparison src/share/vm/graal/graalCodeInstaller.cpp @ 9359:44e05c9afb54
replaced definition of SLOT_PER_WORD with use of VMRegImpl::slots_per_word
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Sat, 27 Apr 2013 10:13:10 +0200 |
parents | 0266549ff6e0 |
children | 18632807db02 |
comparison
equal
deleted
inserted
replaced
9358:f1ffa0639a2a | 9359:44e05c9afb54 |
---|---|
79 static int bitset_size(oop bitset) { | 79 static int bitset_size(oop bitset) { |
80 arrayOop arr = (arrayOop) BitSet::words(bitset); | 80 arrayOop arr = (arrayOop) BitSet::words(bitset); |
81 return arr->length() * MapWordBits; | 81 return arr->length() * MapWordBits; |
82 } | 82 } |
83 | 83 |
84 #ifdef _LP64 | |
85 #define SLOTS_PER_WORD 2 | |
86 #else | |
87 #define SLOTS_PER_WORD 1 | |
88 #endif // _LP64 | |
89 | |
90 // creates a HotSpot oop map out of the byte arrays provided by DebugInfo | 84 // creates a HotSpot oop map out of the byte arrays provided by DebugInfo |
91 static OopMap* create_oop_map(jint total_frame_size, jint parameter_count, oop debug_info) { | 85 static OopMap* create_oop_map(jint total_frame_size, jint parameter_count, oop debug_info) { |
92 OopMap* map = new OopMap(total_frame_size, parameter_count); | 86 OopMap* map = new OopMap(total_frame_size, parameter_count); |
93 oop register_map = (oop) DebugInfo::registerRefMap(debug_info); | 87 oop register_map = (oop) DebugInfo::registerRefMap(debug_info); |
94 oop frame_map = (oop) DebugInfo::frameRefMap(debug_info); | 88 oop frame_map = (oop) DebugInfo::frameRefMap(debug_info); |
107 } | 101 } |
108 | 102 |
109 for (jint i = 0; i < bitset_size(frame_map); i++) { | 103 for (jint i = 0; i < bitset_size(frame_map); i++) { |
110 bool is_oop = is_bit_set(frame_map, i); | 104 bool is_oop = is_bit_set(frame_map, i); |
111 // HotSpot stack slots are 4 bytes | 105 // HotSpot stack slots are 4 bytes |
112 VMReg reg = VMRegImpl::stack2reg(i * SLOTS_PER_WORD); | 106 VMReg reg = VMRegImpl::stack2reg(i * VMRegImpl::slots_per_word); |
113 if (is_oop) { | 107 if (is_oop) { |
114 map->set_oop(reg); | 108 map->set_oop(reg); |
115 } else { | 109 } else { |
116 map->set_value(reg); | 110 map->set_value(reg); |
117 } | 111 } |
124 oop graal_reg = registers->obj_at(i); | 118 oop graal_reg = registers->obj_at(i); |
125 jint graal_reg_number = code_Register::number(graal_reg); | 119 jint graal_reg_number = code_Register::number(graal_reg); |
126 VMReg hotspot_reg = get_hotspot_reg(graal_reg_number); | 120 VMReg hotspot_reg = get_hotspot_reg(graal_reg_number); |
127 // HotSpot stack slots are 4 bytes | 121 // HotSpot stack slots are 4 bytes |
128 jint graal_slot = ((jint*) slots->base(T_INT))[i]; | 122 jint graal_slot = ((jint*) slots->base(T_INT))[i]; |
129 jint hotspot_slot = graal_slot * SLOTS_PER_WORD; | 123 jint hotspot_slot = graal_slot * VMRegImpl::slots_per_word; |
130 VMReg hotspot_slot_as_reg = VMRegImpl::stack2reg(hotspot_slot); | 124 VMReg hotspot_slot_as_reg = VMRegImpl::stack2reg(hotspot_slot); |
131 map->set_callee_saved(hotspot_slot_as_reg, hotspot_reg); | 125 map->set_callee_saved(hotspot_slot_as_reg, hotspot_reg); |
132 #ifdef _LP64 | 126 #ifdef _LP64 |
133 // (copied from generate_oop_map() in c1_Runtime1_x86.cpp) | 127 // (copied from generate_oop_map() in c1_Runtime1_x86.cpp) |
134 VMReg hotspot_slot_hi_as_reg = VMRegImpl::stack2reg(hotspot_slot + 1); | 128 VMReg hotspot_slot_hi_as_reg = VMRegImpl::stack2reg(hotspot_slot + 1); |