comparison src/share/vm/runtime/sharedRuntime.cpp @ 6790:2cb2f30450c7

7196262: JSR 292: java/lang/invoke/PrivateInvokeTest.java fails on solaris-sparc Reviewed-by: kvn, jrose, bdelsart
author twisti
date Mon, 17 Sep 2012 12:57:58 -0700
parents da91efe96a93
children 137868b7aa6f
comparison
equal deleted inserted replaced
6749:a6fe94b9759f 6790:2cb2f30450c7
1615 } 1615 }
1616 #endif 1616 #endif
1617 1617
1618 return callee_method; 1618 return callee_method;
1619 } 1619 }
1620
1621 #ifdef ASSERT
1622 void SharedRuntime::check_member_name_argument_is_last_argument(methodHandle method,
1623 const BasicType* sig_bt,
1624 const VMRegPair* regs) {
1625 ResourceMark rm;
1626 const int total_args_passed = method->size_of_parameters();
1627 const VMRegPair* regs_with_member_name = regs;
1628 VMRegPair* regs_without_member_name = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed - 1);
1629
1630 const int member_arg_pos = total_args_passed - 1;
1631 assert(member_arg_pos >= 0 && member_arg_pos < total_args_passed, "oob");
1632 assert(sig_bt[member_arg_pos] == T_OBJECT, "dispatch argument must be an object");
1633
1634 const bool is_outgoing = method->is_method_handle_intrinsic();
1635 int comp_args_on_stack = java_calling_convention(sig_bt, regs_without_member_name, total_args_passed - 1, is_outgoing);
1636
1637 for (int i = 0; i < member_arg_pos; i++) {
1638 VMReg a = regs_with_member_name[i].first();
1639 VMReg b = regs_without_member_name[i].first();
1640 assert(a->value() == b->value(), err_msg_res("register allocation mismatch: a=%d, b=%d", a->value(), b->value()));
1641 }
1642 assert(regs_with_member_name[member_arg_pos].first()->is_valid(), "bad member arg");
1643 }
1644 #endif
1620 1645
1621 // --------------------------------------------------------------------------- 1646 // ---------------------------------------------------------------------------
1622 // We are calling the interpreter via a c2i. Normally this would mean that 1647 // We are calling the interpreter via a c2i. Normally this would mean that
1623 // we were called by a compiled method. However we could have lost a race 1648 // we were called by a compiled method. However we could have lost a race
1624 // where we went int -> i2c -> c2i and so the caller could in fact be 1649 // where we went int -> i2c -> c2i and so the caller could in fact be
2544 double locs_buf[20]; 2569 double locs_buf[20];
2545 buffer.insts()->initialize_shared_locs((relocInfo*)locs_buf, sizeof(locs_buf) / sizeof(relocInfo)); 2570 buffer.insts()->initialize_shared_locs((relocInfo*)locs_buf, sizeof(locs_buf) / sizeof(relocInfo));
2546 MacroAssembler _masm(&buffer); 2571 MacroAssembler _masm(&buffer);
2547 2572
2548 // Fill in the signature array, for the calling-convention call. 2573 // Fill in the signature array, for the calling-convention call.
2549 int total_args_passed = method->size_of_parameters(); 2574 const int total_args_passed = method->size_of_parameters();
2550 2575
2551 BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType,total_args_passed); 2576 BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_args_passed);
2552 VMRegPair* regs = NEW_RESOURCE_ARRAY(VMRegPair,total_args_passed); 2577 VMRegPair* regs = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed);
2553 int i=0; 2578 int i=0;
2554 if( !method->is_static() ) // Pass in receiver first 2579 if( !method->is_static() ) // Pass in receiver first
2555 sig_bt[i++] = T_OBJECT; 2580 sig_bt[i++] = T_OBJECT;
2556 SignatureStream ss(method->signature()); 2581 SignatureStream ss(method->signature());
2557 for( ; !ss.at_return_type(); ss.next()) { 2582 for( ; !ss.at_return_type(); ss.next()) {
2558 sig_bt[i++] = ss.type(); // Collect remaining bits of signature 2583 sig_bt[i++] = ss.type(); // Collect remaining bits of signature
2559 if( ss.type() == T_LONG || ss.type() == T_DOUBLE ) 2584 if( ss.type() == T_LONG || ss.type() == T_DOUBLE )
2560 sig_bt[i++] = T_VOID; // Longs & doubles take 2 Java slots 2585 sig_bt[i++] = T_VOID; // Longs & doubles take 2 Java slots
2561 } 2586 }
2562 assert( i==total_args_passed, "" ); 2587 assert(i == total_args_passed, "");
2563 BasicType ret_type = ss.type(); 2588 BasicType ret_type = ss.type();
2564 2589
2565 // Now get the compiled-Java layout as input (or output) arguments. 2590 // Now get the compiled-Java layout as input (or output) arguments.
2566 // NOTE: Stubs for compiled entry points of method handle intrinsics 2591 // NOTE: Stubs for compiled entry points of method handle intrinsics
2567 // are just trampolines so the argument registers must be outgoing ones. 2592 // are just trampolines so the argument registers must be outgoing ones.
2570 2595
2571 // Generate the compiled-to-native wrapper code 2596 // Generate the compiled-to-native wrapper code
2572 nm = SharedRuntime::generate_native_wrapper(&_masm, 2597 nm = SharedRuntime::generate_native_wrapper(&_masm,
2573 method, 2598 method,
2574 compile_id, 2599 compile_id,
2575 total_args_passed, 2600 sig_bt,
2576 comp_args_on_stack, 2601 regs,
2577 sig_bt,regs,
2578 ret_type); 2602 ret_type);
2579 } 2603 }
2580 } 2604 }
2581 2605
2582 // Must unlock before calling set_code 2606 // Must unlock before calling set_code