src/cpu/sparc/vm/templateTable_sparc.cpp

changeset 1861
2338d41fbd81
parent 1858
c640000b7cc1
child 1907
c18cbe5936b8
child 1920
ab102d5d923e
equal deleted inserted replaced
1860:0c5b3cf3c1f5 1861:2338d41fbd81
578 } 578 }
579 579
580 580
581 void TemplateTable::iload(int n) { 581 void TemplateTable::iload(int n) {
582 transition(vtos, itos); 582 transition(vtos, itos);
583 debug_only(__ verify_local_tag(frame::TagValue, Llocals, Otos_i, n));
584 __ ld( Llocals, Interpreter::local_offset_in_bytes(n), Otos_i ); 583 __ ld( Llocals, Interpreter::local_offset_in_bytes(n), Otos_i );
585 } 584 }
586 585
587 586
588 void TemplateTable::lload(int n) { 587 void TemplateTable::lload(int n) {
589 transition(vtos, ltos); 588 transition(vtos, ltos);
590 assert(n+1 < Argument::n_register_parameters, "would need more code"); 589 assert(n+1 < Argument::n_register_parameters, "would need more code");
591 debug_only(__ verify_local_tag(frame::TagCategory2, Llocals, Otos_l, n));
592 __ load_unaligned_long(Llocals, Interpreter::local_offset_in_bytes(n+1), Otos_l); 590 __ load_unaligned_long(Llocals, Interpreter::local_offset_in_bytes(n+1), Otos_l);
593 } 591 }
594 592
595 593
596 void TemplateTable::fload(int n) { 594 void TemplateTable::fload(int n) {
597 transition(vtos, ftos); 595 transition(vtos, ftos);
598 assert(n < Argument::n_register_parameters, "would need more code"); 596 assert(n < Argument::n_register_parameters, "would need more code");
599 debug_only(__ verify_local_tag(frame::TagValue, Llocals, G3_scratch, n));
600 __ ldf( FloatRegisterImpl::S, Llocals, Interpreter::local_offset_in_bytes(n), Ftos_f ); 597 __ ldf( FloatRegisterImpl::S, Llocals, Interpreter::local_offset_in_bytes(n), Ftos_f );
601 } 598 }
602 599
603 600
604 void TemplateTable::dload(int n) { 601 void TemplateTable::dload(int n) {
605 transition(vtos, dtos); 602 transition(vtos, dtos);
606 FloatRegister dst = Ftos_d; 603 FloatRegister dst = Ftos_d;
607 debug_only(__ verify_local_tag(frame::TagCategory2, Llocals, G3_scratch, n));
608 __ load_unaligned_double(Llocals, Interpreter::local_offset_in_bytes(n+1), dst); 604 __ load_unaligned_double(Llocals, Interpreter::local_offset_in_bytes(n+1), dst);
609 } 605 }
610 606
611 607
612 void TemplateTable::aload(int n) { 608 void TemplateTable::aload(int n) {
613 transition(vtos, atos); 609 transition(vtos, atos);
614 debug_only(__ verify_local_tag(frame::TagReference, Llocals, Otos_i, n));
615 __ ld_ptr( Llocals, Interpreter::local_offset_in_bytes(n), Otos_i ); 610 __ ld_ptr( Llocals, Interpreter::local_offset_in_bytes(n), Otos_i );
616 } 611 }
617 612
618 613
619 void TemplateTable::aload_0() { 614 void TemplateTable::aload_0() {
705 } 700 }
706 701
707 702
708 void TemplateTable::astore() { 703 void TemplateTable::astore() {
709 transition(vtos, vtos); 704 transition(vtos, vtos);
710 // astore tos can also be a returnAddress, so load and store the tag too 705 __ load_ptr(0, Otos_i);
711 __ load_ptr_and_tag(0, Otos_i, Otos_l2); 706 __ inc(Lesp, Interpreter::stackElementSize);
712 __ inc(Lesp, Interpreter::stackElementSize());
713 __ verify_oop_or_return_address(Otos_i, G3_scratch); 707 __ verify_oop_or_return_address(Otos_i, G3_scratch);
714 locals_index(G3_scratch); 708 locals_index(G3_scratch);
715 __ store_local_ptr( G3_scratch, Otos_i, Otos_l2 ); 709 __ store_local_ptr(G3_scratch, Otos_i);
716 } 710 }
717 711
718 712
719 void TemplateTable::wide_istore() { 713 void TemplateTable::wide_istore() {
720 transition(vtos, vtos); 714 transition(vtos, vtos);
748 } 742 }
749 743
750 744
751 void TemplateTable::wide_astore() { 745 void TemplateTable::wide_astore() {
752 transition(vtos, vtos); 746 transition(vtos, vtos);
753 // astore tos can also be a returnAddress, so load and store the tag too 747 __ load_ptr(0, Otos_i);
754 __ load_ptr_and_tag(0, Otos_i, Otos_l2); 748 __ inc(Lesp, Interpreter::stackElementSize);
755 __ inc(Lesp, Interpreter::stackElementSize());
756 __ verify_oop_or_return_address(Otos_i, G3_scratch); 749 __ verify_oop_or_return_address(Otos_i, G3_scratch);
757 locals_index_wide(G3_scratch); 750 locals_index_wide(G3_scratch);
758 __ store_local_ptr( G3_scratch, Otos_i, Otos_l2 ); 751 __ store_local_ptr(G3_scratch, Otos_i);
759 } 752 }
760 753
761 754
762 void TemplateTable::iastore() { 755 void TemplateTable::iastore() {
763 transition(itos, vtos); 756 transition(itos, vtos);
843 // Store is OK. 836 // Store is OK.
844 __ bind(store_ok); 837 __ bind(store_ok);
845 do_oop_store(_masm, O1, noreg, arrayOopDesc::base_offset_in_bytes(T_OBJECT), Otos_i, G3_scratch, _bs->kind(), true); 838 do_oop_store(_masm, O1, noreg, arrayOopDesc::base_offset_in_bytes(T_OBJECT), Otos_i, G3_scratch, _bs->kind(), true);
846 839
847 __ ba(false,done); 840 __ ba(false,done);
848 __ delayed()->inc(Lesp, 3* Interpreter::stackElementSize()); // adj sp (pops array, index and value) 841 __ delayed()->inc(Lesp, 3* Interpreter::stackElementSize); // adj sp (pops array, index and value)
849 842
850 __ bind(is_null); 843 __ bind(is_null);
851 do_oop_store(_masm, O1, noreg, arrayOopDesc::base_offset_in_bytes(T_OBJECT), G0, G4_scratch, _bs->kind(), true); 844 do_oop_store(_masm, O1, noreg, arrayOopDesc::base_offset_in_bytes(T_OBJECT), G0, G4_scratch, _bs->kind(), true);
852 845
853 __ profile_null_seen(G3_scratch); 846 __ profile_null_seen(G3_scratch);
854 __ inc(Lesp, 3* Interpreter::stackElementSize()); // adj sp (pops array, index and value) 847 __ inc(Lesp, 3* Interpreter::stackElementSize); // adj sp (pops array, index and value)
855 __ bind(done); 848 __ bind(done);
856 } 849 }
857 850
858 851
859 void TemplateTable::bastore() { 852 void TemplateTable::bastore() {
882 } 875 }
883 876
884 877
885 void TemplateTable::istore(int n) { 878 void TemplateTable::istore(int n) {
886 transition(itos, vtos); 879 transition(itos, vtos);
887 __ tag_local(frame::TagValue, Llocals, Otos_i, n);
888 __ st(Otos_i, Llocals, Interpreter::local_offset_in_bytes(n)); 880 __ st(Otos_i, Llocals, Interpreter::local_offset_in_bytes(n));
889 } 881 }
890 882
891 883
892 void TemplateTable::lstore(int n) { 884 void TemplateTable::lstore(int n) {
893 transition(ltos, vtos); 885 transition(ltos, vtos);
894 assert(n+1 < Argument::n_register_parameters, "only handle register cases"); 886 assert(n+1 < Argument::n_register_parameters, "only handle register cases");
895 __ tag_local(frame::TagCategory2, Llocals, Otos_l, n);
896 __ store_unaligned_long(Otos_l, Llocals, Interpreter::local_offset_in_bytes(n+1)); 887 __ store_unaligned_long(Otos_l, Llocals, Interpreter::local_offset_in_bytes(n+1));
897 888
898 } 889 }
899 890
900 891
901 void TemplateTable::fstore(int n) { 892 void TemplateTable::fstore(int n) {
902 transition(ftos, vtos); 893 transition(ftos, vtos);
903 assert(n < Argument::n_register_parameters, "only handle register cases"); 894 assert(n < Argument::n_register_parameters, "only handle register cases");
904 __ tag_local(frame::TagValue, Llocals, Otos_l, n);
905 __ stf(FloatRegisterImpl::S, Ftos_f, Llocals, Interpreter::local_offset_in_bytes(n)); 895 __ stf(FloatRegisterImpl::S, Ftos_f, Llocals, Interpreter::local_offset_in_bytes(n));
906 } 896 }
907 897
908 898
909 void TemplateTable::dstore(int n) { 899 void TemplateTable::dstore(int n) {
910 transition(dtos, vtos); 900 transition(dtos, vtos);
911 FloatRegister src = Ftos_d; 901 FloatRegister src = Ftos_d;
912 __ tag_local(frame::TagCategory2, Llocals, Otos_l, n);
913 __ store_unaligned_double(src, Llocals, Interpreter::local_offset_in_bytes(n+1)); 902 __ store_unaligned_double(src, Llocals, Interpreter::local_offset_in_bytes(n+1));
914 } 903 }
915 904
916 905
917 void TemplateTable::astore(int n) { 906 void TemplateTable::astore(int n) {
918 transition(vtos, vtos); 907 transition(vtos, vtos);
919 // astore tos can also be a returnAddress, so load and store the tag too 908 __ load_ptr(0, Otos_i);
920 __ load_ptr_and_tag(0, Otos_i, Otos_l2); 909 __ inc(Lesp, Interpreter::stackElementSize);
921 __ inc(Lesp, Interpreter::stackElementSize());
922 __ verify_oop_or_return_address(Otos_i, G3_scratch); 910 __ verify_oop_or_return_address(Otos_i, G3_scratch);
923 __ store_local_ptr( n, Otos_i, Otos_l2 ); 911 __ store_local_ptr(n, Otos_i);
924 } 912 }
925 913
926 914
927 void TemplateTable::pop() { 915 void TemplateTable::pop() {
928 transition(vtos, vtos); 916 transition(vtos, vtos);
929 __ inc(Lesp, Interpreter::stackElementSize()); 917 __ inc(Lesp, Interpreter::stackElementSize);
930 } 918 }
931 919
932 920
933 void TemplateTable::pop2() { 921 void TemplateTable::pop2() {
934 transition(vtos, vtos); 922 transition(vtos, vtos);
935 __ inc(Lesp, 2 * Interpreter::stackElementSize()); 923 __ inc(Lesp, 2 * Interpreter::stackElementSize);
936 } 924 }
937 925
938 926
939 void TemplateTable::dup() { 927 void TemplateTable::dup() {
940 transition(vtos, vtos); 928 transition(vtos, vtos);
941 // stack: ..., a 929 // stack: ..., a
942 // load a and tag 930 // load a and tag
943 __ load_ptr_and_tag(0, Otos_i, Otos_l2); 931 __ load_ptr(0, Otos_i);
944 __ push_ptr(Otos_i, Otos_l2); 932 __ push_ptr(Otos_i);
945 // stack: ..., a, a 933 // stack: ..., a, a
946 } 934 }
947 935
948 936
949 void TemplateTable::dup_x1() { 937 void TemplateTable::dup_x1() {
950 transition(vtos, vtos); 938 transition(vtos, vtos);
951 // stack: ..., a, b 939 // stack: ..., a, b
952 __ load_ptr_and_tag(1, G3_scratch, G4_scratch); // get a 940 __ load_ptr( 1, G3_scratch); // get a
953 __ load_ptr_and_tag(0, Otos_l1, Otos_l2); // get b 941 __ load_ptr( 0, Otos_l1); // get b
954 __ store_ptr_and_tag(1, Otos_l1, Otos_l2); // put b 942 __ store_ptr(1, Otos_l1); // put b
955 __ store_ptr_and_tag(0, G3_scratch, G4_scratch); // put a - like swap 943 __ store_ptr(0, G3_scratch); // put a - like swap
956 __ push_ptr(Otos_l1, Otos_l2); // push b 944 __ push_ptr(Otos_l1); // push b
957 // stack: ..., b, a, b 945 // stack: ..., b, a, b
958 } 946 }
959 947
960 948
961 void TemplateTable::dup_x2() { 949 void TemplateTable::dup_x2() {
962 transition(vtos, vtos); 950 transition(vtos, vtos);
963 // stack: ..., a, b, c 951 // stack: ..., a, b, c
964 // get c and push on stack, reuse registers 952 // get c and push on stack, reuse registers
965 __ load_ptr_and_tag(0, G3_scratch, G4_scratch); // get c 953 __ load_ptr( 0, G3_scratch); // get c
966 __ push_ptr(G3_scratch, G4_scratch); // push c with tag 954 __ push_ptr(G3_scratch); // push c with tag
967 // stack: ..., a, b, c, c (c in reg) (Lesp - 4) 955 // stack: ..., a, b, c, c (c in reg) (Lesp - 4)
968 // (stack offsets n+1 now) 956 // (stack offsets n+1 now)
969 __ load_ptr_and_tag(3, Otos_l1, Otos_l2); // get a 957 __ load_ptr( 3, Otos_l1); // get a
970 __ store_ptr_and_tag(3, G3_scratch, G4_scratch); // put c at 3 958 __ store_ptr(3, G3_scratch); // put c at 3
971 // stack: ..., c, b, c, c (a in reg) 959 // stack: ..., c, b, c, c (a in reg)
972 __ load_ptr_and_tag(2, G3_scratch, G4_scratch); // get b 960 __ load_ptr( 2, G3_scratch); // get b
973 __ store_ptr_and_tag(2, Otos_l1, Otos_l2); // put a at 2 961 __ store_ptr(2, Otos_l1); // put a at 2
974 // stack: ..., c, a, c, c (b in reg) 962 // stack: ..., c, a, c, c (b in reg)
975 __ store_ptr_and_tag(1, G3_scratch, G4_scratch); // put b at 1 963 __ store_ptr(1, G3_scratch); // put b at 1
976 // stack: ..., c, a, b, c 964 // stack: ..., c, a, b, c
977 } 965 }
978 966
979 967
980 void TemplateTable::dup2() { 968 void TemplateTable::dup2() {
981 transition(vtos, vtos); 969 transition(vtos, vtos);
982 __ load_ptr_and_tag(1, G3_scratch, G4_scratch); // get a 970 __ load_ptr(1, G3_scratch); // get a
983 __ load_ptr_and_tag(0, Otos_l1, Otos_l2); // get b 971 __ load_ptr(0, Otos_l1); // get b
984 __ push_ptr(G3_scratch, G4_scratch); // push a 972 __ push_ptr(G3_scratch); // push a
985 __ push_ptr(Otos_l1, Otos_l2); // push b 973 __ push_ptr(Otos_l1); // push b
986 // stack: ..., a, b, a, b 974 // stack: ..., a, b, a, b
987 } 975 }
988 976
989 977
990 void TemplateTable::dup2_x1() { 978 void TemplateTable::dup2_x1() {
991 transition(vtos, vtos); 979 transition(vtos, vtos);
992 // stack: ..., a, b, c 980 // stack: ..., a, b, c
993 __ load_ptr_and_tag(1, Lscratch, G1_scratch); // get b 981 __ load_ptr( 1, Lscratch); // get b
994 __ load_ptr_and_tag(2, Otos_l1, Otos_l2); // get a 982 __ load_ptr( 2, Otos_l1); // get a
995 __ store_ptr_and_tag(2, Lscratch, G1_scratch); // put b at a 983 __ store_ptr(2, Lscratch); // put b at a
996 // stack: ..., b, b, c 984 // stack: ..., b, b, c
997 __ load_ptr_and_tag(0, G3_scratch, G4_scratch); // get c 985 __ load_ptr( 0, G3_scratch); // get c
998 __ store_ptr_and_tag(1, G3_scratch, G4_scratch); // put c at b 986 __ store_ptr(1, G3_scratch); // put c at b
999 // stack: ..., b, c, c 987 // stack: ..., b, c, c
1000 __ store_ptr_and_tag(0, Otos_l1, Otos_l2); // put a at c 988 __ store_ptr(0, Otos_l1); // put a at c
1001 // stack: ..., b, c, a 989 // stack: ..., b, c, a
1002 __ push_ptr(Lscratch, G1_scratch); // push b 990 __ push_ptr(Lscratch); // push b
1003 __ push_ptr(G3_scratch, G4_scratch); // push c 991 __ push_ptr(G3_scratch); // push c
1004 // stack: ..., b, c, a, b, c 992 // stack: ..., b, c, a, b, c
1005 } 993 }
1006 994
1007 995
1008 // The spec says that these types can be a mixture of category 1 (1 word) 996 // The spec says that these types can be a mixture of category 1 (1 word)
1009 // types and/or category 2 types (long and doubles) 997 // types and/or category 2 types (long and doubles)
1010 void TemplateTable::dup2_x2() { 998 void TemplateTable::dup2_x2() {
1011 transition(vtos, vtos); 999 transition(vtos, vtos);
1012 // stack: ..., a, b, c, d 1000 // stack: ..., a, b, c, d
1013 __ load_ptr_and_tag(1, Lscratch, G1_scratch); // get c 1001 __ load_ptr( 1, Lscratch); // get c
1014 __ load_ptr_and_tag(3, Otos_l1, Otos_l2); // get a 1002 __ load_ptr( 3, Otos_l1); // get a
1015 __ store_ptr_and_tag(3, Lscratch, G1_scratch); // put c at 3 1003 __ store_ptr(3, Lscratch); // put c at 3
1016 __ store_ptr_and_tag(1, Otos_l1, Otos_l2); // put a at 1 1004 __ store_ptr(1, Otos_l1); // put a at 1
1017 // stack: ..., c, b, a, d 1005 // stack: ..., c, b, a, d
1018 __ load_ptr_and_tag(2, G3_scratch, G4_scratch); // get b 1006 __ load_ptr( 2, G3_scratch); // get b
1019 __ load_ptr_and_tag(0, Otos_l1, Otos_l2); // get d 1007 __ load_ptr( 0, Otos_l1); // get d
1020 __ store_ptr_and_tag(0, G3_scratch, G4_scratch); // put b at 0 1008 __ store_ptr(0, G3_scratch); // put b at 0
1021 __ store_ptr_and_tag(2, Otos_l1, Otos_l2); // put d at 2 1009 __ store_ptr(2, Otos_l1); // put d at 2
1022 // stack: ..., c, d, a, b 1010 // stack: ..., c, d, a, b
1023 __ push_ptr(Lscratch, G1_scratch); // push c 1011 __ push_ptr(Lscratch); // push c
1024 __ push_ptr(Otos_l1, Otos_l2); // push d 1012 __ push_ptr(Otos_l1); // push d
1025 // stack: ..., c, d, a, b, c, d 1013 // stack: ..., c, d, a, b, c, d
1026 } 1014 }
1027 1015
1028 1016
1029 void TemplateTable::swap() { 1017 void TemplateTable::swap() {
1030 transition(vtos, vtos); 1018 transition(vtos, vtos);
1031 // stack: ..., a, b 1019 // stack: ..., a, b
1032 __ load_ptr_and_tag(1, G3_scratch, G4_scratch); // get a 1020 __ load_ptr( 1, G3_scratch); // get a
1033 __ load_ptr_and_tag(0, Otos_l1, Otos_l2); // get b 1021 __ load_ptr( 0, Otos_l1); // get b
1034 __ store_ptr_and_tag(0, G3_scratch, G4_scratch); // put b 1022 __ store_ptr(0, G3_scratch); // put b
1035 __ store_ptr_and_tag(1, Otos_l1, Otos_l2); // put a 1023 __ store_ptr(1, Otos_l1); // put a
1036 // stack: ..., b, a 1024 // stack: ..., b, a
1037 } 1025 }
1038 1026
1039 1027
1040 void TemplateTable::iop2(Operation op) { 1028 void TemplateTable::iop2(Operation op) {
1043 switch (op) { 1031 switch (op) {
1044 case add: __ add(O1, Otos_i, Otos_i); break; 1032 case add: __ add(O1, Otos_i, Otos_i); break;
1045 case sub: __ sub(O1, Otos_i, Otos_i); break; 1033 case sub: __ sub(O1, Otos_i, Otos_i); break;
1046 // %%%%% Mul may not exist: better to call .mul? 1034 // %%%%% Mul may not exist: better to call .mul?
1047 case mul: __ smul(O1, Otos_i, Otos_i); break; 1035 case mul: __ smul(O1, Otos_i, Otos_i); break;
1048 case _and: __ and3(O1, Otos_i, Otos_i); break; 1036 case _and: __ and3(O1, Otos_i, Otos_i); break;
1049 case _or: __ or3(O1, Otos_i, Otos_i); break; 1037 case _or: __ or3(O1, Otos_i, Otos_i); break;
1050 case _xor: __ xor3(O1, Otos_i, Otos_i); break; 1038 case _xor: __ xor3(O1, Otos_i, Otos_i); break;
1051 case shl: __ sll(O1, Otos_i, Otos_i); break; 1039 case shl: __ sll(O1, Otos_i, Otos_i); break;
1052 case shr: __ sra(O1, Otos_i, Otos_i); break; 1040 case shr: __ sra(O1, Otos_i, Otos_i); break;
1053 case ushr: __ srl(O1, Otos_i, Otos_i); break; 1041 case ushr: __ srl(O1, Otos_i, Otos_i); break;
1054 default: ShouldNotReachHere(); 1042 default: ShouldNotReachHere();
1055 } 1043 }
1059 void TemplateTable::lop2(Operation op) { 1047 void TemplateTable::lop2(Operation op) {
1060 transition(ltos, ltos); 1048 transition(ltos, ltos);
1061 __ pop_l(O2); 1049 __ pop_l(O2);
1062 switch (op) { 1050 switch (op) {
1063 #ifdef _LP64 1051 #ifdef _LP64
1064 case add: __ add(O2, Otos_l, Otos_l); break; 1052 case add: __ add(O2, Otos_l, Otos_l); break;
1065 case sub: __ sub(O2, Otos_l, Otos_l); break; 1053 case sub: __ sub(O2, Otos_l, Otos_l); break;
1066 case _and: __ and3( O2, Otos_l, Otos_l); break; 1054 case _and: __ and3(O2, Otos_l, Otos_l); break;
1067 case _or: __ or3( O2, Otos_l, Otos_l); break; 1055 case _or: __ or3(O2, Otos_l, Otos_l); break;
1068 case _xor: __ xor3( O2, Otos_l, Otos_l); break; 1056 case _xor: __ xor3(O2, Otos_l, Otos_l); break;
1069 #else 1057 #else
1070 case add: __ addcc(O3, Otos_l2, Otos_l2); __ addc(O2, Otos_l1, Otos_l1); break; 1058 case add: __ addcc(O3, Otos_l2, Otos_l2); __ addc(O2, Otos_l1, Otos_l1); break;
1071 case sub: __ subcc(O3, Otos_l2, Otos_l2); __ subc(O2, Otos_l1, Otos_l1); break; 1059 case sub: __ subcc(O3, Otos_l2, Otos_l2); __ subc(O2, Otos_l1, Otos_l1); break;
1072 case _and: __ and3( O3, Otos_l2, Otos_l2); __ and3( O2, Otos_l1, Otos_l1); break; 1060 case _and: __ and3(O3, Otos_l2, Otos_l2); __ and3(O2, Otos_l1, Otos_l1); break;
1073 case _or: __ or3( O3, Otos_l2, Otos_l2); __ or3( O2, Otos_l1, Otos_l1); break; 1061 case _or: __ or3(O3, Otos_l2, Otos_l2); __ or3(O2, Otos_l1, Otos_l1); break;
1074 case _xor: __ xor3( O3, Otos_l2, Otos_l2); __ xor3( O2, Otos_l1, Otos_l1); break; 1062 case _xor: __ xor3(O3, Otos_l2, Otos_l2); __ xor3(O2, Otos_l1, Otos_l1); break;
1075 #endif 1063 #endif
1076 default: ShouldNotReachHere(); 1064 default: ShouldNotReachHere();
1077 } 1065 }
1078 } 1066 }
1079 1067
1305 transition(vtos, vtos); 1293 transition(vtos, vtos);
1306 locals_index(G3_scratch); 1294 locals_index(G3_scratch);
1307 __ ldsb(Lbcp, 2, O2); // load constant 1295 __ ldsb(Lbcp, 2, O2); // load constant
1308 __ access_local_int(G3_scratch, Otos_i); 1296 __ access_local_int(G3_scratch, Otos_i);
1309 __ add(Otos_i, O2, Otos_i); 1297 __ add(Otos_i, O2, Otos_i);
1310 __ st(Otos_i, G3_scratch, Interpreter::value_offset_in_bytes()); // access_local_int puts E.A. in G3_scratch 1298 __ st(Otos_i, G3_scratch, 0); // access_local_int puts E.A. in G3_scratch
1311 } 1299 }
1312 1300
1313 1301
1314 void TemplateTable::wide_iinc() { 1302 void TemplateTable::wide_iinc() {
1315 transition(vtos, vtos); 1303 transition(vtos, vtos);
1316 locals_index_wide(G3_scratch); 1304 locals_index_wide(G3_scratch);
1317 __ get_2_byte_integer_at_bcp( 4, O2, O3, InterpreterMacroAssembler::Signed); 1305 __ get_2_byte_integer_at_bcp( 4, O2, O3, InterpreterMacroAssembler::Signed);
1318 __ access_local_int(G3_scratch, Otos_i); 1306 __ access_local_int(G3_scratch, Otos_i);
1319 __ add(Otos_i, O3, Otos_i); 1307 __ add(Otos_i, O3, Otos_i);
1320 __ st(Otos_i, G3_scratch, Interpreter::value_offset_in_bytes()); // access_local_int puts E.A. in G3_scratch 1308 __ st(Otos_i, G3_scratch, 0); // access_local_int puts E.A. in G3_scratch
1321 } 1309 }
1322 1310
1323 1311
1324 void TemplateTable::convert() { 1312 void TemplateTable::convert() {
1325 // %%%%% Factor this first part accross platforms 1313 // %%%%% Factor this first part accross platforms
1553 __ sub(G3_scratch, in_bytes(constMethodOopDesc::codes_offset()) - (is_wide ? 5 : 3), Otos_i); 1541 __ sub(G3_scratch, in_bytes(constMethodOopDesc::codes_offset()) - (is_wide ? 5 : 3), Otos_i);
1554 1542
1555 // Bump Lbcp to target of JSR 1543 // Bump Lbcp to target of JSR
1556 __ add(Lbcp, O1_disp, Lbcp); 1544 __ add(Lbcp, O1_disp, Lbcp);
1557 // Push returnAddress for "ret" on stack 1545 // Push returnAddress for "ret" on stack
1558 __ push_ptr(Otos_i, G0); // push ptr sized thing plus 0 for tag. 1546 __ push_ptr(Otos_i);
1559 // And away we go! 1547 // And away we go!
1560 __ dispatch_next(vtos); 1548 __ dispatch_next(vtos);
1561 return; 1549 return;
1562 } 1550 }
1563 1551
2752 Register Rcache = G3_scratch; 2740 Register Rcache = G3_scratch;
2753 Register Roffset = G4_scratch; 2741 Register Roffset = G4_scratch;
2754 Register Rflags = G4_scratch; 2742 Register Rflags = G4_scratch;
2755 Register Rreceiver = Lscratch; 2743 Register Rreceiver = Lscratch;
2756 2744
2757 __ ld_ptr(Llocals, Interpreter::value_offset_in_bytes(), Rreceiver); 2745 __ ld_ptr(Llocals, 0, Rreceiver);
2758 2746
2759 // access constant pool cache (is resolved) 2747 // access constant pool cache (is resolved)
2760 __ get_cache_and_index_at_bcp(Rcache, G4_scratch, 2); 2748 __ get_cache_and_index_at_bcp(Rcache, G4_scratch, 2);
2761 __ ld_ptr(Rcache, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::f2_offset(), Roffset); 2749 __ ld_ptr(Rcache, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::f2_offset(), Roffset);
2762 __ add(Lbcp, 1, Lbcp); // needed to report exception at the correct bcp 2750 __ add(Lbcp, 1, Lbcp); // needed to report exception at the correct bcp
3694 3682
3695 void TemplateTable::multianewarray() { 3683 void TemplateTable::multianewarray() {
3696 transition(vtos, atos); 3684 transition(vtos, atos);
3697 // put ndims * wordSize into Lscratch 3685 // put ndims * wordSize into Lscratch
3698 __ ldub( Lbcp, 3, Lscratch); 3686 __ ldub( Lbcp, 3, Lscratch);
3699 __ sll( Lscratch, Interpreter::logStackElementSize(), Lscratch); 3687 __ sll( Lscratch, Interpreter::logStackElementSize, Lscratch);
3700 // Lesp points past last_dim, so set to O1 to first_dim address 3688 // Lesp points past last_dim, so set to O1 to first_dim address
3701 __ add( Lesp, Lscratch, O1); 3689 __ add( Lesp, Lscratch, O1);
3702 call_VM(Otos_i, CAST_FROM_FN_PTR(address, InterpreterRuntime::multianewarray), O1); 3690 call_VM(Otos_i, CAST_FROM_FN_PTR(address, InterpreterRuntime::multianewarray), O1);
3703 __ add( Lesp, Lscratch, Lesp); // pop all dimensions off the stack 3691 __ add( Lesp, Lscratch, Lesp); // pop all dimensions off the stack
3704 } 3692 }

mercurial