Changeset 15826
- Timestamp:
- May 26, 2013, 7:49:59 PM (8 years ago)
- Location:
- trunk/source/lisp-kernel
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lisp-kernel/area.h
r15815 r15826 76 76 natural static_dnodes; /* for hash consing, maybe other things. */ 77 77 natural *static_used; /* bitvector */ 78 natural *refidx; /* compressed refbits */79 natural first_indexed_ref; /* area's first bit in refidx */80 78 } area; 81 79 -
trunk/source/lisp-kernel/arm-exceptions.c
r15822 r15826 1644 1644 return; 1645 1645 } 1646 ea = (LispObj*)(xpGPR(xp,arg_x) + unbox_fixnum(xpGPR(xp,temp2)));1646 ea = (LispObj*)(xpGPR(xp,arg_x) + xpGPR(xp,imm0)); 1647 1647 xpGPR(xp,arg_z) = t_value; 1648 1648 } else if (program_counter >= &egc_set_hash_key) { … … 1652 1652 root = xpGPR(xp,arg_x); 1653 1653 val = xpGPR(xp,arg_z); 1654 ea = (LispObj *) (root+ unbox_fixnum(xpGPR(xp,temp2)));1654 ea = (LispObj *) (root+xpGPR(xp,arg_y)+misc_data_offset); 1655 1655 need_memoize_root = true; 1656 1656 } else if (program_counter >= &egc_gvset) { … … 1678 1678 ((LispObj)ea < val)) { 1679 1679 atomic_set_bit(refbits, bitnumber); 1680 atomic_set_bit(global_refidx, bitnumber>>8);1681 1680 if (need_memoize_root) { 1682 1681 bitnumber = area_dnode(root, lisp_global(REF_BASE)); 1683 1682 atomic_set_bit(refbits, bitnumber); 1684 atomic_set_bit(global_refidx,bitnumber>>8);1685 1683 } 1686 1684 } -
trunk/source/lisp-kernel/arm-gc.c
r15821 r15826 712 712 713 713 void 714 check_refmap_consistency(LispObj *start, LispObj *end, bitvector refbits , bitvector refidx)714 check_refmap_consistency(LispObj *start, LispObj *end, bitvector refbits) 715 715 { 716 716 LispObj x1, *base = start, *prev = start; … … 758 758 Bug(NULL, "Missing memoization in doublenode at 0x" LISP "\n", start); 759 759 set_bit(refbits, ref_dnode); 760 if (refidx) {761 set_bit(refidx,ref_dnode>>8);762 }763 } else {764 if (refidx) {765 if (!ref_bit(refidx, ref_dnode>>8)) {766 Bug(NULL, "Memoization for doublenode at 0x" LISP " not indexed\n", start);767 set_bit(refidx,ref_dnode>>8);768 }769 }770 760 } 771 761 } -
trunk/source/lisp-kernel/arm-spentry.s
r15822 r15826 759 759 __(mov imm1,imm1,lsr imm2) 760 760 __(mov imm0,imm0,lsr #bitmap_shift) 761 __(ref_global(temp 1,refbits))762 __(add temp 1,temp1,imm0,lsl #word_shift)763 __(ldr imm2,[temp 1])761 __(ref_global(temp0,refbits)) 762 __(add temp0,temp0,imm0,lsl #word_shift) 763 __(ldr imm2,[temp0]) 764 764 __(tst imm2,imm1) 765 765 __(bxne lr) 766 0: __(ldrex imm2,[temp 1])766 0: __(ldrex imm2,[temp0]) 767 767 __(orr imm2,imm2,imm1) 768 __(strex imm0,imm2,[temp 1])768 __(strex imm0,imm2,[temp0]) 769 769 __(cmp imm0,#0) 770 __(bne 0b) 771 __(sub imm0,arg_y,temp0) 772 __(mov imm0,imm0,lsr #dnode_shift+8) 773 __(and imm2,imm0,#31) 774 __(mov imm1,#0x80000000) 775 __(mov imm1,imm1,lsr imm2) 776 __(mov imm0,imm0,lsr #bitmap_shift) 777 __(ref_global(temp1,ephemeral_refidx)) 778 __(add temp1,temp1,imm0,lsl #word_shift) 779 1: __(ldrex imm2,[temp1]) 780 __(orr imm2,imm2,imm1) 781 __(strex imm0,imm2,[temp1]) 782 __(cmp imm0,#0) 783 __(bne 1b) 770 __(bne 0b) 784 771 __(bx lr) 785 772 … … 803 790 __(mov imm1,imm1,lsr imm2) 804 791 __(mov imm0,imm0,lsr #bitmap_shift) 805 __(ref_global(temp 1,refbits))806 __(add temp 1,temp1,imm0,lsl #word_shift)807 __(ldr imm2,[temp 1])792 __(ref_global(temp0,refbits)) 793 __(add temp0,temp0,imm0,lsl #word_shift) 794 __(ldr imm2,[temp0]) 808 795 __(tst imm2,imm1) 809 796 __(bxne lr) 810 0: __(ldrex imm2,[temp 1])797 0: __(ldrex imm2,[temp0]) 811 798 __(orr imm2,imm2,imm1) 812 __(strex imm0,imm2,[temp 1])799 __(strex imm0,imm2,[temp0]) 813 800 __(cmp imm0,#0) 814 801 __(bne 0b) 815 __(sub imm0,arg_y,temp0)816 __(mov imm0,imm0,lsr #dnode_shift+8)817 __(and imm2,imm0,#31)818 __(mov imm1,#0x80000000)819 __(mov imm1,imm1,lsr imm2)820 __(mov imm0,imm0,lsr #bitmap_shift)821 __(ref_global(temp1,ephemeral_refidx))822 __(add temp1,temp1,imm0,lsl #word_shift)823 1: __(ldrex imm2,[temp1])824 __(orr imm2,imm2,imm1)825 __(strex imm0,imm2,[temp1])826 __(cmp imm0,#0)827 __(bne 1b)828 802 __(bx lr) 829 803 … … 851 825 __(mov imm1,imm1,lsr imm2) 852 826 __(mov imm0,imm0,lsr #bitmap_shift) 853 __(ref_global(temp 1,refbits))854 __(add temp 1,temp1,imm0,lsl #word_shift)855 __(ldr imm2,[temp 1])827 __(ref_global(temp0,refbits)) 828 __(add temp0,temp0,imm0,lsl #word_shift) 829 __(ldr imm2,[temp0]) 856 830 __(tst imm2,imm1) 857 831 __(bxne lr) 858 0: __(ldrex imm2,[temp 1])832 0: __(ldrex imm2,[temp0]) 859 833 __(orr imm2,imm2,imm1) 860 __(strex imm0,imm2,[temp 1])834 __(strex imm0,imm2,[temp0]) 861 835 __(cmp imm0,#0) 862 __(bne 0b) 863 __(add imm0,arg_y,#misc_data_offset) 864 __(add imm0,imm0,arg_x) 865 __(sub imm0,imm0,temp0) 866 __(mov imm0,imm0,lsr #dnode_shift+8) 867 __(and imm2,imm0,#31) 868 __(mov imm1,#0x80000000) 869 __(mov imm1,imm1,lsr imm2) 870 __(mov imm0,imm0,lsr #bitmap_shift) 871 __(ref_global(temp1,ephemeral_refidx)) 872 __(add temp1,temp1,imm0,lsl #word_shift) 873 1: __(ldrex imm2,[temp1]) 874 __(orr imm2,imm2,imm1) 875 __(strex imm0,imm2,[temp1]) 876 __(cmp imm0,#0) 877 __(bne 1b) 836 __(bne 0b) 878 837 __(bx lr) 879 838 … … 902 861 __(mov imm1,imm1,lsr imm2) 903 862 __(mov imm0,imm0,lsr #bitmap_shift) 904 __(ref_global(temp 1,refbits))905 __(add temp 1,temp1,imm0,lsl #word_shift)906 __(ldr imm2,[temp 1])863 __(ref_global(temp0,refbits)) 864 __(add temp0,temp0,imm0,lsl #word_shift) 865 __(ldr imm2,[temp0]) 907 866 __(tst imm2,imm1) 908 867 __(bxne lr) 909 0: __(ldrex imm2,[temp 1])868 0: __(ldrex imm2,[temp0]) 910 869 __(orr imm2,imm2,imm1) 911 __(strex imm0,imm2,[temp 1])870 __(strex imm0,imm2,[temp0]) 912 871 __(cmp imm0,#0) 913 __(bne 0b) 914 __(add imm0,arg_y,#misc_data_offset) 915 __(add imm0,imm0,arg_x) 916 __(sub imm0,imm0,temp0) 917 __(mov imm0,imm0,lsr #dnode_shift+8) 918 __(and imm2,imm0,#31) 919 __(mov imm1,#0x80000000) 920 __(mov imm1,imm1,lsr imm2) 921 __(mov imm0,imm0,lsr #bitmap_shift) 922 __(ref_global(temp1,ephemeral_refidx)) 923 __(add temp1,temp1,imm0,lsl #word_shift) 924 1: __(ldrex imm2,[temp1]) 925 __(orr imm2,imm2,imm1) 926 __(strex imm0,imm2,[temp1]) 927 __(cmp imm0,#0) 928 __(bne 1b) 929 872 __(bne 0b) 930 873 /* Now need to ensure that the hash table itself is in the refmap; we 931 874 know that it's in bounds, etc. */ 932 875 __(ref_global(temp0,ref_base)) 933 876 __(sub imm0,arg_x,temp0) 934 877 __(mov imm0,imm0,lsr #dnode_shift) … … 937 880 __(mov imm1,imm1,lsr imm2) 938 881 __(mov imm0,imm0,lsr #bitmap_shift) 939 __(ref_global(temp 1,refbits))940 __(add temp 1,temp1,imm0,lsl #word_shift)941 __(ldr imm2,[temp 1])882 __(ref_global(temp0,refbits)) 883 __(add temp0,temp0,imm0,lsl #word_shift) 884 __(ldr imm2,[temp0]) 942 885 __(tst imm2,imm1) 943 886 __(bxne lr) 944 2: __(ldrex imm2,[temp1])887 1: __(ldrex imm2,[temp0]) 945 888 __(orr imm2,imm2,imm1) 946 __(strex imm0,imm2,[temp 1])889 __(strex imm0,imm2,[temp0]) 947 890 __(cmp imm0,#0) 948 __(bne 2b) 949 __(sub imm0,arg_x,temp0) 950 __(mov imm0,imm0,lsr #dnode_shift+8) 951 __(and imm2,imm0,#31) 952 __(mov imm1,#0x80000000) 953 __(mov imm1,imm1,lsr imm2) 954 __(mov imm0,imm0,lsr #bitmap_shift) 955 __(ref_global(temp1,ephemeral_refidx)) 956 __(add temp1,temp1,imm0,lsl #word_shift) 957 3: __(ldrex imm2,[temp1]) 958 __(orr imm2,imm2,imm1) 959 __(strex imm0,imm2,[temp1]) 960 __(cmp imm0,#0) 961 __(bne 3b) 891 __(bne 1b) 962 892 __(bx lr) 963 893 … … 985 915 _spentry(store_node_conditional) 986 916 C(egc_store_node_conditional): 987 __(vpop1(temp 2))917 __(vpop1(temp0)) 988 918 989 1: __(unbox_fixnum(imm2,temp 2))919 1: __(unbox_fixnum(imm2,temp0)) 990 920 __(add imm2,imm2,arg_x) 991 921 __(ldrex temp1,[imm2]) 992 922 __(cmp temp1,arg_y) 993 __(bne 9f)923 __(bne 5f) 994 924 __(strex imm0,arg_z,[imm2]) 995 925 .globl C(egc_store_node_conditional_test) … … 998 928 __(bne 1b) 999 929 __(cmp arg_z,arg_x) 1000 __(blo 8f)1001 1002 __(ref_global( temp0,ref_base))930 __(blo 4f) 931 932 __(ref_global(imm0,ref_base)) 1003 933 __(ref_global(imm1,oldspace_dnode_count)) 1004 __(sub imm0,imm2, temp0)934 __(sub imm0,imm2,imm0) 1005 935 __(mov imm0,imm0,lsr #dnode_shift) 1006 936 __(cmp imm0,imm1) 1007 __(bhs 8f)1008 __(and imm 2,imm0,#31)1009 __(mov imm1,#0x80000000)1010 __(mov imm1, imm1,lsr imm2)1011 __(ref_global(temp 1,refbits))937 __(bhs 4f) 938 __(and imm1,imm0,#31) 939 __(mov arg_x,#0x80000000) 940 __(mov imm1,arg_x,lsr imm1) 941 __(ref_global(temp0,refbits)) 1012 942 __(mov imm0,imm0,lsr #bitmap_shift) 1013 __(add temp 1,temp1,imm0,lsl #word_shift)1014 __(ldr imm2,[temp 1])943 __(add temp0,temp0,imm0,lsl #word_shift) 944 __(ldr imm2,[temp0]) 1015 945 __(tst imm2,imm1) 1016 946 __(bxne lr) 1017 2: __(ldrex imm2,[temp 1])947 2: __(ldrex imm2,[temp0]) 1018 948 __(orr imm2,imm2,imm1) 1019 __(strex imm0,imm2,[temp1]) 949 __(strex imm0,imm2,[temp0]) 950 .globl C(egc_set_hash_key_conditional_test) 951 C(egc_set_hash_key_conditional_test): 1020 952 __(cmp imm0,#0) 1021 953 __(bne 2b) 1022 __(add imm0,arg_x,temp2,asr #fixnumshift) 1023 __(sub imm0,imm0,temp0) 1024 __(mov imm0,imm0,lsr #dnode_shift+8) 1025 __(mov imm1,#0x80000000) 1026 __(and imm2,imm0,#31) 1027 __(mov imm1,imm1,lsr imm2) 1028 __(mov imm0,imm0,lsr #bitmap_shift) 1029 __(ref_global(temp1,ephemeral_refidx)) 1030 __(add temp1,temp1,imm0,lsl #word_shift) 1031 3: __(ldrex imm2,[temp1]) 1032 __(orr imm2,imm2,imm1) 1033 __(strex imm0,imm2,[temp1]) 1034 __(cmp imm0,#0) 1035 __(bne 3b) 1036 __(b 8f) 954 __(b 4f) 1037 955 1038 956 /* arg_z = new value, arg_y = expected old value, arg_x = hash-vector, … … 1043 961 .globl C(egc_set_hash_key_conditional) 1044 962 C(egc_set_hash_key_conditional): 1045 __(vpop1( temp2))1046 __(unbox_fixnum(imm1, temp2))963 __(vpop1(imm1)) 964 __(unbox_fixnum(imm1,imm1)) 1047 965 0: __(add imm2,arg_x,imm1) 1048 966 __(ldrex temp1,[imm2]) 1049 967 __(cmp temp1,arg_y) 1050 __(bne 9f)968 __(bne 5f) 1051 969 __(strex imm0,arg_z,[imm2]) 1052 .globl C(egc_set_hash_key_conditional_test)1053 C(egc_set_hash_key_conditional_test):1054 970 __(cmp imm0,#0) 1055 971 __(bne 0b) 1056 972 __(cmp arg_z,arg_x) 1057 __(blo 8f)973 __(blo 4f) 1058 974 __(ref_global(temp0,ref_base)) 1059 975 __(sub imm0,imm2,temp0) … … 1061 977 __(ref_global(imm1,oldspace_dnode_count)) 1062 978 __(cmp imm0,imm1) 1063 __(bhs 8f)979 __(bhs 4f) 1064 980 __(and imm2,imm0,#31) 1065 981 __(mov imm1,#0x80000000) 1066 982 __(mov imm1,imm1,lsr imm2) 1067 983 __(mov imm0,imm0,lsr #bitmap_shift) 1068 __(ref_global(temp 1,refbits))1069 __(add temp 1,temp1,imm0,lsl #word_shift)1070 __(ldr imm2,[temp 1])984 __(ref_global(temp0,refbits)) 985 __(add temp0,temp0,imm0,lsl #word_shift) 986 __(ldr imm2,[temp0]) 1071 987 __(tst imm2,imm1) 1072 988 __(bxne lr) 1073 1: __(ldrex imm2,[temp 1])989 1: __(ldrex imm2,[temp0]) 1074 990 __(orr imm2,imm2,imm1) 1075 __(strex imm0,imm2,[temp 1])991 __(strex imm0,imm2,[temp0]) 1076 992 __(cmp imm0,#0) 1077 __(bne 1b) 1078 __(add imm0,arg_x,temp2,asr #fixnumshift) 1079 __(sub imm0,imm0,temp0) 1080 __(mov imm0,imm0,lsr #dnode_shift+8) 1081 __(and imm2,imm0,#31) 1082 __(mov imm1,#0x80000000) 1083 __(mov imm1,imm1,lsr imm2) 1084 __(mov imm0,imm0,lsr #bitmap_shift) 1085 __(ref_global(temp1,ephemeral_refidx)) 1086 __(add temp1,temp1,imm0,lsl #word_shift) 1087 2: __(ldrex imm2,[temp1]) 1088 __(orr imm2,imm2,imm1) 1089 __(strex imm0,imm2,[temp1]) 1090 __(cmp imm0,#0) 1091 __(bne 2b) 993 __(bne 1b) 1092 994 /* Now need to ensure that the hash table itself is in the refmap; we 1093 995 know that it's in bounds, etc. */ 996 __(ref_global(temp0,ref_base)) 1094 997 __(sub imm0,arg_x,temp0) 1095 998 __(mov imm0,imm0,lsr #dnode_shift) … … 1098 1001 __(mov imm1,imm1,lsr imm2) 1099 1002 __(mov imm0,imm0,lsr #bitmap_shift) 1100 __(ref_global(temp 1,refbits))1101 __(add temp 1,temp1,imm0,lsl #word_shift)1102 __(ldr imm2,[temp 1])1003 __(ref_global(temp0,refbits)) 1004 __(add temp0,temp0,imm0,lsl #word_shift) 1005 __(ldr imm2,[temp0]) 1103 1006 __(tst imm2,imm1) 1104 1007 __(bxne lr) 1105 3: __(ldrex imm2,[temp1])1008 1: __(ldrex imm2,[temp0]) 1106 1009 __(orr imm2,imm2,imm1) 1107 __(strex imm0,imm2,[temp 1])1010 __(strex imm0,imm2,[temp0]) 1108 1011 __(cmp imm0,#0) 1109 __(bne 3b) 1110 __(sub imm0,arg_x,temp0) 1111 __(mov imm0,imm0,lsr #dnode_shift+8) 1112 __(and imm2,imm0,#31) 1113 __(mov imm1,#0x80000000) 1114 __(mov imm1,imm1,lsr imm2) 1115 __(mov imm0,imm0,lsr #bitmap_shift) 1116 __(ref_global(temp1,ephemeral_refidx)) 1117 __(add temp1,temp1,imm0,lsl #word_shift) 1118 4: __(ldrex imm2,[temp1]) 1119 __(orr imm2,imm2,imm1) 1120 __(strex imm0,imm2,[temp1]) 1121 __(cmp imm0,#0) 1122 __(bne 4b) 1123 1012 __(bne 1b) 1124 1013 C(egc_write_barrier_end): 1125 8: __(mov arg_z,#nil_value)1014 4: __(mov arg_z,#nil_value) 1126 1015 __(add arg_z,arg_z,#t_offset) 1127 1016 __(bx lr) 1128 9: __(_clrex(arg_z))1017 5: __(_clrex(arg_z)) 1129 1018 __(mov arg_z,#nil_value) 1130 1019 __(bx lr) -
trunk/source/lisp-kernel/bits.c
r15821 r15826 54 54 } 55 55 56 /* Note that this zeros natural-sizedwords */56 /* Note that this zeros longwords */ 57 57 void 58 58 zero_bits(bitvector bits, natural nbits) 59 59 { 60 natural i, n = (((nbits+(nbits_in_word-1)))>>bitmap_shift); 61 62 for(i=0; i < n; i++) { 63 bits[i]= 0; 64 } 60 memset(bits, 0, ((sizeof(natural)*(((nbits+(nbits_in_word-1)))>>bitmap_shift)))); 65 61 } 66 62 -
trunk/source/lisp-kernel/constants.h
r15815 r15826 179 179 #define gc_postgc_pending fixnum_bitmask(26) 180 180 181 typedef struct {182 natural w0;183 natural w1;184 } dnode; -
trunk/source/lisp-kernel/gc-common.c
r15823 r15826 1090 1090 } 1091 1091 1092 typedef struct { 1093 bitvector refidx; 1094 bitvector refbits; 1095 bitvector idxp; 1096 bitvector idxlimit; 1097 bitvector rangelimit; 1098 bitvector reflimit; 1099 bitvector refp; 1100 natural idx; 1101 bitvector idxbase; 1102 } bitidx_state; 1103 1104 natural * 1105 next_refbits(bitidx_state *s) 1106 { 1107 bitvector p, limit; 1108 natural idxbit, idx; 1109 1110 while (1) { 1111 p = s->refp; 1112 limit = s->rangelimit; 1113 while (p < limit) { 1114 if (*p) { 1115 s->refp = p+1; 1116 return p; 1117 } 1118 p++; 1119 } 1120 idx = s->idx; 1121 while (idx == 0) { 1122 if (s->idxp == s->idxlimit) { 1123 return NULL; 1124 } 1125 idx = *(s->idxp); 1126 if (idx) { 1127 s->idx = idx; 1128 s->idxbase = s->refbits + ((s->idxp - s->refidx) * (WORD_SIZE * (256 / WORD_SIZE))); 1129 } 1130 s->idxp++; 1131 } 1132 idxbit = count_leading_zeros(idx); 1133 s->idx &= ~(BIT0_MASK>>idxbit); 1134 p = s->idxbase + (idxbit * (256/WORD_SIZE)); 1135 s->refp = p; 1136 s->rangelimit = p + (256/WORD_SIZE); 1137 if (s->reflimit < s->rangelimit) { 1138 s->rangelimit = s->reflimit; 1139 } 1140 } 1141 } 1142 1143 void 1144 init_bitidx_state(bitidx_state *s, bitvector refidx, bitvector refbits, natural ndnodes) 1145 { 1146 s->refidx = refidx; 1147 s->refbits = refbits; 1148 s->idxp = refidx; 1149 s->idxlimit = refidx + ((((ndnodes + 255) >> 8) + (WORD_SIZE-1)) >> bitmap_shift); 1150 s->idx = 0; 1151 s->reflimit = refbits + ((ndnodes + (WORD_SIZE-1)) >> bitmap_shift); 1152 s->refp = s->rangelimit = s->idxbase = NULL; 1153 } 1154 1155 1156 void 1157 forward_memoized_area(area *a, natural num_memo_dnodes, bitvector refbits, bitvector refidx) 1158 { 1159 LispObj *p = (LispObj *) a->low, *pbase = p, x1, x2, new; 1092 void 1093 forward_memoized_area(area *a, natural num_memo_dnodes, bitvector refbits) 1094 { 1095 LispObj *p = (LispObj *) a->low, x1, x2, new; 1160 1096 #ifdef ARM 1161 1097 LispObj *p0 = p; 1162 1098 #endif 1163 natural bits, *bitsp, nextbit, memo_dnode = 0, ref_dnode, hash_dnode_limit = 0;1099 natural bits, bitidx, *bitsp, nextbit, diff, memo_dnode = 0, hash_dnode_limit = 0; 1164 1100 int tag_x1; 1165 1101 hash_table_vector_header *hashp = NULL; 1166 1102 Boolean header_p; 1167 bitidx_state state;1168 1169 1103 1170 1104 1171 1105 1172 1106 if (num_memo_dnodes) { 1173 init_bitidx_state(&state, refidx, refbits, num_memo_dnodes);1174 1107 if (GCDebug) { 1175 check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits , refidx);1108 check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits); 1176 1109 } 1177 1110 … … 1179 1112 when we move a key in a hash table vector that wants 1180 1113 us to tell it about that. */ 1181 1182 bits = 0;1183 while ( 1) {1114 1115 set_bitidx_vars(refbits, 0, bitsp, bits, bitidx); 1116 while (memo_dnode < num_memo_dnodes) { 1184 1117 if (bits == 0) { 1185 bitsp = next_refbits(&state); 1186 if (bitsp == NULL) { 1187 return; 1188 } 1189 bits = *bitsp; 1190 ref_dnode = (bitsp-refbits)<<bitmap_shift; 1191 } 1192 nextbit = count_leading_zeros(bits); 1193 bits &= ~(BIT0_MASK>>nextbit); 1194 memo_dnode = ref_dnode + nextbit; 1195 p = pbase+(memo_dnode*2); 1196 x1 = p[0]; 1197 x2 = p[1]; 1198 tag_x1 = fulltag_of(x1); 1199 header_p = (nodeheader_tag_p(tag_x1)); 1200 1201 if (header_p && 1202 (header_subtag(x1) == subtag_hash_vector)) { 1203 hashp = (hash_table_vector_header *) p; 1204 if (hashp->flags & nhash_track_keys_mask) { 1205 hash_dnode_limit = memo_dnode + ((header_element_count(x1)+2)>>1); 1206 } else { 1207 hashp = NULL; 1208 } 1209 } 1210 if (! header_p) { 1211 new = node_forwarding_address(x1); 1212 if (new != x1) { 1213 *p = new; 1118 int remain = nbits_in_word - bitidx; 1119 memo_dnode += remain; 1120 p += (remain+remain); 1121 if (memo_dnode < num_memo_dnodes) { 1122 bits = *++bitsp; 1123 } 1124 bitidx = 0; 1125 } else { 1126 nextbit = count_leading_zeros(bits); 1127 if ((diff = (nextbit - bitidx)) != 0) { 1128 memo_dnode += diff; 1129 bitidx = nextbit; 1130 p += (diff+diff); 1131 } 1132 x1 = p[0]; 1133 x2 = p[1]; 1134 tag_x1 = fulltag_of(x1); 1135 bits &= ~(BIT0_MASK >> bitidx); 1136 header_p = (nodeheader_tag_p(tag_x1)); 1137 1138 if (header_p && 1139 (header_subtag(x1) == subtag_hash_vector)) { 1140 hashp = (hash_table_vector_header *) p; 1141 if (hashp->flags & nhash_track_keys_mask) { 1142 hash_dnode_limit = memo_dnode + ((header_element_count(x1)+2)>>1); 1143 } else { 1144 hashp = NULL; 1145 } 1146 } 1147 1148 1149 if (! header_p) { 1150 new = node_forwarding_address(x1); 1151 if (new != x1) { 1152 *p = new; 1214 1153 #ifdef ARM 1215 /* This is heuristic: the two words before P might be immediate 1216 data that just happens to look like a function header and 1217 an unboxed reference to p[0]. That's extremely unlikely, 1218 but close doesn't count ... Fix this. */ 1219 if (p != p0) { 1220 if(header_subtag(p[-2]) == subtag_function) { 1221 /* Just updated the code vector; fix the entrypoint */ 1222 if (p[-1] == (untag(x1)+fulltag_odd_fixnum)) { 1223 p[-1] = (untag(new)+fulltag_odd_fixnum); 1154 if (p != p0) { 1155 if(header_subtag(p[-2]) == subtag_function) { 1156 /* Just updated the code vector; fix the entrypoint */ 1157 if (p[-1] == (untag(x1)+fulltag_odd_fixnum)) { 1158 p[-1] = (untag(new)+fulltag_odd_fixnum); 1159 } 1224 1160 } 1225 1161 } 1226 }1227 1162 #endif 1228 } 1229 } 1230 p++; 1231 1232 new = node_forwarding_address(x2); 1233 if (new != x2) { 1234 *p = new; 1235 if (memo_dnode < hash_dnode_limit) { 1236 /* If this code is reached, 'hashp' is non-NULL and pointing 1237 at the header of a hash_table_vector, and 'memo_dnode' identifies 1238 a pair of words inside the hash_table_vector. It may be 1239 hard for program analysis tools to recognize that, but I 1240 believe that warnings about 'hashp' being NULL here can 1241 be safely ignored. */ 1242 hashp->flags |= nhash_key_moved_mask; 1243 hash_dnode_limit = 0; 1244 hashp = NULL; 1245 } 1163 } 1164 } 1165 p++; 1166 1167 new = node_forwarding_address(x2); 1168 if (new != x2) { 1169 *p = new; 1170 if (memo_dnode < hash_dnode_limit) { 1171 /* If this code is reached, 'hashp' is non-NULL and pointing 1172 at the header of a hash_table_vector, and 'memo_dnode' identifies 1173 a pair of words inside the hash_table_vector. It may be 1174 hard for program analysis tools to recognize that, but I 1175 believe that warnings about 'hashp' being NULL here can 1176 be safely ignored. */ 1177 hashp->flags |= nhash_key_moved_mask; 1178 hash_dnode_limit = 0; 1179 hashp = NULL; 1180 } 1181 } 1182 p++; 1183 memo_dnode++; 1184 bitidx++; 1185 1246 1186 } 1247 1187 } … … 1356 1296 } 1357 1297 1358 1359 void 1360 mark_managed_static_refs(area *a, BytePtr low_dynamic_address, natural ndynamic_dnodes, bitvector refidx) 1298 void 1299 mark_managed_static_refs(area *a, BytePtr low_dynamic_address, natural ndynamic_dnodes) 1361 1300 { 1362 1301 bitvector refbits = managed_static_refbits; 1363 dnode *dnodes = (dnode *)a->low, *d;1364 1302 LispObj *p = (LispObj *) a->low, x1, x2; 1365 natural inbits, outbits, bits, *bitsp, nextbit, memo_dnode = 0,1366 num_memo_dnodes = a->ndnodes , ref_dnode;1303 natural inbits, outbits, bits, bitidx, *bitsp, nextbit, diff, memo_dnode = 0, 1304 num_memo_dnodes = a->ndnodes; 1367 1305 Boolean keep_x1, keep_x2; 1368 bitidx_state state;1369 1306 1370 1307 if (num_memo_dnodes) { 1371 init_bitidx_state(&state, refidx, refbits, num_memo_dnodes);1372 1373 1308 if (GCDebug) { 1374 check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits , refidx);1309 check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits); 1375 1310 } 1376 1311 1377 1312 1378 1379 1380 inbits = outbits = bits = 0; 1381 while (1) { 1313 set_bitidx_vars(refbits, 0, bitsp, bits, bitidx); 1314 inbits = outbits = bits; 1315 while (memo_dnode < num_memo_dnodes) { 1382 1316 if (bits == 0) { 1317 int remain = nbits_in_word - bitidx; 1318 memo_dnode += remain; 1319 p += (remain+remain); 1383 1320 if (outbits != inbits) { 1384 1321 *bitsp = outbits; 1385 1322 } 1386 bitsp = next_refbits(&state); 1387 if (bitsp == NULL) { 1388 break; 1389 } 1390 inbits = outbits = bits = *bitsp; 1391 ref_dnode = (bitsp-refbits)<<bitmap_shift; 1392 } 1393 nextbit = count_leading_zeros(bits); 1394 bits &= ~(BIT0_MASK>>nextbit); 1395 memo_dnode = ref_dnode + nextbit; 1396 d = dnodes+memo_dnode; 1397 x1 = d->w0; 1398 x2 = d->w1; 1399 keep_x1 = mark_static_ref(x1, low_dynamic_address, ndynamic_dnodes); 1400 keep_x2 = mark_static_ref(x2, low_dynamic_address, ndynamic_dnodes); 1401 if ((keep_x1 == false) && 1402 (keep_x2 == false)) { 1403 outbits &= ~(BIT0_MASK >> nextbit); 1323 if (memo_dnode < num_memo_dnodes) { 1324 bits = *++bitsp; 1325 } 1326 inbits = outbits = bits; 1327 bitidx = 0; 1328 } else { 1329 nextbit = count_leading_zeros(bits); 1330 if ((diff = (nextbit - bitidx)) != 0) { 1331 memo_dnode += diff; 1332 bitidx = nextbit; 1333 p += (diff+diff); 1334 } 1335 x1 = *p++; 1336 x2 = *p++; 1337 bits &= ~(BIT0_MASK >> bitidx); 1338 keep_x1 = mark_static_ref(x1, low_dynamic_address, ndynamic_dnodes); 1339 keep_x2 = mark_static_ref(x2, low_dynamic_address, ndynamic_dnodes); 1340 if ((keep_x1 == false) && 1341 (keep_x2 == false)) { 1342 outbits &= ~(BIT0_MASK >> bitidx); 1343 } 1344 memo_dnode++; 1345 bitidx++; 1404 1346 } 1405 1347 } 1406 1348 if (GCDebug) { 1407 1349 p = (LispObj *) a->low; 1408 check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits, NULL); 1409 } 1410 } 1411 } 1412 1413 1414 void 1415 mark_memoized_area(area *a, natural num_memo_dnodes, bitvector refidx) 1350 check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits); 1351 } 1352 } 1353 } 1354 1355 void 1356 mark_memoized_area(area *a, natural num_memo_dnodes) 1416 1357 { 1417 1358 bitvector refbits = a->refbits; 1418 dnode *dnodes = (dnode *)a->low, *d; 1419 LispObj *p = (LispObj *) a->low,x1, x2; 1420 natural inbits, outbits, bits, bitidx, *bitsp, nextbit, diff, memo_dnode = 0, ref_dnode = 0; 1359 LispObj *p = (LispObj *) a->low, x1, x2; 1360 natural inbits, outbits, bits, bitidx, *bitsp, nextbit, diff, memo_dnode = 0; 1421 1361 Boolean keep_x1, keep_x2; 1422 1362 natural hash_dnode_limit = 0; 1423 1363 hash_table_vector_header *hashp = NULL; 1424 1364 int mark_method = 3; 1425 bitidx_state state;1426 1427 1428 1365 1429 1366 if (num_memo_dnodes) { 1430 init_bitidx_state(&state, refidx, refbits, num_memo_dnodes);1431 1432 1367 if (GCDebug) { 1433 check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits , refidx);1368 check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits); 1434 1369 } 1435 1370 … … 1439 1374 or readonly areas is definitely uninteresting, but other cases are 1440 1375 more complicated (and some of these cases are hard to detect.) 1376 1441 1377 Some headers are "interesting", to the forwarder if not to us. 1442 1378 … … 1461 1397 } 1462 1398 } 1463 1464 1465 1466 inbits = outbits = bits = 0; 1467 while (1) { 1399 1400 set_bitidx_vars(refbits, 0, bitsp, bits, bitidx); 1401 inbits = outbits = bits; 1402 while (memo_dnode < num_memo_dnodes) { 1468 1403 if (bits == 0) { 1404 int remain = nbits_in_word - bitidx; 1405 memo_dnode += remain; 1406 p += (remain+remain); 1469 1407 if (outbits != inbits) { 1470 1408 *bitsp = outbits; 1471 1409 } 1472 bitsp = next_refbits(&state); 1473 if (bitsp == NULL) { 1474 break; 1475 } 1476 inbits = outbits = bits = *bitsp; 1477 ref_dnode = (bitsp-refbits)<<bitmap_shift; 1478 } 1479 nextbit = count_leading_zeros(bits); 1480 bits &= ~(BIT0_MASK >> nextbit); 1481 memo_dnode = ref_dnode + nextbit; 1482 d = dnodes+memo_dnode; 1483 x1 = d->w0; 1484 x2 = d->w1; 1485 1486 1487 if (hashp) { 1488 Boolean force_x1 = false; 1489 if ((memo_dnode >= hash_dnode_limit) && (mark_method == 3)) { 1490 /* if vector_header_count is odd, x1 might be the last word of the header */ 1491 force_x1 = (hash_table_vector_header_count & 1) && (memo_dnode == hash_dnode_limit); 1492 /* was marking header, switch to data */ 1493 hash_dnode_limit = area_dnode(((LispObj *)hashp) 1494 + 1 1495 + header_element_count(hashp->header), 1496 a->low); 1497 /* In traditional weak method, don't mark vector entries at all. */ 1498 /* Otherwise mark the non-weak elements only */ 1499 mark_method = ((lisp_global(WEAK_GC_METHOD) == 0) ? 0 : 1500 ((hashp->flags & nhash_weak_value_mask) 1501 ? (1 + (hash_table_vector_header_count & 1)) 1502 : (2 - (hash_table_vector_header_count & 1)))); 1503 } 1504 1505 if (memo_dnode < hash_dnode_limit) { 1506 /* perhaps ignore one or both of the elements */ 1507 if (!force_x1 && !(mark_method & 1)) x1 = 0; 1508 if (!(mark_method & 2)) x2 = 0; 1509 } else { 1510 hashp = NULL; 1511 } 1512 } 1513 1514 if (header_subtag(x1) == subtag_hash_vector) { 1515 if (hashp) Bug(NULL, "header inside hash vector?"); 1516 hash_table_vector_header *hp = (hash_table_vector_header *)d; 1517 if (hp->flags & nhash_weak_mask) { 1518 /* Work around the issue that seems to cause ticket:817, 1519 which is that tenured hash vectors that are weak on value 1520 aren't always maintained on GCweakvll. If they aren't and 1521 we process them weakly here, nothing will delete the unreferenced 1522 elements. */ 1523 if (!(hp->flags & nhash_weak_value_mask)) { 1524 /* If header_count is odd, this cuts off the last header field */ 1525 /* That case is handled specially above */ 1526 hash_dnode_limit = memo_dnode + ((hash_table_vector_header_count) >>1); 1527 hashp = hp; 1528 mark_method = 3; 1529 } 1530 } 1531 } 1532 1533 keep_x1 = mark_ephemeral_root(x1); 1534 keep_x2 = mark_ephemeral_root(x2); 1535 if ((keep_x1 == false) && 1536 (keep_x2 == false) && 1537 (hashp == NULL)) { 1538 outbits &= ~(BIT0_MASK >> bitidx); 1410 if (memo_dnode < num_memo_dnodes) { 1411 bits = *++bitsp; 1412 } 1413 inbits = outbits = bits; 1414 bitidx = 0; 1415 } else { 1416 nextbit = count_leading_zeros(bits); 1417 if ((diff = (nextbit - bitidx)) != 0) { 1418 memo_dnode += diff; 1419 bitidx = nextbit; 1420 p += (diff+diff); 1421 } 1422 x1 = *p++; 1423 x2 = *p++; 1424 bits &= ~(BIT0_MASK >> bitidx); 1425 1426 1427 if (hashp) { 1428 Boolean force_x1 = false; 1429 if ((memo_dnode >= hash_dnode_limit) && (mark_method == 3)) { 1430 /* if vector_header_count is odd, x1 might be the last word of the header */ 1431 force_x1 = (hash_table_vector_header_count & 1) && (memo_dnode == hash_dnode_limit); 1432 /* was marking header, switch to data */ 1433 hash_dnode_limit = area_dnode(((LispObj *)hashp) 1434 + 1 1435 + header_element_count(hashp->header), 1436 a->low); 1437 /* In traditional weak method, don't mark vector entries at all. */ 1438 /* Otherwise mark the non-weak elements only */ 1439 mark_method = ((lisp_global(WEAK_GC_METHOD) == 0) ? 0 : 1440 ((hashp->flags & nhash_weak_value_mask) 1441 ? (1 + (hash_table_vector_header_count & 1)) 1442 : (2 - (hash_table_vector_header_count & 1)))); 1443 } 1444 1445 if (memo_dnode < hash_dnode_limit) { 1446 /* perhaps ignore one or both of the elements */ 1447 if (!force_x1 && !(mark_method & 1)) x1 = 0; 1448 if (!(mark_method & 2)) x2 = 0; 1449 } else { 1450 hashp = NULL; 1451 } 1452 } 1453 1454 if (header_subtag(x1) == subtag_hash_vector) { 1455 if (hashp) Bug(NULL, "header inside hash vector?"); 1456 hash_table_vector_header *hp = (hash_table_vector_header *)(p - 2); 1457 if (hp->flags & nhash_weak_mask) { 1458 /* Work around the issue that seems to cause ticket:817, 1459 which is that tenured hash vectors that are weak on value 1460 aren't always maintained on GCweakvll. If they aren't and 1461 we process them weakly here, nothing will delete the unreferenced 1462 elements. */ 1463 if (!(hp->flags & nhash_weak_value_mask)) { 1464 /* If header_count is odd, this cuts off the last header field */ 1465 /* That case is handled specially above */ 1466 hash_dnode_limit = memo_dnode + ((hash_table_vector_header_count) >>1); 1467 hashp = hp; 1468 mark_method = 3; 1469 } 1470 } 1471 } 1472 1473 keep_x1 = mark_ephemeral_root(x1); 1474 keep_x2 = mark_ephemeral_root(x2); 1475 if ((keep_x1 == false) && 1476 (keep_x2 == false) && 1477 (hashp == NULL)) { 1478 outbits &= ~(BIT0_MASK >> bitidx); 1479 } 1480 memo_dnode++; 1481 bitidx++; 1539 1482 } 1540 1483 } 1541 1484 if (GCDebug) { 1542 1485 p = (LispObj *) a->low; 1543 check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits , a->refidx);1486 check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits); 1544 1487 } 1545 1488 } … … 1743 1686 1744 1687 if (GCephemeral_low) { 1745 mark_memoized_area(tenured_area, area_dnode(a->low,tenured_area->low) , tenured_area->refidx);1746 mark_memoized_area(managed_static_area,managed_static_area->ndnodes , managed_static_area->refidx);1688 mark_memoized_area(tenured_area, area_dnode(a->low,tenured_area->low)); 1689 mark_memoized_area(managed_static_area,managed_static_area->ndnodes); 1747 1690 } else { 1748 mark_managed_static_refs(managed_static_area,low_markable_address,area_dnode(a->active,low_markable_address) , managed_static_refidx);1691 mark_managed_static_refs(managed_static_area,low_markable_address,area_dnode(a->active,low_markable_address)); 1749 1692 } 1750 1693 other_tcr = tcr; … … 1879 1822 1880 1823 if (GCephemeral_low) { 1881 forward_memoized_area(tenured_area, area_dnode(a->low, tenured_area->low), tenured_area->refbits , tenured_area->refidx);1882 forward_memoized_area(managed_static_area,managed_static_area->ndnodes, managed_static_area->refbits , managed_static_area->refidx);1824 forward_memoized_area(tenured_area, area_dnode(a->low, tenured_area->low), tenured_area->refbits); 1825 forward_memoized_area(managed_static_area,managed_static_area->ndnodes, managed_static_area->refbits); 1883 1826 } else { 1884 forward_memoized_area(managed_static_area,area_dnode(managed_static_area->active,managed_static_area->low),managed_static_refbits , managed_static_refidx);1827 forward_memoized_area(managed_static_area,area_dnode(managed_static_area->active,managed_static_area->low),managed_static_refbits); 1885 1828 } 1886 1829 a->active = (BytePtr) ptr_from_lispobj(compact_dynamic_heap()); -
trunk/source/lisp-kernel/gc.h
r15823 r15826 64 64 extern LispObj GCarealow, GCareadynamiclow; 65 65 extern natural GCndnodes_in_area, GCndynamic_dnodes_in_area; 66 extern bitvector GCmarkbits, GCdynamic_markbits,managed_static_refbits ,global_refidx,dynamic_refidx,managed_static_refidx;66 extern bitvector GCmarkbits, GCdynamic_markbits,managed_static_refbits; 67 67 LispObj *global_reloctab, *GCrelocptr; 68 68 LispObj GCfirstunmarked; … … 187 187 void update_locref(LispObj *); 188 188 void forward_gcable_ptrs(void); 189 void forward_memoized_area(area *, natural, bitvector, bitvector); 190 189 void forward_memoized_area(area *, natural, bitvector); 191 190 void forward_tcr_tlb(TCR *); 192 191 void reclaim_static_dnodes(void); … … 215 214 LispObj dnode_forwarding_address(natural, int); 216 215 LispObj locative_forwarding_address(LispObj); 217 void check_refmap_consistency(LispObj *, LispObj *, bitvector , bitvector);216 void check_refmap_consistency(LispObj *, LispObj *, bitvector); 218 217 void check_all_areas(TCR *); 219 218 void mark_tstack_area(area *); … … 221 220 void mark_cstack_area(area *); 222 221 void mark_simple_area_range(LispObj *, LispObj *); 223 void mark_memoized_area(area *, natural , bitvector);222 void mark_memoized_area(area *, natural); 224 223 LispObj calculate_relocation(void); 225 224 void forward_range(LispObj *, LispObj *); … … 254 253 did_gc_notification_since_last_full_gc; 255 254 256 257 258 255 #endif /* __GC_H__ */ -
trunk/source/lisp-kernel/image.c
r15823 r15826 282 282 fd)) { 283 283 return; 284 }285 /* Should change image format and store this in the image */286 {287 natural ndnodes = area_dnode(a->active, a->low), i;288 if (!CommitMemory(managed_static_refidx,(((ndnodes +255)>>8)+7)>>3)) {289 return;290 }291 for (i=0; i < ndnodes; i++) {292 if (ref_bit(managed_static_refbits,i)) {293 set_bit(managed_static_refidx,i>>8);294 }295 }296 284 } 297 285 advance += refbits_size; -
trunk/source/lisp-kernel/lisp_globals.h
r15823 r15826 78 78 #define MANAGED_STATIC_REFBITS (-50) /* refs from managed_static to dynamic */ 79 79 #define MANAGED_STATIC_DNODES (-51) /* ndnodes in managed_static_area */ 80 #define EPHEMERAL_REFIDX (-52) /* compressed refmap to ephmeral space */81 #define MANAGED_STATIC_REFIDX (-53) /* compressed refmap from managed static to dynamic */82 80 83 #define MIN_KERNEL_GLOBAL MANAGED_STATIC_REFIDX 81 82 83 #define MIN_KERNEL_GLOBAL MANAGED_STATIC_DNODES 84 84 85 85 /* These are only non-zero when an image is being saved or loaded */ -
trunk/source/lisp-kernel/lisp_globals.s
r15823 r15826 212 212 _rnode(managed_static_refbits) /* refs from managed_static to dynamic */ 213 213 _rnode(managed_static_dnodes) /* ndnodes in managed_static_area */ 214 _rnode(ephemeral_refidx) /* index of refbits */215 _rnode(managed_static_refidx) /* index of managed_static_refbits */216 214 _ends 217 215 -
trunk/source/lisp-kernel/mach-o-image.c
r15823 r15826 712 712 void *lib; 713 713 LispObj image_nil = 0; 714 natural i;715 714 716 715 /* Because of the way that we've reserved memory, we can only … … 844 843 CommitMemory(global_mark_ref_bits,align_to_power_of_2(nrefbytes, 12)); 845 844 CommitMemory(managed_static_refbits,align_to_power_of_2(nrefbytes, 12)); 846 CommitMemory(managed_static_refidx,(managed_static_area->ndnodes+255)>>3);847 845 memcpy(managed_static_refbits,ms_end,nrefbytes); 848 846 memset(ms_end,0,nrefbytes); 849 for (i = 0; i < managed_static_area->ndnodes; i++) { 850 if (ref_bit(managed_static_refbits,i)) { 851 set_bit(managed_static_refidx,i>>8); 852 } 853 } 847 854 848 return image_nil; 855 849 } -
trunk/source/lisp-kernel/memory.c
r15823 r15826 406 406 } 407 407 408 void409 zero_refbits(bitvector refidx, bitvector refbits, natural ndnodes)410 {411 bitvector refbase = refbits, refword, limit = refbase + ((ndnodes + (WORD_SIZE-1)) >> node_shift), reflimit;412 natural i, n = (((ndnodes + 255) >> 8) + (WORD_SIZE-1)) >> bitmap_shift, bit, idx;413 414 for (i = 0; i < n; i++, refbase += WORD_SIZE * (256 / WORD_SIZE)) {415 idx = *refidx;416 417 if (idx != 0) {418 *refidx = 0;419 while (idx) {420 bit = count_leading_zeros(idx);421 idx &= ~(BIT0_MASK>>bit);422 refword = refbase + bit * (256/WORD_SIZE);423 reflimit = refword + (256/WORD_SIZE);424 if (limit < reflimit) {425 reflimit = limit;426 }427 while (refword < reflimit) {428 *refword++ = 0;429 }430 }431 }432 refidx++;433 }434 #if 0435 /* Check,slowly */436 for (i=0;i<ndnodes;i++) {437 if (ref_bit(refbits,i)) {438 Bug(NULL, "Bit 0x" LISP " set unexpectedly\n", i);439 }440 }441 #endif442 }443 444 408 445 409 … … 690 654 691 655 if (target == tenured_area) { 692 zero_refbits(global_refidx,managed_static_area->refbits, managed_static_area->ndnodes);693 656 zero_bits(refbits, new_tenured_dnodes); 694 zero_bits(dynamic_refidx,(new_tenured_dnodes+255)>>8);695 657 lisp_global(OLDEST_EPHEMERAL) = ptr_to_lispobj(curfree); 696 658 } else { … … 925 887 } 926 888 927 928 929 930 931 889 #ifdef DARWIN 932 890 /* -
trunk/source/lisp-kernel/memprotect.h
r15823 r15826 129 129 130 130 131 void132 initialize_refidx_from_refbits(bitvector, bitvector, natural);133 131 134 132 #endif /* __memprotect_h__ */ -
trunk/source/lisp-kernel/pmcl-kernel.c
r15823 r15826 136 136 137 137 LispObj lisp_nil = (LispObj) 0; 138 bitvector global_mark_ref_bits = NULL, dynamic_mark_ref_bits = NULL, relocatable_mark_ref_bits = NULL , global_refidx = NULL, dynamic_refidx = NULL,managed_static_refidx = NULL;138 bitvector global_mark_ref_bits = NULL, dynamic_mark_ref_bits = NULL, relocatable_mark_ref_bits = NULL; 139 139 140 140 … … 290 290 a->hardlimit = base+hardsize; 291 291 a->softlimit = base+hardsize+softsize; 292 a->h = h; 292 293 a->softprot = soft_area; 293 294 a->hardprot = hard_area; … … 525 526 { 526 527 Ptr h; 527 natural base , refbits_size;528 natural base; 528 529 BytePtr 529 530 end, … … 571 572 end = lastbyte; 572 573 reserved_region_end = lastbyte; 573 refbits_size = ((totalsize+63)>>6); /* word size! */ 574 end = (BytePtr) ((natural)((((natural)end) - refbits_size) & ~4095)); 574 end = (BytePtr) ((natural)((((natural)end) - ((totalsize+63)>>6)) & ~4095)); 575 575 576 576 global_mark_ref_bits = (bitvector)end; 577 end = (BytePtr) ((natural)((((natural)end) - ((refbits_size+255) >> 8)) & ~4095));578 global_refidx = (bitvector)end;579 /* Don't really want to commit so much so soon */580 CommitMemory((BytePtr)global_refidx,(BytePtr)global_mark_ref_bits-(BytePtr)global_refidx);581 582 577 end = (BytePtr) ((natural)((((natural)end) - ((totalsize+63) >> 6)) & ~4095)); 583 578 global_reloctab = (LispObj *) end; … … 597 592 exit(1); 598 593 } 599 managed_static_refidx = ReserveMemory(((((MANAGED_STATIC_SIZE>>dnode_shift)+255)>>8)+7)>>3);600 if (managed_static_refidx == NULL) {601 #ifdef WINDOWS602 wperror("allocate refidx for managed static area");603 #else604 perror("allocate refidx for managed static area");605 #endif606 exit(1);607 }608 594 } 609 595 #endif … … 657 643 prefix_size = (prefix_dnodes+7)>>3, 658 644 markbits_size = (3*sizeof(LispObj))+((ndnodes+7)>>3), 659 prefix_index_bits,660 645 n; 661 646 low_markable_address = low; 662 647 high_markable_address = high; 663 648 dynamic_mark_ref_bits = (bitvector)(((BytePtr)global_mark_ref_bits)+prefix_size); 664 if (prefix_dnodes & 255) {665 fprintf(dbgout, "warning: prefix_dnodes not a multiple of 256\n");666 }667 prefix_index_bits = prefix_dnodes>>8;668 if (prefix_index_bits & (WORD_SIZE-1)) {669 fprintf(dbgout, "warning: prefix_index_bits not a multiple of %d\n", WORD_SIZE);670 }671 dynamic_refidx = (bitvector)(((BytePtr)global_refidx)+(prefix_index_bits>>3));672 649 relocatable_mark_ref_bits = dynamic_mark_ref_bits; 673 650 n = align_to_power_of_2(markbits_size,log2_page_size); … … 745 722 add_area_holding_area_lock(a); 746 723 CommitMemory(start, end-start); 724 a->h = start; 747 725 a->softprot = NULL; 748 726 a->hardprot = NULL; … … 1770 1748 tenured_area->younger = g2_area; 1771 1749 tenured_area->refbits = dynamic_mark_ref_bits; 1772 tenured_area->refidx = dynamic_refidx;1773 1750 managed_static_area->refbits = global_mark_ref_bits; 1774 managed_static_area->refidx = global_refidx;1775 1751 a->markbits = dynamic_mark_ref_bits; 1776 1752 tenured_area->static_dnodes = a->static_dnodes; … … 1781 1757 lisp_global(STATIC_CONS_AREA) = ptr_to_lispobj(static_cons_area); 1782 1758 lisp_global(REFBITS) = ptr_to_lispobj(global_mark_ref_bits); 1783 lisp_global(EPHEMERAL_REFIDX) = ptr_to_lispobj(global_refidx);1784 1759 g2_area->threshold = default_g2_threshold; 1785 1760 g1_area->threshold = default_g1_threshold; … … 2088 2063 } 2089 2064 lisp_global(MANAGED_STATIC_REFBITS) = (LispObj)managed_static_refbits; 2090 lisp_global(MANAGED_STATIC_REFIDX) = (LispObj)managed_static_refidx;2091 2065 lisp_global(MANAGED_STATIC_DNODES) = (LispObj)managed_static_area->ndnodes; 2092 2066 atexit(lazarus); -
trunk/source/lisp-kernel/ppc-exceptions.c
r15816 r15826 1999 1999 ((LispObj)ea < val)) { 2000 2000 atomic_set_bit(refbits, bitnumber); 2001 atomic_set_bit(global_refidx, bitnumber>>8);2002 2001 if (need_memoize_root) { 2003 2002 bitnumber = area_dnode(root, lisp_global(REF_BASE)); 2004 2003 atomic_set_bit(refbits, bitnumber); 2005 atomic_set_bit(global_refidx,bitnumber>>8);2006 2004 } 2007 2005 } -
trunk/source/lisp-kernel/ppc-gc.c
r15821 r15826 832 832 833 833 void 834 check_refmap_consistency(LispObj *start, LispObj *end, bitvector refbits , bitvector refidx)834 check_refmap_consistency(LispObj *start, LispObj *end, bitvector refbits) 835 835 { 836 836 LispObj x1, *base = start, *prev = start; … … 875 875 Bug(NULL, "Missing memoization in doublenode at 0x" LISP "\n", start); 876 876 set_bit(refbits, ref_dnode); 877 if (refidx) {878 set_bit(refidx,ref_dnode>>8);879 }880 } else {881 if (refidx) {882 if (!ref_bit(refidx, ref_dnode>>8)) {883 Bug(NULL, "Memoization for doublenode at 0x" LISP " not indexed\n", start);884 set_bit(refidx,ref_dnode>>8);885 }886 }887 877 } 888 878 } -
trunk/source/lisp-kernel/ppc-spentry.s
r15817 r15826 481 481 __(sub imm0,arg_y,imm2) 482 482 __(load_highbit(imm3)) 483 __(srri(imm0,imm0,dnode_shift)) 484 __(srri(imm2,imm0,8)) 483 __(srri(imm0,imm0,dnode_shift)) 485 484 __(ref_global(imm1,oldspace_dnode_count)) 486 485 __(extract_bit_shift_count(imm4,imm0)) … … 488 487 __(srr(imm3,imm3,imm4)) 489 488 __(srri(imm0,imm0,bitmap_shift)) 490 __(ref_global( temp0,refbits))489 __(ref_global(imm2,refbits)) 491 490 __(bgelr) 492 491 __(slri(imm0,imm0,word_shift)) 493 __(ldrx(imm1, temp0,imm0))492 __(ldrx(imm1,imm2,imm0)) 494 493 __(and. imm1,imm1,imm3) 495 494 __(bnelr) 496 1: __(lrarx(imm1, temp0,imm0))495 1: __(lrarx(imm1,imm2,imm0)) 497 496 __(or imm1,imm1,imm3) 498 __(strcx(imm1, temp0,imm0))497 __(strcx(imm1,imm2,imm0)) 499 498 __(bne- 1b) 500 499 __(isync) 501 __(extract_bit_shift_count(imm4,imm2))502 __(srri(imm2,imm2,bitmap_shift))503 __(load_highbit(imm3))504 __(ref_global(temp0,ephemeral_refidx))505 __(slri(imm2,imm2,word_shift))506 __(srr(imm3,imm3,imm4))507 2: __(lrarx(imm1,temp0,imm2))508 __(or imm1,imm1,imm3)509 __(strcx(imm1,temp0,imm2))510 __(bne 2b)511 __(isync)512 500 __(blr) 513 501 … … 527 515 __(extract_bit_shift_count(imm4,imm0)) 528 516 __(cmplr(imm0,imm1)) 529 __(srri(imm2,imm0,8))530 517 __(srr(imm3,imm3,imm4)) 531 518 __(srri(imm0,imm0,bitmap_shift)) 532 __(ref_global( temp0,refbits))519 __(ref_global(imm2,refbits)) 533 520 __(bgelr) 534 521 __(slri(imm0,imm0,word_shift)) 535 __(ldrx(imm1, temp0,imm0))522 __(ldrx(imm1,imm2,imm0)) 536 523 __(and. imm1,imm1,imm3) 537 524 __(bnelr) 538 1: __(lrarx(imm1, temp0,imm0))525 1: __(lrarx(imm1,imm2,imm0)) 539 526 __(or imm1,imm1,imm3) 540 __(strcx(imm1, temp0,imm0))527 __(strcx(imm1,imm2,imm0)) 541 528 __(bne- 1b) 542 529 __(isync) 543 __(extract_bit_shift_count(imm4,imm2))544 __(srri(imm2,imm2,bitmap_shift))545 __(load_highbit(imm3))546 __(ref_global(temp0,ephemeral_refidx))547 __(slri(imm2,imm2,word_shift))548 __(srr(imm3,imm3,imm4))549 2: __(lrarx(imm1,temp0,imm2))550 __(or imm1,imm1,imm3)551 __(strcx(imm1,temp0,imm2))552 __(bne 2b)553 __(isync)554 530 __(blr) 555 531 … … 572 548 __(srri(imm0,imm0,dnode_shift)) 573 549 __(cmplr(imm0,imm1)) 574 __(srri(imm2,imm0,8))575 550 __(extract_bit_shift_count(imm4,imm0)) 576 551 __(srri(imm0,imm0,bitmap_shift)) 577 552 __(srr(imm3,imm3,imm4)) 578 __(ref_global( temp0,refbits))553 __(ref_global(imm2,refbits)) 579 554 __(bgelr) 580 555 __(slri(imm0,imm0,word_shift)) 581 __(ldrx(imm1, temp0,imm0))556 __(ldrx(imm1,imm2,imm0)) 582 557 __(and. imm1,imm1,imm3) 583 558 __(bnelr) 584 1: __(lrarx(imm1, temp0,imm0))559 1: __(lrarx(imm1,imm2,imm0)) 585 560 __(or imm1,imm1,imm3) 586 __(strcx(imm1, temp0,imm0))561 __(strcx(imm1,imm2,imm0)) 587 562 __(bne- 1b) 588 563 __(isync) 589 __(extract_bit_shift_count(imm4,imm2))590 __(srri(imm2,imm2,bitmap_shift))591 __(load_highbit(imm3))592 __(ref_global(temp0,ephemeral_refidx))593 __(slri(imm2,imm2,word_shift))594 __(srr(imm3,imm3,imm4))595 2: __(lrarx(imm1,temp0,imm2))596 __(or imm1,imm1,imm3)597 __(strcx(imm1,temp0,imm2))598 __(bne 2b)599 __(isync)600 564 __(blr) 601 565 … … 619 583 __(srri(imm0,imm0,dnode_shift)) 620 584 __(cmplr(imm0,imm1)) 621 __(srri(imm2,imm0,8))622 585 __(extract_bit_shift_count(imm4,imm0)) 623 586 __(srri(imm0,imm0,bitmap_shift)) 624 587 __(srr(imm3,imm3,imm4)) 625 __(ref_global(temp0,refbits)) 626 __(ref_global(temp1,ephemeral_refidx)) 588 __(ref_global(imm2,refbits)) 627 589 __(bgelr) 628 590 __(slri(imm0,imm0,word_shift)) 629 __(ldrx(imm1, temp0,imm0))591 __(ldrx(imm1,imm2,imm0)) 630 592 __(and. imm1,imm1,imm3) 631 __(bne 3f)632 1: __(lrarx(imm1, temp0,imm0))593 __(bne 2f) 594 1: __(lrarx(imm1,imm2,imm0)) 633 595 __(or imm1,imm1,imm3) 634 __(strcx(imm1, temp0,imm0))596 __(strcx(imm1,imm2,imm0)) 635 597 __(bne- 1b) 636 598 __(isync) 637 __(load_highbit(imm3)) 638 __(extract_bit_shift_count(imm4,imm2)) 639 __(srri(imm2,imm2,bitmap_shift)) 640 __(srr(imm3,imm3,imm4)) 641 __(slri(imm2,imm2,word_shift)) 642 2: __(lrarx(imm1,temp1,imm2)) 643 __(or imm1,imm1,imm3) 644 __(strcx(imm1,temp1,imm2)) 645 __(bne 2b) 646 __(isync) 647 3: 599 2: 648 600 __(ref_global(imm1,ref_base)) 649 601 __(sub imm0,arg_x,imm1) 650 602 __(srri(imm0,imm0,dnode_shift)) 651 __(srri(imm2,imm0,8))652 603 __(load_highbit(imm3)) 653 604 __(extract_bit_shift_count(imm4,imm0)) … … 655 606 __(srr(imm3,imm3,imm4)) 656 607 __(slri(imm0,imm0,word_shift)) 657 __(ldrx(imm1, temp0,imm0))608 __(ldrx(imm1,imm2,imm0)) 658 609 __(and. imm1,imm1,imm3) 659 610 __(bnelr) 660 4: __(lrarx(imm1,temp0,imm0))611 3: __(lrarx(imm1,imm2,imm0)) 661 612 __(or imm1,imm1,imm3) 662 __(strcx(imm1, temp0,imm0))663 __(bne- 4b)613 __(strcx(imm1,imm2,imm0)) 614 __(bne- 3b) 664 615 __(isync) 665 __(load_highbit(imm3))666 __(extract_bit_shift_count(imm4,imm2))667 __(srri(imm2,imm2,bitmap_shift))668 __(srr(imm3,imm3,imm4))669 __(slri(imm2,imm2,word_shift))670 5: __(lrarx(imm1,temp1,imm2))671 __(or imm1,imm1,imm3)672 __(strcx(imm1,temp1,imm2))673 __(bne 5b)674 __(isync)675 616 __(blr) 676 617 … … 702 643 1: __(lrarx(temp1,arg_x,imm4)) 703 644 __(cmpr(cr1,temp1,arg_y)) 704 __(bne cr1, 9f)645 __(bne cr1,5f) 705 646 __(strcx(arg_z,arg_x,imm4)) 706 647 .globl C(egc_store_node_conditional_test) … … 715 656 __(srri(imm0,imm0,dnode_shift)) 716 657 __(cmplr(imm0,imm1)) 717 __(srri(imm2,imm0,8)) 718 __(extract_bit_shift_count(imm4,imm0)) 658 __(extract_bit_shift_count(imm2,imm0)) 719 659 __(srri(imm0,imm0,bitmap_shift)) 720 __(srr(imm3,imm3,imm 4))721 __(ref_global( temp0,refbits))722 __(bge 8f)660 __(srr(imm3,imm3,imm2)) 661 __(ref_global(imm2,refbits)) 662 __(bge 4f) 723 663 __(slri(imm0,imm0,word_shift)) 724 2: __(lrarx(imm1, temp0,imm0))664 2: __(lrarx(imm1,imm2,imm0)) 725 665 __(or imm1,imm1,imm3) 726 __(strcx( imm1,temp0,imm0))666 __(strcx( imm1,imm2,imm0)) 727 667 __(bne- 2b) 728 668 __(isync) 729 __(load_highbit(imm3)) 730 __(extract_bit_shift_count(imm4,imm2)) 731 __(srri(imm2,imm2,bitmap_shift)) 732 __(ref_global(temp0,ephemeral_refidx)) 733 __(srr(imm3,imm3,imm4)) 734 __(slri(imm2,imm2,word_shift)) 735 3: __(lrarx(imm1,temp0,imm2)) 736 __(or imm1,imm1,imm3) 737 __(strcx(imm1,temp0,imm2)) 738 __(bne 3b) 739 __(isync) 740 __(b 8f) 669 __(b 4f) 741 670 742 671 /* arg_z = new value, arg_y = expected old value, arg_x = hash-vector, … … 752 681 1: __(lrarx(temp1,arg_x,imm4)) 753 682 __(cmpr(cr1,temp1,arg_y)) 754 __(bne cr1, 9f)683 __(bne cr1,5f) 755 684 __(strcx(arg_z,arg_x,imm4)) 756 685 .globl C(egc_set_hash_key_conditional_test) … … 765 694 __(srri(imm0,imm0,dnode_shift)) 766 695 __(cmplr(imm0,imm1)) 767 __(srri(imm2,imm0,8)) 768 __(extract_bit_shift_count(imm4,imm0)) 769 __(srri(imm0,imm0,bitmap_shift)) 770 __(srr(imm3,imm3,imm4)) 771 __(ref_global(temp0,refbits)) 772 __(ref_global(temp1,ephemeral_refidx)) 773 __(bge 8f) 696 __(extract_bit_shift_count(imm2,imm0)) 697 __(srri(imm0,imm0,bitmap_shift)) 698 __(srr(imm3,imm3,imm2)) 699 __(ref_global(imm2,refbits)) 700 __(bge 4f) 774 701 __(slri(imm0,imm0,word_shift)) 775 2: __(lrarx(imm1, temp0,imm0))702 2: __(lrarx(imm1,imm2,imm0)) 776 703 __(or imm1,imm1,imm3) 777 __(strcx(imm1, temp0,imm0))704 __(strcx(imm1,imm2,imm0)) 778 705 __(bne- 2b) 779 706 __(isync) 780 __(load_highbit(imm3))781 __(extract_bit_shift_count(imm4,imm2))782 __(srri(imm2,imm2,bitmap_shift))783 __(srr(imm3,imm3,imm4))784 __(slri(imm2,imm2,word_shift))785 3: __(lrarx(imm1,temp1,imm2))786 __(or imm1,imm1,imm3)787 __(strcx(imm1,temp1,imm2))788 __(bne 3b)789 __(isync)790 791 707 /* Memoize hash table header */ 792 708 __(ref_global(imm1,ref_base)) … … 794 710 __(srri(imm0,imm0,dnode_shift)) 795 711 __(load_highbit(imm3)) 796 __(srri(imm2,imm0,8))797 712 __(extract_bit_shift_count(imm4,imm0)) 798 713 __(srri(imm0,imm0,bitmap_shift)) 799 714 __(srr(imm3,imm3,imm4)) 800 715 __(slri(imm0,imm0,word_shift)) 801 __(ldrx(imm1, temp0,imm0))716 __(ldrx(imm1,imm2,imm0)) 802 717 __(and. imm1,imm1,imm3) 803 __(bne 8f)804 4: __(lrarx(imm1,temp0,imm0))718 __(bne 4f) 719 3: __(lrarx(imm1,imm2,imm0)) 805 720 __(or imm1,imm1,imm3) 806 __(strcx(imm1,temp0,imm0)) 807 __(bne- 4b) 808 __(isync) 809 __(load_highbit(imm3)) 810 __(extract_bit_shift_count(imm4,imm2)) 811 __(srri(imm2,imm2,bitmap_shift)) 812 __(srr(imm3,imm3,imm4)) 813 __(slri(imm2,imm2,word_shift)) 814 5: __(lrarx(imm1,temp1,imm2)) 815 __(or imm1,imm1,imm3) 816 __(strcx(imm1,temp1,imm2)) 817 __(bne 5b) 721 __(strcx(imm1,imm2,imm0)) 722 __(bne- 3b) 818 723 __(isync) 819 724 C(egc_write_barrier_end): 820 8: __(li arg_z,t_value)821 __(blr) 822 9: __(li imm0,RESERVATION_DISCHARGE)725 4: __(li arg_z,t_value) 726 __(blr) 727 5: __(li imm0,RESERVATION_DISCHARGE) 823 728 __(strcx(rzero,0,imm0)) 824 729 __(li arg_z,nil_value) -
trunk/source/lisp-kernel/x86-exceptions.c
r15823 r15826 2760 2760 if ((bitnumber < lisp_global(OLDSPACE_DNODE_COUNT))) { 2761 2761 atomic_set_bit(refbits, bitnumber); 2762 atomic_set_bit(global_refidx,bitnumber>>8);2763 2762 if (need_memoize_root) { 2764 2763 atomic_set_bit(refbits, rootbitnumber); 2765 atomic_set_bit(global_refidx,rootbitnumber>>8);2766 2764 } 2767 2765 } 2768 2766 if (bitnumber < lisp_global(MANAGED_STATIC_DNODES)) { 2769 2767 atomic_set_bit(managed_static_refbits,bitnumber); 2770 atomic_set_bit(managed_static_refidx,bitnumber>>8);2771 2768 if (need_memoize_root) { 2772 2769 atomic_set_bit(managed_static_refbits, rootbitnumber); 2773 atomic_set_bit(managed_static_refidx,rootbitnumber>>8);2774 2770 } 2775 2771 } -
trunk/source/lisp-kernel/x86-gc.c
r15823 r15826 1216 1216 1217 1217 void 1218 check_refmap_consistency(LispObj *start, LispObj *end, bitvector refbits , bitvector refidx)1218 check_refmap_consistency(LispObj *start, LispObj *end, bitvector refbits) 1219 1219 { 1220 1220 LispObj x1, *base = start, *prev = start; … … 1273 1273 Bug(NULL, "Missing memoization in doublenode at 0x" LISP "\n", start); 1274 1274 set_bit(refbits, ref_dnode); 1275 if (refidx) {1276 set_bit(refidx, ref_dnode>>8);1277 }1278 } else {1279 if (refidx) {1280 if (!ref_bit(refidx, ref_dnode>>8)) {1281 Bug(NULL, "Memoization for doublenode at 0x" LISP " not indexed\n", start);1282 set_bit(refidx,ref_dnode>>8);1283 }1284 }1285 1275 } 1286 1276 } … … 2688 2678 *base = start, *prev = start; 2689 2679 int tag; 2690 bitvector refbits = managed_static_refbits , refidx = managed_static_refidx;2680 bitvector refbits = managed_static_refbits; 2691 2681 natural ref_dnode, node_dnode; 2692 2682 Boolean intergen_ref; … … 2732 2722 ref_dnode = area_dnode(start, base); 2733 2723 set_bit(refbits, ref_dnode); 2734 set_bit(refidx, ref_dnode>>8);2735 2724 } 2736 2725 start += 2; … … 2839 2828 CommitMemory(managed_static_area->refbits, refbytes); /* zeros them */ 2840 2829 CommitMemory(managed_static_refbits,refbytes); /* zeroes them, too */ 2841 CommitMemory(managed_static_refidx,((managed_dnodes+255)>>8)>>3);2842 2830 update_managed_refs(managed_static_area, low_markable_address, area_dnode(a->active,low_markable_address)); 2843 2831 } -
trunk/source/lisp-kernel/x86-spentry32.s
r15823 r15826 1732 1732 __(cmpl lisp_global(oldspace_dnode_count),%imm0) 1733 1733 __(jae 2f) 1734 __(movd %imm0,%mm0)1735 1734 __(ref_global(refbits,%temp0)) 1736 1735 __(xorb $31,%imm0_b) 1737 1736 __(lock) 1738 1737 __(btsl %imm0,(%temp0)) 1739 __(shrl $8,%imm0)1740 1738 __(xorb $31,%imm0_b) 1741 __(ref_global(ephemeral_refidx,%temp0))1742 __(lock)1743 __(btsl %imm0,(%temp0))1744 __(movd %mm0,%imm0)1745 1739 2: __(cmpl lisp_global(managed_static_dnodes),%imm0) 1746 1740 __(jae 0b) 1747 1741 __(ref_global(managed_static_refbits,%temp0)) 1748 __(xorb $31,%imm0_b)1749 __(lock)1750 __(btsl %imm0,(%temp0))1751 __(ref_global(managed_static_refidx,%temp0))1752 __(shrl $8,%imm0)1753 1742 __(xorb $31,%imm0_b) 1754 1743 __(lock) … … 1770 1759 __(cmpl lisp_global(oldspace_dnode_count),%imm0) 1771 1760 __(jae 2f) 1772 __(movd %imm0,%mm0)1773 1761 __(ref_global(refbits,%temp0)) 1774 1762 __(xorb $31,%imm0_b) 1775 1763 __(lock) 1776 1764 __(btsl %imm0,(%temp0)) 1777 __(shrl $8,%imm0) 1778 __(xorb $31,%imm0_b) 1779 __(ref_global(ephemeral_refidx,%temp0)) 1780 __(lock) 1781 __(btsl %imm0,(%temp0)) 1782 __(movd %mm0,%imm0) 1765 __(xorb $31,%imm0_b) 1783 1766 2: __(cmpl lisp_global(managed_static_dnodes),%imm0) 1784 1767 __(jae 0b) … … 1787 1770 __(lock) 1788 1771 __(btsl %imm0,(%temp0)) 1789 __(ref_global(managed_static_refidx,%temp0))1790 __(shrl $8,%imm0)1791 __(xorb $31,%imm0_b)1792 __(lock)1793 __(btsl %imm0,(%temp0))1794 1772 __(ret) 1795 1773 _endsubp(rplacd) … … 1810 1788 __(cmpl lisp_global(oldspace_dnode_count),%imm0) 1811 1789 __(jae 2f) 1812 __(movd %imm0,%mm0)1813 1790 __(ref_global(refbits,%temp1)) 1814 1791 __(xorb $31,%imm0_b) 1815 1792 __(lock) 1816 1793 __(btsl %imm0,(%temp1)) 1817 __(shrl $8,%imm0)1818 1794 __(xorb $31,%imm0_b) 1819 __(ref_global(ephemeral_refidx,%temp1))1820 __(lock)1821 __(btsl %imm0,(%temp1))1822 __(movd %mm0,%imm0)1823 1795 2: __(cmpl lisp_global(managed_static_dnodes),%imm0) 1824 1796 __(jae 0b) … … 1827 1799 __(lock) 1828 1800 __(btsl %imm0,(%temp1)) 1829 __(ref_global(managed_static_refidx,%temp1))1830 __(shrl $8,%imm0)1831 __(xorb $31,%imm0_b)1832 __(lock)1833 __(btsl %imm0,(%temp1))1834 1801 __(ret) 1835 1802 _endsubp(gvset) … … 1856 1823 __(lock) 1857 1824 __(btsl %imm0,(%temp1)) 1858 __(shrl $8,%imm0)1859 __(xorb $31,%imm0_b)1860 __(ref_global(ephemeral_refidx,%temp1))1861 __(lock)1862 __(btsl %imm0,(%temp1))1863 1825 /* Now memoize the address of the hash vector */ 1864 __(ref_global(refbits,%temp1))1865 1826 __(movl %temp0,%imm0) 1866 1827 __(subl lisp_global(ref_base),%imm0) … … 1869 1830 __(lock) 1870 1831 __(btsl %imm0,(%temp1)) 1871 __(shrl $8,%imm0)1872 __(xorb $31,%imm0_b)1873 __(ref_global(ephemeral_refidx,%temp1))1874 __(lock)1875 __(btsl %imm0,(%temp1))1876 1832 __(lea misc_data_offset(%temp0,%arg_y),%imm0) 1877 1833 __(subl lisp_global(ref_base),%imm0) … … 1883 1839 __(lock) 1884 1840 __(btsl %imm0,(%temp1)) 1885 __(ref_global(managed_static_refidx,%temp1))1886 __(shrl $8,%imm0)1887 __(xorb $31,%imm0_b)1888 __(lock)1889 __(btsl %imm0,(%temp1))1890 1841 /* Now memoize the address of the hash vector */ 1891 __(ref_global(managed_static_refbits,%temp1))1892 1842 __(movl %temp0,%imm0) 1893 1843 __(subl lisp_global(ref_base),%imm0) … … 1896 1846 __(lock) 1897 1847 __(btsl %imm0,(%temp1)) 1898 __(ref_global(managed_static_refidx,%temp1))1899 __(shrl $8,%imm0)1900 __(xorb $31,%imm0_b)1901 __(lock)1902 __(btsl %imm0,(%temp1))1903 1848 __(ret) 1904 1849 _endsubp(set_hash_key) … … 1930 1875 __(cmpl lisp_global(oldspace_dnode_count),%imm0) 1931 1876 __(jae 2f) 1932 __(movd %imm0,%mm0)1933 1877 __(ref_global(refbits,%arg_y)) 1934 1878 __(xorb $31,%imm0_b) 1935 1879 __(lock) 1936 1880 __(btsl %imm0,(%arg_y)) 1937 __(shrl $8,%imm0)1938 1881 __(xorb $31,%imm0_b) 1939 __(ref_global(ephemeral_refidx,%arg_y))1940 __(lock)1941 __(btsl %imm0,(%arg_y))1942 __(movd %mm0,%imm0)1943 1882 2: __(cmpl lisp_global(managed_static_dnodes),%imm0) 1944 1883 __(jae 8f) 1945 1884 __(ref_global(managed_static_refbits,%arg_y)) 1946 __(xorb $31,%imm0_b)1947 __(lock)1948 __(btsl %imm0,(%arg_y))1949 __(ref_global(managed_static_refidx,%arg_y))1950 __(shrl $8,%imm0)1951 1885 __(xorb $31,%imm0_b) 1952 1886 __(lock) … … 1983 1917 __(lock) 1984 1918 __(btsl %imm0,(%arg_y)) 1985 __(shrl $8,%imm0)1986 __(xorb $31,%imm0_b)1987 __(ref_global(ephemeral_refidx,%arg_y))1988 __(lock)1989 __(btsl %imm0,(%arg_y))1990 1919 /* Now memoize the address of the hash vector */ 1991 __(ref_global(refbits,%arg_y))1992 1920 __(movl %temp1,%imm0) 1993 1921 __(subl lisp_global(ref_base),%imm0) … … 1996 1924 __(lock) 1997 1925 __(btsl %imm0,(%arg_y)) 1998 __(ref_global(ephemeral_refidx,%arg_y))1999 __(shrl $8,%imm0)2000 __(xorb $31,%imm0_b)2001 __(lock)2002 __(btsl %imm0,(%arg_y))2003 1926 __(leal misc_data_offset(%temp1,%temp0),%imm0) 2004 1927 __(subl lisp_global(ref_base),%imm0) … … 2010 1933 __(lock) 2011 1934 __(btsl %imm0,(%arg_y)) 2012 __(ref_global(managed_static_refidx,%arg_y))2013 __(shrl $8,%imm0)2014 __(xorb $31,%imm0_b)2015 __(lock)2016 __(btsl %imm0,(%arg_y))2017 __(ref_global(managed_static_refbits,%arg_y))2018 1935 /* Now memoize the address of the hash vector */ 2019 1936 __(movl %temp1,%imm0) … … 2023 1940 __(lock) 2024 1941 __(btsl %imm0,(%arg_y)) 2025 __(ref_global(managed_static_refidx,%arg_y))2026 __(shrl $8,%imm0)2027 __(xorb $31,%imm0_b)2028 __(lock)2029 __(btsl %imm0,(%arg_y))2030 1942 .globl C(egc_write_barrier_end) 2031 1943 C(egc_write_barrier_end): -
trunk/source/lisp-kernel/x86-spentry64.s
r15823 r15826 1775 1775 __(jae 2f) 1776 1776 __(ref_global(refbits,%temp0)) 1777 __(xorq $63,%imm0) 1778 __(lock) 1779 __(btsq %imm0,(%temp0)) 1780 __(ref_global(ephemeral_refidx,%temp0)) 1781 __(shrq $8,%imm0) 1782 __(xorq $63,%imm0) 1777 __(xorb $63,%imm0_b) 1783 1778 __(lock) 1784 1779 __(btsq %imm0,(%temp0)) … … 1786 1781 __(jae 0b) 1787 1782 __(ref_global(managed_static_refbits,%temp0)) 1788 __(xor $63,%imm1)1783 __(xorb $63,%imm1_b) 1789 1784 __(lock) 1790 __(btsq %imm1,(%temp0))1791 __(shrq $8,%imm1)1792 __(ref_global(managed_static_refidx,%temp0))1793 __(xorb $63,(%temp0))1794 1785 __(btsq %imm1,(%temp0)) 1795 1786 __(ret) … … 1811 1802 __(jae 2f) 1812 1803 __(ref_global(refbits,%temp0)) 1813 __(xor q $63,%imm0)1804 __(xorb $63,%imm0_b) 1814 1805 __(lock) 1815 1806 __(btsq %imm0,(%temp0)) 1816 __(ref_global(ephemeral_refidx,%temp0)) 1817 __(shrq $8,%imm0) 1818 __(xorq $63,%imm0) 1819 __(lock) 1820 __(btsq %imm0,(%temp0)) 1807 __(ret) 1821 1808 2: __(cmpq lisp_global(managed_static_dnodes),%imm1) 1822 1809 __(jae 0b) 1823 1810 __(ref_global(managed_static_refbits,%temp0)) 1824 __(xor $63,%imm1) 1825 __(lock) 1826 __(btsq %imm1,(%temp0)) 1827 __(shrq $8,%imm1) 1828 __(ref_global(managed_static_refidx,%temp0)) 1829 __(xorb $63,(%temp0)) 1811 __(xorb $63,%imm1_b) 1830 1812 __(lock) 1831 1813 __(btsq %imm1,(%temp0)) … … 1851 1833 __(jae 2f) 1852 1834 __(ref_global(refbits,%temp0)) 1853 __(xorq $63,%imm0) 1854 __(lock) 1855 __(btsq %imm0,(%temp0)) 1856 __(ref_global(ephemeral_refidx,%temp0)) 1857 __(shrq $8,%imm0) 1858 __(xorq $63,%imm0) 1835 __(xorb $63,%imm0_b) 1859 1836 __(lock) 1860 1837 __(btsq %imm0,(%temp0)) … … 1862 1839 __(jae 0b) 1863 1840 __(ref_global(managed_static_refbits,%temp0)) 1864 __(xor $63,%imm1)1841 __(xorb $63,%imm1_b) 1865 1842 __(lock) 1866 1843 __(btsq %imm1,(%temp0)) 1867 __(shrq $8,%imm1)1868 __(ref_global(managed_static_refidx,%temp0))1869 __(xor $63,%imm1)1870 __(lock)1871 __(btsq %imm1,(%temp0))1872 1844 __(ret) 1873 1845 _endsubp(gvset) … … 1893 1865 __(jae 2f) 1894 1866 __(ref_global(refbits,%temp0)) 1895 __(xorq $63,%imm0) 1896 __(lock) 1897 __(btsq %imm0,(%temp0)) 1898 __(ref_global(ephemeral_refidx,%temp0)) 1899 __(shrq $8,%imm0) 1900 __(xorq $63,%imm0) 1867 __(xorb $63,%imm0_b) 1901 1868 __(lock) 1902 1869 __(btsq %imm0,(%temp0)) 1903 1870 /* Now memoize the address of the hash vector */ 1904 __(ref_global(refbits,%temp0))1905 1871 __(movq %arg_x,%imm0) 1906 1872 __(subq lisp_global(ref_base),%imm0) 1907 1873 __(shrq $dnode_shift,%imm0) 1908 __(xorq $63,%imm0) 1909 __(lock) 1910 __(btsq %imm0,(%temp0)) 1911 __(ref_global(ephemeral_refidx,%temp0)) 1912 __(shrq $8,%imm0) 1913 __(xorq $63,%imm0) 1874 __(xorb $63,%imm0_b) 1914 1875 __(lock) 1915 1876 __(btsq %imm0,(%temp0)) … … 1917 1878 __(jae 0b) 1918 1879 __(ref_global(managed_static_refbits,%temp0)) 1919 __(xor $63,%imm1)1880 __(xorb $63,%imm1_b) 1920 1881 __(lock) 1921 1882 __(btsq %imm1,(%temp0)) … … 1924 1885 __(subq lisp_global(ref_base),%imm0) 1925 1886 __(shrq $dnode_shift,%imm0) 1926 __(xor q $63,%imm0)1887 __(xorb $63,%imm0_b) 1927 1888 __(lock) 1928 1889 __(btsq %imm0,(%temp0)) 1929 __(ref_global(managed_static_refidx,%temp0))1930 __(shrq $8,%imm0)1931 __(xorq $63,%imm0)1932 __(lock)1933 __(btsq %imm0,(%temp0))1934 __(shrq $8,%imm1)1935 __(xor $63,%imm1)1936 __(lock)1937 __(btsq %imm1,(%temp0))1938 1890 __(ret) 1939 1891 _endsubp(set_hash_key) … … 1964 1916 __(ref_global(refbits,%temp1)) 1965 1917 __(jae 2f) 1966 __(xorq $63,%imm0) 1967 __(lock) 1968 __(btsq %imm0,(%temp1)) 1969 __(shrq $8,%imm0) 1970 __(ref_global(ephemeral_refidx,%temp1)) 1971 __(xorq $63,%imm0) 1918 __(xorb $63,%imm0_b) 1972 1919 __(lock) 1973 1920 __(btsq %imm0,(%temp1)) … … 1975 1922 __(jae 8f) 1976 1923 __(ref_global(managed_static_refbits,%temp1)) 1977 __(xor $63,%imm1)1924 __(xorb $63,%imm1_b) 1978 1925 __(lock) 1979 __(btsq %imm1,(%temp1)) 1980 __(ref_global(managed_static_refidx,%temp1)) 1981 __(shrq $8,%imm1) 1982 __(xor $63,%imm1) 1983 __(lock) 1984 __(btsq %imm1,(%temp1)) 1926 __(btsq %imm1,(%temp1)) 1985 1927 .globl C(egc_store_node_conditional_success_end) 1986 1928 C(egc_store_node_conditional_success_end): … … 2010 1952 __(ref_global(refbits,%temp1)) 2011 1953 __(jae 2f) 2012 __(xorq $63,%imm0) 2013 __(lock) 2014 __(btsq %imm0,(%temp1)) 2015 __(shrq $8,%imm0) 2016 __(xorq $63,%imm0) 2017 __(ref_global(ephemeral_refidx,%temp1)) 1954 __(xorb $63,%imm0_b) 2018 1955 __(lock) 2019 1956 __(btsq %imm0,(%temp1)) … … 2021 1958 __(movq %arg_x,%imm0) 2022 1959 __(subq lisp_global(ref_base),%imm0) 2023 __(ref_global(refbits,%temp1))2024 1960 __(shrq $dnode_shift,%imm0) 2025 __(xorq $63,%imm0) 2026 __(lock) 2027 __(btsq %imm0,(%temp1)) 2028 __(shrq $8,%imm0) 2029 __(xorq $63,%imm0) 2030 __(ref_global(ephemeral_refidx,%temp1)) 1961 __(xorb $63,%imm0_b) 2031 1962 __(lock) 2032 1963 __(btsq %imm0,(%temp1)) … … 2034 1965 __(jae 8f) 2035 1966 __(ref_global(managed_static_refbits,%temp1)) 2036 __(xor $63,%imm1)1967 __(xorb $63,%imm1_b) 2037 1968 __(lock) 2038 1969 __(btsq %imm1,(%temp1)) … … 2041 1972 __(subq lisp_global(ref_base),%imm0) 2042 1973 __(shrq $dnode_shift,%imm0) 2043 __(xorq $63,%imm0) 2044 __(lock) 2045 __(btsq %imm0,(%temp1)) 2046 __(ref_global(managed_static_refidx,%temp1)) 2047 __(shrq $8,%imm1) 2048 __(xor $63,%imm1) 2049 __(lock) 2050 __(btsq %imm1,(%temp1)) 2051 __(shrq $8,%imm0) 2052 __(xorq $63,%imm0) 1974 __(xorb $63,%imm0_b) 2053 1975 __(lock) 2054 1976 __(btsq %imm0,(%temp1))
Note: See TracChangeset
for help on using the changeset viewer.