< prev index next >
src/share/vm/opto/graphKit.cpp
Print this page
rev 10512 : value type calling convention
@@ -1715,18 +1715,30 @@
//-------------------------set_arguments_for_java_call-------------------------
// Arguments (pre-popped from the stack) are taken from the JVMS.
void GraphKit::set_arguments_for_java_call(CallJavaNode* call) {
// Add the call arguments:
uint nargs = call->method()->arg_size();
- for (uint i = 0; i < nargs; i++) {
+ for (uint i = 0, idx = 0; i < nargs; i++) {
Node* arg = argument(i);
+ if (ValueTypePassFieldsAsArgs) {
+ if (arg->is_ValueType()) {
+ ValueTypeNode* vt = arg->as_ValueType();
+ // We don't pass value type arguments by reference but instead
+ // pass each field of the value type
+ idx += vt->set_arguments_for_java_call(call, idx + TypeFunc::Parms, *this);
+ } else {
+ call->init_req(idx + TypeFunc::Parms, arg);
+ idx++;
+ }
+ } else {
if (arg->is_ValueType()) {
// Pass value type argument via oop to callee
arg = arg->as_ValueType()->store_to_memory(this);
}
call->init_req(i + TypeFunc::Parms, arg);
}
+ }
}
//---------------------------set_edges_for_java_call---------------------------
// Connect a newly created call into the current JVMS.
// A return value node (if any) is returned from set_edges_for_java_call.
@@ -2125,13 +2137,13 @@
void GraphKit::round_double_arguments(ciMethod* dest_method) {
// (Note: TypeFunc::make has a cache that makes this fast.)
const TypeFunc* tf = TypeFunc::make(dest_method);
- int nargs = tf->domain()->cnt() - TypeFunc::Parms;
+ int nargs = tf->domain_sig()->cnt() - TypeFunc::Parms;
for (int j = 0; j < nargs; j++) {
- const Type *targ = tf->domain()->field_at(j + TypeFunc::Parms);
+ const Type *targ = tf->domain_sig()->field_at(j + TypeFunc::Parms);
if( targ->basic_type() == T_DOUBLE ) {
// If any parameters are doubles, they must be rounded before
// the call, dstore_rounding does gvn.transform
Node *arg = argument(j);
arg = dstore_rounding(arg);
@@ -2229,14 +2241,14 @@
void GraphKit::record_profiled_arguments_for_speculation(ciMethod* dest_method, Bytecodes::Code bc) {
if (!UseTypeSpeculation) {
return;
}
const TypeFunc* tf = TypeFunc::make(dest_method);
- int nargs = tf->domain()->cnt() - TypeFunc::Parms;
+ int nargs = tf->domain_sig()->cnt() - TypeFunc::Parms;
int skip = Bytecodes::has_receiver(bc) ? 1 : 0;
for (int j = skip, i = 0; j < nargs && i < TypeProfileArgsLimit; j++) {
- const Type *targ = tf->domain()->field_at(j + TypeFunc::Parms);
+ const Type *targ = tf->domain_sig()->field_at(j + TypeFunc::Parms);
if (targ->basic_type() == T_OBJECT || targ->basic_type() == T_ARRAY) {
bool maybe_null = true;
ciKlass* better_type = NULL;
if (method()->argument_profiled_type(bci(), i, better_type, maybe_null)) {
record_profile_for_speculation(argument(j), better_type, maybe_null);
< prev index next >