< prev index next >
src/hotspot/share/opto/graphKit.cpp
Print this page
*** 1770,1787 ****
} else {
// Pass value type argument via oop to callee
arg = vt->allocate(this)->get_oop();
}
} else if (t->is_valuetypeptr()) {
// Constant null passed for a value type argument
assert(arg->bottom_type()->remove_speculative() == TypePtr::NULL_PTR, "Anything other than null?");
- ciMethod* declared_method = method()->get_method_at_bci(bci());
int arg_size = declared_method->signature()->arg_size_for_bc(java_bc());
inc_sp(arg_size); // restore arguments
uncommon_trap(Deoptimization::Reason_null_check, Deoptimization::Action_none);
return;
}
call->init_req(idx, arg);
idx++;
}
}
--- 1770,1795 ----
} else {
// Pass value type argument via oop to callee
arg = vt->allocate(this)->get_oop();
}
} else if (t->is_valuetypeptr()) {
+ ciMethod* declared_method = method()->get_method_at_bci(bci());
+ if (arg->is_ValueTypePtr()) {
+ // We are calling an Object method with a value type receiver
+ ValueTypePtrNode* vt = arg->isa_ValueTypePtr();
+ assert(i == TypeFunc::Parms && !declared_method->is_static(), "argument must be receiver");
+ assert(vt->is_allocated(&gvn()), "argument must be allocated");
+ arg = vt->get_oop();
+ } else {
// Constant null passed for a value type argument
assert(arg->bottom_type()->remove_speculative() == TypePtr::NULL_PTR, "Anything other than null?");
int arg_size = declared_method->signature()->arg_size_for_bc(java_bc());
inc_sp(arg_size); // restore arguments
uncommon_trap(Deoptimization::Reason_null_check, Deoptimization::Action_none);
return;
}
+ }
call->init_req(idx, arg);
idx++;
}
}
*** 3409,3418 ****
--- 3417,3434 ----
if (stopped()) // Dead monitor?
return NULL;
assert(dead_locals_are_killed(), "should kill locals before sync. point");
+ // We cannot lock on a value type
+ if (obj->is_ValueTypeBase()) {
+ inc_sp(1);
+ uncommon_trap(Deoptimization::Reason_class_check, Deoptimization::Action_none);
+ dec_sp(1);
+ return NULL;
+ }
+
// Box the stack location
Node* box = _gvn.transform(new BoxLockNode(next_monitor()));
Node* mem = reset_memory();
FastLockNode * flock = _gvn.transform(new FastLockNode(0, obj, box) )->as_FastLock();
*** 3476,3485 ****
--- 3492,3502 ----
return;
if (stopped()) { // Dead monitor?
map()->pop_monitor(); // Kill monitor from debug info
return;
}
+ assert(!obj->is_ValueTypeBase(), "should not unlock on value type");
// Memory barrier to avoid floating things down past the locked region
insert_mem_bar(Op_MemBarReleaseLock);
const TypeFunc *tf = OptoRuntime::complete_monitor_exit_Type();
< prev index next >