comparison src/cpu/sparc/vm/sharedRuntime_sparc.cpp @ 18041:52b4284cb496

Merge with jdk8u20-b26
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 16:02:50 +0200
parents 89152779163c 0bf37f737702
children 2a69cbe850a8
comparison
equal deleted inserted replaced
17606:45d7b2c7029d 18041:52b4284cb496
1130 } 1130 }
1131 1131
1132 1132
1133 int SharedRuntime::c_calling_convention(const BasicType *sig_bt, 1133 int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
1134 VMRegPair *regs, 1134 VMRegPair *regs,
1135 VMRegPair *regs2,
1135 int total_args_passed) { 1136 int total_args_passed) {
1137 assert(regs2 == NULL, "not needed on sparc");
1136 1138
1137 // Return the number of VMReg stack_slots needed for the args. 1139 // Return the number of VMReg stack_slots needed for the args.
1138 // This value does not include an abi space (like register window 1140 // This value does not include an abi space (like register window
1139 // save area). 1141 // save area).
1140 1142
2108 // Now figure out where the args must be stored and how much stack space 2110 // Now figure out where the args must be stored and how much stack space
2109 // they require (neglecting out_preserve_stack_slots but space for storing 2111 // they require (neglecting out_preserve_stack_slots but space for storing
2110 // the 1st six register arguments). It's weird see int_stk_helper. 2112 // the 1st six register arguments). It's weird see int_stk_helper.
2111 // 2113 //
2112 int out_arg_slots; 2114 int out_arg_slots;
2113 out_arg_slots = c_calling_convention(out_sig_bt, out_regs, total_c_args); 2115 out_arg_slots = c_calling_convention(out_sig_bt, out_regs, NULL, total_c_args);
2114 2116
2115 if (is_critical_native) { 2117 if (is_critical_native) {
2116 // Critical natives may have to call out so they need a save area 2118 // Critical natives may have to call out so they need a save area
2117 // for register arguments. 2119 // for register arguments.
2118 int double_slots = 0; 2120 int double_slots = 0;
2709 } 2711 }
2710 2712
2711 if (!is_critical_native) { 2713 if (!is_critical_native) {
2712 // reset handle block 2714 // reset handle block
2713 __ ld_ptr(G2_thread, in_bytes(JavaThread::active_handles_offset()), L5); 2715 __ ld_ptr(G2_thread, in_bytes(JavaThread::active_handles_offset()), L5);
2714 __ st_ptr(G0, L5, JNIHandleBlock::top_offset_in_bytes()); 2716 __ st(G0, L5, JNIHandleBlock::top_offset_in_bytes());
2715 2717
2716 __ ld_ptr(G2_thread, in_bytes(Thread::pending_exception_offset()), G3_scratch); 2718 __ ld_ptr(G2_thread, in_bytes(Thread::pending_exception_offset()), G3_scratch);
2717 check_forward_pending_exception(masm, G3_scratch); 2719 check_forward_pending_exception(masm, G3_scratch);
2718 } 2720 }
2719 2721
2855 // Now figure out where the args must be stored and how much stack space 2857 // Now figure out where the args must be stored and how much stack space
2856 // they require (neglecting out_preserve_stack_slots but space for storing 2858 // they require (neglecting out_preserve_stack_slots but space for storing
2857 // the 1st six register arguments). It's weird see int_stk_helper. 2859 // the 1st six register arguments). It's weird see int_stk_helper.
2858 // 2860 //
2859 int out_arg_slots; 2861 int out_arg_slots;
2860 out_arg_slots = c_calling_convention(out_sig_bt, out_regs, total_c_args); 2862 out_arg_slots = c_calling_convention(out_sig_bt, out_regs, NULL, total_c_args);
2861 2863
2862 // Calculate the total number of stack slots we will need. 2864 // Calculate the total number of stack slots we will need.
2863 2865
2864 // First count the abi requirement plus all of the outgoing args 2866 // First count the abi requirement plus all of the outgoing args
2865 int stack_slots = SharedRuntime::out_preserve_stack_slots() + out_arg_slots; 2867 int stack_slots = SharedRuntime::out_preserve_stack_slots() + out_arg_slots;
3377 Register O2UnrollBlock = O2; 3379 Register O2UnrollBlock = O2;
3378 Register O3array = O3; 3380 Register O3array = O3;
3379 Register O4array_size = O4; 3381 Register O4array_size = O4;
3380 Label loop; 3382 Label loop;
3381 3383
3382 // Before we make new frames, check to see if stack is available. 3384 #ifdef ASSERT
3383 // Do this after the caller's return address is on top of stack 3385 // Compilers generate code that bang the stack by as much as the
3386 // interpreter would need. So this stack banging should never
3387 // trigger a fault. Verify that it does not on non product builds.
3384 if (UseStackBanging) { 3388 if (UseStackBanging) {
3385 // Get total frame size for interpreted frames 3389 // Get total frame size for interpreted frames
3386 __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes(), O4); 3390 __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes(), O4);
3387 __ bang_stack_size(O4, O3, G3_scratch); 3391 __ bang_stack_size(O4, O3, G3_scratch);
3388 } 3392 }
3393 #endif
3389 3394
3390 __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes(), O4array_size); 3395 __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes(), O4array_size);
3391 __ ld_ptr(O2UnrollBlock, Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes(), G3pcs); 3396 __ ld_ptr(O2UnrollBlock, Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes(), G3pcs);
3392 __ ld_ptr(O2UnrollBlock, Deoptimization::UnrollBlock::frame_sizes_offset_in_bytes(), O3array); 3397 __ ld_ptr(O2UnrollBlock, Deoptimization::UnrollBlock::frame_sizes_offset_in_bytes(), O3array);
3393 3398
3431 void SharedRuntime::generate_deopt_blob() { 3436 void SharedRuntime::generate_deopt_blob() {
3432 // allocate space for the code 3437 // allocate space for the code
3433 ResourceMark rm; 3438 ResourceMark rm;
3434 // setup code generation tools 3439 // setup code generation tools
3435 int pad = VerifyThread ? 512 : 0;// Extra slop space for more verify code 3440 int pad = VerifyThread ? 512 : 0;// Extra slop space for more verify code
3441 #ifdef ASSERT
3436 if (UseStackBanging) { 3442 if (UseStackBanging) {
3437 pad += StackShadowPages*16 + 32; 3443 pad += StackShadowPages*16 + 32;
3438 } 3444 }
3445 #endif
3439 #ifdef GRAAL 3446 #ifdef GRAAL
3440 pad += 1000; // Increase the buffer size when compiling for GRAAL 3447 pad += 1000; // Increase the buffer size when compiling for GRAAL
3441 #endif 3448 #endif
3442 #ifdef _LP64 3449 #ifdef _LP64
3443 CodeBuffer buffer("deopt_blob", 2100+pad+1000, 512); 3450 CodeBuffer buffer("deopt_blob", 2100+pad+1000, 512);
3733 void SharedRuntime::generate_uncommon_trap_blob() { 3740 void SharedRuntime::generate_uncommon_trap_blob() {
3734 // allocate space for the code 3741 // allocate space for the code
3735 ResourceMark rm; 3742 ResourceMark rm;
3736 // setup code generation tools 3743 // setup code generation tools
3737 int pad = VerifyThread ? 512 : 0; 3744 int pad = VerifyThread ? 512 : 0;
3745 #ifdef ASSERT
3738 if (UseStackBanging) { 3746 if (UseStackBanging) {
3739 pad += StackShadowPages*16 + 32; 3747 pad += StackShadowPages*16 + 32;
3740 } 3748 }
3749 #endif
3741 #ifdef _LP64 3750 #ifdef _LP64
3742 CodeBuffer buffer("uncommon_trap_blob", 2700+pad, 512); 3751 CodeBuffer buffer("uncommon_trap_blob", 2700+pad, 512);
3743 #else 3752 #else
3744 // Measured 8/7/03 at 660 in 32bit debug build (no VerifyThread) 3753 // Measured 8/7/03 at 660 in 32bit debug build (no VerifyThread)
3745 // Measured 8/7/03 at 1028 in 32bit debug build (VerifyThread) 3754 // Measured 8/7/03 at 1028 in 32bit debug build (VerifyThread)