Mercurial > hg > graal-jvmci-8
comparison src/cpu/sparc/vm/c1_Runtime1_sparc.cpp @ 14422:2b8e28fdf503
Merge
author | kvn |
---|---|
date | Tue, 05 Nov 2013 17:38:04 -0800 |
parents | 252d541466ea |
children | de6a9e811145 |
comparison
equal
deleted
inserted
replaced
14421:3068270ba476 | 14422:2b8e28fdf503 |
---|---|
35 #include "runtime/sharedRuntime.hpp" | 35 #include "runtime/sharedRuntime.hpp" |
36 #include "runtime/signature.hpp" | 36 #include "runtime/signature.hpp" |
37 #include "runtime/vframeArray.hpp" | 37 #include "runtime/vframeArray.hpp" |
38 #include "utilities/macros.hpp" | 38 #include "utilities/macros.hpp" |
39 #include "vmreg_sparc.inline.hpp" | 39 #include "vmreg_sparc.inline.hpp" |
40 #if INCLUDE_ALL_GCS | |
41 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" | |
42 #endif | |
40 | 43 |
41 // Implementation of StubAssembler | 44 // Implementation of StubAssembler |
42 | 45 |
43 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry_point, int number_of_arguments) { | 46 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry_point, int number_of_arguments) { |
44 // for sparc changing the number of arguments doesn't change | 47 // for sparc changing the number of arguments doesn't change |
399 __ save_frame(0); | 402 __ save_frame(0); |
400 | 403 |
401 if (id == fast_new_instance_init_check_id) { | 404 if (id == fast_new_instance_init_check_id) { |
402 // make sure the klass is initialized | 405 // make sure the klass is initialized |
403 __ ldub(G5_klass, in_bytes(InstanceKlass::init_state_offset()), G3_t1); | 406 __ ldub(G5_klass, in_bytes(InstanceKlass::init_state_offset()), G3_t1); |
404 __ cmp_and_br_short(G3_t1, InstanceKlass::fully_initialized, Assembler::notEqual, Assembler::pn, slow_path); | 407 __ cmp(G3_t1, InstanceKlass::fully_initialized); |
408 __ br(Assembler::notEqual, false, Assembler::pn, slow_path); | |
409 __ delayed()->nop(); | |
405 } | 410 } |
406 #ifdef ASSERT | 411 #ifdef ASSERT |
407 // assert object can be fast path allocated | 412 // assert object can be fast path allocated |
408 { | 413 { |
409 Label ok, not_ok; | 414 Label ok, not_ok; |
510 Register O1_t2 = O1; | 515 Register O1_t2 = O1; |
511 assert_different_registers(G5_klass, G4_length, G1_arr_size, G3_t1, O1_t2); | 516 assert_different_registers(G5_klass, G4_length, G1_arr_size, G3_t1, O1_t2); |
512 | 517 |
513 // check that array length is small enough for fast path | 518 // check that array length is small enough for fast path |
514 __ set(C1_MacroAssembler::max_array_allocation_length, G3_t1); | 519 __ set(C1_MacroAssembler::max_array_allocation_length, G3_t1); |
515 __ cmp_and_br_short(G4_length, G3_t1, Assembler::greaterUnsigned, Assembler::pn, slow_path); | 520 __ cmp(G4_length, G3_t1); |
521 __ br(Assembler::greaterUnsigned, false, Assembler::pn, slow_path); | |
522 __ delayed()->nop(); | |
516 | 523 |
517 // if we got here then the TLAB allocation failed, so try | 524 // if we got here then the TLAB allocation failed, so try |
518 // refilling the TLAB or allocating directly from eden. | 525 // refilling the TLAB or allocating directly from eden. |
519 Label retry_tlab, try_eden; | 526 Label retry_tlab, try_eden; |
520 __ tlab_refill(retry_tlab, try_eden, slow_path); // preserves G4_length and G5_klass | 527 __ tlab_refill(retry_tlab, try_eden, slow_path); // preserves G4_length and G5_klass |
802 { __ set_info("load_mirror_patching", dont_gc_arguments); | 809 { __ set_info("load_mirror_patching", dont_gc_arguments); |
803 oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching)); | 810 oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching)); |
804 } | 811 } |
805 break; | 812 break; |
806 | 813 |
814 case load_appendix_patching_id: | |
815 { __ set_info("load_appendix_patching", dont_gc_arguments); | |
816 oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_appendix_patching)); | |
817 } | |
818 break; | |
819 | |
807 case dtrace_object_alloc_id: | 820 case dtrace_object_alloc_id: |
808 { // O0: object | 821 { // O0: object |
809 __ set_info("dtrace_object_alloc", dont_gc_arguments); | 822 __ set_info("dtrace_object_alloc", dont_gc_arguments); |
810 // we can't gc here so skip the oopmap but make sure that all | 823 // we can't gc here so skip the oopmap but make sure that all |
811 // the live registers get saved. | 824 // the live registers get saved. |
904 Register cardtable = G5; | 917 Register cardtable = G5; |
905 Register tmp = G1_scratch; | 918 Register tmp = G1_scratch; |
906 Register tmp2 = G3_scratch; | 919 Register tmp2 = G3_scratch; |
907 jbyte* byte_map_base = ((CardTableModRefBS*)bs)->byte_map_base; | 920 jbyte* byte_map_base = ((CardTableModRefBS*)bs)->byte_map_base; |
908 | 921 |
909 Label not_already_dirty, restart, refill; | 922 Label not_already_dirty, restart, refill, young_card; |
910 | 923 |
911 #ifdef _LP64 | 924 #ifdef _LP64 |
912 __ srlx(addr, CardTableModRefBS::card_shift, addr); | 925 __ srlx(addr, CardTableModRefBS::card_shift, addr); |
913 #else | 926 #else |
914 __ srl(addr, CardTableModRefBS::card_shift, addr); | 927 __ srl(addr, CardTableModRefBS::card_shift, addr); |
916 | 929 |
917 AddressLiteral rs(byte_map_base); | 930 AddressLiteral rs(byte_map_base); |
918 __ set(rs, cardtable); // cardtable := <card table base> | 931 __ set(rs, cardtable); // cardtable := <card table base> |
919 __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable] | 932 __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable] |
920 | 933 |
934 __ cmp_and_br_short(tmp, G1SATBCardTableModRefBS::g1_young_card_val(), Assembler::equal, Assembler::pt, young_card); | |
935 | |
936 __ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad)); | |
937 __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable] | |
938 | |
921 assert(CardTableModRefBS::dirty_card_val() == 0, "otherwise check this code"); | 939 assert(CardTableModRefBS::dirty_card_val() == 0, "otherwise check this code"); |
922 __ cmp_and_br_short(tmp, G0, Assembler::notEqual, Assembler::pt, not_already_dirty); | 940 __ cmp_and_br_short(tmp, G0, Assembler::notEqual, Assembler::pt, not_already_dirty); |
923 | 941 |
942 __ bind(young_card); | |
924 // We didn't take the branch, so we're already dirty: return. | 943 // We didn't take the branch, so we're already dirty: return. |
925 // Use return-from-leaf | 944 // Use return-from-leaf |
926 __ retl(); | 945 __ retl(); |
927 __ delayed()->nop(); | 946 __ delayed()->nop(); |
928 | 947 |
1059 default: ShouldNotReachHere(); | 1078 default: ShouldNotReachHere(); |
1060 } | 1079 } |
1061 | 1080 |
1062 __ verify_not_null_oop(Oexception); | 1081 __ verify_not_null_oop(Oexception); |
1063 | 1082 |
1083 #ifdef ASSERT | |
1084 // check that fields in JavaThread for exception oop and issuing pc are | |
1085 // empty before writing to them | |
1086 Label oop_empty; | |
1087 Register scratch = I7; // We can use I7 here because it's overwritten later anyway. | |
1088 __ ld_ptr(Address(G2_thread, JavaThread::exception_oop_offset()), scratch); | |
1089 __ br_null(scratch, false, Assembler::pt, oop_empty); | |
1090 __ delayed()->nop(); | |
1091 __ stop("exception oop already set"); | |
1092 __ bind(oop_empty); | |
1093 | |
1094 Label pc_empty; | |
1095 __ ld_ptr(Address(G2_thread, JavaThread::exception_pc_offset()), scratch); | |
1096 __ br_null(scratch, false, Assembler::pt, pc_empty); | |
1097 __ delayed()->nop(); | |
1098 __ stop("exception pc already set"); | |
1099 __ bind(pc_empty); | |
1100 #endif | |
1101 | |
1064 // save the exception and issuing pc in the thread | 1102 // save the exception and issuing pc in the thread |
1065 __ st_ptr(Oexception, G2_thread, in_bytes(JavaThread::exception_oop_offset())); | 1103 __ st_ptr(Oexception, G2_thread, in_bytes(JavaThread::exception_oop_offset())); |
1066 __ st_ptr(Oissuing_pc, G2_thread, in_bytes(JavaThread::exception_pc_offset())); | 1104 __ st_ptr(Oissuing_pc, G2_thread, in_bytes(JavaThread::exception_pc_offset())); |
1067 | 1105 |
1068 // use the throwing pc as the return address to lookup (has bci & oop map) | 1106 // use the throwing pc as the return address to lookup (has bci & oop map) |