Mercurial > hg > truffle
comparison src/cpu/ppc/vm/macroAssembler_ppc.cpp @ 20710:c5e86c5cd22e
8066964: ppc64: argument and return type profiling, fix problem with popframe
Reviewed-by: roland, kvn
author | goetz |
---|---|
date | Fri, 12 Dec 2014 08:48:56 +0100 |
parents | 327e7269f90d |
children |
comparison
equal
deleted
inserted
replaced
20709:28f116adb50c | 20710:c5e86c5cd22e |
---|---|
804 lfd(F31, offset, src); | 804 lfd(F31, offset, src); |
805 } | 805 } |
806 | 806 |
807 // For verify_oops. | 807 // For verify_oops. |
808 void MacroAssembler::save_volatile_gprs(Register dst, int offset) { | 808 void MacroAssembler::save_volatile_gprs(Register dst, int offset) { |
809 std(R2, offset, dst); offset += 8; | |
809 std(R3, offset, dst); offset += 8; | 810 std(R3, offset, dst); offset += 8; |
810 std(R4, offset, dst); offset += 8; | 811 std(R4, offset, dst); offset += 8; |
811 std(R5, offset, dst); offset += 8; | 812 std(R5, offset, dst); offset += 8; |
812 std(R6, offset, dst); offset += 8; | 813 std(R6, offset, dst); offset += 8; |
813 std(R7, offset, dst); offset += 8; | 814 std(R7, offset, dst); offset += 8; |
818 std(R12, offset, dst); | 819 std(R12, offset, dst); |
819 } | 820 } |
820 | 821 |
821 // For verify_oops. | 822 // For verify_oops. |
822 void MacroAssembler::restore_volatile_gprs(Register src, int offset) { | 823 void MacroAssembler::restore_volatile_gprs(Register src, int offset) { |
824 ld(R2, offset, src); offset += 8; | |
823 ld(R3, offset, src); offset += 8; | 825 ld(R3, offset, src); offset += 8; |
824 ld(R4, offset, src); offset += 8; | 826 ld(R4, offset, src); offset += 8; |
825 ld(R5, offset, src); offset += 8; | 827 ld(R5, offset, src); offset += 8; |
826 ld(R6, offset, src); offset += 8; | 828 ld(R6, offset, src); offset += 8; |
827 ld(R7, offset, src); offset += 8; | 829 ld(R7, offset, src); offset += 8; |
1181 bool check_exceptions) { | 1183 bool check_exceptions) { |
1182 // R3_ARG1 is reserved for the thread | 1184 // R3_ARG1 is reserved for the thread |
1183 mr_if_needed(R4_ARG2, arg_1); | 1185 mr_if_needed(R4_ARG2, arg_1); |
1184 assert(arg_2 != R4_ARG2, "smashed argument"); | 1186 assert(arg_2 != R4_ARG2, "smashed argument"); |
1185 mr_if_needed(R5_ARG3, arg_2); | 1187 mr_if_needed(R5_ARG3, arg_2); |
1188 call_VM(oop_result, entry_point, check_exceptions); | |
1189 } | |
1190 | |
1191 void MacroAssembler::call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, Register arg_3, | |
1192 bool check_exceptions) { | |
1193 // R3_ARG1 is reserved for the thread | |
1194 mr_if_needed(R4_ARG2, arg_1); | |
1195 assert(arg_2 != R4_ARG2, "smashed argument"); | |
1196 mr_if_needed(R5_ARG3, arg_2); | |
1197 mr_if_needed(R6_ARG4, arg_3); | |
1186 call_VM(oop_result, entry_point, check_exceptions); | 1198 call_VM(oop_result, entry_point, check_exceptions); |
1187 } | 1199 } |
1188 | 1200 |
1189 void MacroAssembler::call_VM_leaf(address entry_point) { | 1201 void MacroAssembler::call_VM_leaf(address entry_point) { |
1190 call_VM_leaf_base(entry_point); | 1202 call_VM_leaf_base(entry_point); |
3056 // READ: oop. KILL: R0. Volatile floats perhaps. | 3068 // READ: oop. KILL: R0. Volatile floats perhaps. |
3057 void MacroAssembler::verify_oop(Register oop, const char* msg) { | 3069 void MacroAssembler::verify_oop(Register oop, const char* msg) { |
3058 if (!VerifyOops) { | 3070 if (!VerifyOops) { |
3059 return; | 3071 return; |
3060 } | 3072 } |
3061 // Will be preserved. | 3073 |
3062 Register tmp = R11; | |
3063 assert(oop != tmp, "precondition"); | |
3064 unsigned int nbytes_save = 10*8; // 10 volatile gprs | |
3065 address/* FunctionDescriptor** */fd = StubRoutines::verify_oop_subroutine_entry_address(); | 3074 address/* FunctionDescriptor** */fd = StubRoutines::verify_oop_subroutine_entry_address(); |
3066 // save tmp | 3075 const Register tmp = R11; // Will be preserved. |
3067 mr(R0, tmp); | 3076 const int nbytes_save = 11*8; // Volatile gprs except R0. |
3068 // kill tmp | 3077 save_volatile_gprs(R1_SP, -nbytes_save); // except R0 |
3069 save_LR_CR(tmp); | 3078 |
3079 if (oop == tmp) mr(R4_ARG2, oop); | |
3080 save_LR_CR(tmp); // save in old frame | |
3070 push_frame_reg_args(nbytes_save, tmp); | 3081 push_frame_reg_args(nbytes_save, tmp); |
3071 // restore tmp | |
3072 mr(tmp, R0); | |
3073 save_volatile_gprs(R1_SP, 112); // except R0 | |
3074 // load FunctionDescriptor** / entry_address * | 3082 // load FunctionDescriptor** / entry_address * |
3075 load_const(tmp, fd); | 3083 load_const_optimized(tmp, fd, R0); |
3076 // load FunctionDescriptor* / entry_address | 3084 // load FunctionDescriptor* / entry_address |
3077 ld(tmp, 0, tmp); | 3085 ld(tmp, 0, tmp); |
3078 mr(R4_ARG2, oop); | 3086 if (oop != tmp) mr_if_needed(R4_ARG2, oop); |
3079 load_const(R3_ARG1, (address)msg); | 3087 load_const_optimized(R3_ARG1, (address)msg, R0); |
3080 // call destination for its side effect | 3088 // Call destination for its side effect. |
3081 call_c(tmp); | 3089 call_c(tmp); |
3082 restore_volatile_gprs(R1_SP, 112); // except R0 | 3090 |
3083 pop_frame(); | 3091 pop_frame(); |
3084 // save tmp | |
3085 mr(R0, tmp); | |
3086 // kill tmp | |
3087 restore_LR_CR(tmp); | 3092 restore_LR_CR(tmp); |
3088 // restore tmp | 3093 restore_volatile_gprs(R1_SP, -nbytes_save); // except R0 |
3089 mr(tmp, R0); | |
3090 } | 3094 } |
3091 | 3095 |
3092 const char* stop_types[] = { | 3096 const char* stop_types[] = { |
3093 "stop", | 3097 "stop", |
3094 "untested", | 3098 "untested", |