1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
|
@
@ File: thumb2startup.s
@ Author: John van Groningen, adapted for Thumb-2 by Camil Staps
@ Machine: ARM
.include "thumb2regs.s"
.fpu vfp3
.thumb
.syntax unified
.include "armmacros.s"
USE_CLIB = 1
SHARE_CHAR_INT = 1
MY_ITOS = 1
FINALIZERS = 1
STACK_OVERFLOW_EXCEPTION_HANDLER = 0
WRITE_HEAP = 0
@ DEBUG = 0
PREFETCH2 = 0
NO_BIT_INSTRUCTIONS = 1
ADJUST_HEAP_SIZE = 1
MARK_GC = 1
MARK_AND_COPY_GC = 1
NEW_DESCRIPTORS = 1
@ #define PROFILE
MODULE_NAMES_IN_TIME_PROFILER = 1
COMPACT_GC_ONLY = 0
MINIMUM_HEAP_SIZE = 8000
MINIMUM_HEAP_SIZE_2 = 4000
.ifdef LINUX
# define section(n) .section .text.n,"ax"
.else
# define section(n) .text
.endif
DESCRIPTOR_ARITY_OFFSET = (-2)
ZERO_ARITY_DESCRIPTOR_OFFSET = (-4)
.hidden semi_space_size
.comm semi_space_size,4
.hidden heap_mbp
.comm heap_mbp,4
.hidden stack_mbp
.comm stack_mbp,4
.hidden heap_p
.comm heap_p,4
.hidden heap_p1
.comm heap_p1,4
.hidden heap_p2
.comm heap_p2,4
.hidden heap_p3
.comm heap_p3,4
.hidden end_heap_p3
.comm end_heap_p3,4
.hidden heap_size_33
.comm heap_size_33,4
.hidden vector_p
.comm vector_p,4
.hidden vector_counter
.comm vector_counter,4
.hidden neg_heap_vector_plus_4
.comm neg_heap_vector_plus_4,4
.hidden heap_size_32_33
.comm heap_size_32_33,4
.hidden heap_vector
.comm heap_vector,4
.hidden stack_top
.comm stack_top,4
.hidden end_vector
.comm end_vector,4
.hidden heap_size_129
.comm heap_size_129,4
.hidden heap_copied_vector
.comm heap_copied_vector,4
.hidden heap_copied_vector_size
.comm heap_copied_vector_size,4
.hidden heap_end_after_copy_gc
.comm heap_end_after_copy_gc,4
.hidden heap_end_after_gc
.comm heap_end_after_gc,4
.hidden extra_heap
.comm extra_heap,4
.hidden extra_heap_size
.comm extra_heap_size,4
.hidden stack_p
.comm stack_p,4
.hidden halt_sp
.comm halt_sp,4
.hidden n_allocated_words
.comm n_allocated_words,4
.hidden basic_only
.comm basic_only,4
.hidden last_time
.comm last_time,4
.hidden execute_time
.comm execute_time,4
.hidden garbage_collect_time
.comm garbage_collect_time,4
.hidden IO_time
.comm IO_time,4
.globl saved_heap_p
.hidden saved_heap_p
.comm saved_heap_p,8
.globl saved_a_stack_p
.hidden saved_a_stack_p
.comm saved_a_stack_p,4
.globl end_a_stack
.hidden end_a_stack
.comm end_a_stack,4
.globl end_b_stack
.hidden end_b_stack
.comm end_b_stack,4
.hidden dll_initisialised
.comm dll_initisialised,4
.if WRITE_HEAP
.comm heap_end_write_heap,4
.comm d3_flag_write_heap,4
.comm heap2_begin_and_end,8
.endif
.if STACK_OVERFLOW_EXCEPTION_HANDLER
.comm a_stack_guard_page,4
.endif
.globl profile_stack_pointer
.hidden profile_stack_pointer
.comm profile_stack_pointer,4
.data
.p2align 2
.if MARK_GC
bit_counter:
.long 0
bit_vector_p:
.long 0
zero_bits_before_mark:
.long 1
n_free_words_after_mark:
.long 1000
n_last_heap_free_bytes:
.long 0
lazy_array_list:
.long 0
n_marked_words:
.long 0
end_stack:
.long 0
.if ADJUST_HEAP_SIZE
bit_vector_size:
.long 0
.endif
.endif
caf_list:
.long 0
.globl caf_listp
.hidden caf_listp
caf_listp:
.long 0
zero_length_string:
.long __STRING__+2
.long 0
true_string:
.long __STRING__+2
.long 4
true_c_string:
.ascii "True"
.byte 0,0,0,0
false_string:
.long __STRING__+2
.long 5
false_c_string:
.ascii "False"
.byte 0,0,0
file_c_string:
.ascii "File"
.byte 0,0,0,0
garbage_collect_flag:
.byte 0
.byte 0,0,0
.hidden sprintf_buffer
.comm sprintf_buffer,32
out_of_memory_string_1:
.ascii "Not enough memory to allocate heap and stack"
.byte 10,0
printf_int_string:
.ascii "%d"
.byte 0
printf_real_string:
.ascii "%.15g"
.byte 0
printf_string_string:
.ascii "%s"
.byte 0
printf_char_string:
.ascii "%c"
.byte 0
garbage_collect_string_1:
.asciz "A stack: "
garbage_collect_string_2:
.asciz " bytes. BC stack: "
garbage_collect_string_3:
.ascii " bytes."
.byte 10,0
heap_use_after_gc_string_1:
.ascii "Heap use after garbage collection: "
.byte 0
heap_use_after_gc_string_2:
.ascii " Bytes."
.byte 10,0
stack_overflow_string:
.ascii "Stack overflow."
.byte 10,0
out_of_memory_string_4:
.ascii "Heap full."
.byte 10,0
time_string_1:
.ascii "Execution: "
.byte 0
time_string_2:
.ascii " Garbage collection: "
.byte 0
time_string_4:
.ascii " Total: "
.byte 0
high_index_string:
.ascii "Index too high in UPDATE string."
.byte 10,0
low_index_string:
.ascii "Index negative in UPDATE string."
.byte 10,0
IO_error_string:
.ascii "IO error: "
.byte 0
new_line_string:
.byte 10,0
sprintf_time_string:
.ascii "%d.%02d"
.byte 0
.if MARK_GC
marked_gc_string_1:
.ascii "Marked: "
.byte 0
.endif
.ifdef PROFILE
.p2align 2
.if MODULE_NAMES_IN_TIME_PROFILER
.ifdef LINUX
.globl m_system
.endif
m_system:
.long 6
.ascii "System"
.byte 0
.byte 0
.long m_system
.endif
garbage_collector_name:
.long 0
.asciz "garbage_collector"
.p2align 2
.endif
.ifdef DLL
start_address:
.long 0
.endif
.p2align 2
.hidden sprintf_time_buffer
.comm sprintf_time_buffer,20
.p2align 2
.if SHARE_CHAR_INT
.globl small_integers
.hidden small_integers
.comm small_integers,33*8
.globl static_characters
.hidden static_characters
.comm static_characters,256*8
.endif
.ifdef SHARED_LIBRARY
.section .init_array
.long clean_init
.section .fini_array
.long clean_fini
.endif
.text
.globl abc_main
.globl print
.globl print_char
.globl print_int
.globl print_real
.globl print__string__
.globl print__chars__sc
.globl print_sc
.globl print_symbol
.globl print_symbol_sc
.globl printD
.globl DtoAC
.globl push_t_r_args
.globl push_a_r_args
.globl halt
.globl dump
.globl catAC
.globl sliceAC
.globl updateAC
.globl eqAC
.globl cmpAC
.globl string_to_string_node
.globl int_array_to_node
.globl real_array_to_node
.globl _create_arrayB
.globl _create_arrayC
.globl _create_arrayI
.globl _create_arrayR
.globl _create_r_array
.globl create_array
.globl create_arrayB
.globl create_arrayC
.globl create_arrayI
.globl create_arrayR
.globl create_R_array
.globl BtoAC
.globl ItoAC
.globl RtoAC
.globl eqD
.globl collect_0
.globl collect_1
.globl collect_2
.globl collect_3
.globl _c3,_c4,_c5,_c6,_c7,_c8,_c9,_c10,_c11,_c12
.hidden _c3,_c4,_c5,_c6,_c7,_c8,_c9,_c10,_c11,_c12
.globl _c13,_c14,_c15,_c16,_c17,_c18,_c19,_c20,_c21,_c22
.hidden _c13,_c14,_c15,_c16,_c17,_c18,_c19,_c20,_c21,_c22
.globl _c23,_c24,_c25,_c26,_c27,_c28,_c29,_c30,_c31,_c32
.hidden _c23,_c24,_c25,_c26,_c27,_c28,_c29,_c30,_c31,_c32
.globl e__system__eaind
.hidden e__system__eaind
.globl e__system__nind
.hidden e__system__nind
@ old name of the previous label for compatibility, remove later
.globl __indirection
.hidden __indirection
.globl e__system__dind
.hidden e__system__dind
.globl eval_fill
.globl eval_upd_0,eval_upd_1,eval_upd_2,eval_upd_3,eval_upd_4
.globl eval_upd_5,eval_upd_6,eval_upd_7,eval_upd_8,eval_upd_9
.globl eval_upd_10,eval_upd_11,eval_upd_12,eval_upd_13,eval_upd_14
.globl eval_upd_15,eval_upd_16,eval_upd_17,eval_upd_18,eval_upd_19
.globl eval_upd_20,eval_upd_21,eval_upd_22,eval_upd_23,eval_upd_24
.globl eval_upd_25,eval_upd_26,eval_upd_27,eval_upd_28,eval_upd_29
.globl eval_upd_30,eval_upd_31,eval_upd_32
.globl repl_args_b
.globl push_arg_b
.globl del_args
.globl add_IO_time
.globl add_execute_time
.globl IO_error
.globl stack_overflow
.globl out_of_memory_4
.globl print_error
.ifndef DLL
.global _start
.endif
.globl sin_real
.globl cos_real
.globl tan_real
.globl asin_real
.globl acos_real
.globl atan_real
.globl ln_real
.globl log10_real
.globl exp_real
.globl pow_real
.globl r_to_i_real
.globl entier_real
.ifdef PROFILE
.globl init_profiler
.globl profile_s,profile_n,profile_r,profile_t
.globl write_profile_information,write_profile_stack
.endif
.globl __driver
@ from system.abc:
.globl INT
.globl CHAR
.globl BOOL
.globl REAL
.globl FILE
.globl __STRING__
.globl __ARRAY__
.globl __cycle__in__spine
.globl __print__graph
.globl __eval__to__nf
@ from wcon.c:
.globl w_print_char
.globl w_print_string
.globl w_print_text
.globl w_print_int
.globl w_print_real
.globl ew_print_char
.globl ew_print_text
.globl ew_print_string
.globl ew_print_int
.globl ab_stack_size
.globl heap_size
.globl flags
@ from standard c library:
.globl malloc
.globl free
.globl sprintf
.globl strlen
.if STACK_OVERFLOW_EXCEPTION_HANDLER
.globl allocate_memory_with_guard_page_at_end
.endif
.if ADJUST_HEAP_SIZE
.global heap_size_multiple
.global initial_heap_size
.endif
.if WRITE_HEAP
.global min_write_heap_size
.endif
.if FINALIZERS
.global __Nil
.globl finalizer_list
.hidden finalizer_list
.comm finalizer_list,4
.globl free_finalizer_list
.hidden free_finalizer_list
.comm free_finalizer_list,4
.endif
.thumb_func
abc_main:
str lr,[BSTACK_PTR,#-4]!
stmdb BSTACK_PTR!,{r0-r12}
.ifdef DLL
ldr BSTACK_0,[BSTACK_PTR,#28]
lao SCRATCH_REG,start_address,0
sto BSTACK_0,SCRATCH_REG,start_address,0
.endif
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl init_clean
tst BSTACK_0,BSTACK_0
bne init_error
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl init_timer
lao SCRATCH_REG,halt_sp,0
sto BSTACK_PTR,SCRATCH_REG,halt_sp,0
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl init_profiler
.endif
.ifdef DLL
lao SCRATCH_REG,start_address,1
ldo BSTACK_0,SCRATCH_REG,start_address,1
.align
add lr,pc,#7
str lr,[BSTACK_PTR,#-4]!
blx BSTACK_0
.else
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl __start
.endif
.thumb_func
exit:
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl exit_clean
.thumb_func
init_error:
ldmia BSTACK_PTR!,{r0-r12,pc}
.globl clean_init
.thumb_func
clean_init:
stmdb BSTACK_PTR!,{r0-r12,lr}
lao SCRATCH_REG,dll_initisialised,0
mov r0,#1
sto r0,SCRATCH_REG,dll_initisialised,0
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl init_clean
tst BSTACK_0,BSTACK_0
bne init_dll_error
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl init_timer
lao SCRATCH_REG,halt_sp,1
sto BSTACK_PTR,SCRATCH_REG,halt_sp,1
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl init_profiler
.endif
lao SCRATCH_REG,saved_heap_p,0
otoa SCRATCH_REG,saved_heap_p,0
str HEAP_PTR,[SCRATCH_REG]
str HEAP_FREE,[SCRATCH_REG,#4]
lao SCRATCH_REG,saved_a_stack_p,0
sto ASTACK_PTR,SCRATCH_REG,saved_a_stack_p,0
mov BSTACK_0,#1
b exit_dll_init
.thumb_func
init_dll_error:
mov BSTACK_0,#0
b exit_dll_init
.globl clean_fini
.thumb_func
clean_fini:
stmdb BSTACK_PTR!,{r0-r12,lr}
lao SCRATCH_REG,saved_heap_p,1
otoa SCRATCH_REG,saved_heap_p,1
ldr HEAP_PTR,[SCRATCH_REG]
ldr HEAP_FREE,[SCRATCH_REG,#4]
lao SCRATCH_REG,saved_a_stack_p,1
ldo ASTACK_PTR,SCRATCH_REG,saved_a_stack_p,1
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl exit_clean
.thumb_func
exit_dll_init:
ldmia BSTACK_PTR!,{r0-r12,pc}
.thumb_func
init_clean:
add BSTACK_0,BSTACK_PTR,#128
lao SCRATCH_REG,ab_stack_size,0
ldo SCRATCH_REG,SCRATCH_REG,ab_stack_size,0
sub BSTACK_0,BSTACK_0,SCRATCH_REG
lao SCRATCH_REG,end_b_stack,0
sto BSTACK_0,SCRATCH_REG,end_b_stack,0
lao SCRATCH_REG,flags,0
ldo BSTACK_0,SCRATCH_REG,flags,0
and BSTACK_0,BSTACK_0,#1
lao SCRATCH_REG,basic_only,0
sto BSTACK_0,SCRATCH_REG,basic_only,0
lao SCRATCH_REG,heap_size,0
ldo BSTACK_0,SCRATCH_REG,heap_size,0
.if PREFETCH2
subs BSTACK_0,BSTACK_0,#63
.else
subs BSTACK_0,BSTACK_0,#3
.endif
@ divide by 33
ldr SCRATCH_REG,=1041204193
umull ASTACK_3,BSTACK_0,SCRATCH_REG,BSTACK_0
lsr BSTACK_0,BSTACK_0,#3
lao SCRATCH_REG,heap_size_33,0
sto BSTACK_0,SCRATCH_REG,heap_size_33,0
lao SCRATCH_REG,heap_size,1
ldo BSTACK_0,SCRATCH_REG,heap_size,1
subs BSTACK_0,BSTACK_0,#3
@ divide by 129
ldr SCRATCH_REG,=266354561
umull ASTACK_3,BSTACK_0,SCRATCH_REG,BSTACK_0
lsr BSTACK_0,BSTACK_0,#3
lao SCRATCH_REG,heap_size_129,0
sto BSTACK_0,SCRATCH_REG,heap_size_129,0
add BSTACK_0,BSTACK_0,#3
and BSTACK_0,BSTACK_0,#-4
lao SCRATCH_REG,heap_copied_vector_size,0
sto BSTACK_0,SCRATCH_REG,heap_copied_vector_size,0
lao SCRATCH_REG,heap_end_after_copy_gc,0
mov ASTACK_3,#0
sto ASTACK_3,SCRATCH_REG,heap_end_after_copy_gc,0
lao SCRATCH_REG,heap_size,2
ldo BSTACK_0,SCRATCH_REG,heap_size,2
add BSTACK_0,BSTACK_0,#7
and BSTACK_0,BSTACK_0,#-8
.ifdef PIC
lao SCRATCH_REG,heap_size,3
.endif
sto BSTACK_0,SCRATCH_REG,heap_size,3
add BSTACK_0,BSTACK_0,#7
store_global_registers
mov r0,BSTACK_0
bl malloc
load_global_registers
movs BSTACK_0,r0
beq no_memory_2
lao SCRATCH_REG,heap_mbp,0
sto BSTACK_0,SCRATCH_REG,heap_mbp,0
add HEAP_PTR,BSTACK_0,#3
and HEAP_PTR,HEAP_PTR,#-4
lao SCRATCH_REG,heap_p,0
sto HEAP_PTR,SCRATCH_REG,heap_p,0
lao ASTACK_2,ab_stack_size,1
ldo ASTACK_2,ASTACK_2,ab_stack_size,1
add ASTACK_2,ASTACK_2,#3
store_global_registers
mov r0,ASTACK_2
.if STACK_OVERFLOW_EXCEPTION_HANDLER
bl allocate_memory_with_guard_page_at_end
.else
bl malloc
.endif
load_global_registers
movs BSTACK_0,r0
beq no_memory_3
lao SCRATCH_REG,stack_mbp,0
sto BSTACK_0,SCRATCH_REG,stack_mbp,0
.if STACK_OVERFLOW_EXCEPTION_HANDLER
lao SCRATCH_REG,ab_stack_size,2
ldo SCRATCH_REG,SCRATCH_REG,ab_stack_size,2
add BSTACK_0,BSTACK_0,SCRATCH_REG
lao SCRATCH_REG,a_stack_guard_page,0
add BSTACK_0,BSTACK_0,#4096
add BSTACK_0,BSTACK_0,#(3+4095)-4096
bic BSTACK_0,BSTACK_0,#255
bic BSTACK_0,BSTACK_0,#4095-255
sto BSTACK_0,SCRATCH_REG,a_stack_guard_page,0
lao SCRATCH_REG,ab_stack_size,3
ldo SCRATCH_REG,SCRATCH_REG,ab_stack_size,3
sub BSTACK_0,BSTACK_0,SCRATCH_REG
.endif
add BSTACK_0,BSTACK_0,#3
and BSTACK_0,BSTACK_0,#-4
mov ASTACK_PTR,BSTACK_0
lao SCRATCH_REG,stack_p,0
sto BSTACK_0,SCRATCH_REG,stack_p,0
lao SCRATCH_REG,ab_stack_size,4
ldo SCRATCH_REG,SCRATCH_REG,ab_stack_size,4
add BSTACK_0,BSTACK_0,SCRATCH_REG
subs BSTACK_0,BSTACK_0,#64
lao SCRATCH_REG,end_a_stack,0
sto BSTACK_0,SCRATCH_REG,end_a_stack,0
.if SHARE_CHAR_INT
lao ASTACK_0,small_integers,0
otoa ASTACK_0,small_integers,0
mov BSTACK_0,#0
laol BSTACK_1,INT+2,INT_o_2,0
otoa BSTACK_1,INT_o_2,0
.thumb_func
make_small_integers_lp:
str BSTACK_1,[ASTACK_0]
str BSTACK_0,[ASTACK_0,#4]
add BSTACK_0,BSTACK_0,#1
add ASTACK_0,ASTACK_0,#8
cmp BSTACK_0,#33
bne make_small_integers_lp
lao ASTACK_0,static_characters,0
otoa ASTACK_0,static_characters,0
mov BSTACK_0,#0
laol BSTACK_1,CHAR+2,CHAR_O_2,0
otoa BSTACK_1,CHAR_O_2,0
.thumb_func
make_static_characters_lp:
str BSTACK_1,[ASTACK_0]
str BSTACK_0,[ASTACK_0,#4]
add BSTACK_0,BSTACK_0,#1
add ASTACK_0,ASTACK_0,#8
cmp BSTACK_0,#256
bne make_static_characters_lp
.endif
laol ASTACK_0,caf_list+4,caf_list_o_4,0
otoa ASTACK_0,caf_list_o_4,0
lao SCRATCH_REG,caf_listp,0
sto ASTACK_0,SCRATCH_REG,caf_listp,0
.if FINALIZERS
lao SCRATCH_REG,finalizer_list,0
laol ASTACK_3,__Nil-4,__Nil_o_m4,0
otoa ASTACK_3,__Nil_o_m4,0
sto ASTACK_3,SCRATCH_REG,finalizer_list,0
lao SCRATCH_REG,free_finalizer_list,0
sto ASTACK_3,SCRATCH_REG,free_finalizer_list,0
.endif
lao SCRATCH_REG,heap_p1,0
sto HEAP_PTR,SCRATCH_REG,heap_p1,0
lao SCRATCH_REG,heap_size_129,1
ldo ASTACK_2,SCRATCH_REG,heap_size_129,1
lsl ASTACK_2,ASTACK_2,#4
add BSTACK_0,HEAP_PTR,ASTACK_2,lsl #2
lao SCRATCH_REG,heap_copied_vector,0
sto BSTACK_0,SCRATCH_REG,heap_copied_vector,0
lao SCRATCH_REG,heap_copied_vector_size,1
ldo SCRATCH_REG,SCRATCH_REG,heap_copied_vector_size,1
add BSTACK_0,SCRATCH_REG
lao SCRATCH_REG,heap_p2,0
sto BSTACK_0,SCRATCH_REG,heap_p2,0
lao SCRATCH_REG,garbage_collect_flag,0
mov ASTACK_3,#0
stob ASTACK_3,SCRATCH_REG,garbage_collect_flag,0
.if MARK_AND_COPY_GC
lao SCRATCH_REG,flags,1
ldo SCRATCH_REG,SCRATCH_REG,flags,1
tst SCRATCH_REG,#64
beq no_mark1
.endif
.if MARK_GC || COMPACT_GC_ONLY
lao SCRATCH_REG,heap_size_33,1
ldo BSTACK_0,SCRATCH_REG,heap_size_33,1
lao SCRATCH_REG,heap_vector,0
sto HEAP_PTR,SCRATCH_REG,heap_vector,0
add HEAP_PTR,HEAP_PTR,BSTACK_0
.if PREFETCH2
add HEAP_PTR,HEAP_PTR,#63
and HEAP_PTR,HEAP_PTR,#-64
.else
add HEAP_PTR,HEAP_PTR,#3
and HEAP_PTR,HEAP_PTR,#-4
.endif
lao SCRATCH_REG,heap_p3,0
sto HEAP_PTR,SCRATCH_REG,heap_p3,0
lsl ASTACK_2,BSTACK_0,#3
lao SCRATCH_REG,garbage_collect_flag,1
mov ASTACK_3,#-1
stob ASTACK_3,SCRATCH_REG,garbage_collect_flag,1
.endif
.if MARK_AND_COPY_GC
no_mark1:
.endif
.if ADJUST_HEAP_SIZE
lao BSTACK_0,initial_heap_size,0
ldo BSTACK_0,BSTACK_0,initial_heap_size,0
.if MARK_AND_COPY_GC
mov BSTACK_1,#MINIMUM_HEAP_SIZE_2
lao SCRATCH_REG,flags,2
ldo SCRATCH_REG,SCRATCH_REG,flags,2
tst SCRATCH_REG,#64
bne no_mark9
add BSTACK_1,BSTACK_1,BSTACK_1
no_mark9:
.else
.if MARK_GC || COMPACT_GC_ONLY
mov BSTACK_1,#MINIMUM_HEAP_SIZE
.else
mov BSTACK_1,#MINIMUM_HEAP_SIZE_2
.endif
.endif
cmp BSTACK_0,BSTACK_1
ble too_large_or_too_small
lsr BSTACK_0,BSTACK_0,#2
cmp BSTACK_0,ASTACK_2
bge too_large_or_too_small
mov ASTACK_2,BSTACK_0
.thumb_func
too_large_or_too_small:
.endif
add BSTACK_0,HEAP_PTR,ASTACK_2,lsl #2
lao SCRATCH_REG,heap_end_after_gc,0
sto BSTACK_0,SCRATCH_REG,heap_end_after_gc,0
mov HEAP_FREE,ASTACK_2
.if MARK_AND_COPY_GC
lao SCRATCH_REG,flags,3
ldo SCRATCH_REG,SCRATCH_REG,flags,3
tst SCRATCH_REG,#64
beq no_mark2
.endif
.if MARK_GC && ADJUST_HEAP_SIZE
lao SCRATCH_REG,bit_vector_size,0
sto ASTACK_2,SCRATCH_REG,bit_vector_size,0
.endif
.if MARK_AND_COPY_GC
no_mark2:
.endif
mov BSTACK_0,#0
ldr pc,[BSTACK_PTR],#4
no_memory_2:
lao r0,out_of_memory_string_1,0
otoa r0,out_of_memory_string_1,0
store_global_registers
bl ew_print_string
load_global_registers
.ifdef _WINDOWS_
? movl $1,@execution_aborted
.endif
mov r0,#1
ldr pc,[BSTACK_PTR],#4
no_memory_3:
lao r0,out_of_memory_string_1,1
otoa r0,out_of_memory_string_1,1
store_global_registers
bl ew_print_string
load_global_registers
.ifdef _WINDOWS_
? movl $1,@execution_aborted
.endif
lao r0,heap_mbp,1
ldo r0,r0,heap_mbp,1
bl free
mov r0,#1
ldr pc,[BSTACK_PTR],#4
.thumb_func
exit_clean:
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl add_execute_time
lao BSTACK_0,flags,4
ldo BSTACK_0,BSTACK_0,flags,4
tst BSTACK_0,#8
beq no_print_execution_time
lao r0,time_string_1,0
otoa r0,time_string_1,0
store_global_registers
bl ew_print_string
load_global_registers
lao SCRATCH_REG,execute_time,0
ldo BSTACK_0,SCRATCH_REG,execute_time,0
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl print_time
lao r0,time_string_2,0
otoa r0,time_string_2,0
store_global_registers
bl ew_print_string
load_global_registers
lao SCRATCH_REG,garbage_collect_time,0
ldo BSTACK_0,SCRATCH_REG,garbage_collect_time,0
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl print_time
lao r0,time_string_4,0
otoa r0,time_string_4,0
store_global_registers
bl ew_print_string
load_global_registers
lao SCRATCH_REG,execute_time,1
ldo BSTACK_0,SCRATCH_REG,execute_time,1
lao SCRATCH_REG,garbage_collect_time,1
ldo SCRATCH_REG,SCRATCH_REG,garbage_collect_time,1
add BSTACK_0,SCRATCH_REG
lao SCRATCH_REG,IO_time,0
ldo SCRATCH_REG,SCRATCH_REG,IO_time,0
add BSTACK_0,SCRATCH_REG
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl print_time
mov r0,#10
bl ew_print_char
.thumb_func
no_print_execution_time:
lao r0,stack_mbp,1
ldo r0,r0,stack_mbp,1
bl free
lao r0,heap_mbp,2
ldo r0,r0,heap_mbp,2
bl free
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl write_profile_information
.endif
ldr pc,[BSTACK_PTR],#4
.thumb_func
__driver:
lao ASTACK_2,flags,5
ldo ASTACK_2,ASTACK_2,flags,5
tst ASTACK_2,#16
beq __print__graph
b __eval__to__nf
.ifdef PIC
.ifdef DLL
lto start_address,0
.endif
lto halt_sp,0
.ifdef DLL
lto start_address,1
.endif
lto dll_initisialised,0
lto halt_sp,1
lto saved_heap_p,0
lto saved_a_stack_p,0
lto saved_heap_p,1
lto saved_a_stack_p,1
lto ab_stack_size,0
lto end_b_stack,0
lto flags,0
lto basic_only,0
lto heap_size,0
lto heap_size_33,0
lto heap_size,1
lto heap_size_129,0
lto heap_copied_vector_size,0
lto heap_end_after_copy_gc,0
lto heap_size,2
lto heap_size,3
lto heap_mbp,0
lto heap_p,0
lto ab_stack_size,1
lto stack_mbp,0
.if STACK_OVERFLOW_EXCEPTION_HANDLER
lto ab_stack_size,2
lto a_stack_guard_page,0
lto ab_stack_size,3
.endif
lto stack_p,0
lto ab_stack_size,4
lto end_a_stack,0
lto small_integers,0
ltol INT+2,INT_o_2,0
lto static_characters,0
ltol CHAR+2,CHAR_O_2,0
ltol caf_list+4,caf_list_o_4,0
lto caf_listp,0
.if FINALIZERS
lto finalizer_list,0
ltol __Nil-4,__Nil_o_m4,0
lto free_finalizer_list,0
.endif
lto heap_p1,0
lto heap_size_129,1
lto heap_copied_vector,0
lto heap_copied_vector_size,1
lto heap_p2,0
lto garbage_collect_flag,0
.if MARK_AND_COPY_GC
lto flags,1
.endif
.if MARK_GC || COMPACT_GC_ONLY
lto heap_size_33,1
lto heap_vector,0
lto heap_p3,0
lto garbage_collect_flag,1
.endif
.if ADJUST_HEAP_SIZE
lto initial_heap_size,0
.if MARK_AND_COPY_GC
lto flags,2
.endif
.endif
lto heap_end_after_gc,0
.if MARK_AND_COPY_GC
lto flags,3
.endif
.if MARK_GC && ADJUST_HEAP_SIZE
lto bit_vector_size,0
.endif
lto out_of_memory_string_1,0
lto out_of_memory_string_1,1
lto heap_mbp,1
lto flags,4
lto time_string_1,0
lto execute_time,0
lto time_string_2,0
lto garbage_collect_time,0
lto time_string_4,0
lto execute_time,1
lto garbage_collect_time,1
lto IO_time,0
lto stack_mbp,1
lto heap_mbp,2
lto flags,5
.endif
.ltorg
.thumb_func
print_time:
@ divide by 1000
ldr SCRATCH_REG,=274877907
umull ASTACK_3,ASTACK_0,SCRATCH_REG,BSTACK_0
lsr ASTACK_0,ASTACK_0,#6
mov ASTACK_3,#-1025
add ASTACK_3,ASTACK_3,#-1000-(-1025)
mla BSTACK_0,ASTACK_0,ASTACK_3,BSTACK_0
@ divide by 10
ldr SCRATCH_REG,=-858993459
umull ASTACK_3,BSTACK_0,SCRATCH_REG,BSTACK_0
lsr BSTACK_0,BSTACK_0,#3
.if USE_CLIB
store_global_registers
mov r3,BSTACK_0
mov r2,ASTACK_0
lao r1,sprintf_time_string,0
lao r0,sprintf_time_buffer,0
otoa r1,sprintf_time_string,0
otoa r0,sprintf_time_buffer,0
bl sprintf
lao r0,sprintf_time_buffer,1
otoa r0,sprintf_time_buffer,1
bl ew_print_string
load_global_registers
.else
store_global_registers
mov r0,ASTACK_0
bl ew_print_int
load_global_registers
lao ASTACK_0,sprintf_time_buffer,0
otoa ASTACK_0,sprintf_time_buffer,0
eor ASTACK_1,ASTACK_1,ASTACK_1
mov BSTACK_1,#10
mov SCRATCH_REG,#46
strb SCRATCH_REG,[ASTACK_0]
@ divide by 10
ldr SCRATCH_REG,=-858993459
umull ASTACK_3,BSTACK_4,SCRATCH_REG,BSTACK_0
lsr BSTACK_4,BSTACK_4,#3
sub BSTACK_0,BSTACK_0,BSTACK_4,lsl #1
sub BSTACK_0,BSTACK_0,BSTACK_4,lsl #3
add BSTACK_0,BSTACK_0,#48
add ASTACK_1,ASTACK_1,#48
strb BSTACK_4,[ASTACK_0,#1]
strb BSTACK_0,[ASTACK_0,#2]
store_global_registers
mov r1,#3
mov r0,ASTACK_0
bl ew_print_text
load_global_registers
.endif
ldr pc,[BSTACK_PTR],#4
.thumb_func
print_sc:
lao SCRATCH_REG,basic_only,1
ldo ASTACK_2,SCRATCH_REG,basic_only,1
cmp ASTACK_2,#0
bne end_print
.thumb_func
print:
store_global_registers
mov r0,BSTACK_0
bl w_print_string
load_global_registers
.thumb_func
end_print:
ldr pc,[BSTACK_PTR],#4
.thumb_func
dump:
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl print
b halt
printD: tst BSTACK_0,#2
bne printD_
mov ASTACK_2,BSTACK_0
b print_string_a2
DtoAC_record:
ldr ASTACK_2,[BSTACK_0,#-6]
@.ifdef PIC
.if 0
add SCRATCH_REG,BSTACK_0,#-6
add ASTACK_2,ASTACK_2,SCRATCH_REG
.endif
b DtoAC_string_a2
DtoAC: tst BSTACK_0,#2
bne DtoAC_
mov ASTACK_2,BSTACK_0
b DtoAC_string_a2
DtoAC_:
ldrh SCRATCH_REG,[BSTACK_0,#-2]
cmp SCRATCH_REG,#256
bhs DtoAC_record
ldrh BSTACK_1,[BSTACK_0]
add SCRATCH_REG,BSTACK_0,#10
add ASTACK_2,SCRATCH_REG,BSTACK_1
DtoAC_string_a2:
ldr BSTACK_0,[ASTACK_2]
add ASTACK_0,ASTACK_2,#4
b build_string
.thumb_func
print_symbol:
mov BSTACK_1,#0
b print_symbol_2
.thumb_func
print_symbol_sc:
lao SCRATCH_REG,basic_only,2
ldo BSTACK_1,SCRATCH_REG,basic_only,2
print_symbol_2:
ldr BSTACK_0,[ASTACK_0]
laol SCRATCH_REG,INT+2,INT_o_2,1
otoa SCRATCH_REG,INT_o_2,1
cmp BSTACK_0,SCRATCH_REG
beq print_int_node
laol SCRATCH_REG,CHAR+2,CHAR_o_2,0
otoa SCRATCH_REG,CHAR_o_2,0
cmp BSTACK_0,SCRATCH_REG
beq print_char_denotation
laol SCRATCH_REG,BOOL+2,BOOL_o_2,0
otoa SCRATCH_REG,BOOL_o_2,0
cmp BSTACK_0,SCRATCH_REG
beq print_bool
laol SCRATCH_REG,REAL+2,REAL_o_2,0
otoa SCRATCH_REG,REAL_o_2,0
cmp BSTACK_0,SCRATCH_REG
beq print_real_node
cmp BSTACK_1,#0
bne end_print_symbol
printD_:
ldrh SCRATCH_REG,[BSTACK_0,#-2]
cmp SCRATCH_REG,#256
bhs print_record
ldrh BSTACK_1,[BSTACK_0]
add SCRATCH_REG,BSTACK_0,#10
add ASTACK_2,SCRATCH_REG,BSTACK_1
b print_string_a2
.thumb_func
print_record:
ldr ASTACK_2,[BSTACK_0,#-6]
@.ifdef PIC
.if 0
add SCRATCH_REG,BSTACK_0,#-6
add ASTACK_2,ASTACK_2,SCRATCH_REG
.endif
b print_string_a2
.thumb_func
end_print_symbol:
ldr pc,[BSTACK_PTR],#4
.thumb_func
print_int_node:
store_global_registers
ldr r0,[ASTACK_0,#4]
bl w_print_int
load_global_registers
ldr pc,[BSTACK_PTR],#4
.thumb_func
print_int:
store_global_registers
mov r0,BSTACK_0
bl w_print_int
load_global_registers
ldr pc,[BSTACK_PTR],#4
.thumb_func
print_char_denotation:
tst BSTACK_1,BSTACK_1
bne print_char_node
store_global_registers
ldr SCRATCH_REG,[ASTACK_0,#4]
str SCRATCH_REG,[BSTACK_PTR,#-4]!
mov r0,#0x27
bl w_print_char
ldr r0,[BSTACK_PTR],#4
bl w_print_char
mov r0,#0x27
bl w_print_char
load_global_registers
ldr pc,[BSTACK_PTR],#4
.thumb_func
print_char_node:
store_global_registers
ldr r0,[ASTACK_0,#4]
bl w_print_char
load_global_registers
ldr pc,[BSTACK_PTR],#4
.thumb_func
print_char:
store_global_registers
str BSTACK_0,[BSTACK_PTR,#-4]!
bl w_print_char
add BSTACK_PTR,BSTACK_PTR,#4
load_global_registers
ldr pc,[BSTACK_PTR],#4
.thumb_func
print_bool:
ldsb ASTACK_0,[ASTACK_0,#4]
tst ASTACK_0,ASTACK_0
beq print_false
.thumb_func
print_true:
store_global_registers
lao r0,true_c_string,0
otoa r0,true_c_string,0
bl w_print_string
load_global_registers
ldr pc,[BSTACK_PTR],#4
.thumb_func
print_false:
store_global_registers
lao r0,false_c_string,0
otoa r0,false_c_string,0
bl w_print_string
load_global_registers
ldr pc,[BSTACK_PTR],#4
.thumb_func
print_real:
.ifdef SOFT_FP_CC
vmov r0,BSTACK_3,d0
.endif
b print_real_
.thumb_func
print_real_node:
.ifdef SOFT_FP_CC
ldrd r0,BSTACK_3,[ASTACK_0,#4]
.else
vldr.f64 d0,[ASTACK_0,#4]
.endif
.thumb_func
print_real_:
store_global_registers
push {r11}
mov r11,BSTACK_PTR
bic lr,r11,#7
mov BSTACK_PTR,lr
bl w_print_real
mov BSTACK_PTR,r11
pop {r11}
load_global_registers
ldr pc,[BSTACK_PTR],#4
print_string_a2:
store_global_registers
ldr r1,[ASTACK_2]
add r0,ASTACK_2,#4
bl w_print_text
load_global_registers
ldr pc,[BSTACK_PTR],#4
.thumb_func
print__chars__sc:
lao SCRATCH_REG,basic_only,3
ldo ASTACK_2,SCRATCH_REG,basic_only,3
cmp ASTACK_2,#0
bne no_print_chars
.thumb_func
print__string__:
store_global_registers
ldr r1,[ASTACK_0,#4]
add r0,ASTACK_0,#8
bl w_print_text
load_global_registers
.thumb_func
no_print_chars:
ldr pc,[BSTACK_PTR],#4
.thumb_func
push_a_r_args:
str HEAP_PTR,[BSTACK_PTR,#-4]!
ldr ASTACK_1,[ASTACK_0,#8]
subs ASTACK_1,ASTACK_1,#2
ldrh HEAP_PTR,[ASTACK_1]
subs HEAP_PTR,HEAP_PTR,#256
ldrh BSTACK_1,[ASTACK_1,#2]
add ASTACK_1,ASTACK_1,#4
str ASTACK_1,[BSTACK_PTR,#-4]!
mov ASTACK_1,HEAP_PTR
subs ASTACK_1,ASTACK_1,BSTACK_1
lsl BSTACK_0,BSTACK_0,#2
add SCRATCH_REG,ASTACK_0,#12
add ASTACK_0,SCRATCH_REG,BSTACK_1,lsl #2
subs HEAP_PTR,HEAP_PTR,#1
.thumb_func
mul_array_size_lp:
add ASTACK_0,ASTACK_0,BSTACK_0
subs HEAP_PTR,HEAP_PTR,#1
bcs mul_array_size_lp
add HEAP_PTR,ASTACK_0,ASTACK_1,lsl #2
b push_a_elements
.thumb_func
push_a_elements_lp:
ldr BSTACK_0,[ASTACK_0,#-4]!
str BSTACK_0,[ASTACK_PTR],#4
.thumb_func
push_a_elements:
subs BSTACK_1,BSTACK_1,#1
bcs push_a_elements_lp
mov ASTACK_0,HEAP_PTR
ldr BSTACK_0,[BSTACK_PTR],#4
ldr HEAP_PTR,[BSTACK_PTR],#4
ldr ASTACK_2,[BSTACK_PTR],#4
b push_b_elements
.thumb_func
push_b_elements_lp:
ldr SCRATCH_REG,[ASTACK_0,#-4]!
str SCRATCH_REG,[BSTACK_PTR,#-4]!
.thumb_func
push_b_elements:
subs ASTACK_1,ASTACK_1,#1
bcs push_b_elements_lp
mov pc,ASTACK_2
.thumb_func
push_t_r_args:
ldr ASTACK_2,[BSTACK_PTR],#4
ldr ASTACK_1,[ASTACK_0]
add ASTACK_0,ASTACK_0,#4
subs ASTACK_1,ASTACK_1,#2
ldrh BSTACK_0,[ASTACK_1]
subs BSTACK_0,BSTACK_0,#256
ldrh BSTACK_1,[ASTACK_1,#2]
add ASTACK_1,ASTACK_1,#4
str ASTACK_1,[ASTACK_PTR]
str BSTACK_1,[ASTACK_PTR,#4]
sub BSTACK_1,BSTACK_0,BSTACK_1
add ASTACK_1,ASTACK_0,BSTACK_0,lsl #2
cmp BSTACK_0,#2
bls small_record
ldr ASTACK_1,[ASTACK_0,#4]
add SCRATCH_REG,ASTACK_1,#-4
add ASTACK_1,SCRATCH_REG,BSTACK_0,lsl #2
.thumb_func
small_record:
b push_r_b_elements
.thumb_func
push_r_b_elements_lp:
subs BSTACK_0,BSTACK_0,#1
bne not_first_arg_b
ldr SCRATCH_REG,[ASTACK_0]
str SCRATCH_REG,[BSTACK_PTR,#-4]!
b push_r_b_elements
.thumb_func
not_first_arg_b:
ldr SCRATCH_REG,[ASTACK_1,#-4]!
str SCRATCH_REG,[BSTACK_PTR,#-4]!
.thumb_func
push_r_b_elements:
subs BSTACK_1,BSTACK_1,#1
bcs push_r_b_elements_lp
ldr BSTACK_1,[ASTACK_PTR,#4]
str ASTACK_2,[BSTACK_PTR,#-4]!
ldr SCRATCH_REG,[ASTACK_PTR]
str SCRATCH_REG,[BSTACK_PTR,#-4]!
b push_r_a_elements
.thumb_func
push_r_a_elements_lp:
subs BSTACK_0,BSTACK_0,#1
bne not_first_arg_a
ldr ASTACK_2,[ASTACK_0]
str ASTACK_2,[ASTACK_PTR],#4
b push_r_a_elements
.thumb_func
not_first_arg_a:
ldr ASTACK_2,[ASTACK_1,#-4]!
str ASTACK_2,[ASTACK_PTR],#4
.thumb_func
push_r_a_elements:
subs BSTACK_1,BSTACK_1,#1
bcs push_r_a_elements_lp
ldr BSTACK_0,[BSTACK_PTR],#4
ldr pc,[BSTACK_PTR],#4
BtoAC:
tst BSTACK_0,BSTACK_0
beq BtoAC_false
BtoAC_true:
lao ASTACK_0,true_string,0
otoa ASTACK_0,true_string,0
ldr pc,[BSTACK_PTR],#4
BtoAC_false:
lao ASTACK_0,false_string,0
otoa ASTACK_0,false_string,0
ldr pc,[BSTACK_PTR],#4
RtoAC:
.if USE_CLIB
vmov r2,BSTACK_1,d0
lao r1,printf_real_string,0
lao r0,sprintf_buffer,0
otoa r1,printf_real_string,0
otoa r0,sprintf_buffer,0
mov BSTACK_0,BSTACK_PTR
mov lr,BSTACK_PTR
and lr,lr,#-8
mov BSTACK_PTR,lr
bl sprintf
mov BSTACK_PTR,BSTACK_0
.else
lao r0,sprintf_buffer,1
otoa r0,sprintf_buffer,1
bl convert_real_to_string
.endif
b return_sprintf_buffer
ItoAC:
.if MY_ITOS
lao ASTACK_0,sprintf_buffer,2
otoa ASTACK_0,sprintf_buffer,2
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl int_to_string
lao SCRATCH_REG,sprintf_buffer,3
otoa SCRATCH_REG,sprintf_buffer,3
sub BSTACK_0,ASTACK_0,SCRATCH_REG
b sprintf_buffer_to_string
.thumb_func
int_to_string:
tst BSTACK_0,BSTACK_0
bpl no_minus
mov SCRATCH_REG,#45
strb SCRATCH_REG,[ASTACK_0],#1
neg BSTACK_0,BSTACK_0
.thumb_func
no_minus:
add ASTACK_2,ASTACK_0,#12
beq zero_digit
ldr BSTACK_2,=0xcccccccd
.thumb_func
calculate_digits:
cmp BSTACK_0,#10
blo last_digit
umull SCRATCH_REG,ASTACK_1,BSTACK_2,BSTACK_0
add BSTACK_1,BSTACK_0,#48
lsr BSTACK_0,ASTACK_1,#3
and ASTACK_1,ASTACK_1,#-8
sub BSTACK_1,BSTACK_1,ASTACK_1
sub BSTACK_1,BSTACK_1,ASTACK_1,lsr #2
strb BSTACK_1,[ASTACK_2],#1
b calculate_digits
.thumb_func
last_digit:
tst BSTACK_0,BSTACK_0
beq no_zero
.thumb_func
zero_digit:
add BSTACK_0,BSTACK_0,#48
strb BSTACK_0,[ASTACK_2],#1
.thumb_func
no_zero:
add ASTACK_1,ASTACK_0,#12
.thumb_func
reverse_digits:
ldrb BSTACK_1,[ASTACK_2,#-1]!
strb BSTACK_1,[ASTACK_0],#1
cmp ASTACK_1,ASTACK_2
bne reverse_digits
mov SCRATCH_REG,#0
strb SCRATCH_REG,[ASTACK_0]
ldr pc,[BSTACK_PTR],#4
.else
mov r2,BSTACK_0
lao r1,printf_int_string,0
lao r0,sprintf_buffer,4
otoa r1,printf_int_string,0
otoa r0,sprintf_buffer,4
bl sprintf
.endif
.thumb_func
return_sprintf_buffer:
.if USE_CLIB
lao r0,sprintf_buffer,5
otoa r0,sprintf_buffer,5
bl strlen
mov BSTACK_0,r0
.else
laol BSTACK_0,sprintf_buffer-1,sprintf_buffer_o_m1,0
otoa BSTACK_0,sprintf_buffer_o_m1,0
.thumb_func
skip_characters:
ldrb SCRATCH_REG,[BSTACK_0,#1]!
tst SCRATCH_REG,SCRATCH_REG
bne skip_characters
lao SCRATCH_REG,sprintf_buffer,6
otoa SCRATCH_REG,sprintf_buffer,6
sub BSTACK_0,BSTACK_0,SCRATCH_REG
.endif
.if MY_ITOS
.thumb_func
sprintf_buffer_to_string:
lao ASTACK_0,sprintf_buffer,7
otoa ASTACK_0,sprintf_buffer,7
.thumb_func
build_string:
.endif
add BSTACK_1,BSTACK_0,#3
lsr BSTACK_1,BSTACK_1,#2
add BSTACK_1,BSTACK_1,#2
subs HEAP_FREE,HEAP_FREE,BSTACK_1
bhs D_to_S_no_gc
str ASTACK_0,[BSTACK_PTR,#-4]!
bl collect_0
ldr ASTACK_0,[BSTACK_PTR],#4
D_to_S_no_gc:
subs BSTACK_1,BSTACK_1,#2
mov ASTACK_2,HEAP_PTR
laol SCRATCH_REG,__STRING__+2,__STRING___o_2,0
otoa SCRATCH_REG,__STRING___o_2,0
str BSTACK_0,[HEAP_PTR,#4]
str SCRATCH_REG,[HEAP_PTR],#8
b D_to_S_cp_str_2
D_to_S_cp_str_1:
ldr BSTACK_0,[ASTACK_0],#4
str BSTACK_0,[HEAP_PTR],#4
D_to_S_cp_str_2:
subs BSTACK_1,BSTACK_1,#1
bcs D_to_S_cp_str_1
mov ASTACK_0,ASTACK_2
ldr pc,[BSTACK_PTR],#4
eqD: ldr BSTACK_0,[ASTACK_0]
ldr SCRATCH_REG,[ASTACK_1]
cmp BSTACK_0,SCRATCH_REG
bne eqD_false
laol SCRATCH_REG,INT+2,INT_o_2,2
otoa SCRATCH_REG,INT_o_2,2
cmp BSTACK_0,SCRATCH_REG
beq eqD_INT
laol SCRATCH_REG,CHAR+2,CHAR_o_2,1
otoa SCRATCH_REG,CHAR_o_2,1
cmp BSTACK_0,SCRATCH_REG
beq eqD_CHAR
laol SCRATCH_REG,BOOL+2,BOOL_o_2,1
otoa SCRATCH_REG,BOOL_o_2,1
cmp BSTACK_0,SCRATCH_REG
beq eqD_BOOL
laol SCRATCH_REG,REAL+2,REAL_o_2,1
otoa SCRATCH_REG,REAL_o_2,1
cmp BSTACK_0,SCRATCH_REG
beq eqD_REAL
mov BSTACK_0,#1
ldr pc,[BSTACK_PTR],#4
eqD_CHAR:
eqD_INT:
ldr BSTACK_1,[ASTACK_0,#4]
mov BSTACK_0,#0
ldr SCRATCH_REG,[ASTACK_1,#4]
cmp BSTACK_1,SCRATCH_REG
it eq
moveq BSTACK_0,#1
ldr pc,[BSTACK_PTR],#4
eqD_BOOL:
ldrb BSTACK_1,[ASTACK_0,#4]
mov BSTACK_0,#0
ldrb SCRATCH_REG,[ASTACK_1,#4]
cmp BSTACK_1,SCRATCH_REG
it eq
moveq BSTACK_0,#1
ldr pc,[BSTACK_PTR],#4
eqD_REAL:
vldr.f64 d0,[ASTACK_0,#4]
vldr.f64 d1,[ASTACK_1,#4]
mov BSTACK_0,#0
vcmp.f64 d1,d0
vmrs APSR_nzcv,fpscr
it eq
moveq BSTACK_0,#1
ldr pc,[BSTACK_PTR],#4
eqD_false:
mov BSTACK_0,#0
ldr pc,[BSTACK_PTR],#4
@
@ the timer
@
.thumb_func
init_timer:
store_global_registers
sub BSTACK_PTR,BSTACK_PTR,#20
mov r0,BSTACK_PTR
bl times
ldr BSTACK_0,[BSTACK_PTR]
add BSTACK_0,BSTACK_0,BSTACK_0
add BSTACK_0,BSTACK_0,BSTACK_0,lsl #2
add BSTACK_PTR,BSTACK_PTR,#20
lao SCRATCH_REG,last_time,0
sto BSTACK_0,SCRATCH_REG,last_time,0
eor BSTACK_0,BSTACK_0,BSTACK_0
lao SCRATCH_REG,execute_time,2
sto BSTACK_0,SCRATCH_REG,execute_time,2
lao SCRATCH_REG,garbage_collect_time,2
sto BSTACK_0,SCRATCH_REG,garbage_collect_time,2
lao SCRATCH_REG,IO_time,1
sto BSTACK_0,SCRATCH_REG,IO_time,1
load_global_registers
ldr pc,[BSTACK_PTR],#4
.thumb_func
get_time_diff:
sub BSTACK_PTR,BSTACK_PTR,#20
mov r0,BSTACK_PTR
bl times
ldr BSTACK_0,[BSTACK_PTR]
add BSTACK_0,BSTACK_0,BSTACK_0
add BSTACK_0,BSTACK_0,BSTACK_0,lsl #2
add BSTACK_PTR,BSTACK_PTR,#20
lao ASTACK_0,last_time,1
otoa ASTACK_0,last_time,1
ldr ASTACK_1,[ASTACK_0]
str BSTACK_0,[ASTACK_0]
subs BSTACK_0,BSTACK_0,ASTACK_1
ldr pc,[BSTACK_PTR],#4
.thumb_func
add_execute_time:
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl get_time_diff
lao ASTACK_0,execute_time,3
otoa ASTACK_0,execute_time,3
.thumb_func
add_time:
ldr SCRATCH_REG,[ASTACK_0]
add BSTACK_0,BSTACK_0,SCRATCH_REG
str BSTACK_0,[ASTACK_0]
ldr pc,[BSTACK_PTR],#4
.thumb_func
add_garbage_collect_time:
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl get_time_diff
lao ASTACK_0,garbage_collect_time,3
otoa ASTACK_0,garbage_collect_time,3
b add_time
add_IO_time:
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl get_time_diff
lao ASTACK_0,IO_time,2
otoa ASTACK_0,IO_time,2
b add_time
.ifdef PIC
lto sprintf_time_string,0
lto sprintf_time_buffer,0
.if USE_CLIB
lto sprintf_time_buffer,1
.endif
lto basic_only,1
lto basic_only,2
ltol INT+2,INT_o_2,1
ltol CHAR+2,CHAR_o_2,0
ltol BOOL+2,BOOL_o_2,0
ltol REAL+2,REAL_o_2,0
lto true_c_string,0
lto false_c_string,0
lto basic_only,3
lto true_string,0
lto false_string,0
.if USE_CLIB
lto printf_real_string,0
lto sprintf_buffer,0
.else
lto sprintf_buffer,1
.endif
.if MY_ITOS
lto sprintf_buffer,2
lto sprintf_buffer,3
.else
lto printf_int_string,0
lto sprintf_buffer,4
.endif
.if USE_CLIB
lto sprintf_buffer,5
.else
ltol sprintf_buffer-1,sprintf_buffer_o_m1,0
lto sprintf_buffer,6
.endif
.if MY_ITOS
lto sprintf_buffer,7
.endif
ltol __STRING__+2,__STRING___o_2,0
ltol INT+2,INT_o_2,2
ltol CHAR+2,CHAR_o_2,1
ltol BOOL+2,BOOL_o_2,1
ltol REAL+2,REAL_o_2,1
lto last_time,0
lto execute_time,2
lto garbage_collect_time,2
lto IO_time,1
lto last_time,1
lto execute_time,3
lto garbage_collect_time,3
lto IO_time,2
.endif
.ltorg
.ifdef PIC
.ifdef PROFILE
lto garbage_collector_name,0
lto garbage_collector_name,1
lto garbage_collector_name,2
lto garbage_collector_name,3
.endif
lto heap_end_after_gc,1
lto n_allocated_words,0
.if MARK_AND_COPY_GC
lto flags,6
.endif
.if MARK_GC
lto bit_counter,0
lto n_allocated_words,1
lto bit_vector_p,0
lto n_free_words_after_mark,0
lto bit_counter,1
lto bit_vector_p,1
lto n_free_words_after_mark,1
lto heap_vector,1
lto heap_p3,1
lto heap_end_after_gc,2
lto bit_counter,2
lto n_free_words_after_mark,2
.endif
lto garbage_collect_flag,2
lto garbage_collect_flag,3
lto extra_heap_size,0
lto extra_heap,0
lto heap_end_after_gc,3
lto flags,7
lto garbage_collect_string_1,0
lto stack_p,1
lto garbage_collect_string_2,0
lto halt_sp,2
lto garbage_collect_string_3,0
lto stack_p,2
lto ab_stack_size,5
.endif
@
@ the garbage collector
@
collect_3:
str lr,[BSTACK_PTR,#-4]!
.ifdef PROFILE
lao ASTACK_2,garbage_collector_name,0
otoa ASTACK_2,garbage_collector_name,0
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_s
.endif
str ASTACK_0,[ASTACK_PTR]
str ASTACK_1,[ASTACK_PTR,#4]
str ASTACK_2,[ASTACK_PTR,#8]
add ASTACK_PTR,ASTACK_PTR,#12
bl collect_0_
ldr ASTACK_2,[ASTACK_PTR,#-4]
ldr ASTACK_1,[ASTACK_PTR,#-8]
ldr ASTACK_0,[ASTACK_PTR,#-12]!
.ifdef PROFILE
b profile_r
.else
ldr pc,[BSTACK_PTR],#4
.endif
collect_2:
str lr,[BSTACK_PTR,#-4]!
.ifdef PROFILE
lao ASTACK_2,garbage_collector_name,1
otoa ASTACK_2,garbage_collector_name,1
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_s
.endif
str ASTACK_0,[ASTACK_PTR]
str ASTACK_1,[ASTACK_PTR,#4]
add ASTACK_PTR,ASTACK_PTR,#8
bl collect_0_
ldr ASTACK_1,[ASTACK_PTR,#-4]
ldr ASTACK_0,[ASTACK_PTR,#-8]!
.ifdef PROFILE
b profile_r
.else
ldr pc,[BSTACK_PTR],#4
.endif
collect_1:
str lr,[BSTACK_PTR,#-4]!
.ifdef PROFILE
lao ASTACK_2,garbage_collector_name,2
otoa ASTACK_2,garbage_collector_name,2
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_s
.endif
str ASTACK_0,[ASTACK_PTR],#4
bl collect_0_
ldr ASTACK_0,[ASTACK_PTR,#-4]!
.ifdef PROFILE
b profile_r
.else
ldr pc,[BSTACK_PTR],#4
mov pc,lr
.endif
.ifdef PROFILE
collect_0:
str lr,[BSTACK_PTR,#-4]!
lao ASTACK_2,garbage_collector_name,3
otoa ASTACK_2,garbage_collector_name,3
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_s
bl collect_0_
b profile_r
.endif
.ifndef PROFILE
collect_0:
.endif
collect_0_:
store_bstack_and_lr
lao SCRATCH_REG,heap_end_after_gc,1
ldo SCRATCH_REG,SCRATCH_REG,heap_end_after_gc,1
sub ASTACK_2,SCRATCH_REG,HEAP_PTR
lsr ASTACK_2,ASTACK_2,#2
sub ASTACK_2,ASTACK_2,HEAP_FREE
lao SCRATCH_REG,n_allocated_words,0
sto ASTACK_2,SCRATCH_REG,n_allocated_words,0
.if MARK_AND_COPY_GC
lao SCRATCH_REG,flags,6
ldo SCRATCH_REG,SCRATCH_REG,flags,6
tst SCRATCH_REG,#64
beq no_mark3
.endif
.if MARK_GC
lao SCRATCH_REG,bit_counter,0
ldo ASTACK_2,SCRATCH_REG,bit_counter,0
cmp ASTACK_2,#0
beq no_scan
mov BSTACK_1,#0
str ASTACK_PTR,[BSTACK_PTR,#-4]!
lao SCRATCH_REG,n_allocated_words,1
ldo ASTACK_PTR,SCRATCH_REG,n_allocated_words,1
lao SCRATCH_REG,bit_vector_p,0
ldo ASTACK_0,SCRATCH_REG,bit_vector_p,0
lao SCRATCH_REG,n_free_words_after_mark,0
ldo BSTACK_2,SCRATCH_REG,n_free_words_after_mark,0
.thumb_func
scan_bits:
ldr SCRATCH_REG,[ASTACK_0]
cmp BSTACK_1,SCRATCH_REG
beq zero_bits
str BSTACK_1,[ASTACK_0],#4
subs ASTACK_2,ASTACK_2,#1
bne scan_bits
b end_scan
.thumb_func
zero_bits:
add ASTACK_1,ASTACK_0,#4
add ASTACK_0,ASTACK_0,#4
subs ASTACK_2,ASTACK_2,#1
bne skip_zero_bits_lp1
b end_bits
.thumb_func
skip_zero_bits_lp:
cmp BSTACK_0,#0
bne end_zero_bits
skip_zero_bits_lp1:
ldr BSTACK_0,[ASTACK_0],#4
subs ASTACK_2,ASTACK_2,#1
bne skip_zero_bits_lp
cmp BSTACK_0,#0
beq end_bits
str BSTACK_1,[ASTACK_0,#-4]
subs BSTACK_0,ASTACK_0,ASTACK_1
b end_bits2
.thumb_func
end_zero_bits:
sub BSTACK_0,ASTACK_0,ASTACK_1
lsl BSTACK_0,BSTACK_0,#3
str BSTACK_1,[ASTACK_0,#-4]
add BSTACK_2,BSTACK_2,BSTACK_0
cmp BSTACK_0,ASTACK_PTR
blo scan_bits
.thumb_func
found_free_memory:
lao SCRATCH_REG,bit_counter,1
sto ASTACK_2,SCRATCH_REG,bit_counter,1
lao SCRATCH_REG,bit_vector_p,1
sto ASTACK_0,SCRATCH_REG,bit_vector_p,1
lao SCRATCH_REG,n_free_words_after_mark,1
sto BSTACK_2,SCRATCH_REG,n_free_words_after_mark,1
sub HEAP_FREE,BSTACK_0,ASTACK_PTR
add ASTACK_2,ASTACK_1,#-4
lao SCRATCH_REG,heap_vector,1
ldo SCRATCH_REG,SCRATCH_REG,heap_vector,1
subs ASTACK_2,ASTACK_2,SCRATCH_REG
lsl ASTACK_2,ASTACK_2,#5
lao SCRATCH_REG,heap_p3,1
ldo HEAP_PTR,SCRATCH_REG,heap_p3,1
add HEAP_PTR,HEAP_PTR,ASTACK_2
add ASTACK_2,HEAP_PTR,BSTACK_0,lsl #2
lao SCRATCH_REG,heap_end_after_gc,2
sto ASTACK_2,SCRATCH_REG,heap_end_after_gc,2
ldr ASTACK_PTR,[BSTACK_PTR],#4
load_bstack_and_pc
.thumb_func
end_bits:
sub BSTACK_0,ASTACK_0,ASTACK_1
add BSTACK_0,BSTACK_0,#4
end_bits2:
lsl BSTACK_0,BSTACK_0,#3
add BSTACK_2,BSTACK_2,BSTACK_0
cmp BSTACK_0,ASTACK_PTR
bhs found_free_memory
.thumb_func
end_scan:
ldr ASTACK_PTR,[BSTACK_PTR],#4
lao SCRATCH_REG,bit_counter,2
sto ASTACK_2,SCRATCH_REG,bit_counter,2
lao SCRATCH_REG,n_free_words_after_mark,2
sto BSTACK_2,SCRATCH_REG,n_free_words_after_mark,2
.thumb_func
no_scan:
.endif
@ to do: check value in ASTACK_2
.if MARK_AND_COPY_GC
no_mark3:
.endif
lao SCRATCH_REG,garbage_collect_flag,2
ldosb BSTACK_0,SCRATCH_REG,garbage_collect_flag,2
cmp BSTACK_0,#0
ble collect
.ifdef PIC
lao SCRATCH_REG,garbage_collect_flag,3
.endif
sub BSTACK_0,BSTACK_0,#2
stob BSTACK_0,SCRATCH_REG,garbage_collect_flag,3
lao SCRATCH_REG,extra_heap_size,0
ldo BSTACK_1,SCRATCH_REG,extra_heap_size,0
cmp ASTACK_2,BSTACK_1
bhi collect
sub HEAP_FREE,BSTACK_1,ASTACK_2
lao SCRATCH_REG,extra_heap,0
ldo HEAP_PTR,SCRATCH_REG,extra_heap,0
add BSTACK_1,HEAP_PTR,BSTACK_1,lsl #2
lao SCRATCH_REG,heap_end_after_gc,3
sto BSTACK_1,SCRATCH_REG,heap_end_after_gc,3
load_bstack_and_pc
.thumb_func
.align
collect:
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl add_execute_time
lao SCRATCH_REG,flags,7
ldo SCRATCH_REG,SCRATCH_REG,flags,7
tst SCRATCH_REG,#4
beq no_print_stack_sizes
lao r0,garbage_collect_string_1,0
otoa r0,garbage_collect_string_1,0
store_global_registers
bl ew_print_string
mov BSTACK_0,ASTACK_PTR
lao SCRATCH_REG,stack_p,1
ldo SCRATCH_REG,SCRATCH_REG,stack_p,1
sub r0,BSTACK_0,SCRATCH_REG
bl ew_print_int
lao r0,garbage_collect_string_2,0
otoa r0,garbage_collect_string_2,0
bl ew_print_string
lao SCRATCH_REG,halt_sp,2
ldo BSTACK_0,SCRATCH_REG,halt_sp,2
add r0,BSTACK_PTR,#0
sub r0,BSTACK_0,r0
bl ew_print_int
lao r0,garbage_collect_string_3,0
otoa r0,garbage_collect_string_3,0
bl ew_print_string
load_global_registers
.thumb_func
no_print_stack_sizes:
lao SCRATCH_REG,stack_p,2
ldo BSTACK_0,SCRATCH_REG,stack_p,2
lao SCRATCH_REG,ab_stack_size,5
ldo SCRATCH_REG,SCRATCH_REG,ab_stack_size,5
add BSTACK_0,BSTACK_0,SCRATCH_REG
cmp ASTACK_PTR,BSTACK_0
bhi stack_overflow
.if MARK_AND_COPY_GC
lao SCRATCH_REG,flags,8
ldo SCRATCH_REG,SCRATCH_REG,flags,8
tst SCRATCH_REG,#64
bne compacting_collector
.else
.if MARK_GC
b compacting_collector
.endif
.endif
.if MARK_AND_COPY_GC || !MARK_GC
lao SCRATCH_REG,garbage_collect_flag,4
ldosb SCRATCH_REG,SCRATCH_REG,garbage_collect_flag,4
cmp SCRATCH_REG,#0
bne compacting_collector
lao SCRATCH_REG,heap_copied_vector,1
ldo ASTACK_2,SCRATCH_REG,heap_copied_vector,1
lao SCRATCH_REG,heap_end_after_copy_gc,1
ldo SCRATCH_REG,SCRATCH_REG,heap_end_after_copy_gc,1
cmp SCRATCH_REG,#0
beq zero_all
mov BSTACK_0,HEAP_PTR
lao SCRATCH_REG,heap_p1,1
ldo SCRATCH_REG,SCRATCH_REG,heap_p1,1
subs BSTACK_0,BSTACK_0,SCRATCH_REG
add BSTACK_0,BSTACK_0,#63*4
lsr BSTACK_0,BSTACK_0,#8
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl zero_bit_vector
lao SCRATCH_REG,heap_end_after_copy_gc,2
ldo ASTACK_1,SCRATCH_REG,heap_end_after_copy_gc,2
lao SCRATCH_REG,heap_p1,2
ldo SCRATCH_REG,SCRATCH_REG,heap_p1,2
subs ASTACK_1,ASTACK_1,SCRATCH_REG
lsr ASTACK_1,ASTACK_1,#6
and ASTACK_1,ASTACK_1,#-4
lao SCRATCH_REG,heap_copied_vector,2
ldo ASTACK_2,SCRATCH_REG,heap_copied_vector,2
lao SCRATCH_REG,heap_copied_vector_size,2
ldo BSTACK_0,SCRATCH_REG,heap_copied_vector_size,2
add ASTACK_2,ASTACK_2,ASTACK_1
subs BSTACK_0,BSTACK_0,ASTACK_1
lsr BSTACK_0,BSTACK_0,#2
lao SCRATCH_REG,heap_end_after_copy_gc,3
mov LINK_REG,#0
sto LINK_REG,SCRATCH_REG,heap_end_after_copy_gc,3
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl zero_bit_vector
b end_zero_bit_vector
.thumb_func
zero_all:
lao SCRATCH_REG,heap_copied_vector_size,3
ldo BSTACK_0,SCRATCH_REG,heap_copied_vector_size,3
lsr BSTACK_0,BSTACK_0,#2
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl zero_bit_vector
.thumb_func
end_zero_bit_vector:
.include "thumb2copy.s"
.if WRITE_HEAP
lao SCRATCH_REG,heap2_begin_and_end,0
sto ASTACK_PTR,SCRATCH_REG,heap2_begin_and_end,0
.endif
sub ASTACK_2,ASTACK_PTR,HEAP_PTR
lsr ASTACK_2,ASTACK_2,#2
ldr ASTACK_PTR,[BSTACK_PTR],#4
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl add_garbage_collect_time
lao SCRATCH_REG,n_allocated_words,2
ldo SCRATCH_REG,SCRATCH_REG,n_allocated_words,2
subs ASTACK_2,ASTACK_2,SCRATCH_REG
mov HEAP_FREE,ASTACK_2
bls switch_to_mark_scan
add BSTACK_0,ASTACK_2,ASTACK_2,lsl #2
lsl BSTACK_0,BSTACK_0,#5
lao BSTACK_1,heap_size,4
ldo BSTACK_1,BSTACK_1,heap_size,4
mov ASTACK_0,BSTACK_1
lsl BSTACK_1,BSTACK_1,#2
add BSTACK_1,BSTACK_1,ASTACK_0
add BSTACK_1,BSTACK_1,BSTACK_1
add BSTACK_1,BSTACK_1,ASTACK_0
cmp BSTACK_0,BSTACK_1
bhs no_mark_scan
@ b no_mark_scan
.thumb_func
switch_to_mark_scan:
lao SCRATCH_REG,heap_size_33,2
ldo BSTACK_0,SCRATCH_REG,heap_size_33,2
lsl BSTACK_0,BSTACK_0,#5
lao SCRATCH_REG,heap_p,1
ldo BSTACK_1,SCRATCH_REG,heap_p,1
lao SCRATCH_REG,heap_p1,3
ldo ASTACK_0,SCRATCH_REG,heap_p1,3
lao SCRATCH_REG,heap_p2,1
ldo SCRATCH_REG,SCRATCH_REG,heap_p2,1
cmp ASTACK_0,SCRATCH_REG
bcc vector_at_begin
.thumb_func
vector_at_end:
lao SCRATCH_REG,heap_p3,2
sto BSTACK_1,SCRATCH_REG,heap_p3,2
add BSTACK_1,BSTACK_1,BSTACK_0
lao SCRATCH_REG,heap_vector,2
sto BSTACK_1,SCRATCH_REG,heap_vector,2
lao SCRATCH_REG,heap_p1,4
ldo BSTACK_0,SCRATCH_REG,heap_p1,4
lao SCRATCH_REG,extra_heap,1
sto BSTACK_0,SCRATCH_REG,extra_heap,1
subs BSTACK_1,BSTACK_1,BSTACK_0
lsr BSTACK_1,BSTACK_1,#2
lao SCRATCH_REG,extra_heap_size,1
sto BSTACK_1,SCRATCH_REG,extra_heap_size,1
b switch_to_mark_scan_2
.thumb_func
vector_at_begin:
lao SCRATCH_REG,heap_vector,3
sto BSTACK_1,SCRATCH_REG,heap_vector,3
lao SCRATCH_REG,heap_size,5
ldo SCRATCH_REG,SCRATCH_REG,heap_size,5
add BSTACK_1,BSTACK_1,SCRATCH_REG
subs BSTACK_1,BSTACK_1,BSTACK_0
lao SCRATCH_REG,heap_p3,3
sto BSTACK_1,SCRATCH_REG,heap_p3,3
lao SCRATCH_REG,extra_heap,2
sto BSTACK_1,SCRATCH_REG,extra_heap,2
lao SCRATCH_REG,heap_p2,2
ldo ASTACK_0,SCRATCH_REG,heap_p2,2
subs ASTACK_0,ASTACK_0,BSTACK_1
lsr ASTACK_0,ASTACK_0,#2
lao SCRATCH_REG,extra_heap_size,2
sto ASTACK_0,SCRATCH_REG,extra_heap_size,2
switch_to_mark_scan_2:
lao BSTACK_0,heap_size,6
ldo BSTACK_0,BSTACK_0,heap_size,6
lsr BSTACK_0,BSTACK_0,#3
sub BSTACK_0,BSTACK_0,ASTACK_2
lsl BSTACK_0,BSTACK_0,#2
lao SCRATCH_REG,garbage_collect_flag,5
mov ASTACK_3,#1
stob ASTACK_3,SCRATCH_REG,garbage_collect_flag,5
cmp ASTACK_2,#0
bpl end_garbage_collect
mov ASTACK_3,#-1
strb ASTACK_3,[SCRATCH_REG]
lao SCRATCH_REG,extra_heap_size,3
ldo BSTACK_1,SCRATCH_REG,extra_heap_size,3
mov BSTACK_0,BSTACK_1
lao SCRATCH_REG,n_allocated_words,3
ldo SCRATCH_REG,SCRATCH_REG,n_allocated_words,3
subs BSTACK_0,BSTACK_0,SCRATCH_REG
bmi out_of_memory_4
lao SCRATCH_REG,extra_heap,3
ldo HEAP_PTR,SCRATCH_REG,extra_heap,3
lsl BSTACK_1,BSTACK_1,#2
add BSTACK_1,BSTACK_1,HEAP_PTR
lao SCRATCH_REG,heap_end_after_gc,4
sto BSTACK_1,SCRATCH_REG,heap_end_after_gc,4
.if WRITE_HEAP
lao SCRATCH_REG,heap_end_write_heap,0
sto HEAP_PTR,SCRATCH_REG,heap_end_write_heap,0
lao SCRATCH_REG,d3_flag_write_heap,0
mov ASTACK_3,#1
sto ASTACK_3,SCRATCH_REG,d3_flag_write_heap,0
b end_garbage_collect_
.else
b end_garbage_collect
.endif
.thumb_func
no_mark_scan:
@ exchange the semi_spaces
lao SCRATCH_REG,heap_p1,5
ldo BSTACK_0,SCRATCH_REG,heap_p1,5
lao SCRATCH_REG,heap_p2,3
ldo BSTACK_1,SCRATCH_REG,heap_p2,3
lao SCRATCH_REG,heap_p2,4
sto BSTACK_0,SCRATCH_REG,heap_p2,4
lao SCRATCH_REG,heap_p1,6
sto BSTACK_1,SCRATCH_REG,heap_p1,6
lao SCRATCH_REG,heap_size_129,2
ldo BSTACK_0,SCRATCH_REG,heap_size_129,2
lsl BSTACK_0,BSTACK_0,#6-2
.ifdef MUNMAP
lao SCRATCH_REG,heap_p2,5
ldo BSTACK_1,SCRATCH_REG,heap_p2,5
add ASTACK_0,BSTACK_1,BSTACK_0,lsl #2
add BSTACK_1,BSTACK_1,#4095
and BSTACK_1,BSTACK_1,#-4096
and ASTACK_0,ASTACK_0,#-4096
subs ASTACK_0,ASTACK_0,BSTACK_1
bls no_pages
str BSTACK_0,[BSTACK_PTR,#-4]!
str ASTACK_0,[BSTACK_PTR,#-4]!
str BSTACK_1,[BSTACK_PTR,#-4]!
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl _munmap
add BSTACK_PTR,BSTACK_PTR,#8
ldr BSTACK_0,[BSTACK_PTR],#4
.thumb_func
no_pages:
.endif
.if ADJUST_HEAP_SIZE
mov BSTACK_1,BSTACK_0
.endif
subs BSTACK_0,BSTACK_0,ASTACK_2
.if ADJUST_HEAP_SIZE
mov ASTACK_0,BSTACK_0
lao SCRATCH_REG,heap_size_multiple,0
ldo SCRATCH_REG,SCRATCH_REG,heap_size_multiple,0
umull BSTACK_0,ASTACK_1,SCRATCH_REG,BSTACK_0
lsr BSTACK_0,BSTACK_0,#9
orr BSTACK_0,BSTACK_0,ASTACK_1,lsl #32-9
lsrs ASTACK_1,ASTACK_1,#9
bne no_small_heap1
cmp BSTACK_0,#MINIMUM_HEAP_SIZE_2
bhs not_too_small1
mov BSTACK_0,#MINIMUM_HEAP_SIZE_2
not_too_small1:
subs BSTACK_1,BSTACK_1,BSTACK_0
blo no_small_heap1
sub HEAP_FREE,HEAP_FREE,BSTACK_1
lsl BSTACK_1,BSTACK_1,#2
lao SCRATCH_REG,heap_end_after_gc,5
ldo ASTACK_2,SCRATCH_REG,heap_end_after_gc,5
lao SCRATCH_REG,heap_end_after_copy_gc,4
sto ASTACK_2,SCRATCH_REG,heap_end_after_copy_gc,4
sub ASTACK_2,ASTACK_2,BSTACK_1
lao SCRATCH_REG,heap_end_after_gc,6
sto ASTACK_2,SCRATCH_REG,heap_end_after_gc,6
no_small_heap1:
mov BSTACK_0,ASTACK_0
.endif
lsl BSTACK_0,BSTACK_0,#2
.endif
.thumb_func
end_garbage_collect:
.if WRITE_HEAP
lao SCRATCH_REG,heap_end_write_heap,1
sto HEAP_PTR,SCRATCH_REG,heap_end_write_heap,1
lao SCRATCH_REG,d3_flag_write_heap,1
mov ASTACK_3,#0
sto ASTACK_3,SCRATCH_REG,d3_flag_write_heap,1
.thumb_func
end_garbage_collect_:
.endif
str BSTACK_0,[BSTACK_PTR,#-4]!
store_global_registers
lao SCRATCH_REG,flags,9
ldo SCRATCH_REG,SCRATCH_REG,flags,9
tst SCRATCH_REG,#2
beq no_heap_use_message
str BSTACK_0,[BSTACK_PTR,#-4]!
lao r0,heap_use_after_gc_string_1,0
otoa r0,heap_use_after_gc_string_1,0
bl ew_print_string
ldr r0,[BSTACK_PTR],#4
bl ew_print_int
lao r0,heap_use_after_gc_string_2,0
otoa r0,heap_use_after_gc_string_2,0
bl ew_print_string
.thumb_func
no_heap_use_message:
load_global_registers
.if FINALIZERS
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl call_finalizers
.endif
ldr BSTACK_0,[BSTACK_PTR],#4
.if WRITE_HEAP
@ Check whether memory profiling is on or off
lao SCRATCH_REG,flags,10
ldo SCRATCH_REG,SCRATCH_REG,flags,10
tst SCRATCH_REG,#32
beq no_write_heap
lao SCRATCH_REG,min_write_heap_size,0
ldo SCRATCH_REG,SCRATCH_REG,min_write_heap_size,0
cmp BSTACK_0,SCRATCH_REG
blo no_write_heap
str ASTACK_0,[BSTACK_PTR,#-4]!
str ASTACK_1,[BSTACK_PTR,#-4]!
str ASTACK_2,[BSTACK_PTR,#-4]!
str ASTACK_PTR,[BSTACK_PTR,#-4]!
str HEAP_PTR,[BSTACK_PTR,#-4]!
subs BSTACK_PTR,BSTACK_PTR,#64
lao SCRATCH_REG,d3_flag_write_heap,2
ldo BSTACK_0,SCRATCH_REG,d3_flag_write_heap,2
tst BSTACK_0,BSTACK_0
bne copy_to_compact_with_alloc_in_extra_heap
lao BSTACK_0,garbage_collect_flag,6
ldosb BSTACK_0,BSTACK_0,garbage_collect_flag,6
lao SCRATCH_REG,heap2_begin_and_end,1
ldo ASTACK_0,SCRATCH_REG,heap2_begin_and_end,1
laol SCRATCH_REG,heap2_begin_and_end+4,heap2_begin_and_end_o_4,0
ldo ASTACK_1,SCRATCH_REG,heap2_begin_and_end_o_4,0
lao BSTACK_1,heap_p1,7
otoa BSTACK_1,heap_p1,7
tst BSTACK_0,BSTACK_0
beq gc0
lao BSTACK_1,heap_p2,6
otoa BSTACK_1,heap_p2,6
bgt gc1
lao BSTACK_1,heap_p3,4
otoa BSTACK_1,heap_p3,4
mov ASTACK_0,#0
mov ASTACK_1,#0
gc0:
gc1:
ldr BSTACK_1,[BSTACK_1]
? /* fill record */
mov BSTACK_0,BSTACK_PTR
str BSTACK_1,[BSTACK_0,#0]
? movl a4,4(d0) // klop dit?
? movl a0,8(d0) // heap2_begin
? movl a1,12(d0) // heap2_end
lao SCRATCH_REG,stack_p,3
ldo BSTACK_1,SCRATCH_REG,stack_p,3
? movl d1,16(d0) // stack_begin
? movl a3,20(d0) // stack_end
? movl $0,24(d0) // text_begin
? movl $0,28(d0) // data_begin
? movl $small_integers,32(d0) // small_integers
? movl $static_characters,36(d0) // small_characters
? movl $INT+2,40(d0) // INT-descP
? movl $CHAR+2,44(d0) // CHAR-descP
? movl $REAL+2,48(d0) // REAL-descP
? movl $BOOL+2,52(d0) // BOOL-descP
? movl $__STRING__+2,56(d0) // STRING-descP
? movl $__ARRAY__+2,60(d0) // ARRAY-descP
str BSTACK_0,[BSTACK_PTR,#-4]!
bl write_heap
add BSTACK_PTR,BSTACK_PTR,#68
ldr HEAP_PTR,[BSTACK_PTR],#4
ldr ASTACK_PTR,[BSTACK_PTR],#4
ldr ASTACK_2,[BSTACK_PTR],#4
ldr ASTACK_1,[BSTACK_PTR],#4
ldr ASTACK_0,[BSTACK_PTR],#4
.thumb_func
no_write_heap:
.endif
load_bstack_and_pc
.ifdef PIC
.if MARK_AND_COPY_GC
lto flags,8
.endif
.if MARK_AND_COPY_GC || !MARK_GC
lto garbage_collect_flag,4
lto heap_copied_vector,1
lto heap_end_after_copy_gc,1
lto heap_p1,1
lto heap_end_after_copy_gc,2
lto heap_p1,2
lto heap_copied_vector,2
lto heap_copied_vector_size,2
lto heap_end_after_copy_gc,3
lto heap_copied_vector_size,3
.endif
.if WRITE_HEAP
lto heap2_begin_and_end,0
.endif
lto n_allocated_words,2
lto heap_size,4
lto heap_size_33,2
lto heap_p,1
lto heap_p1,3
lto heap_p2,1
lto heap_p3,2
lto heap_vector,2
lto heap_p1,4
lto extra_heap,1
lto extra_heap_size,1
lto heap_vector,3
lto heap_size,5
lto heap_p3,3
lto extra_heap,2
lto heap_p2,2
lto extra_heap_size,2
lto heap_size,6
lto garbage_collect_flag,5
lto extra_heap_size,3
lto n_allocated_words,3
lto extra_heap,3
lto heap_end_after_gc,4
.if WRITE_HEAP
lto heap_end_write_heap,0
lto d3_flag_write_heap,0
.endif
lto heap_p1,5
lto heap_p2,3
lto heap_p2,4
lto heap_p1,6
lto heap_size_129,2
.ifdef MUNMAP
lto heap_p2,5
.endif
.if ADJUST_HEAP_SIZE
lto heap_size_multiple,0
lto heap_end_after_gc,5
lto heap_end_after_copy_gc,4
lto heap_end_after_gc,6
.endif
.if WRITE_HEAP
lto heap_end_write_heap,1
lto d3_flag_write_heap,1
.endif
lto flags,9
lto heap_use_after_gc_string_1,0
lto heap_use_after_gc_string_2,0
.if WRITE_HEAP
lto flags,10
lto min_write_heap_size,0
lto d3_flag_write_heap,2
lto garbage_collect_flag,6
lto heap2_begin_and_end,1
ltol heap2_begin_and_end+4,heap2_begin_and_end_o_4,0
lto heap_p1,7
lto heap_p2,6
lto heap_p3,4
lto stack_p,3
.endif
.endif
.ltorg
.ifdef PIC
.if FINALIZERS
lto free_finalizer_list,1
ltol __Nil-4,__Nil_o_m4,1
lto free_finalizer_list,2
ltol __Nil-4,__Nil_o_m4,2
.endif
.if WRITE_HEAP
lto heap2_begin_and_end,2
ltol heap2_begin_and_end+4,heap2_begin_and_end_o_4,1
lto heap_p2,7
.endif
lto out_of_memory_string_4,0
lto stack_top,0
lto heap_vector,4
.if MARK_GC
.if MARK_AND_COPY_GC
lto flags,11
.endif
lto zero_bits_before_mark,0
.endif
lto heap_size_33,3
.if MARK_GC
.if MARK_AND_COPY_GC
lto flags,12
.endif
lto n_last_heap_free_bytes,0
lto n_free_words_after_mark,3
.endif
.if ADJUST_HEAP_SIZE
lto bit_vector_size,1
lto heap_size_multiple,1
.endif
.endif
.if FINALIZERS
.thumb_func
call_finalizers:
lao SCRATCH_REG,free_finalizer_list,1
ldo BSTACK_0,SCRATCH_REG,free_finalizer_list,1
.thumb_func
call_finalizers_lp:
laol SCRATCH_REG,__Nil-4,__Nil_o_m4,1
otoa SCRATCH_REG,__Nil_o_m4,1
cmp BSTACK_0,SCRATCH_REG
beq end_call_finalizers
ldr SCRATCH_REG,[BSTACK_0,#4]
str SCRATCH_REG,[BSTACK_PTR,#-4]!
ldr BSTACK_1,[BSTACK_0,#8]
ldr SCRATCH_REG,[BSTACK_1,#4]
str SCRATCH_REG,[BSTACK_PTR,#-4]!
ldr SCRATCH_REG,[BSTACK_1]
blx SCRATCH_REG
add BSTACK_PTR,BSTACK_PTR,#4
ldr BSTACK_0,[BSTACK_PTR],#4
b call_finalizers_lp
.thumb_func
end_call_finalizers:
lao SCRATCH_REG,free_finalizer_list,2
laol ASTACK_3,__Nil-4,__Nil_o_m4,2
otoa ASTACK_3,__Nil_o_m4,2
sto ASTACK_3,SCRATCH_REG,free_finalizer_list,2
ldr pc,[BSTACK_PTR],#4
.endif
.if WRITE_HEAP
.thumb_func
copy_to_compact_with_alloc_in_extra_heap:
lao SCRATCH_REG,heap2_begin_and_end,2
ldo ASTACK_0,SCRATCH_REG,heap2_begin_and_end,2
laol SCRATCH_REG,heap2_begin_and_end+4,heap2_begin_and_end_o_4,1
ldo ASTACK_1,SCRATCH_REG,heap2_begin_and_end_o_4,1
lao BSTACK_1,heap_p2,7
otoa BSTACK_1,heap_p2,7
b gc1
.endif
out_of_memory_4:
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl add_garbage_collect_time
lao ASTACK_2,out_of_memory_string_4,0
otoa ASTACK_2,out_of_memory_string_4,0
b print_error
.thumb_func
zero_bit_vector:
eor ASTACK_1,ASTACK_1,ASTACK_1
tst BSTACK_0,#1
beq zero_bits1_1
str ASTACK_1,[ASTACK_2]
add ASTACK_2,ASTACK_2,#4
zero_bits1_1:
lsr BSTACK_0,BSTACK_0,#1
mov BSTACK_1,BSTACK_0
lsr BSTACK_0,BSTACK_0,#1
tst BSTACK_1,#1
beq zero_bits1_5
subs ASTACK_2,ASTACK_2,#8
b zero_bits1_2
zero_bits1_4:
str ASTACK_1,[ASTACK_2]
str ASTACK_1,[ASTACK_2,#4]
zero_bits1_2:
str ASTACK_1,[ASTACK_2,#8]
str ASTACK_1,[ASTACK_2,#12]
add ASTACK_2,ASTACK_2,#16
zero_bits1_5:
subs BSTACK_0,BSTACK_0,#1
bhs zero_bits1_4
ldr pc,[BSTACK_PTR],#4
.thumb_func
reorder:
str ASTACK_PTR,[BSTACK_PTR,#-4]!
str ASTACK_2,[BSTACK_PTR,#-4]!
mov ASTACK_2,BSTACK_0
lsl ASTACK_2,ASTACK_2,#2
mov ASTACK_PTR,BSTACK_1
lsl ASTACK_PTR,ASTACK_PTR,#2
add ASTACK_0,ASTACK_0,ASTACK_PTR
subs ASTACK_1,ASTACK_1,ASTACK_2
str ASTACK_PTR,[BSTACK_PTR,#-4]!
str ASTACK_2,[BSTACK_PTR,#-4]!
str BSTACK_1,[BSTACK_PTR,#-4]!
str BSTACK_0,[BSTACK_PTR,#-4]!
b st_reorder_lp
.thumb_func
reorder_lp:
ldr ASTACK_2,[ASTACK_0]
ldr ASTACK_PTR,[ASTACK_1,#-4]
str ASTACK_2,[ASTACK_1,#-4]
subs ASTACK_1,ASTACK_1,#4
str ASTACK_PTR,[ASTACK_0]
add ASTACK_0,ASTACK_0,#4
subs BSTACK_0,BSTACK_0,#1
bne next_b_in_element
ldr BSTACK_0,[BSTACK_PTR]
ldr SCRATCH_REG,[BSTACK_PTR,#12]
add ASTACK_0,ASTACK_0,SCRATCH_REG
.thumb_func
next_b_in_element:
subs BSTACK_1,BSTACK_1,#1
bne next_a_in_element
ldr BSTACK_1,[BSTACK_PTR,#4]
ldr SCRATCH_REG,[BSTACK_PTR,#8]
subs ASTACK_1,ASTACK_1,SCRATCH_REG
.thumb_func
next_a_in_element:
.thumb_func
st_reorder_lp:
cmp ASTACK_1,ASTACK_0
bhi reorder_lp
ldr BSTACK_0,[BSTACK_PTR],#4
ldr BSTACK_1,[BSTACK_PTR],#4
add BSTACK_PTR,BSTACK_PTR,#8
ldr ASTACK_2,[BSTACK_PTR],#4
ldr ASTACK_PTR,[BSTACK_PTR],#4
ldr pc,[BSTACK_PTR],#4
@
@ the sliding compacting garbage collector
@
.thumb_func
compacting_collector:
@ zero all mark bits
lao SCRATCH_REG,stack_top,0
sto ASTACK_PTR,SCRATCH_REG,stack_top,0
lao SCRATCH_REG,heap_vector,4
ldo HEAP_PTR,SCRATCH_REG,heap_vector,4
.if MARK_GC
.if MARK_AND_COPY_GC
lao SCRATCH_REG,flags,11
ldo SCRATCH_REG,SCRATCH_REG,flags,11
tst SCRATCH_REG,#64
beq no_mark4
.endif
lao SCRATCH_REG,zero_bits_before_mark,0
otoa SCRATCH_REG,zero_bits_before_mark,0
ldr ASTACK_3,[SCRATCH_REG]
cmp ASTACK_3,#0
beq no_zero_bits
mov ASTACK_3,#0
str ASTACK_3,[SCRATCH_REG]
.if MARK_AND_COPY_GC
no_mark4:
.endif
.endif
mov ASTACK_2,HEAP_PTR
lao SCRATCH_REG,heap_size_33,3
ldo BSTACK_0,SCRATCH_REG,heap_size_33,3
add BSTACK_0,BSTACK_0,#3
lsr BSTACK_0,BSTACK_0,#2
mov BSTACK_1,#0
tst BSTACK_0,#1
beq zero_bits_1
str BSTACK_1,[ASTACK_2],#4
zero_bits_1:
mov ASTACK_0,BSTACK_0
lsr BSTACK_0,BSTACK_0,#2
tst ASTACK_0,#2
beq zero_bits_5
subs ASTACK_2,ASTACK_2,#8
b zero_bits_2
zero_bits_4:
str BSTACK_1,[ASTACK_2]
str BSTACK_1,[ASTACK_2,#4]
zero_bits_2:
str BSTACK_1,[ASTACK_2,#8]
str BSTACK_1,[ASTACK_2,#12]
add ASTACK_2,ASTACK_2,#16
zero_bits_5:
subs BSTACK_0,BSTACK_0,#1
bcs zero_bits_4
.if MARK_GC
.if MARK_AND_COPY_GC
lao SCRATCH_REG,flags,12
ldo SCRATCH_REG,SCRATCH_REG,flags,12
tst SCRATCH_REG,#64
beq no_mark5
.endif
.thumb_func
no_zero_bits:
lao SCRATCH_REG,n_last_heap_free_bytes,0
ldo BSTACK_0,SCRATCH_REG,n_last_heap_free_bytes,0
lao SCRATCH_REG,n_free_words_after_mark,3
ldo BSTACK_1,SCRATCH_REG,n_free_words_after_mark,3
.if 1
lsr BSTACK_0,BSTACK_0,#2
.else
lsl BSTACK_1,BSTACK_1,#2
.endif
add ASTACK_2,BSTACK_1,BSTACK_1,lsl #3
lsr ASTACK_2,ASTACK_2,#2
cmp BSTACK_0,ASTACK_2
bgt compact_gc
.if ADJUST_HEAP_SIZE
lao SCRATCH_REG,bit_vector_size,1
ldo BSTACK_1,SCRATCH_REG,bit_vector_size,1
lsl BSTACK_1,BSTACK_1,#2
sub BSTACK_0,BSTACK_1,BSTACK_0
lao SCRATCH_REG,heap_size_multiple,1
ldo SCRATCH_REG,SCRATCH_REG,heap_size_multiple,1
umull BSTACK_0,ASTACK_1,SCRATCH_REG,BSTACK_0
lsr BSTACK_0,BSTACK_0,#7
orr BSTACK_0,BSTACK_0,ASTACK_1,lsl #32-7
lsrs ASTACK_1,ASTACK_1,#7
bne no_smaller_heap
cmp BSTACK_0,BSTACK_1
bhs no_smaller_heap
cmp BSTACK_1,#MINIMUM_HEAP_SIZE
bls no_smaller_heap
b compact_gc
.thumb_func
no_smaller_heap:
.endif
.include "thumb2mark.s"
.ifdef PIC
lto zero_bits_before_mark,1
lto n_last_heap_free_bytes,1
lto n_free_words_after_mark,4
.endif
.thumb_func
compact_gc:
lao SCRATCH_REG,zero_bits_before_mark,1
mov ASTACK_3,#1
sto ASTACK_3,SCRATCH_REG,zero_bits_before_mark,1
lao SCRATCH_REG,n_last_heap_free_bytes,1
mov ASTACK_3,#0
sto ASTACK_3,SCRATCH_REG,n_last_heap_free_bytes,1
lao SCRATCH_REG,n_free_words_after_mark,4
mov ASTACK_3,#1000
sto ASTACK_3,SCRATCH_REG,n_free_words_after_mark,4
.if MARK_AND_COPY_GC
no_mark5:
.endif
.endif
.include "thumb2compact.s"
lao SCRATCH_REG,stack_top,1
ldo ASTACK_PTR,SCRATCH_REG,stack_top,1
lao SCRATCH_REG,heap_size_33,4
ldo BSTACK_1,SCRATCH_REG,heap_size_33,4
lsl BSTACK_1,BSTACK_1,#5
lao SCRATCH_REG,heap_p3,5
ldo SCRATCH_REG,SCRATCH_REG,heap_p3,5
add BSTACK_1,BSTACK_1,SCRATCH_REG
lao SCRATCH_REG,heap_end_after_gc,7
sto BSTACK_1,SCRATCH_REG,heap_end_after_gc,7
subs BSTACK_1,BSTACK_1,HEAP_PTR
lsr BSTACK_1,BSTACK_1,#2
lao SCRATCH_REG,n_allocated_words,4
ldo SCRATCH_REG,SCRATCH_REG,n_allocated_words,4
subs BSTACK_1,BSTACK_1,SCRATCH_REG
mov HEAP_FREE,BSTACK_1
bcc out_of_memory_4
ldr SCRATCH_REG,=107374182
cmp BSTACK_1,SCRATCH_REG
bhs not_out_of_memory
add BSTACK_0,BSTACK_1,BSTACK_1,lsl #2
lsl BSTACK_0,BSTACK_0,#3
lao SCRATCH_REG,heap_size,7
ldo SCRATCH_REG,SCRATCH_REG,heap_size,7
cmp BSTACK_0,SCRATCH_REG
bcc out_of_memory_4
.thumb_func
not_out_of_memory:
.if MARK_GC || COMPACT_GC_ONLY
.if MARK_GC && ADJUST_HEAP_SIZE
.if MARK_AND_COPY_GC
lao SCRATCH_REG,flags,13
ldo SCRATCH_REG,SCRATCH_REG,flags,13
tst SCRATCH_REG,#64
beq no_mark_6
.endif
lao SCRATCH_REG,heap_p3,6
ldo BSTACK_0,SCRATCH_REG,heap_p3,6
sub BSTACK_0,HEAP_PTR,BSTACK_0
lao SCRATCH_REG,n_allocated_words,5
ldo BSTACK_1,SCRATCH_REG,n_allocated_words,5
add BSTACK_0,BSTACK_0,BSTACK_1,lsl #2
lao SCRATCH_REG,heap_size_33,5
ldo BSTACK_1,SCRATCH_REG,heap_size_33,5
lsl BSTACK_1,BSTACK_1,#5
lao SCRATCH_REG,heap_size_multiple,2
ldo SCRATCH_REG,SCRATCH_REG,heap_size_multiple,2
umull BSTACK_0,ASTACK_1,SCRATCH_REG,BSTACK_0
lsr BSTACK_0,BSTACK_0,#8
orr BSTACK_0,BSTACK_0,ASTACK_1,lsl #32-8
lsrs ASTACK_1,ASTACK_1,#8
bne no_small_heap2
and BSTACK_0,BSTACK_0,#-4
cmp BSTACK_0,#MINIMUM_HEAP_SIZE
bhs not_too_small2
mov BSTACK_0,#MINIMUM_HEAP_SIZE
not_too_small2:
mov ASTACK_0,BSTACK_1
subs ASTACK_0,ASTACK_0,BSTACK_0
blo no_small_heap2
lao SCRATCH_REG,heap_end_after_gc,8
otoa SCRATCH_REG,heap_end_after_gc,8
ldr ASTACK_3,[SCRATCH_REG]
sub ASTACK_3,ASTACK_3,ASTACK_0
str ASTACK_3,[SCRATCH_REG]
sub HEAP_FREE,HEAP_FREE,ASTACK_0,lsr #2
mov BSTACK_1,BSTACK_0
no_small_heap2:
lsr BSTACK_1,BSTACK_1,#2
lao SCRATCH_REG,bit_vector_size,2
sto BSTACK_1,SCRATCH_REG,bit_vector_size,2
.if MARK_AND_COPY_GC
no_mark_6:
.endif
.endif
b no_copy_garbage_collection
.else
@ to do prevent overflow
lsl BSTACK_0,BSTACK_0,#2
lao SCRATCH_REG,heap_size,8
ldo SCRATCH_REG,SCRATCH_REG,heap_size,8
lsl ASTACK_0,SCRATCH_REG,#5
sub ASTACK_0,ASTACK_0,SCRATCH_REG
cmp BSTACK_0,ASTACK_0
ble no_copy_garbage_collection
lao SCRATCH_REG,heap_p,2
ldo BSTACK_0,SCRATCH_REG,heap_p,2
lao SCRATCH_REG,heap_p1,8
sto BSTACK_0,SCRATCH_REG,heap_p1,8
lao SCRATCH_REG,heap_size_129,3
lto BSTACK_1,SCRATCH_REG,heap_size_129,3
lsl BSTACK_1,BSTACK_1,#6
add BSTACK_0,BSTACK_0,BSTACK_1
lao SCRATCH_REG,heap_copied_vector,3
sto BSTACK_0,SCRATCH_REG,heap_copied_vector,3
lao SCRATCH_REG,heap_end_after_gc,9
sto BSTACK_0,SCRATCH_REG,heap_end_after_gc,9
lao SCRATCH_REG,heap_copied_vector_size,4
ldo BSTACK_1,SCRATCH_REG,heap_copied_vector_size,4
add BSTACK_1,BSTACK_1,BSTACK_0
lao SCRATCH_REG,heap_p2,8
sto BSTACK_1,SCRATCH_REG,heap_p2,8
lao SCRATCH_REG,heap_p3,7
ldo BSTACK_0,SCRATCH_REG,heap_p3,7
lao SCRATCH_REG,heap_vector,5
ldo SCRATCH_REG,SCRATCH_REG,heap_vector,5
cmp BSTACK_0,SCRATCH_REG
ble vector_at_end_2
lao SCRATCH_REG,heap_vector,6
ldo BSTACK_1,SCRATCH_REG,heap_vector,6
lao SCRATCH_REG,extra_heap,4
sto BSTACK_1,SCRATCH_REG,extra_heap,4
subs BSTACK_0,BSTACK_0,BSTACK_1
lsr BSTACK_0,BSTACK_0,#2
lao SCRATCH_REG,extra_heap_size,4
sto BSTACK_0,SCRATCH_REG,extra_heap_size,4
lao SCRATCH_REG,garbage_collect_flag,7
mov ASTACK_3,#2
stob ASTACK_3,SCRATCH_REG,garbage_collect_flag,7
b no_copy_garbage_collection
vector_at_end_2:
lao SCRATCH_REG,garbage_collect_flag,8
mov ASTACK_3,#0
stob ASTACK_3,SCRATCH_REG,garbage_collect_flag,8
.endif
.thumb_func
no_copy_garbage_collection:
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl add_garbage_collect_time
mov BSTACK_0,HEAP_PTR
lao SCRATCH_REG,heap_p3,8
ldo SCRATCH_REG,SCRATCH_REG,heap_p3,8
subs BSTACK_0,BSTACK_0,SCRATCH_REG
lao SCRATCH_REG,n_allocated_words,6
ldo BSTACK_1,SCRATCH_REG,n_allocated_words,6
add BSTACK_0,BSTACK_0,BSTACK_1,lsl #2
b end_garbage_collect
.thumb_func
stack_overflow:
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl add_execute_time
lao ASTACK_2,stack_overflow_string,0
otoa ASTACK_2,stack_overflow_string,0
b print_error
IO_error:
str r0,[BSTACK_PTR]
lao r0,IO_error_string,0
otoa r0,IO_error_string,0
store_global_registers
bl ew_print_string
ldr r0,[BSTACK_PTR],#4
bl ew_print_string
lao r0,new_line_string,0
otoa r0,new_line_string,0
bl ew_print_string
load_global_registers
b halt
.thumb_func
print_error:
mov r0,ASTACK_2
store_global_registers
bl ew_print_string
load_global_registers
.thumb_func
halt:
lao SCRATCH_REG,halt_sp,3
ldo BSTACK_PTR,SCRATCH_REG,halt_sp,3
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl write_profile_stack
.endif
b exit
.ifdef PIC
lto stack_top,1
lto heap_size_33,4
lto heap_p3,5
lto heap_end_after_gc,7
lto n_allocated_words,4
lto heap_size,7
.if MARK_GC || COMPACT_GC_ONLY
.if MARK_GC && ADJUST_HEAP_SIZE
.if MARK_AND_COPY_GC
lto flags,13
.endif
lto heap_p3,6
lto n_allocated_words,5
lto heap_size_33,5
lto heap_size_multiple,2
lto heap_end_after_gc,8
lto bit_vector_size,2
.endif
.else
lto heap_size,8
lto heap_p,2
lto heap_p1,8
lto heap_size_129,3
lto heap_copied_vector,3
lto heap_end_after_gc,9
lto heap_copied_vector_size,4
lto heap_p2,8
lto heap_p3,7
lto heap_vector,5
lto heap_vector,6
lto extra_heap,4
lto extra_heap_size,4
lto garbage_collect_flag,7
lto garbage_collect_flag,8
.endif
lto heap_p3,8
lto n_allocated_words,6
lto stack_overflow_string,0
lto IO_error_string,0
lto new_line_string,0
lto halt_sp,3
.endif
.ltorg
.thumb_func
e__system__eaind:
.thumb_func
eval_fill:
str ASTACK_0,[ASTACK_PTR],#4
mov ASTACK_0,ASTACK_1
ldr SCRATCH_REG,[ASTACK_1]
.align
add lr,pc,#7
str lr,[BSTACK_PTR,#-4]!
blx SCRATCH_REG
mov ASTACK_1,ASTACK_0
ldr ASTACK_0,[ASTACK_PTR,#-4]!
ldr ASTACK_2,[ASTACK_1]
str ASTACK_2,[ASTACK_0]
ldr ASTACK_2,[ASTACK_1,#4]
str ASTACK_2,[ASTACK_0,#4]
ldr ASTACK_2,[ASTACK_1,#8]
str ASTACK_2,[ASTACK_0,#8]
ldr pc,[BSTACK_PTR],#4
.p2align 2
b e__system__eaind
nop
nop
.ifdef PIC
.long e__system__dind-.
.else
.long e__system__dind
.endif
.long -2
.thumb_func
e__system__nind:
.thumb_func
__indirection:
ldr ASTACK_1,[ASTACK_0,#4]
ldr BSTACK_0,[ASTACK_1]
tst BSTACK_0,#2
.if MARK_GC
beq eval_fill2
.else
beq __cycle__in__spine
.endif
str BSTACK_0,[ASTACK_0]
ldr ASTACK_2,[ASTACK_1,#4]
str ASTACK_2,[ASTACK_0,#4]
ldr ASTACK_2,[ASTACK_1,#8]
str ASTACK_2,[ASTACK_0,#8]
ldr pc,[BSTACK_PTR],#4
.if MARK_GC
eval_fill2:
lao SCRATCH_REG,__cycle__in__spine,0
otoa SCRATCH_REG,__cycle__in__spine,0
str SCRATCH_REG,[ASTACK_0]
str ASTACK_0,[ASTACK_PTR]
.if MARK_AND_COPY_GC
lao SCRATCH_REG,flags,14
ldo SCRATCH_REG,SCRATCH_REG,flags,14
tst SCRATCH_REG,#64
beq __cycle__in__spine
.endif
add ASTACK_PTR,ASTACK_PTR,#4
mov ASTACK_0,ASTACK_1
.align
add lr,pc,#7
str lr,[BSTACK_PTR,#-4]!
blx BSTACK_0
mov ASTACK_1,ASTACK_0
ldr ASTACK_0,[ASTACK_PTR,#-4]!
ldr ASTACK_2,[ASTACK_1]
str ASTACK_2,[ASTACK_0]
ldr ASTACK_2,[ASTACK_1,#4]
str ASTACK_2,[ASTACK_0,#4]
ldr ASTACK_2,[ASTACK_1,#8]
str ASTACK_2,[ASTACK_0,#8]
ldr pc,[BSTACK_PTR],#4
.endif
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_0:
lao SCRATCH_REG,e__system__nind,0
otoa SCRATCH_REG,e__system__nind,0
str SCRATCH_REG,[ASTACK_1]
str ASTACK_0,[ASTACK_1,#4]
mov pc,ASTACK_3
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_1:
lao SCRATCH_REG,e__system__nind,1
otoa SCRATCH_REG,e__system__nind,1
str SCRATCH_REG,[ASTACK_1]
ldr BSTACK_0,[ASTACK_1,#4]
str ASTACK_0,[ASTACK_1,#4]
mov ASTACK_1,BSTACK_0
mov pc,ASTACK_3
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_2:
lao SCRATCH_REG,e__system__nind,2
otoa SCRATCH_REG,e__system__nind,2
str SCRATCH_REG,[ASTACK_1]
ldr ASTACK_2,[ASTACK_1,#4]
str ASTACK_0,[ASTACK_1,#4]
ldr ASTACK_1,[ASTACK_1,#8]
mov pc,ASTACK_3
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_3:
lao SCRATCH_REG,e__system__nind,3
otoa SCRATCH_REG,e__system__nind,3
str SCRATCH_REG,[ASTACK_1]
ldr ASTACK_2,[ASTACK_1,#4]
str ASTACK_0,[ASTACK_1,#4]
str ASTACK_0,[ASTACK_PTR],#4
ldr ASTACK_0,[ASTACK_1,#12]
ldr ASTACK_1,[ASTACK_1,#8]
mov pc,ASTACK_3
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_4:
lao SCRATCH_REG,e__system__nind,4
otoa SCRATCH_REG,e__system__nind,4
str SCRATCH_REG,[ASTACK_1]
ldr ASTACK_2,[ASTACK_1,#4]
str ASTACK_0,[ASTACK_1,#4]
str ASTACK_0,[ASTACK_PTR]
ldr BSTACK_1,[ASTACK_1,#16]
str BSTACK_1,[ASTACK_PTR,#4]
add ASTACK_PTR,ASTACK_PTR,#8
ldr ASTACK_0,[ASTACK_1,#12]
ldr ASTACK_1,[ASTACK_1,#8]
mov pc,ASTACK_3
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_5:
lao SCRATCH_REG,e__system__nind,5
otoa SCRATCH_REG,e__system__nind,5
str SCRATCH_REG,[ASTACK_1]
ldr ASTACK_2,[ASTACK_1,#4]
str ASTACK_0,[ASTACK_PTR]
str ASTACK_0,[ASTACK_1,#4]
ldr BSTACK_1,[ASTACK_1,#20]
str BSTACK_1,[ASTACK_PTR,#4]
ldr BSTACK_1,[ASTACK_1,#16]
str BSTACK_1,[ASTACK_PTR,#8]
add ASTACK_PTR,ASTACK_PTR,#12
ldr ASTACK_0,[ASTACK_1,#12]
ldr ASTACK_1,[ASTACK_1,#8]
mov pc,ASTACK_3
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_6:
lao SCRATCH_REG,e__system__nind,6
otoa SCRATCH_REG,e__system__nind,6
str SCRATCH_REG,[ASTACK_1]
ldr ASTACK_2,[ASTACK_1,#4]
str ASTACK_0,[ASTACK_PTR]
str ASTACK_0,[ASTACK_1,#4]
ldr BSTACK_1,[ASTACK_1,#24]
str BSTACK_1,[ASTACK_PTR,#4]
ldr BSTACK_1,[ASTACK_1,#20]
str BSTACK_1,[ASTACK_PTR,#8]
ldr BSTACK_1,[ASTACK_1,#16]
str BSTACK_1,[ASTACK_PTR,#12]
add ASTACK_PTR,ASTACK_PTR,#16
ldr ASTACK_0,[ASTACK_1,#12]
ldr ASTACK_1,[ASTACK_1,#8]
mov pc,ASTACK_3
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_7:
mov BSTACK_0,#0
mov BSTACK_1,#20
.thumb_func
eval_upd_n:
lao SCRATCH_REG,e__system__nind,7
otoa SCRATCH_REG,e__system__nind,7
add BSTACK_2,ASTACK_1,BSTACK_1
str SCRATCH_REG,[ASTACK_1]
ldr ASTACK_2,[ASTACK_1,#4]
str ASTACK_0,[ASTACK_PTR]
str ASTACK_0,[ASTACK_1,#4]
ldr BSTACK_1,[BSTACK_2,#8]
str BSTACK_1,[ASTACK_PTR,#4]
ldr BSTACK_1,[BSTACK_2,#4]
str BSTACK_1,[ASTACK_PTR,#8]
ldr BSTACK_1,[BSTACK_2]
str BSTACK_1,[ASTACK_PTR,#12]
add ASTACK_PTR,ASTACK_PTR,#16
.thumb_func
eval_upd_n_lp:
ldr BSTACK_1,[BSTACK_2,#-4]!
str BSTACK_1,[ASTACK_PTR],#4
subs BSTACK_0,BSTACK_0,#1
bcs eval_upd_n_lp
ldr ASTACK_0,[ASTACK_1,#12]
ldr ASTACK_1,[ASTACK_1,#8]
mov pc,ASTACK_3
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_8:
mov BSTACK_0,#1
mov BSTACK_1,#24
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_9:
mov BSTACK_0,#2
mov BSTACK_1,#28
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_10:
mov BSTACK_0,#3
mov BSTACK_1,#32
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_11:
mov BSTACK_0,#4
mov BSTACK_1,#36
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_12:
mov BSTACK_0,#5
mov BSTACK_1,#40
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_13:
mov BSTACK_0,#6
mov BSTACK_1,#44
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_14:
mov BSTACK_0,#7
mov BSTACK_1,#48
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_15:
mov BSTACK_0,#8
mov BSTACK_1,#52
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_16:
mov BSTACK_0,#9
mov BSTACK_1,#56
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_17:
mov BSTACK_0,#10
mov BSTACK_1,#60
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_18:
mov BSTACK_0,#11
mov BSTACK_1,#64
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_19:
mov BSTACK_0,#12
mov BSTACK_1,#68
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_20:
mov BSTACK_0,#13
mov BSTACK_1,#72
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_21:
mov BSTACK_0,#14
mov BSTACK_1,#76
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_22:
mov BSTACK_0,#15
mov BSTACK_1,#80
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_23:
mov BSTACK_0,#16
mov BSTACK_1,#84
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_24:
mov BSTACK_0,#17
mov BSTACK_1,#88
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_25:
mov BSTACK_0,#18
mov BSTACK_1,#92
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_26:
mov BSTACK_0,#19
mov BSTACK_1,#96
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_27:
mov BSTACK_0,#20
mov BSTACK_1,#100
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_28:
mov BSTACK_0,#21
mov BSTACK_1,#104
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_29:
mov BSTACK_0,#22
mov BSTACK_1,#108
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_30:
mov BSTACK_0,#23
mov BSTACK_1,#112
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_31:
mov BSTACK_0,#24
mov BSTACK_1,#116
b eval_upd_n
.ifdef PROFILE
.align
add lr,pc,#9
str lr,[BSTACK_PTR,#-4]!
bl profile_n
mov ASTACK_2,BSTACK_0
.endif
eval_upd_32:
mov BSTACK_0,#25
mov BSTACK_1,#120
b eval_upd_n
@
@ STRINGS
@
.section .text. (catAC)
catAC:
ldr BSTACK_0,[ASTACK_0,#4]
ldr BSTACK_1,[ASTACK_1,#4]
add ASTACK_2,BSTACK_0,BSTACK_1
add ASTACK_2,ASTACK_2,#8+3
lsr ASTACK_2,ASTACK_2,#2
subs HEAP_FREE,HEAP_FREE,ASTACK_2
blo gc_3
gc_r_3:
add ASTACK_0,ASTACK_0,#8
add ASTACK_1,ASTACK_1,#8
@ fill_node
str HEAP_PTR,[BSTACK_PTR,#-4]!
laol SCRATCH_REG,__STRING__+2,__STRING___o_2,1
otoa SCRATCH_REG,__STRING___o_2,1
str SCRATCH_REG,[HEAP_PTR]
@ store length
add ASTACK_2,BSTACK_0,BSTACK_1
str ASTACK_2,[HEAP_PTR,#4]
add HEAP_PTR,HEAP_PTR,#8
@ copy string 1
add ASTACK_2,BSTACK_1,#3
add BSTACK_1,BSTACK_1,HEAP_PTR
lsrs ASTACK_2,ASTACK_2,#2
beq catAC_after_copy_lp1
catAC_copy_lp1:
ldr SCRATCH_REG,[ASTACK_1],#4
str SCRATCH_REG,[HEAP_PTR],#4
subs ASTACK_2,ASTACK_2,#1
bne catAC_copy_lp1
catAC_after_copy_lp1:
mov HEAP_PTR,BSTACK_1
@ copy_string 2
cat_string_6:
lsrs ASTACK_2,BSTACK_0,#2
beq cat_string_9
cat_string_7:
ldr BSTACK_1,[ASTACK_0],#4
@ store not aligned
str BSTACK_1,[HEAP_PTR],#4
subs ASTACK_2,ASTACK_2,#1
bne cat_string_7
cat_string_9:
tst BSTACK_0,#2
beq cat_string_10
ldrh BSTACK_1,[ASTACK_0],#2
strh BSTACK_1,[HEAP_PTR],#2
cat_string_10:
tst BSTACK_0,#1
beq cat_string_11
ldrb BSTACK_1,[ASTACK_0]
strb BSTACK_1,[HEAP_PTR],#1
cat_string_11:
ldr ASTACK_0,[BSTACK_PTR],#4
@ align heap pointer
add HEAP_PTR,HEAP_PTR,#3
and HEAP_PTR,HEAP_PTR,#-4
ldr pc,[BSTACK_PTR],#4
gc_3: bl collect_2
b gc_r_3
.thumb_func
empty_string:
lao ASTACK_0,zero_length_string,0
otoa ASTACK_0,zero_length_string,0
ldr pc,[BSTACK_PTR],#4
.ifdef PIC
ltol __STRING__+2,__STRING___o_2,1
lto zero_length_string,0
.endif
.section .text.sliceAC,"ax"
sliceAC:
ldr ASTACK_2,[ASTACK_0,#4]
tst BSTACK_1,BSTACK_1
bpl slice_string_1
mov BSTACK_1,#0
slice_string_1:
cmp BSTACK_1,ASTACK_2
bge empty_string
cmp BSTACK_0,BSTACK_1
blt empty_string
add BSTACK_0,BSTACK_0,#1
cmp BSTACK_0,ASTACK_2
ble slice_string_2
mov BSTACK_0,ASTACK_2
slice_string_2:
subs BSTACK_0,BSTACK_0,BSTACK_1
add ASTACK_2,BSTACK_0,#8+3
lsr ASTACK_2,ASTACK_2,#2
subs HEAP_FREE,HEAP_FREE,ASTACK_2
blo gc_4
r_gc_4:
subs ASTACK_2,ASTACK_2,#2
add SCRATCH_REG,ASTACK_0,#8
add ASTACK_1,SCRATCH_REG,BSTACK_1
laol SCRATCH_REG,__STRING__+2,__STRING___o_2,2
otoa SCRATCH_REG,__STRING___o_2,2
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
@ copy part of string
mov ASTACK_0,HEAP_PTR
add HEAP_PTR,HEAP_PTR,#8
cmp ASTACK_2,#0
beq sliceAC_after_copy_lp
sliceAC_copy_lp:
@ load not aligned
ldr SCRATCH_REG,[ASTACK_1],#4
str SCRATCH_REG,[HEAP_PTR],#4
subs ASTACK_2,ASTACK_2,#1
bne sliceAC_copy_lp
sliceAC_after_copy_lp:
ldr pc,[BSTACK_PTR],#4
gc_4:
bl collect_1
add ASTACK_2,BSTACK_0,#8+3
lsr ASTACK_2,ASTACK_2,#2
b r_gc_4
.ifdef PIC
ltol __STRING__+2,__STRING___o_2,2
.endif
.section .text.updateAC,"ax"
updateAC:
ldr ASTACK_2,[ASTACK_0,#4]
cmp BSTACK_1,ASTACK_2
bhs update_string_error
add ASTACK_2,ASTACK_2,#8+3
lsr ASTACK_2,ASTACK_2,#2
subs HEAP_FREE,HEAP_FREE,ASTACK_2
blo gc_5
r_gc_5:
ldr ASTACK_2,[ASTACK_0,#4]
add ASTACK_2,ASTACK_2,#3
lsr ASTACK_2,ASTACK_2,#2
mov ASTACK_1,ASTACK_0
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,__STRING__+2,__STRING___o_2,3
otoa SCRATCH_REG,__STRING___o_2,3
str SCRATCH_REG,[HEAP_PTR]
ldr SCRATCH_REG,[ASTACK_1,#4]
add ASTACK_1,ASTACK_1,#8
str SCRATCH_REG,[HEAP_PTR,#4]
add HEAP_PTR,HEAP_PTR,#8
add BSTACK_1,BSTACK_1,HEAP_PTR
cmp ASTACK_2,#0
beq updateAC_after_copy_lp
updateAC_copy_lp:
ldr SCRATCH_REG,[ASTACK_1],#4
str SCRATCH_REG,[HEAP_PTR],#4
subs ASTACK_2,ASTACK_2,#1
bne updateAC_copy_lp
updateAC_after_copy_lp:
strb BSTACK_0,[BSTACK_1]
ldr pc,[BSTACK_PTR],#4
gc_5: bl collect_1
b r_gc_5
.thumb_func
update_string_error:
lao ASTACK_2,high_index_string,0
otoa ASTACK_2,high_index_string,0
tst BSTACK_0,BSTACK_0
bpl update_string_error_2
lao ASTACK_2,low_index_string,0
otoa ASTACK_2,low_index_string,0
update_string_error_2:
b print_error
.ifdef PIC
ltol __STRING__+2,__STRING___o_2,3
lto high_index_string,0
lto low_index_string,0
.endif
.section .text.eqAC,"ax"
eqAC:
ldr BSTACK_0,[ASTACK_0,#4]
ldr SCRATCH_REG,[ASTACK_1,#4]
cmp BSTACK_0,SCRATCH_REG
bne equal_string_ne
add ASTACK_0,ASTACK_0,#8
add ASTACK_1,ASTACK_1,#8
and BSTACK_1,BSTACK_0,#3
lsrs BSTACK_0,BSTACK_0,#2
beq equal_string_b
equal_string_1:
ldr ASTACK_2,[ASTACK_0]
ldr SCRATCH_REG,[ASTACK_1]
cmp ASTACK_2,SCRATCH_REG
bne equal_string_ne
add ASTACK_0,ASTACK_0,#4
add ASTACK_1,ASTACK_1,#4
subs BSTACK_0,BSTACK_0,#1
bne equal_string_1
.thumb_func
equal_string_b:
tst BSTACK_1,#2
beq equal_string_2
ldrh BSTACK_0,[ASTACK_0]
ldrh SCRATCH_REG,[ASTACK_1]
cmp BSTACK_0,SCRATCH_REG
bne equal_string_ne
add ASTACK_0,ASTACK_0,#2
add ASTACK_1,ASTACK_1,#2
equal_string_2:
tst BSTACK_1,#1
beq equal_string_eq
ldrb BSTACK_1,[ASTACK_0]
ldrb SCRATCH_REG,[ASTACK_1]
cmp BSTACK_1,SCRATCH_REG
bne equal_string_ne
.thumb_func
equal_string_eq:
mov BSTACK_0,#1
ldr pc,[BSTACK_PTR],#4
.thumb_func
equal_string_ne:
mov BSTACK_0,#0
ldr pc,[BSTACK_PTR],#4
.section .text.cmpAC,"ax"
cmpAC:
ldr BSTACK_1,[ASTACK_0,#4]
ldr ASTACK_2,[ASTACK_1,#4]
add ASTACK_0,ASTACK_0,#8
add ASTACK_1,ASTACK_1,#8
cmp ASTACK_2,BSTACK_1
blo cmp_string_less
bhi cmp_string_more
mov BSTACK_0,#0
b cmp_string_chars
.thumb_func
cmp_string_more:
mov BSTACK_0,#1
b cmp_string_chars
.thumb_func
cmp_string_less:
mov BSTACK_0,#-1
mov BSTACK_1,ASTACK_2
b cmp_string_chars
cmp_string_1:
ldr ASTACK_2,[ASTACK_1]
ldr SCRATCH_REG,[ASTACK_0]
cmp ASTACK_2,SCRATCH_REG
bne cmp_string_ne4
add ASTACK_1,ASTACK_1,#4
add ASTACK_0,ASTACK_0,#4
.thumb_func
cmp_string_chars:
subs BSTACK_1,BSTACK_1,#4
bcs cmp_string_1
.thumb_func
cmp_string_b:
@ to do compare bytes using and instead of ldrb
tst BSTACK_1,#2
beq cmp_string_2
ldrb ASTACK_2,[ASTACK_1]
ldrb SCRATCH_REG,[ASTACK_0]
cmp ASTACK_2,SCRATCH_REG
bne cmp_string_ne
ldrb ASTACK_2,[ASTACK_1,#1]
ldrb SCRATCH_REG,[ASTACK_0,#1]
cmp ASTACK_2,SCRATCH_REG
bne cmp_string_ne
add ASTACK_1,ASTACK_1,#2
add ASTACK_0,ASTACK_0,#2
cmp_string_2:
tst BSTACK_1,#1
beq cmp_string_eq
ldrb ASTACK_2,[ASTACK_1]
ldrb SCRATCH_REG,[ASTACK_0]
cmp ASTACK_2,SCRATCH_REG
bne cmp_string_ne
.thumb_func
cmp_string_eq:
ldr pc,[BSTACK_PTR],#4
cmp_string_ne4:
@ to do compare bytes using and instead of ldrb
ldrb BSTACK_1,[ASTACK_1]
ldrb SCRATCH_REG,[ASTACK_0]
cmp BSTACK_1,SCRATCH_REG
bne cmp_string_ne
ldrb BSTACK_1,[ASTACK_1,#1]
ldrb SCRATCH_REG,[ASTACK_0,#1]
cmp BSTACK_1,SCRATCH_REG
bne cmp_string_ne
ldrb BSTACK_1,[ASTACK_1,#2]
ldrb SCRATCH_REG,[ASTACK_0,#2]
cmp BSTACK_1,SCRATCH_REG
bne cmp_string_ne
ldrb BSTACK_1,[ASTACK_1,#3]
ldrb SCRATCH_REG,[ASTACK_0,#3]
cmp BSTACK_1,SCRATCH_REG
.thumb_func
cmp_string_ne:
bhi cmp_string_r1
mov BSTACK_0,#-1
ldr pc,[BSTACK_PTR],#4
cmp_string_r1:
mov BSTACK_0,#1
ldr pc,[BSTACK_PTR],#4
.section .text.string_to_string_node,"ax"
.thumb_func
string_to_string_node:
ldr ASTACK_2,[ASTACK_0],#4
add BSTACK_0,ASTACK_2,#3
lsr BSTACK_0,BSTACK_0,#2
add SCRATCH_REG,BSTACK_0,#2
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
blo string_to_string_node_gc
.thumb_func
string_to_string_node_r:
laol SCRATCH_REG,__STRING__+2,__STRING___o_2,4
otoa SCRATCH_REG,__STRING___o_2,4
str SCRATCH_REG,[HEAP_PTR]
str ASTACK_2,[HEAP_PTR,#4]
mov ASTACK_2,HEAP_PTR
add HEAP_PTR,HEAP_PTR,#8
b string_to_string_node_4
string_to_string_node_2:
ldr SCRATCH_REG,[ASTACK_0],#4
str SCRATCH_REG,[HEAP_PTR],#4
string_to_string_node_4:
subs BSTACK_0,BSTACK_0,#1
bge string_to_string_node_2
mov ASTACK_0,ASTACK_2
ldr pc,[BSTACK_PTR],#4
.thumb_func
string_to_string_node_gc:
stmdb BSTACK_PTR!,{ASTACK_0,ASTACK_2}
bl collect_0
ldmia BSTACK_PTR!,{ASTACK_0,ASTACK_2}
b string_to_string_node_r
.ifdef PIC
ltol __STRING__+2,__STRING___o_2,4
.endif
.section .text.int_array_to_node,"ax"
.thumb_func
int_array_to_node:
ldr BSTACK_0,[ASTACK_0,#-8]
add SCRATCH_REG,BSTACK_0,#3
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
blo int_array_to_node_gc
.thumb_func
int_array_to_node_r:
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,0
otoa SCRATCH_REG,__ARRAY___o_2,0
str SCRATCH_REG,[HEAP_PTR]
mov ASTACK_1,ASTACK_0
str BSTACK_0,[HEAP_PTR,#4]
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,INT+2,INT_o_2,3
otoa SCRATCH_REG,INT_o_2,3
str SCRATCH_REG,[HEAP_PTR,#8]
add HEAP_PTR,HEAP_PTR,#12
b int_array_to_node_4
int_array_to_node_2:
ldr SCRATCH_REG,[ASTACK_1],#4
str SCRATCH_REG,[HEAP_PTR],#4
int_array_to_node_4:
subs BSTACK_0,BSTACK_0,#1
bge int_array_to_node_2
ldr pc,[BSTACK_PTR],#4
.thumb_func
int_array_to_node_gc:
str ASTACK_0,[BSTACK_PTR,#-4]!
bl collect_0
ldr ASTACK_0,[BSTACK_PTR],#4
b int_array_to_node_r
.ifdef PIC
ltol __ARRAY__+2,__ARRAY___o_2,0
ltol INT+2,INT_o_2,3
.endif
.section .text.real_array_to_node,"ax"
.thumb_func
real_array_to_node:
ldr BSTACK_0,[ASTACK_0,#-8]
add SCRATCH_REG,BSTACK_0,#3+1
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
blo real_array_to_node_gc
.thumb_func
real_array_to_node_r:
tst HEAP_PTR,#4
orr HEAP_PTR,HEAP_PTR,#4
it ne
addne HEAP_FREE,HEAP_FREE,#1
mov ASTACK_1,ASTACK_0
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,1
otoa SCRATCH_REG,__ARRAY___o_2,1
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,REAL+2,REAL_o_2,2
otoa SCRATCH_REG,REAL_o_2,2
str SCRATCH_REG,[HEAP_PTR,#8]
add HEAP_PTR,HEAP_PTR,#12
b real_array_to_node_4
real_array_to_node_2:
ldr SCRATCH_REG,[ASTACK_1]
str SCRATCH_REG,[HEAP_PTR]
ldr ASTACK_2,[ASTACK_1,#4]
add ASTACK_1,ASTACK_1,#8
str ASTACK_2,[HEAP_PTR,#4]
add HEAP_PTR,HEAP_PTR,#8
real_array_to_node_4:
subs BSTACK_0,BSTACK_0,#1
bge real_array_to_node_2
ldr pc,[BSTACK_PTR],#4
.thumb_func
real_array_to_node_gc:
str ASTACK_0,[BSTACK_PTR,#-4]!
bl collect_0
ldr ASTACK_0,[BSTACK_PTR],#4
b real_array_to_node_r
.ifdef PIC
ltol __ARRAY__+2,__ARRAY___o_2,1
ltol REAL+2,REAL_o_2,2
.endif
.text
.p2align 2
.long 3
_c3: b __cycle__in__spine
.p2align 2
.long 4
_c4: b __cycle__in__spine
.p2align 2
.long 5
_c5: b __cycle__in__spine
.p2align 2
.long 6
_c6: b __cycle__in__spine
.p2align 2
.long 7
_c7: b __cycle__in__spine
.p2align 2
.long 8
_c8: b __cycle__in__spine
.p2align 2
.long 9
_c9: b __cycle__in__spine
.p2align 2
.long 10
_c10: b __cycle__in__spine
.p2align 2
.long 11
_c11: b __cycle__in__spine
.p2align 2
.long 12
_c12: b __cycle__in__spine
.p2align 2
.long 13
_c13: b __cycle__in__spine
.p2align 2
.long 14
_c14: b __cycle__in__spine
.p2align 2
.long 15
_c15: b __cycle__in__spine
.p2align 2
.long 16
_c16: b __cycle__in__spine
.p2align 2
.long 17
_c17: b __cycle__in__spine
.p2align 2
.long 18
_c18: b __cycle__in__spine
.p2align 2
.long 19
_c19: b __cycle__in__spine
.p2align 2
.long 20
_c20: b __cycle__in__spine
.p2align 2
.long 21
_c21: b __cycle__in__spine
.p2align 2
.long 22
_c22: b __cycle__in__spine
.p2align 2
.long 23
_c23: b __cycle__in__spine
.p2align 2
.long 24
_c24: b __cycle__in__spine
.p2align 2
.long 25
_c25: b __cycle__in__spine
.p2align 2
.long 26
_c26: b __cycle__in__spine
.p2align 2
.long 27
_c27: b __cycle__in__spine
.p2align 2
.long 28
_c28: b __cycle__in__spine
.p2align 2
.long 29
_c29: b __cycle__in__spine
.p2align 2
.long 30
_c30: b __cycle__in__spine
.p2align 2
.long 31
_c31: b __cycle__in__spine
.p2align 2
.long 32
_c32: b __cycle__in__spine
@
@ ARRAYS
@
_create_arrayB:
add BSTACK_1,BSTACK_0,#3
lsr BSTACK_1,BSTACK_1,#2
add SCRATCH_REG,BSTACK_1,#3
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4574
bl collect_0
no_collect_4574:
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,2
otoa SCRATCH_REG,__ARRAY___o_2,2
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
laol SCRATCH_REG,BOOL+2,BOOL_o_2,2
otoa SCRATCH_REG,BOOL_o_2,2
str SCRATCH_REG,[HEAP_PTR,#8]
add SCRATCH_REG,HEAP_PTR,#12
add HEAP_PTR,SCRATCH_REG,BSTACK_1,lsl #2
ldr pc,[BSTACK_PTR],#4
_create_arrayC:
add BSTACK_1,BSTACK_0,#3
lsr BSTACK_1,BSTACK_1,#2
add SCRATCH_REG,BSTACK_1,#2
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4573
bl collect_0
no_collect_4573:
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,__STRING__+2,__STRING___o_2,5
otoa SCRATCH_REG,__STRING___o_2,5
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
add SCRATCH_REG,HEAP_PTR,#8
add HEAP_PTR,SCRATCH_REG,BSTACK_1,lsl #2
ldr pc,[BSTACK_PTR],#4
_create_arrayI:
add SCRATCH_REG,BSTACK_0,#3
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4572
bl collect_0
no_collect_4572:
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,3
otoa SCRATCH_REG,__ARRAY___o_2,3
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
laol SCRATCH_REG,INT+2,INT_o_2,4
otoa SCRATCH_REG,INT_o_2,4
str SCRATCH_REG,[HEAP_PTR,#8]
add SCRATCH_REG,HEAP_PTR,#12
add HEAP_PTR,SCRATCH_REG,BSTACK_0,lsl #2
ldr pc,[BSTACK_PTR],#4
_create_arrayR:
add SCRATCH_REG,BSTACK_0,BSTACK_0
add SCRATCH_REG,SCRATCH_REG,#3+1
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4580
bl collect_0
no_collect_4580:
tst HEAP_PTR,#4
orr HEAP_PTR,HEAP_PTR,#4
it ne
addne HEAP_FREE,HEAP_FREE,#1
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,4
otoa SCRATCH_REG,__ARRAY___o_2,4
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
laol SCRATCH_REG,REAL+2,REAL_o_2,3
otoa SCRATCH_REG,REAL_o_2,3
str SCRATCH_REG,[HEAP_PTR,#8]
add SCRATCH_REG,HEAP_PTR,#12
add HEAP_PTR,SCRATCH_REG,BSTACK_0,lsl #3
ldr pc,[BSTACK_PTR],#4
@ BSTACK_0: number of elements, BSTACK_1: element descriptor
@ BSTACK_2: element size, BSTACK_3: element a size, a0:a_element-> a0: array
.thumb_func
_create_r_array:
mul SCRATCH_REG,BSTACK_0,BSTACK_2
add SCRATCH_REG,SCRATCH_REG,#3
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4586
bl collect_1
no_collect_4586:
mov ASTACK_2,ASTACK_0
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,5
otoa SCRATCH_REG,__ARRAY___o_2,5
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
str BSTACK_1,[HEAP_PTR,#8]
mov ASTACK_0,HEAP_PTR
add HEAP_PTR,HEAP_PTR,#12
@ BSTACK_0: number of elements, a0: array
@ BSTACK_2: element size, BSTACK_3: element a size, a2:a_element
cmp BSTACK_3,#0
beq _create_r_array_0
cmp BSTACK_3,#2
blo _create_r_array_1
beq _create_r_array_2
cmp BSTACK_3,#4
blo _create_r_array_3
beq _create_r_array_4
b _create_r_array_5
_create_r_array_0:
lsl BSTACK_2,BSTACK_2,#2
mul SCRATCH_REG,BSTACK_0,BSTACK_2
add HEAP_PTR,HEAP_PTR,SCRATCH_REG
ldr pc,[BSTACK_PTR],#4
_create_r_array_1:
lsl BSTACK_2,BSTACK_2,#2
b _st_fillBSTACK_3_array
_fillBSTACK_3_array:
str ASTACK_2,[HEAP_PTR]
add HEAP_PTR,HEAP_PTR,BSTACK_2
_st_fillBSTACK_3_array:
subs BSTACK_0,BSTACK_0,#1
bcs _fillBSTACK_3_array
ldr pc,[BSTACK_PTR],#4
_create_r_array_2:
lsl BSTACK_2,BSTACK_2,#2
b _st_fillBSTACK_2_array
_fillBSTACK_2_array:
str ASTACK_2,[HEAP_PTR]
str ASTACK_2,[HEAP_PTR,#4]
add HEAP_PTR,HEAP_PTR,BSTACK_2
_st_fillBSTACK_2_array:
subs BSTACK_0,BSTACK_0,#1
bcs _fillBSTACK_2_array
ldr pc,[BSTACK_PTR],#4
_create_r_array_3:
lsl BSTACK_2,BSTACK_2,#2
b _st_fillBSTACK_1_array
_fillBSTACK_1_array:
str ASTACK_2,[HEAP_PTR]
str ASTACK_2,[HEAP_PTR,#4]
str ASTACK_2,[HEAP_PTR,#8]
add HEAP_PTR,HEAP_PTR,BSTACK_2
_st_fillBSTACK_1_array:
subs BSTACK_0,BSTACK_0,#1
bcs _fillBSTACK_1_array
ldr pc,[BSTACK_PTR],#4
_create_r_array_4:
lsl BSTACK_2,BSTACK_2,#2
b _st_fillBSTACK_0_array
_fillBSTACK_0_array:
str ASTACK_2,[HEAP_PTR]
str ASTACK_2,[HEAP_PTR,#4]
str ASTACK_2,[HEAP_PTR,#8]
str ASTACK_2,[HEAP_PTR,#12]
add HEAP_PTR,HEAP_PTR,BSTACK_2
_st_fillBSTACK_0_array:
subs BSTACK_0,BSTACK_0,#1
bcs _fillBSTACK_0_array
ldr pc,[BSTACK_PTR],#4
_create_r_array_5:
sub BSTACK_2,BSTACK_2,BSTACK_3
lsl BSTACK_2,BSTACK_2,#2
b _st_fillr5_array
_fillr5_array:
str ASTACK_2,[HEAP_PTR]
str ASTACK_2,[HEAP_PTR,#4]
str ASTACK_2,[HEAP_PTR,#8]
str ASTACK_2,[HEAP_PTR,#12]
add HEAP_PTR,HEAP_PTR,#16
sub BSTACK_1,BSTACK_3,#5
_copy_elem_5_lp:
str ASTACK_2,[HEAP_PTR],#4
subs BSTACK_1,BSTACK_1,#1
bcs _copy_elem_5_lp
add HEAP_PTR,HEAP_PTR,BSTACK_2
_st_fillr5_array:
subs BSTACK_0,BSTACK_0,#1
bcs _fillr5_array
ldr pc,[BSTACK_PTR],#4
create_arrayB:
mov ASTACK_1,BSTACK_1
add BSTACK_1,BSTACK_1,#3
lsr BSTACK_1,BSTACK_1,#2
add SCRATCH_REG,BSTACK_1,#3
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4575
str ASTACK_1,[BSTACK_PTR,#-4]!
bl collect_0
ldr ASTACK_1,[BSTACK_PTR],#4
no_collect_4575:
orr BSTACK_0,BSTACK_0,BSTACK_0,lsl #8
orr BSTACK_0,BSTACK_0,BSTACK_0,lsl #16
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,6
otoa SCRATCH_REG,__ARRAY___o_2,6
str SCRATCH_REG,[HEAP_PTR]
str ASTACK_1,[HEAP_PTR,#4]
laol SCRATCH_REG,BOOL+2,BOOL_o_2,3
otoa SCRATCH_REG,BOOL_o_2,3
str SCRATCH_REG,[HEAP_PTR,#8]
add HEAP_PTR,HEAP_PTR,#12
b create_arrayBCI
create_arrayC:
mov ASTACK_1,BSTACK_1
add BSTACK_1,BSTACK_1,#3
lsr BSTACK_1,BSTACK_1,#2
add SCRATCH_REG,BSTACK_1,#2
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4578
str ASTACK_1,[BSTACK_PTR,#-4]!
bl collect_0
ldr ASTACK_1,[BSTACK_PTR],#4
no_collect_4578:
orr BSTACK_0,BSTACK_0,BSTACK_0,lsl #8
orr BSTACK_0,BSTACK_0,BSTACK_0,lsl #16
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,__STRING__+2,__STRING___o_2,6
otoa SCRATCH_REG,__STRING___o_2,6
str SCRATCH_REG,[HEAP_PTR]
str ASTACK_1,[HEAP_PTR,#4]
add HEAP_PTR,HEAP_PTR,#8
b create_arrayBCI
create_arrayI:
add SCRATCH_REG,BSTACK_1,#3
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4577
bl collect_0
no_collect_4577:
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,7
otoa SCRATCH_REG,__ARRAY___o_2,7
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_1,[HEAP_PTR,#4]
laol SCRATCH_REG,INT+2,INT_o_2,5
otoa SCRATCH_REG,INT_o_2,5
str SCRATCH_REG,[HEAP_PTR,#8]
add HEAP_PTR,HEAP_PTR,#12
create_arrayBCI:
tst BSTACK_1,#1
lsr BSTACK_1,BSTACK_1,#1
beq st_filli_array
str BSTACK_0,[HEAP_PTR],#4
b st_filli_array
.thumb_func
filli_array:
str BSTACK_0,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
add HEAP_PTR,HEAP_PTR,#8
.thumb_func
st_filli_array:
subs BSTACK_1,BSTACK_1,#1
bcs filli_array
ldr pc,[BSTACK_PTR],#4
create_arrayR:
add SCRATCH_REG,BSTACK_0,BSTACK_0
add SCRATCH_REG,SCRATCH_REG,#3+1
vmov BSTACK_1,ASTACK_1,d0
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4579
str ASTACK_1,[BSTACK_PTR,#-4]!
bl collect_0
ldr ASTACK_1,[BSTACK_PTR],#4
no_collect_4579:
tst HEAP_PTR,#4
orr HEAP_PTR,HEAP_PTR,#4
it ne
addne HEAP_FREE,HEAP_FREE,#1
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,8
otoa SCRATCH_REG,__ARRAY___o_2,8
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
laol SCRATCH_REG,REAL+2,REAL_o_2,4
otoa SCRATCH_REG,REAL_o_2,4
str SCRATCH_REG,[HEAP_PTR,#8]
add HEAP_PTR,HEAP_PTR,#12
b st_fillr_array
.thumb_func
fillr_array:
str BSTACK_1,[HEAP_PTR]
str ASTACK_1,[HEAP_PTR,#4]
add HEAP_PTR,HEAP_PTR,#8
.thumb_func
st_fillr_array:
subs BSTACK_0,BSTACK_0,#1
bcs fillr_array
ldr pc,[BSTACK_PTR],#4
.thumb_func
create_array:
add SCRATCH_REG,BSTACK_0,#3
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4576
bl collect_1
no_collect_4576:
mov BSTACK_1,ASTACK_0
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,9
otoa SCRATCH_REG,__ARRAY___o_2,9
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
mov SCRATCH_REG,#0
str SCRATCH_REG,[HEAP_PTR,#8]
add HEAP_PTR,HEAP_PTR,#12
mov BSTACK_3,BSTACK_0
b fillBSTACK_3_array
@ in BSTACK_0: number of elements, BSTACK_1: element descriptor
@ BSTACK_2: element size, BSTACK_3: element a size -> a0: array
create_R_array:
cmp BSTACK_2,#2
blo create_R_array_1
beq create_R_array_2
cmp BSTACK_2,#4
blo create_R_array_3
beq create_R_array_4
b create_R_array_5
create_R_array_1:
@ BSTACK_0: number of elements, BSTACK_1: element descriptor
@ BSTACK_3: element a size
add SCRATCH_REG,BSTACK_0,#3
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4581
bl collect_0
no_collect_4581:
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,10
otoa SCRATCH_REG,__ARRAY___o_2,10
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
str BSTACK_1,[HEAP_PTR,#8]
add HEAP_PTR,HEAP_PTR,#12
cmp BSTACK_3,#0
beq r_array_1_b
ldr BSTACK_1,[ASTACK_PTR,#-4]
b fillBSTACK_3_array
r_array_1_b:
ldr BSTACK_1,[BSTACK_PTR,#4]
fillBSTACK_3_array:
tst BSTACK_0,#1
lsr BSTACK_0,BSTACK_0,#1
beq st_fillBSTACK_3_array_1
str BSTACK_1,[HEAP_PTR],#4
b st_fillBSTACK_3_array_1
fillBSTACK_3_array_lp:
str BSTACK_1,[HEAP_PTR]
str BSTACK_1,[HEAP_PTR,#4]
add HEAP_PTR,HEAP_PTR,#8
st_fillBSTACK_3_array_1:
subs BSTACK_0,BSTACK_0,#1
bcs fillBSTACK_3_array_lp
ldr pc,[BSTACK_PTR],#4
create_R_array_2:
@ BSTACK_0: number of elements, BSTACK_1: element descriptor
@ BSTACK_3: element a size
add SCRATCH_REG,BSTACK_0,BSTACK_0
add SCRATCH_REG,SCRATCH_REG,#3
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4582
bl collect_0
no_collect_4582:
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,11
otoa SCRATCH_REG,__ARRAY___o_2,11
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
str BSTACK_1,[HEAP_PTR,#8]
add HEAP_PTR,HEAP_PTR,#12
subs BSTACK_3,BSTACK_3,#1
blo r_array_2_bb
beq r_array_2_ab
r_array_2_aa:
ldr BSTACK_1,[ASTACK_PTR,#-4]
ldr ASTACK_2,[ASTACK_PTR,#-8]
b st_fillBSTACK_2_array
r_array_2_ab:
ldr BSTACK_1,[ASTACK_PTR,#-4]
ldr ASTACK_2,[BSTACK_PTR,#4]
b st_fillBSTACK_2_array
r_array_2_bb:
ldr BSTACK_1,[BSTACK_PTR,#4]
ldr ASTACK_2,[BSTACK_PTR,#8]
b st_fillBSTACK_2_array
fillBSTACK_2_array_1:
str BSTACK_1,[HEAP_PTR]
str ASTACK_2,[HEAP_PTR,#4]
add HEAP_PTR,HEAP_PTR,#8
st_fillBSTACK_2_array:
subs BSTACK_0,BSTACK_0,#1
bcs fillBSTACK_2_array_1
ldr pc,[BSTACK_PTR],#4
create_R_array_3:
@ BSTACK_0: number of elements, BSTACK_1: element descriptor
@ BSTACK_3: element a size
add SCRATCH_REG,BSTACK_0,BSTACK_0,lsl #1
add SCRATCH_REG,SCRATCH_REG,#3
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4583
bl collect_0
no_collect_4583:
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,12
otoa SCRATCH_REG,__ARRAY___o_2,12
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
str BSTACK_1,[HEAP_PTR,#8]
add HEAP_PTR,HEAP_PTR,#12
ldr lr,[BSTACK_PTR],#4
mov BSTACK_2,BSTACK_PTR
cmp BSTACK_3,#0
beq r_array_3
sub ASTACK_2,ASTACK_PTR,BSTACK_3,lsl #2
subs BSTACK_3,BSTACK_3,#1
copy_a_to_b_lp3:
ldr SCRATCH_REG,[ASTACK_2],#4
str SCRATCH_REG,[BSTACK_PTR,#-4]!
subs BSTACK_3,BSTACK_3,#1
bcs copy_a_to_b_lp3
r_array_3:
ldr BSTACK_1,[BSTACK_PTR]
ldr ASTACK_1,[BSTACK_PTR,#4]
ldr ASTACK_2,[BSTACK_PTR,#8]
mov BSTACK_PTR,BSTACK_2
b st_fillBSTACK_1_array
fillBSTACK_1_array_1:
str BSTACK_1,[HEAP_PTR]
str ASTACK_1,[HEAP_PTR,#4]
str ASTACK_2,[HEAP_PTR,#8]
add HEAP_PTR,HEAP_PTR,#12
st_fillBSTACK_1_array:
subs BSTACK_0,BSTACK_0,#1
bcs fillBSTACK_1_array_1
bx lr
create_R_array_4:
@ BSTACK_0: number of elements, BSTACK_1: element descriptor
@ BSTACK_3: element a size
lsl SCRATCH_REG,BSTACK_0,#2
add SCRATCH_REG,SCRATCH_REG,#3
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4584
bl collect_0
no_collect_4584:
mov ASTACK_0,HEAP_PTR
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,13
otoa SCRATCH_REG,__ARRAY___o_2,13
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
str BSTACK_1,[HEAP_PTR,#8]
add HEAP_PTR,HEAP_PTR,#12
ldr lr,[BSTACK_PTR],#4
mov BSTACK_2,BSTACK_PTR
cmp BSTACK_3,#0
beq r_array_4
sub ASTACK_2,ASTACK_PTR,BSTACK_3,lsl #2
subs BSTACK_3,BSTACK_3,#1
copy_a_to_b_lp4:
ldr SCRATCH_REG,[ASTACK_2],#4
str SCRATCH_REG,[BSTACK_PTR,#-4]!
subs BSTACK_3,BSTACK_3,#1
bcs copy_a_to_b_lp4
r_array_4:
ldr BSTACK_4,[BSTACK_PTR]
ldr BSTACK_1,[BSTACK_PTR,#4]
ldr ASTACK_1,[BSTACK_PTR,#8]
ldr ASTACK_2,[BSTACK_PTR,#12]
mov BSTACK_PTR,BSTACK_2
b st_fillBSTACK_0_array
fillBSTACK_0_array:
str BSTACK_4,[HEAP_PTR]
str BSTACK_1,[HEAP_PTR,#4]
str ASTACK_1,[HEAP_PTR,#8]
str ASTACK_2,[HEAP_PTR,#12]
add HEAP_PTR,HEAP_PTR,#16
st_fillBSTACK_0_array:
subs BSTACK_0,BSTACK_0,#1
bcs fillBSTACK_0_array
bx lr
create_R_array_5:
@ BSTACK_0: number of elements, BSTACK_1: element descriptor
@ BSTACK_3: element a size, BSTACK_2: element size
mul SCRATCH_REG,BSTACK_0,BSTACK_2
add SCRATCH_REG,SCRATCH_REG,#3
subs HEAP_FREE,HEAP_FREE,SCRATCH_REG
bhs no_collect_4585
bl collect_0
no_collect_4585:
laol SCRATCH_REG,__ARRAY__+2,__ARRAY___o_2,14
otoa SCRATCH_REG,__ARRAY___o_2,14
str SCRATCH_REG,[HEAP_PTR]
str BSTACK_0,[HEAP_PTR,#4]
str BSTACK_1,[HEAP_PTR,#8]
ldr lr,[BSTACK_PTR],#4
mov ASTACK_3,BSTACK_PTR
cmp BSTACK_3,#0
beq r_array_5
sub ASTACK_2,ASTACK_PTR,BSTACK_3,lsl #2
subs BSTACK_3,BSTACK_3,#1
copy_a_to_b_lp5:
ldr SCRATCH_REG,[ASTACK_2],#4
str SCRATCH_REG,[BSTACK_PTR,#-4]!
subs BSTACK_3,BSTACK_3,#1
bcs copy_a_to_b_lp5
r_array_5:
mov ASTACK_0,HEAP_PTR
add HEAP_PTR,HEAP_PTR,#12
ldr BSTACK_1,[BSTACK_PTR]
ldr ASTACK_1,[BSTACK_PTR,#4]
b st_fillr5_array
fillr5_array_1:
str BSTACK_1,[HEAP_PTR]
str ASTACK_1,[HEAP_PTR,#4]
sub SCRATCH_REG,BSTACK_2,#5
ldr ASTACK_2,[BSTACK_PTR,#8]
str ASTACK_2,[HEAP_PTR,#8]
ldr ASTACK_2,[BSTACK_PTR,#12]
add BSTACK_4,BSTACK_PTR,#16
str ASTACK_2,[HEAP_PTR,#12]
add HEAP_PTR,HEAP_PTR,#16
copy_elem_lp5:
ldr ASTACK_2,[BSTACK_4],#4
str ASTACK_2,[HEAP_PTR],#4
subs SCRATCH_REG,SCRATCH_REG,#1
bcs copy_elem_lp5
st_fillr5_array:
subs BSTACK_0,BSTACK_0,#1
bcs fillr5_array_1
mov BSTACK_PTR,ASTACK_3
bx lr
.thumb_func
repl_args_b:
cmp BSTACK_0,#0
ble repl_args_b_1
subs BSTACK_0,BSTACK_0,#1
beq repl_args_b_4
ldr ASTACK_1,[ASTACK_0,#8]
subs BSTACK_1,BSTACK_1,#2
bne repl_args_b_2
str ASTACK_1,[ASTACK_PTR],#4
b repl_args_b_4
repl_args_b_2:
add ASTACK_1,ASTACK_1,BSTACK_0,lsl #2
repl_args_b_3:
ldr ASTACK_2,[ASTACK_1,#-4]!
str ASTACK_2,[ASTACK_PTR],#4
subs BSTACK_0,BSTACK_0,#1
bne repl_args_b_3
repl_args_b_4:
ldr ASTACK_2,[ASTACK_0,#4]
str ASTACK_2,[ASTACK_PTR],#4
repl_args_b_1:
ldr pc,[BSTACK_PTR],#4
.thumb_func
push_arg_b:
cmp BSTACK_1,#2
blo push_arg_b_1
bne push_arg_b_2
cmp BSTACK_1,BSTACK_0
beq push_arg_b_1
push_arg_b_2:
ldr ASTACK_0,[ASTACK_0,#8]
subs BSTACK_1,BSTACK_1,#2
push_arg_b_1:
ldr ASTACK_0,[ASTACK_0,BSTACK_1,lsl #2]
ldr pc,[BSTACK_PTR],#4
.thumb_func
del_args:
ldr BSTACK_1,[ASTACK_0]
subs BSTACK_1,BSTACK_1,BSTACK_0
ldrsh BSTACK_0,[BSTACK_1,#-2]
subs BSTACK_0,BSTACK_0,#2
bge del_args_2
str BSTACK_1,[ASTACK_1]
ldr ASTACK_2,[ASTACK_0,#4]
str ASTACK_2,[ASTACK_1,#4]
ldr ASTACK_2,[ASTACK_0,#8]
str ASTACK_2,[ASTACK_1,#8]
ldr pc,[BSTACK_PTR],#4
del_args_2:
bne del_args_3
str BSTACK_1,[ASTACK_1]
ldr ASTACK_2,[ASTACK_0,#4]
str ASTACK_2,[ASTACK_1,#4]
ldr ASTACK_2,[ASTACK_0,#8]
ldr ASTACK_2,[ASTACK_2]
str ASTACK_2,[ASTACK_1,#8]
ldr pc,[BSTACK_PTR],#4
del_args_3:
subs HEAP_FREE,HEAP_FREE,BSTACK_0
blo del_args_gc
.thumb_func
del_args_r_gc:
str BSTACK_1,[ASTACK_1]
str HEAP_PTR,[ASTACK_1,#8]
ldr ASTACK_2,[ASTACK_0,#4]
ldr ASTACK_0,[ASTACK_0,#8]
str ASTACK_2,[ASTACK_1,#4]
.thumb_func
del_args_copy_args:
ldr ASTACK_2,[ASTACK_0],#4
str ASTACK_2,[HEAP_PTR],#4
subs BSTACK_0,BSTACK_0,#1
bgt del_args_copy_args
ldr pc,[BSTACK_PTR],#4
.thumb_func
del_args_gc:
bl collect_2
b del_args_r_gc
.section .text.sin_real,"ax"
.thumb_func
sin_real:
.ifdef SOFT_FP_CC
vmov r0,r1,d0
.endif
bl sin
.ifdef SOFT_FP_CC
vmov d0,r0,r1
.endif
ldr pc,[BSTACK_PTR],#4
.section .text.cos_real,"ax"
.thumb_func
cos_real:
.ifdef SOFT_FP_CC
vmov r0,r1,d0
.endif
bl cos
.ifdef SOFT_FP_CC
vmov d0,r0,r1
.endif
ldr pc,[BSTACK_PTR],#4
.section .text.tan_real,"ax"
.thumb_func
tan_real:
.ifdef SOFT_FP_CC
vmov r0,r1,d0
.endif
bl tan
.ifdef SOFT_FP_CC
vmov d0,r0,r1
.endif
ldr pc,[BSTACK_PTR],#4
.section .text.asin_real,"ax"
.thumb_func
asin_real:
.ifdef SOFT_FP_CC
vmov r0,r1,d0
.endif
bl asin
.ifdef SOFT_FP_CC
vmov d0,r0,r1
.endif
ldr pc,[BSTACK_PTR],#4
.section .text.acos_real,"ax"
.thumb_func
acos_real:
.ifdef SOFT_FP_CC
vmov r0,r1,d0
.endif
bl acos
.ifdef SOFT_FP_CC
vmov d0,r0,r1
.endif
ldr pc,[BSTACK_PTR],#4
.section .text.atan_real,"ax"
.thumb_func
atan_real:
.ifdef SOFT_FP_CC
vmov r0,r1,d0
.endif
bl atan
.ifdef SOFT_FP_CC
vmov d0,r0,r1
.endif
ldr pc,[BSTACK_PTR],#4
.section .text.ln_real,"ax"
.thumb_func
ln_real:
.ifdef SOFT_FP_CC
vmov r0,r1,d0
.endif
bl log
.ifdef SOFT_FP_CC
vmov d0,r0,r1
.endif
ldr pc,[BSTACK_PTR],#4
.section .text.log10_real,"ax"
log10_real:
.ifdef SOFT_FP_CC
vmov r0,r1,d0
.endif
bl log10
.ifdef SOFT_FP_CC
vmov d0,r0,r1
.endif
ldr pc,[BSTACK_PTR],#4
.section .text.exp_real,"ax"
.thumb_func
exp_real:
.ifdef SOFT_FP_CC
vmov r0,r1,d0
.endif
bl exp
.ifdef SOFT_FP_CC
vmov d0,r0,r1
.endif
ldr pc,[BSTACK_PTR],#4
.section .text.pow_real,"ax"
.thumb_func
pow_real:
.ifdef SOFT_FP_CC
vmov r0,r1,d1
vmov BSTACK_2,BSTACK_1,d0
.else
vmov.f64 d2,d0
vmov.f64 d0,d1
vmov.f64 d1,d2
.endif
bl pow
.ifdef SOFT_FP_CC
vmov d0,r0,r1
.endif
ldr pc,[BSTACK_PTR],#4
.section .text.entier_real,"ax"
.thumb_func
entier_real:
.ifdef SOFT_FP_CC
vmov r0,r1,d0
.endif
bl floor
.ifdef SOFT_FP_CC
vmov d0,r0,r1
.endif
.thumb_func
r_to_i_real:
vcvtr.s32.f64 s0,d0
vmov BSTACK_0,s0
ldr pc,[BSTACK_PTR],#4
.text
.ifdef PIC
.if MARK_GC
lto __cycle__in__spine,0
.if MARK_AND_COPY_GC
lto flags,14
.endif
.endif
lto e__system__nind,0
lto e__system__nind,1
lto e__system__nind,2
lto e__system__nind,3
lto e__system__nind,4
lto e__system__nind,5
lto e__system__nind,6
lto e__system__nind,7
ltol __STRING__+2,__STRING___o_2,5
ltol __STRING__+2,__STRING___o_2,6
ltol __ARRAY__+2,__ARRAY___o_2,2
ltol BOOL+2,BOOL_o_2,2
ltol __ARRAY__+2,__ARRAY___o_2,3
ltol INT+2,INT_o_2,4
ltol __ARRAY__+2,__ARRAY___o_2,4
ltol REAL+2,REAL_o_2,3
ltol __ARRAY__+2,__ARRAY___o_2,5
ltol __ARRAY__+2,__ARRAY___o_2,6
ltol BOOL+2,BOOL_o_2,3
ltol __ARRAY__+2,__ARRAY___o_2,7
ltol INT+2,INT_o_2,5
ltol __ARRAY__+2,__ARRAY___o_2,8
ltol REAL+2,REAL_o_2,4
ltol __ARRAY__+2,__ARRAY___o_2,9
ltol __ARRAY__+2,__ARRAY___o_2,10
ltol __ARRAY__+2,__ARRAY___o_2,11
ltol __ARRAY__+2,__ARRAY___o_2,12
ltol __ARRAY__+2,__ARRAY___o_2,13
ltol __ARRAY__+2,__ARRAY___o_2,14
.endif
.ltorg
.if NEW_DESCRIPTORS
.include "thumb2ap.s"
.endif
|