< prev index next >

src/hotspot/share/runtime/stackValue.cpp

Print this page

170     value.ji = (jint)((ConstantIntValue*)sv)->value();
171     return new StackValue(value.p);
172   } else if (sv->is_constant_oop()) {
173     // constant oop
174     return new StackValue(sv->as_ConstantOopReadValue()->value());
175 #ifdef _LP64
176   } else if (sv->is_constant_double()) {
177     // Constant double in a single stack slot
178     union { intptr_t p; double d; } value;
179     value.p = (intptr_t) CONST64(0xDEADDEAFDEADDEAF);
180     value.d = ((ConstantDoubleValue *)sv)->value();
181     return new StackValue(value.p);
182   } else if (sv->is_constant_long()) {
183     // Constant long in a single stack slot
184     union { intptr_t p; jlong jl; } value;
185     value.p = (intptr_t) CONST64(0xDEADDEAFDEADDEAF);
186     value.jl = ((ConstantLongValue *)sv)->value();
187     return new StackValue(value.p);
188 #endif
189   } else if (sv->is_object()) { // Scalar replaced object in compiled frame
190     Handle ov = ((ObjectValue *)sv)->value();
191     return new StackValue(ov, (ov.is_null()) ? 1 : 0);







192   } else if (sv->is_marker()) {
193     // Should never need to directly construct a marker.
194     ShouldNotReachHere();
195   }
196   // Unknown ScopeValue type
197   ShouldNotReachHere();
198   return new StackValue((intptr_t) 0);   // dummy
199 }
200 
201 
202 BasicLock* StackValue::resolve_monitor_lock(const frame* fr, Location location) {
203   assert(location.is_stack(), "for now we only look at the stack");
204   int word_offset = location.stack_offset() / wordSize;
205   // (stack picture)
206   // high: [     ]  word_offset + 1
207   // low   [     ]  word_offset
208   //
209   // sp->  [     ]  0
210   // the word_offset is the distance from the stack pointer to the lowest address
211   // The frame's original stack pointer, before any extension by its callee

170     value.ji = (jint)((ConstantIntValue*)sv)->value();
171     return new StackValue(value.p);
172   } else if (sv->is_constant_oop()) {
173     // constant oop
174     return new StackValue(sv->as_ConstantOopReadValue()->value());
175 #ifdef _LP64
176   } else if (sv->is_constant_double()) {
177     // Constant double in a single stack slot
178     union { intptr_t p; double d; } value;
179     value.p = (intptr_t) CONST64(0xDEADDEAFDEADDEAF);
180     value.d = ((ConstantDoubleValue *)sv)->value();
181     return new StackValue(value.p);
182   } else if (sv->is_constant_long()) {
183     // Constant long in a single stack slot
184     union { intptr_t p; jlong jl; } value;
185     value.p = (intptr_t) CONST64(0xDEADDEAFDEADDEAF);
186     value.jl = ((ConstantLongValue *)sv)->value();
187     return new StackValue(value.p);
188 #endif
189   } else if (sv->is_object()) { // Scalar replaced object in compiled frame
190     ObjectValue* ov = ((ObjectValue *)sv);
191     bool scalar_replaced = ov->value().is_null();
192     if (ov->maybe_null()) {
193       // Don't treat inline type as scalar replaced if it is null
194       intptr_t is_init_value = StackValue::create_stack_value(fr, reg_map, ov->is_init())->get_int();
195       jint is_init = (jint)*((jint*)&is_init_value);
196       scalar_replaced &= (is_init != 0);
197     }
198     return new StackValue(ov->value(), scalar_replaced ? 1 : 0);
199   } else if (sv->is_marker()) {
200     // Should never need to directly construct a marker.
201     ShouldNotReachHere();
202   }
203   // Unknown ScopeValue type
204   ShouldNotReachHere();
205   return new StackValue((intptr_t) 0);   // dummy
206 }
207 
208 
209 BasicLock* StackValue::resolve_monitor_lock(const frame* fr, Location location) {
210   assert(location.is_stack(), "for now we only look at the stack");
211   int word_offset = location.stack_offset() / wordSize;
212   // (stack picture)
213   // high: [     ]  word_offset + 1
214   // low   [     ]  word_offset
215   //
216   // sp->  [     ]  0
217   // the word_offset is the distance from the stack pointer to the lowest address
218   // The frame's original stack pointer, before any extension by its callee
< prev index next >