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 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 11265 11266 11267 11268 11269 11270 11271 11272 11273 11274 11275 11276 11277 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 11294 11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 11333 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543 11544 11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 11659 11660 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 11735 11736 11737 11738 11739 11740 11741 11742 11743 11744 11745 11746 11747 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 11882 11883 11884 11885 11886 11887 11888 11889 11890 11891 11892 11893 11894 11895 11896 11897 11898 11899 11900 11901 11902 11903 11904 11905 11906 11907 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 12142 12143 12144 12145 12146 12147 12148 12149 12150 12151 12152 12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 12658 12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 13187 13188 13189 13190 13191 13192 13193 13194 13195 13196 13197 13198 13199 13200 13201 13202 13203 13204 13205 13206 13207 13208 13209 13210 13211 13212 13213 13214 13215 13216 13217 13218 13219 13220 13221 13222 13223 13224 13225 13226 13227 13228 13229 13230 13231 13232 13233 13234 13235 13236 13237 13238 13239 13240 13241 13242 13243 13244 13245 13246 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 13281 13282 13283 13284 13285 13286 13287 13288 13289 13290 13291 13292 13293 13294 13295 13296 13297 13298 13299 13300 13301 13302 13303 13304 13305 13306 13307 13308 13309 13310 13311 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 13325 13326 13327 13328 13329 13330 13331 13332 13333 13334 13335 13336 13337 13338 13339 13340 13341 13342 13343 13344 13345 13346 13347 13348 13349 13350 13351 13352 13353 13354 13355 13356 13357 13358 13359 13360 13361 13362 13363 13364 13365 13366 13367 13368 13369 13370 13371 13372 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382 13383 13384 13385 13386 13387 13388 13389 13390 13391 13392 13393 13394 13395 13396 13397 13398 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412 13413 13414 13415 13416 13417 13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 13530 13531 13532 13533 13534 13535 13536 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 13555 13556 13557 13558 13559 13560 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 13586 13587 13588 13589 13590 13591 13592 13593 13594 13595 13596 13597 13598 13599 13600 13601 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 13623 13624 13625 13626 13627 13628 13629 13630 13631 13632 13633 13634 13635 13636 13637 13638 13639 13640 13641 13642 13643 13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 13654 13655 13656 13657 13658 13659 13660 13661 13662 13663 13664 13665 13666 13667 13668 13669 13670 13671 13672 13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684 13685 13686 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 13700 13701 13702 13703 13704 13705 13706 13707 13708 13709 13710 13711 13712 13713 13714 13715 13716 13717 13718 13719 13720 13721 13722 13723 13724 13725 13726 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 13740 13741 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767 13768 13769 13770 13771 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 13828 13829 13830 13831 13832 13833 13834 13835 13836 13837 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 13876 13877 13878 13879 13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890 13891 13892 13893 13894 13895 13896 13897 13898 13899 13900 13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911 13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949 13950 13951 13952 13953 13954 13955 13956 13957 13958 13959 13960 13961 13962 13963 13964 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 14025 14026 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 14143 14144 14145 14146 14147 14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 14177 14178 14179 14180 14181 14182 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213 14214 14215 14216 14217 14218 14219 14220 14221 14222 14223 14224 14225 14226 14227 14228 14229 14230 14231 14232 14233 14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 14680 14681 14682 14683 14684 14685 14686 14687 14688 14689 14690 14691 14692 14693 14694 14695 14696 14697 14698 14699 14700 14701 14702 14703 14704 14705 14706 14707 14708 14709 14710 14711 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844 14845 14846 14847 14848 14849 14850 14851 14852 14853 14854 14855 14856 14857 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 14873 14874 14875 14876 14877 14878 14879 14880 14881 14882 14883 14884 14885 14886 14887 14888 14889 14890 14891 14892 14893 14894 14895 14896 14897 14898 14899 14900 14901 14902 14903 14904 14905 14906 14907 14908 14909 14910 14911 14912 14913 14914 14915 14916 14917 14918 14919 14920 14921 14922 14923 14924 14925 14926 14927 14928 14929 14930 14931 14932 14933 14934 14935 14936 14937 14938 14939 14940 14941 14942 14943 14944 14945 14946 14947 14948 14949 14950 14951 14952 14953 14954 14955 14956 14957 14958 14959 14960 14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 14975 14976 14977 14978 14979 14980 14981 14982 14983 14984 14985 14986 14987 14988 14989 14990 14991 14992 14993 14994 14995 14996 14997 14998 14999 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 15011 15012 15013 15014 15015 15016 15017 15018 15019 15020 15021 15022 15023 15024 15025 15026 15027 15028 15029 15030 15031 15032 15033 15034 15035 15036 15037 15038 15039 15040 15041 15042 15043 15044 15045 15046 15047 15048 15049 15050 15051 15052 15053 15054 15055 15056 15057 15058 15059 15060 15061 15062 15063 15064 15065 15066 15067 15068 15069 15070 15071 15072 15073 15074 15075 15076 15077 15078 15079 15080 15081 15082 15083 15084 15085 15086 15087 15088 15089 15090 15091 15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158 15159 15160 15161 15162 15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 15262 15263 15264 15265 15266 15267 15268 15269 15270 15271 15272 15273 15274 15275 15276 15277 15278 15279 15280 15281 15282 15283 15284 15285 15286 15287 15288 15289 15290 15291 15292 15293 15294 15295 15296 15297 15298 15299 15300 15301 15302 15303 15304 15305 15306 15307 15308 15309 15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331 15332 15333 15334 15335 15336 15337 15338 15339 15340 15341 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 15353 15354 15355 15356 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 15372 15373 15374 15375 15376 15377 15378 15379 15380 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442 15443 15444 15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 15475 15476 15477 15478 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 15494 15495 15496 15497 15498 15499 15500 15501 15502 15503 15504 15505 15506 15507 15508 15509 15510 15511 15512 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 15523 15524 15525 15526 15527 15528 15529 15530 15531 15532 15533 15534 15535 15536 15537 15538 15539 15540 15541 15542 15543 15544 15545 15546 15547 15548 15549 15550 15551 15552 15553 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 15568 15569 15570 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623 15624 15625 15626 15627 15628 15629 15630 15631 15632 15633 15634 15635 15636 15637 15638 15639 15640 15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710 15711 15712 15713 15714 15715 15716 15717 15718 15719 15720 15721 15722 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 15733 15734 15735 15736 15737 15738 15739 15740 15741 15742 15743 15744 15745 15746 15747 15748 15749 15750 15751 15752 15753 15754 15755 15756 15757 15758 15759 15760 15761 15762 15763 15764 15765 15766 15767 15768 15769 15770 15771 15772 15773 15774 15775 15776 15777 15778 15779 15780 15781 15782 15783 15784 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 15803 15804 15805 15806 15807 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 15823 15824 15825 15826 15827 15828 15829 15830 15831 15832 15833 15834 15835 15836 15837 15838 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 15859 15860 15861 15862 15863 15864 15865 15866 15867 15868 15869 15870 15871 15872 15873 15874 15875 15876 15877 15878 15879 15880 15881 15882 15883 15884 15885 15886 15887 15888 15889 15890 15891 15892 15893 15894 15895 15896 15897 15898 15899 15900 15901 15902 15903 15904 15905 15906 15907 15908 15909 15910 15911 15912 15913 15914 15915 15916 15917 15918 15919 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 15980 15981 15982 15983 15984 15985 15986 15987 15988 15989 15990 15991 15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 16006 16007 16008 16009 16010 16011 16012 16013 16014 16015 16016 16017 16018 16019 16020 16021 16022 16023 16024 16025 16026 16027 16028 16029 16030 16031 16032 16033 16034 16035 16036 16037 16038 16039 16040 16041 16042 16043 16044 16045 16046 16047 16048 16049 16050 16051 16052 16053 16054 16055 16056 16057 16058 16059 16060 16061 16062 16063 16064 16065 16066 16067 16068 16069 16070 16071 16072 16073 16074 16075 16076 16077 16078 16079 16080 16081 16082 16083 16084 16085 16086 16087 16088 16089 16090 16091 16092 16093 16094 16095 16096 16097 16098 16099 16100 16101 16102 16103 16104 16105 16106 16107 16108 16109 16110 16111 16112 16113 16114 16115 16116 16117 16118 16119 16120 16121 16122 16123 16124 16125 16126 16127 16128 16129 16130 16131 16132 16133 16134 16135 16136 16137 16138 16139 16140 16141 16142 16143 16144 16145 16146 16147 16148 16149 16150 16151 16152 16153 16154 16155 16156 16157 16158 16159 16160 16161 16162 16163 16164 16165 16166 16167 16168 16169 16170 16171 16172 16173 16174 16175 16176 16177 16178 16179 16180 16181 16182 16183 16184 16185 16186 16187 16188 16189 16190 16191 16192 16193 16194 16195 16196 16197 16198 16199 16200 16201 16202 16203 16204 16205 16206 16207 16208 16209 16210 16211 16212 16213 16214 16215 16216 16217 16218 16219 16220 16221 16222 16223 16224 16225 16226 16227 16228 16229 16230 16231 16232 16233 16234 16235 16236 16237 16238 16239 16240 16241 16242 16243 16244 16245 16246 16247 16248 16249 16250 16251 16252 16253 16254 16255 16256 16257 16258 16259 16260 16261 16262 16263 16264 16265 16266 16267 16268 16269 16270 16271 16272 16273 16274 16275 16276 16277 16278 16279 16280 16281 16282 16283 16284 16285 16286 16287 16288 16289 16290 16291 16292 16293 16294 16295 16296 16297 16298 16299 16300 16301 16302 16303 16304 16305 16306 16307 16308 16309 16310 16311 16312 16313 16314 16315 16316 16317 16318 16319 16320 16321 16322 16323 16324 16325 16326 16327 16328 16329 16330 16331 16332 16333 16334 16335 16336 16337 16338 16339 16340 16341 16342 16343 16344 16345 16346 16347 16348 16349 16350 16351 16352 16353 16354 16355 16356 16357 16358 16359 16360 16361 16362 16363 16364 16365 16366 16367 16368 16369 16370 16371 16372 16373 16374 16375 16376 16377 16378 16379 16380 16381 16382 16383 16384 16385 16386 16387 16388 16389 16390 16391 16392 16393 16394 16395 16396 16397 16398 16399 16400 16401 16402 16403 16404 16405 16406 16407 16408 16409 16410 16411 16412 16413 16414 16415 16416 16417 16418 16419 16420 16421 16422 16423 16424 16425 16426 16427 16428 16429 16430 16431 16432 16433 16434 16435 16436 16437 16438 16439 16440 16441 16442 16443 16444 16445 16446 16447 16448 16449 16450 16451 16452 16453 16454 16455 16456 16457 16458 16459 16460 16461 16462 16463 16464 16465 16466 16467 16468 16469 16470 16471 16472 16473 16474 16475 16476 16477 16478 16479 16480 16481 16482 16483 16484 16485 16486 16487 16488 16489 16490 16491 16492 16493 16494 16495 16496 16497 16498 16499 16500 16501 16502 16503 16504 16505 16506 16507 16508 16509 16510 16511 16512 16513 16514 16515 16516 16517 16518 16519 16520 16521 16522 16523 16524 16525 16526 16527 16528 16529 16530 16531 16532 16533 16534 16535 16536 16537 16538 16539 16540 16541 16542 16543 16544 16545 16546 16547 16548 16549 16550 16551 16552 16553 16554 16555 16556 16557 16558 16559 16560 16561 16562 16563 16564 16565 16566 16567 16568 16569 16570 16571 16572 16573 16574 16575 16576 16577 16578 16579 16580 16581 16582 16583 16584 16585 16586 16587 16588 16589 16590 16591 16592 16593 16594 16595 16596 16597 16598 16599 16600 16601 16602 16603 16604 16605 16606 16607 16608 16609 16610 16611 16612 16613 16614 16615 16616 16617 16618 16619 16620 16621 16622 16623 16624 16625 16626 16627 16628 16629 16630 16631 16632 16633 16634 16635 16636 16637 16638 16639 16640 16641 16642 16643 16644 16645 16646 16647 16648 16649 16650 16651 16652 16653 16654 16655 16656 16657 16658 16659 16660 16661 16662 16663 16664 16665 16666 16667 16668 16669 16670 16671 16672 16673 16674 16675 16676 16677 16678 16679 16680 16681 16682 16683 16684 16685 16686 16687 16688 16689 16690 16691 16692 16693 16694 16695 16696 16697 16698 16699 16700 16701 16702 16703 16704 16705 16706 16707 16708 16709 16710 16711 16712 16713 16714 16715 16716 16717 16718 16719 16720 16721 16722 16723 16724 16725 16726 16727 16728 16729 16730 16731 16732 16733 16734 16735 16736 16737 16738 16739 16740 16741 16742 16743 16744 16745 16746 16747 16748 16749 16750 16751 16752 16753 16754 16755 16756 16757 16758 16759 16760 16761 16762 16763 16764 16765 16766 16767 16768 16769 16770 16771 16772 16773 16774 16775 16776 16777 16778 16779 16780 16781 16782 16783 16784 16785 16786 16787 16788 16789 16790 16791 16792 16793 16794 16795 16796 16797 16798 16799 16800 16801 16802 16803 16804 16805 16806 16807 16808 16809 16810 16811 16812 16813 16814 16815 16816 16817 16818 16819 16820 16821 16822 16823 16824 16825 16826 16827 16828 16829 16830 16831 16832 16833 16834 16835 16836 16837 16838 16839 16840 16841 16842 16843 16844 16845 16846 16847 16848 16849 16850 16851 16852 16853 16854 16855 16856 16857 16858 16859 16860 16861 16862 16863 16864 16865 16866 16867 16868 16869 16870 16871 16872 16873 16874 16875 16876 16877 16878 16879 16880 16881 16882 16883 16884 16885 16886 16887 16888 16889 16890 16891 16892 16893 16894 16895 16896 16897 16898 16899 16900 16901 16902 16903 16904 16905 16906 16907 16908 16909 16910 16911 16912 16913 16914 16915 16916 16917 16918 16919 16920 16921 16922 16923 16924 16925 16926 16927 16928 16929 16930 16931 16932 16933 16934 16935 16936 16937 16938 16939 16940 16941 16942 16943 16944 16945 16946 16947 16948 16949 16950 16951 16952 16953 16954 16955 16956 16957 16958 16959 16960 16961 16962 16963 16964 16965 16966 16967 16968 16969 16970 16971 16972 16973 16974 16975 16976 16977 16978 16979 16980 16981 16982 16983 16984 16985 16986 16987 16988 16989 16990 16991 16992 16993 16994 16995 16996 16997 16998 16999 17000 17001 17002 17003 17004 17005 17006 17007 17008 17009 17010 17011 17012 17013 17014 17015 17016 17017 17018 17019 17020 17021 17022 17023 17024 17025 17026 17027 17028 17029 17030 17031 17032 17033 17034 17035 17036 17037 17038 17039 17040 17041 17042 17043 17044 17045 17046 17047 17048 17049 17050 17051 17052 17053 17054 17055 17056 17057 17058 17059 17060 17061 17062 17063 17064 17065 17066 17067 17068 17069 17070 17071 17072 17073 17074 17075 17076 17077 17078 17079 17080 17081 17082 17083 17084 17085 17086 17087 17088 17089 17090 17091 17092 17093 17094 17095 17096 17097 17098 17099 17100 17101 17102 17103 17104 17105 17106 17107 17108 17109 17110 17111 17112 17113 17114 17115 17116 17117 17118 17119 17120 17121 17122 17123 17124 17125 17126 17127 17128 17129 17130 17131 17132 17133 17134 17135 17136 17137 17138 17139 17140 17141 17142 17143 17144 17145 17146 17147 17148 17149 17150 17151 17152 17153 17154 17155 17156 17157 17158 17159 17160 17161 17162 17163 17164 17165 17166 17167 17168 17169 17170 17171 17172 17173 17174 17175 17176 17177 17178 17179 17180 17181 17182 17183 17184 17185 17186 17187 17188 17189 17190 17191 17192 17193 17194 17195 17196 17197 17198 17199 17200 17201 17202 17203 17204 17205 17206 17207 17208 17209 17210 17211 17212 17213 17214 17215 17216 17217 17218 17219 17220 17221 17222 17223 17224 17225 17226 17227 17228 17229 17230 17231 17232 17233 17234 17235 17236 17237 17238 17239 17240 17241 17242 17243 17244 17245 17246 17247 17248 17249 17250 17251 17252 17253 17254 17255 17256 17257 17258 17259 17260 17261 17262 17263 17264 17265 17266 17267 17268 17269 17270 17271 17272 17273 17274 17275 17276 17277 17278 17279 17280 17281 17282 17283 17284 17285 17286 17287 17288 17289 17290 17291 17292 17293 17294 17295 17296 17297 17298 17299 17300 17301 17302 17303 17304 17305 17306 17307 17308 17309 17310 17311 17312 17313 17314 17315 17316 17317 17318 17319 17320 17321 17322 17323 17324 17325 17326 17327 17328 17329 17330 17331 17332 17333 17334 17335 17336 17337 17338 17339 17340 17341 17342 17343 17344 17345 17346 17347 17348 17349 17350 17351 17352 17353 17354 17355 17356 17357 17358 17359 17360 17361 17362 17363 17364 17365 17366 17367 17368 17369 17370 17371 17372 17373 17374 17375 17376 17377 17378 17379 17380 17381 17382 17383 17384 17385 17386 17387 17388 17389 17390 17391 17392 17393 17394 17395 17396 17397 17398 17399 17400 17401 17402 17403 17404 17405 17406 17407 17408 17409 17410 17411 17412 17413 17414 17415 17416 17417 17418 17419 17420 17421 17422 17423 17424 17425 17426 17427 17428 17429 17430 17431 17432 17433 17434 17435 17436 17437 17438 17439 17440 17441 17442 17443 17444 17445 17446 17447 17448 17449 17450 17451 17452 17453 17454 17455 17456 17457 17458 17459 17460 17461 17462 17463 17464 17465 17466 17467 17468 17469 17470 17471 17472 17473 17474 17475 17476 17477 17478 17479 17480 17481 17482 17483 17484 17485 17486 17487 17488 17489 17490 17491 17492 17493 17494 17495 17496 17497 17498 17499 17500 17501 17502 17503 17504 17505 17506 17507 17508 17509 17510 17511 17512 17513 17514 17515 17516 17517 17518 17519 17520 17521 17522 17523 17524 17525 17526 17527 17528 17529 17530 17531 17532 17533 17534 17535 17536 17537 17538 17539 17540 17541 17542 17543 17544 17545 17546 17547 17548 17549 17550 17551 17552 17553 17554 17555 17556 17557 17558 17559 17560 17561 17562 17563 17564 17565 17566 17567 17568 17569 17570 17571 17572 17573 17574 17575 17576 17577 17578 17579 17580 17581 17582 17583 17584 17585 17586 17587 17588 17589 17590 17591 17592 17593 17594 17595 17596 17597 17598 17599 17600 17601 17602 17603 17604 17605 17606 17607 17608 17609 17610 17611 17612 17613 17614 17615 17616 17617 17618 17619 17620 17621 17622 17623 17624 17625 17626 17627 17628 17629 17630 17631 17632 17633 17634 17635 17636 17637 17638 17639 17640 17641 17642 17643 17644 17645 17646 17647 17648 17649 17650 17651 17652 17653 17654 17655 17656 17657 17658 17659 17660 17661 17662 17663 17664 17665 17666 17667 17668 17669 17670 17671 17672 17673 17674 17675 17676 17677 17678 17679 17680 17681 17682 17683 17684 17685 17686 17687 17688 17689 17690 17691 17692 17693 17694 17695 17696 17697 17698 17699 17700 17701 17702 17703 17704 17705 17706 17707 17708 17709 17710 17711 17712 17713 17714 17715 17716 17717 17718 17719 17720 17721 17722 17723 17724 17725 17726 17727 17728 17729 17730 17731 17732 17733 17734 17735 17736 17737 17738 17739 17740 17741 17742 17743 17744 17745 17746 17747 17748 17749 17750 17751 17752 17753 17754 17755 17756 17757 17758 17759 17760 17761 17762 17763 17764 17765 17766 17767 17768 17769 17770 17771 17772 17773 17774 17775 17776 17777 17778 17779 17780 17781 17782 17783 17784 17785 17786 17787 17788 17789 17790 17791 17792 17793 17794 17795 17796 17797 17798 17799 17800 17801 17802 17803 17804 17805 17806 17807 17808 17809 17810 17811 17812 17813 17814 17815 17816 17817 17818 17819 17820 17821 17822 17823 17824 17825 17826 17827 17828 17829 17830 17831 17832 17833 17834 17835 17836 17837 17838 17839 17840 17841 17842 17843 17844 17845 17846 17847 17848 17849 17850 17851 17852 17853 17854 17855 17856 17857 17858 17859 17860 17861 17862 17863 17864 17865 17866 17867 17868 17869 17870 17871 17872 17873 17874 17875 17876 17877 17878 17879 17880 17881 17882 17883 17884 17885 17886 17887 17888 17889 17890 17891 17892 17893 17894 17895 17896 17897 17898 17899 17900 17901 17902 17903 17904 17905 17906 17907 17908 17909 17910 17911 17912 17913 17914 17915 17916 17917 17918 17919 17920 17921 17922 17923 17924 17925 17926 17927 17928 17929 17930 17931 17932 17933 17934 17935 17936 17937 17938 17939 17940 17941 17942 17943 17944 17945 17946 17947 17948 17949 17950 17951 17952 17953 17954 17955 17956 17957 17958 17959 17960 17961 17962 17963 17964 17965 17966 17967 17968 17969 17970 17971 17972 17973 17974 17975 17976 17977 17978 17979 17980 17981 17982 17983 17984 17985 17986 17987 17988 17989 17990 17991 17992 17993 17994 17995 17996 17997 17998 17999 18000 18001 18002 18003 18004 18005 18006 18007 18008 18009 18010 18011 18012 18013 18014 18015 18016 18017 18018 18019 18020 18021 18022 18023 18024 18025 18026 18027 18028 18029 18030 18031 18032 18033 18034 18035 18036 18037 18038 18039 18040 18041 18042 18043 18044 18045 18046 18047 18048 18049 18050 18051 18052 18053 18054 18055 18056 18057 18058 18059 18060 18061 18062 18063 18064 18065 18066 18067 18068 18069 18070 18071 18072 18073 18074 18075 18076 18077 18078 18079 18080 18081 18082 18083 18084 18085 18086 18087 18088 18089 18090 18091 18092 18093 18094 18095 18096 18097 18098 18099 18100 18101 18102 18103 18104 18105 18106 18107 18108 18109 18110 18111 18112 18113 18114 18115 18116 18117 18118 18119 18120 18121 18122 18123 18124 18125 18126 18127 18128 18129 18130 18131 18132 18133 18134 18135 18136 18137 18138 18139 18140 18141 18142 18143 18144 18145 18146 18147 18148 18149 18150 18151 18152 18153 18154 18155 18156 18157 18158 18159 18160 18161 18162 18163 18164 18165 18166 18167 18168 18169 18170 18171 18172 18173 18174 18175 18176 18177 18178 18179 18180 18181 18182 18183 18184 18185 18186 18187 18188 18189 18190 18191 18192 18193 18194 18195 18196 18197 18198 18199 18200 18201 18202 18203 18204 18205 18206 18207 18208 18209 18210 18211 18212 18213 18214 18215 18216 18217 18218 18219 18220 18221 18222 18223 18224 18225 18226 18227 18228 18229 18230 18231 18232 18233 18234 18235 18236 18237 18238 18239 18240 18241 18242 18243 18244 18245 18246 18247 18248 18249 18250 18251 18252 18253 18254 18255 18256 18257 18258 18259 18260 18261 18262 18263 18264 18265 18266 18267 18268 18269 18270 18271 18272 18273 18274 18275 18276 18277 18278 18279 18280 18281 18282 18283 18284 18285 18286 18287 18288 18289 18290 18291 18292 18293 18294 18295 18296 18297 18298 18299 18300 18301 18302 18303 18304 18305 18306 18307 18308 18309 18310 18311 18312 18313 18314 18315 18316 18317 18318 18319 18320 18321 18322 18323 18324 18325 18326 18327 18328 18329 18330 18331 18332 18333 18334 18335 18336 18337 18338 18339 18340 18341 18342 18343 18344 18345 18346 18347 18348 18349 18350 18351 18352 18353 18354 18355 18356 18357 18358 18359 18360 18361 18362 18363 18364 18365 18366 18367 18368 18369 18370 18371 18372 18373 18374 18375 18376 18377 18378 18379 18380 18381 18382 18383 18384 18385 18386 18387 18388 18389 18390 18391 18392 18393 18394 18395 18396 18397 18398 18399 18400 18401 18402 18403 18404 18405 18406 18407 18408 18409 18410 18411 18412 18413 18414 18415 18416 18417 18418 18419 18420 18421 18422 18423 18424 18425 18426 18427 18428 18429 18430 18431 18432 18433 18434 18435 18436 18437 18438 18439 18440 18441 18442 18443 18444 18445 18446 18447 18448 18449 18450 18451 18452 18453 18454 18455 18456 18457 18458 18459 18460 18461 18462 18463 18464 18465 18466 18467 18468 18469 18470 18471 18472 18473 18474 18475 18476 18477 18478 18479 18480 18481 18482 18483 18484 18485 18486 18487 18488 18489 18490 18491 18492 18493 18494 18495 18496 18497 18498 18499 18500 18501 18502 18503 18504 18505 18506 18507 18508 18509 18510 18511 18512 18513 18514 18515 18516 18517 18518 18519 18520 18521 18522 18523 18524 18525 18526 18527 18528 18529 18530 18531 18532 18533 18534 18535 18536 18537 18538 18539 18540 18541 18542 18543 18544 18545 18546 18547 18548 18549 18550 18551 18552 18553 18554 18555 18556 18557 18558 18559 18560 18561 18562 18563 18564 18565 18566 18567 18568 18569 18570 18571 18572 18573 18574 18575 18576 18577 18578 18579 18580 18581 18582 18583 18584 18585 18586 18587 18588 18589 18590 18591 18592 18593 18594 18595 18596 18597 18598 18599 18600 18601 18602 18603 18604 18605 18606 18607 18608 18609 18610 18611 18612 18613 18614 18615 18616 18617 18618 18619 18620 18621 18622 18623 18624 18625 18626 18627 18628 18629 18630 18631 18632 18633 18634 18635 18636 18637 18638 18639 18640 18641 18642 18643 18644 18645 18646 18647 18648 18649 18650 18651 18652 18653 18654 18655 18656 18657 18658 18659 18660 18661 18662 18663 18664 18665 18666 18667 18668 18669 18670 18671 18672 18673 18674 18675 18676 18677 18678 18679 18680 18681 18682 18683 18684 18685 18686 18687 18688 18689 18690 18691 18692 18693 18694 18695 18696 18697 18698 18699 18700 18701 18702 18703 18704 18705 18706 18707 18708 18709 18710 18711 18712 18713 18714 18715 18716 18717 18718 18719 18720 18721 18722 18723 18724 18725 18726 18727 18728 18729 18730 18731 18732 18733 18734 18735 18736 18737 18738 18739 18740 18741 18742 18743 18744 18745 18746 18747 18748 18749 18750 18751 18752 18753 18754 18755 18756 18757 18758 18759 18760 18761 18762 18763 18764 18765 18766 18767 18768 18769 18770 18771 18772 18773 18774 18775 18776 18777 18778 18779 18780 18781 18782 18783 18784 18785 18786 18787 18788 18789 18790 18791 18792 18793 18794 18795 18796 18797 18798 18799 18800 18801 18802 18803 18804 18805 18806 18807 18808 18809 18810 18811 18812 18813 18814 18815 18816 18817 18818 18819 18820 18821 18822 18823 18824 18825 18826 18827 18828 18829 18830 18831 18832 18833 18834 18835 18836 18837 18838 18839 18840 18841 18842 18843 18844 18845 18846 18847 18848 18849 18850 18851 18852 18853 18854 18855 18856 18857 18858 18859 18860 18861 18862 18863 18864 18865 18866 18867 18868 18869 18870 18871 18872 18873 18874 18875 18876 18877 18878 18879 18880 18881 18882 18883 18884 18885 18886 18887 18888 18889 18890 18891 18892 18893 18894 18895 18896 18897 18898 18899 18900 18901 18902 18903 18904 18905 18906 18907 18908 18909 18910 18911 18912 18913 18914 18915 18916 18917 18918 18919 18920 18921 18922 18923 18924 18925 18926 18927 18928 18929 18930 18931 18932 18933 18934 18935 18936 18937 18938 18939 18940 18941 18942 18943 18944 18945 18946 18947 18948 18949 18950 18951 18952 18953 18954 18955 18956 18957 18958 18959 18960 18961 18962 18963 18964 18965 18966 18967 18968 18969 18970 18971 18972 18973 18974 18975 18976 18977 18978 18979 18980 18981 18982 18983 18984 18985 18986 18987 18988 18989 18990 18991 18992 18993 18994 18995 18996 18997 18998 18999 19000 19001 19002 19003 19004 19005 19006 19007 19008 19009 19010 19011 19012 19013 19014 19015 19016 19017 19018 19019 19020 19021 19022 19023 19024 19025 19026 19027 19028 19029 19030 19031 19032 19033 19034 19035 19036 19037 19038 19039 19040 19041 19042 19043 19044 19045 19046 19047 19048 19049 19050 19051 19052 19053 19054 19055 19056 19057 19058 19059 19060 19061 19062 19063 19064 19065 19066 19067 19068 19069 19070 19071 19072 19073 19074 19075 19076 19077 19078 19079 19080 19081 19082 19083 19084 19085 19086 19087 19088 19089 19090 19091 19092 19093 19094 19095 19096 19097 19098 19099 19100 19101 19102 19103 19104 19105 19106 19107 19108 19109 19110 19111 19112 19113 19114 19115 19116 19117 19118 19119 19120 19121 19122 19123 19124 19125 19126 19127 19128 19129 19130 19131 19132 19133 19134 19135 19136 19137 19138 19139 19140 19141 19142 19143 19144 19145 19146 19147 19148 19149 19150 19151 19152 19153 19154 19155 19156 19157 19158 19159 19160 19161 19162 19163 19164 19165 19166 19167 19168 19169 19170 19171 19172 19173 19174 19175 19176 19177 19178 19179 19180 19181 19182 19183 19184 19185 19186 19187 19188 19189 19190 19191 19192 19193 19194 19195 19196 19197 19198 19199 19200 19201 19202 19203 19204 19205 19206 19207 19208 19209 19210 19211 19212 19213 19214 19215 19216 19217 19218 19219 19220 19221 19222 19223 19224 19225 19226 19227 19228 19229 19230 19231 19232 19233 19234 19235 19236 19237 19238 19239 19240 19241 19242 19243 19244 19245 19246 19247 19248 19249 19250 19251 19252 19253 19254 19255 19256 19257 19258 19259 19260 19261 19262 19263 19264 19265 19266 19267 19268 19269 19270 19271 19272 19273 19274 19275 19276 19277 19278 19279 19280 19281 19282 19283 19284 19285 19286 19287 19288 19289 19290 19291 19292 19293 19294 19295 19296 19297 19298 19299 19300 19301 19302 19303 19304 19305 19306 19307 19308 19309 19310 19311 19312 19313 19314 19315 19316 19317 19318 19319 19320 19321 19322 19323 19324 19325 19326 19327 19328 19329 19330 19331 19332 19333 19334 19335 19336 19337 19338 19339 19340 19341 19342 19343 19344 19345 19346 19347 19348 19349 19350 19351 19352 19353 19354 19355 19356 19357 19358 19359 19360 19361 19362 19363 19364 19365 19366 19367 19368 19369 19370 19371 19372 19373 19374 19375 19376 19377 19378 19379 19380 19381 19382 19383 19384 19385 19386 19387 19388 19389 19390 19391 19392 19393 19394 19395 19396 19397 19398 19399 19400 19401 19402 19403 19404 19405 19406 19407 19408 19409 19410 19411 19412 19413 19414 19415 19416 19417 19418 19419 19420 19421 19422 19423 19424 19425 19426 19427 19428 19429 19430 19431 19432 19433 19434 19435 19436 19437 19438 19439 19440 19441 19442 19443 19444 19445 19446 19447 19448 19449 19450 19451 19452 19453 19454 19455 19456 19457 19458 19459 19460 19461 19462 19463 19464 19465 19466 19467 19468 19469 19470 19471 19472 19473 19474 19475 19476 19477 19478 19479 19480 19481 19482 19483 19484 19485 19486 19487 19488 19489 19490 19491 19492 19493 19494 19495 19496 19497 19498 19499 19500 19501 19502 19503 19504 19505 19506 19507 19508 19509 19510 19511 19512 19513 19514 19515 19516 19517 19518 19519 19520 19521 19522 19523 19524 19525 19526 19527 19528 19529 19530 19531 19532 19533 19534 19535 19536 19537 19538 19539 19540 19541 19542 19543 19544 19545 19546 19547 19548 19549 19550 19551 19552 19553 19554 19555 19556 19557 19558 19559 19560 19561 19562 19563 19564 19565 19566 19567 19568 19569 19570 19571 19572 19573 19574 19575 19576 19577 19578 19579 19580 19581 19582 19583 19584 19585 19586 19587 19588 19589 19590 19591 19592 19593 19594 19595 19596 19597 19598 19599 19600 19601 19602 19603 19604 19605 19606 19607 19608 19609 19610 19611 19612 19613 19614 19615 19616 19617 19618 19619 19620 19621 19622 19623 19624 19625 19626 19627 19628 19629 19630 19631 19632 19633 19634 19635 19636 19637 19638 19639 19640 19641 19642 19643 19644 19645 19646 19647 19648 19649 19650 19651 19652 19653 19654 19655 19656 19657 19658 19659 19660 19661 19662 19663 19664 19665 19666 19667 19668 19669 19670 19671 19672 19673 19674 19675 19676 19677 19678 19679 19680 19681 19682 19683 19684 19685 19686 19687 19688 19689 19690 19691 19692 19693 19694 19695 19696 19697 19698 19699 19700 19701 19702 19703 19704 19705 19706 19707 19708 19709 19710 19711 19712 19713 19714 19715 19716 19717 19718 19719 19720 19721 19722 19723 19724 19725 19726 19727 19728 19729 19730 19731 19732 19733 19734 19735 19736 19737 19738 19739 19740 19741 19742 19743 19744 19745 19746 19747 19748 19749 19750 19751 19752 19753 19754 19755 19756 19757 19758 19759 19760 19761 19762 19763 19764 19765 19766 19767 19768 19769 19770 19771 19772 19773 19774 19775 19776 19777 19778 19779 19780 19781 19782 19783 19784 19785 19786 19787 19788 19789 19790 19791 19792 19793 19794 19795 19796 19797 19798 19799 19800 19801 19802 19803 19804 19805 19806 19807 19808 19809 19810 19811 19812 19813 19814 19815 19816 19817 19818 19819 19820 19821 19822 19823 19824 19825 19826 19827 19828 19829 19830 19831 19832 19833 19834 19835 19836 19837 19838 19839 19840 19841 19842 19843 19844 19845 19846 19847 19848 19849 19850 19851 19852 19853 19854 19855 19856 19857 19858 19859 19860 19861 19862 19863 19864 19865 19866 19867 19868 19869 19870 19871 19872 19873 19874 19875 19876 19877 19878 19879 19880 19881 19882 19883 19884 19885 19886 19887 19888 19889 19890 19891 19892 19893 19894 19895 19896 19897 19898 19899 19900 19901 19902 19903 19904 19905 19906 19907 19908 19909 19910 19911 19912 19913 19914 19915 19916 19917 19918 19919 19920 19921 19922 19923 19924 19925 19926 19927 19928 19929 19930 19931 19932 19933 19934 19935 19936 19937 19938 19939 19940 19941 19942 19943 19944 19945 19946 19947 19948 19949 19950 19951 19952 19953 19954 19955 19956 19957 19958 19959 19960 19961 19962 19963 19964 19965 19966 19967 19968 19969 19970 19971 19972 19973 19974 19975 19976 19977 19978 19979 19980 19981 19982 19983 19984 19985 19986 19987 19988 19989 19990 19991 19992 19993 19994 19995 19996 19997 19998 19999 20000 20001 20002 20003 20004 20005 20006 20007 20008 20009 20010 20011 20012 20013 20014 20015 20016 20017 20018 20019 20020 20021 20022 20023 20024 20025 20026 20027 20028 20029 20030 20031 20032 20033 20034 20035 20036 20037 20038 20039 20040 20041 20042 20043 20044 20045 20046 20047 20048 20049 20050 20051 20052 20053 20054 20055 20056 20057 20058 20059 20060 20061 20062 20063 20064 20065 20066 20067 20068 20069 20070 20071 20072 20073 20074 20075 20076 20077 20078 20079 20080 20081 20082 20083 20084 20085 20086 20087 20088 20089 20090 20091 20092 20093 20094 20095 20096 20097 20098 20099 20100 20101 20102 20103 20104 20105 20106 20107 20108 20109 20110 20111 20112 20113 20114 20115 20116 20117 20118 20119 20120 20121 20122 20123 20124 20125 20126 20127 20128 20129 20130 20131 20132 20133 20134 20135 20136 20137 20138 20139 20140 20141 20142 20143 20144 20145 20146 20147 20148 20149 20150 20151 20152 20153 20154 20155 20156 20157 20158 20159 20160 20161 20162 20163 20164 20165 20166 20167 20168 20169 20170 20171 20172 20173 20174 20175 20176 20177 20178 20179 20180 20181 20182 20183 20184 20185 20186 20187 20188 20189 20190 20191 20192 20193 20194 20195 20196 20197 20198 20199 20200 20201 20202 20203 20204 20205 20206 20207 20208 20209 20210 20211 20212 20213 20214 20215 20216 20217 20218 20219 20220 20221 20222 20223 20224 20225 20226 20227 20228 20229 20230 20231 20232 20233 20234 20235 20236 20237 20238 20239 20240 20241 20242 20243 20244 20245 20246 20247 20248 20249 20250 20251 20252 20253 20254 20255 20256 20257 20258 20259 20260 20261 20262 20263 20264 20265 20266 20267 20268 20269 20270 20271 20272 20273 20274 20275 20276 20277 20278 20279 20280 20281 20282 20283 20284 20285 20286 20287 20288 20289 20290 20291 20292 20293 20294 20295 20296 20297 20298 20299 20300 20301 20302 20303 20304 20305 20306 20307 20308 20309 20310 20311 20312 20313 20314 20315 20316 20317 20318 20319 20320 20321 20322 20323 20324 20325 20326 20327 20328 20329 20330 20331 20332 20333 20334 20335 20336 20337 20338 20339 20340 20341 20342 20343 20344 20345 20346 20347 20348 20349 20350 20351 20352 20353 20354 20355 20356 20357 20358 20359 20360 20361 20362 20363 20364 20365 20366 20367 20368 20369 20370 20371 20372 20373 20374 20375 20376 20377 20378 20379 20380 20381 20382 20383 20384 20385 20386 20387 20388 20389 20390 20391 20392 20393 20394 20395 20396 20397 20398 20399 20400 20401 20402 20403 20404 20405 20406 20407 20408 20409 20410 20411 20412 20413 20414 20415 20416 20417 20418 20419 20420 20421 20422 20423 20424 20425 20426 20427 20428 20429 20430 20431 20432 20433 20434 20435 20436 20437 20438 20439 20440 20441 20442 20443 20444 20445 20446 20447 20448 20449 20450 20451 20452 20453 20454 20455 20456 20457 20458 20459 20460 20461 20462 20463 20464 20465 20466 20467 20468 20469 20470 20471 20472 20473 20474 20475 20476 20477 20478 20479 20480 20481 20482 20483 20484 20485 20486 20487 20488 20489 20490 20491 20492 20493 20494 20495 20496 20497 20498 20499 20500 20501 20502 20503 20504 20505 20506 20507 20508 20509 20510 20511 20512 20513 20514 20515 20516 20517 20518 20519 20520 20521 20522 20523 20524 20525 20526 20527 20528 20529 20530 20531 20532 20533 20534 20535 20536 20537 20538 20539 20540 20541 20542 20543 20544 20545 20546 20547 20548 20549 20550 20551 20552 20553 20554 20555 20556 20557 20558 20559 20560 20561 20562 20563 20564 20565 20566 20567 20568 20569 20570 20571 20572 20573 20574 20575 20576 20577 20578 20579 20580 20581 20582 20583 20584 20585 20586 20587 20588 20589 20590 20591 20592 20593 20594 20595 20596 20597 20598 20599 20600 20601 20602 20603 20604 20605 20606 20607 20608 20609 20610 20611 20612 20613 20614 20615 20616 20617 20618 20619 20620 20621 20622 20623 20624 20625 20626 20627 20628 20629 20630 20631 20632 20633 20634 20635 20636 20637 20638 20639 20640 20641 20642 20643 20644 20645 20646 20647 20648 20649 20650 20651 20652 20653 20654 20655 20656 20657 20658 20659 20660 20661 20662 20663 20664 20665 20666 20667 20668 20669 20670 20671 20672 20673 20674 20675 20676 20677 20678 20679 20680 20681 20682 20683 20684 20685 20686 20687 20688 20689 20690 20691 20692 20693 20694 20695 20696 20697 20698 20699 20700 20701 20702 20703 20704 20705 20706 20707 20708 20709 20710 20711 20712 20713 20714 20715 20716 20717 20718 20719 20720 20721 20722 20723 20724 20725 20726 20727 20728 20729 20730 20731 20732 20733 20734 20735 20736 20737 20738 20739 20740 20741 20742 20743 20744 20745 20746 20747 20748 20749 20750 20751 20752 20753 20754 20755 20756 20757 20758 20759 20760 20761 20762 20763 20764 20765 20766 20767 20768 20769 20770 20771 20772 20773 20774 20775 20776 20777 20778 20779 20780 20781 20782 20783 20784 20785 20786 20787 20788 20789 20790 20791 20792 20793 20794 20795 20796 20797 20798 20799 20800 20801 20802 20803 20804 20805 20806 20807 20808 20809 20810 20811 20812 20813 20814 20815 20816 20817 20818 20819 20820 20821 20822 20823 20824 20825 20826 20827 20828 20829 20830 20831 20832 20833 20834 20835 20836 20837 20838 20839 20840 20841 20842 20843 20844 20845 20846 20847 20848 20849 20850 20851 20852 20853 20854 20855 20856 20857 20858 20859 20860 20861 20862 20863 20864 20865 20866 20867 20868 20869 20870 20871 20872 20873 20874 20875 20876 20877 20878 20879 20880 20881 20882 20883 20884 20885 20886 20887 20888 20889 20890 20891 20892 20893 20894 20895 20896 20897 20898 20899 20900 20901 20902 20903 20904 20905 20906 20907 20908 20909 20910 20911 20912 20913 20914 20915 20916 20917 20918 20919 20920 20921 20922 20923 20924 20925 20926 20927 20928 20929 20930 20931 20932 20933 20934 20935 20936 20937 20938 20939 20940 20941 20942 20943 20944 20945 20946 20947 20948 20949 20950 20951 20952 20953 20954 20955 20956 20957 20958 20959 20960 20961 20962 20963 20964 20965 20966 20967 20968 20969 20970 20971 20972 20973 20974 20975 20976 20977 20978 20979 20980 20981 20982 20983 20984 20985 20986 20987 20988 20989 20990 20991 20992 20993 20994 20995 20996 20997 20998 20999 21000 21001 21002 21003 21004 21005 21006 21007 21008 21009 21010 21011 21012 21013 21014 21015 21016 21017 21018 21019 21020 21021 21022 21023 21024 21025 21026 21027 21028 21029 21030 21031 21032 21033 21034 21035 21036 21037 21038 21039 21040 21041 21042 21043 21044 21045 21046 21047 21048 21049 21050 21051 21052 21053 21054 21055 21056 21057 21058 21059 21060 21061 21062 21063 21064 21065 21066 21067 21068 21069 21070 21071 21072 21073 21074 21075 21076 21077 21078 21079 21080 21081 21082 21083 21084 21085 21086 21087 21088 21089 21090 21091 21092 21093 21094 21095 21096 21097 21098 21099 21100 21101 21102 21103 21104 21105 21106 21107 21108 21109 21110 21111 21112 21113 21114 21115 21116 21117 21118 21119 21120 21121 21122 21123 21124 21125 21126 21127 21128 21129 21130 21131 21132 21133 21134 21135 21136 21137 21138 21139 21140 21141 21142 21143 21144 21145 21146 21147 21148 21149 21150 21151 21152 21153 21154 21155 21156 21157 21158 21159 21160 21161 21162 21163 21164 21165 21166 21167 21168 21169 21170 21171 21172 21173 21174 21175 21176 21177 21178 21179 21180 21181 21182 21183 21184 21185 21186 21187 21188 21189 21190 21191 21192 21193 21194 21195 21196 21197 21198 21199 21200 21201 21202 21203 21204 21205 21206 21207 21208 21209 21210 21211 21212 21213 21214 21215 21216 21217 21218 21219 21220 21221 21222 21223 21224 21225 21226 21227 21228 21229 21230 21231 21232 21233 21234 21235 21236 21237 21238 21239 21240 21241 21242 21243 21244 21245 21246 21247 21248 21249 21250 21251 21252 21253 21254 21255 21256 21257 21258 21259 21260 21261 21262 21263 21264 21265 21266 21267 21268 21269 21270 21271 21272 21273 21274 21275 21276 21277 21278 21279 21280 21281 21282 21283 21284 21285 21286 21287 21288 21289 21290 21291 21292 21293 21294 21295 21296 21297 21298 21299 21300 21301 21302 21303 21304 21305 21306 21307 21308 21309 21310 21311 21312 21313 21314 21315 21316 21317 21318 21319 21320 21321 21322 21323 21324 21325 21326 21327 21328 21329 21330 21331 21332 21333 21334 21335 21336 21337 21338 21339 21340 21341 21342 21343 21344 21345 21346 21347 21348 21349 21350 21351 21352 21353 21354 21355 21356 21357 21358 21359 21360 21361 21362 21363 21364 21365 21366 21367 21368 21369 21370 21371 21372 21373 21374 21375 21376 21377 21378 21379 21380 21381 21382 21383 21384 21385 21386 21387 21388 21389 21390 21391 21392 21393 21394 21395 21396 21397 21398 21399 21400 21401 21402 21403 21404 21405 21406 21407 21408 21409 21410 21411 21412 21413 21414 21415 21416 21417 21418 21419 21420 21421 21422 21423 21424 21425 21426 21427 21428 21429 21430 21431 21432 21433 21434 21435 21436 21437 21438 21439 21440 21441 21442 21443 21444 21445 21446 21447 21448 21449 21450 21451 21452 21453 21454 21455 21456 21457 21458 21459 21460 21461 21462 21463 21464 21465 21466 21467 21468 21469 21470 21471 21472 21473 21474 21475 21476 21477 21478 21479 21480 21481 21482 21483 21484 21485 21486 21487 21488 21489 21490 21491 21492 21493 21494 21495 21496 21497 21498 21499 21500 21501 21502 21503 21504 21505 21506 21507 21508 21509 21510 21511 21512 21513 21514 21515 21516 21517 21518 21519 21520 21521 21522 21523 21524 21525 21526 21527 21528 21529 21530 21531 21532 21533 21534 21535 21536 21537 21538 21539 21540 21541 21542 21543 21544 21545 21546 21547 21548 21549 21550 21551 21552 21553 21554 21555 21556 21557 21558 21559 21560 21561 21562 21563 21564 21565 21566 21567 21568 21569 21570 21571 21572 21573 21574 21575 21576 21577 21578 21579 21580 21581 21582 21583 21584 21585 21586 21587 21588 21589 21590 21591 21592 21593 21594 21595 21596 21597 21598 21599 21600 21601 21602 21603 21604 21605 21606 21607 21608 21609 21610 21611 21612 21613 21614 21615 21616 21617 21618 21619 21620 21621 21622 21623 21624 21625 21626 21627 21628 21629 21630 21631 21632 21633 21634 21635 21636 21637 21638 21639 21640 21641 21642 21643 21644 21645 21646 21647 21648 21649 21650 21651 21652 21653 21654 21655 21656 21657 21658 21659 21660 21661 21662 21663 21664 21665 21666 21667 21668 21669 21670 21671 21672 21673 21674 21675 21676 21677 21678 21679 21680 21681 21682 21683 21684 21685 21686 21687 21688 21689 21690 21691 21692 21693 21694 21695 21696 21697 21698 21699 21700 21701 21702 21703 21704 21705 21706 21707 21708 21709 21710 21711 21712 21713 21714 21715 21716 21717 21718 21719 21720 21721 21722 21723 21724 21725 21726 21727 21728 21729 21730 21731 21732 21733 21734 21735 21736 21737 21738 21739 21740 21741 21742 21743 21744 21745 21746 21747 21748 21749 21750 21751 21752 21753 21754 21755 21756 21757 21758 21759 21760 21761 21762 21763 21764 21765 21766 21767 21768 21769 21770 21771 21772 21773 21774 21775 21776 21777 21778 21779 21780 21781 21782 21783 21784 21785 21786 21787 21788 21789 21790 21791 21792 21793 21794 21795 21796 21797 21798 21799 21800 21801 21802 21803 21804 21805 21806 21807 21808 21809 21810 21811 21812 21813 21814 21815 21816 21817 21818 21819 21820 21821 21822 21823 21824 21825 21826 21827 21828 21829 21830 21831 21832 21833 21834 21835 21836 21837 21838 21839 21840 21841 21842 21843 21844 21845 21846 21847 21848 21849 21850 21851 21852 21853 21854 21855 21856 21857 21858 21859 21860 21861 21862 21863 21864 21865 21866 21867 21868 21869 21870 21871 21872 21873 21874 21875 21876 21877 21878 21879 21880 21881 21882 21883 21884 21885 21886 21887 21888 21889 21890 21891 21892 21893 21894 21895 21896 21897 21898 21899 21900 21901 21902 21903 21904 21905 21906 21907 21908 21909 21910 21911 21912 21913 21914 21915 21916 21917 21918 21919 21920 21921 21922 21923 21924 21925 21926 21927 21928 21929 21930 21931 21932 21933 21934 21935 21936 21937 21938 21939 21940 21941 21942 21943 21944 21945 21946 21947 21948 21949 21950 21951 21952 21953 21954 21955 21956 21957 21958 21959 21960 21961 21962 21963 21964 21965 21966 21967 21968 21969 21970 21971 21972 21973 21974 21975 21976 21977 21978 21979 21980 21981 21982 21983 21984 21985 21986 21987 21988 21989 21990 21991 21992 21993 21994 21995 21996 21997 21998 21999 22000 22001 22002 22003 22004 22005 22006 22007 22008 22009 22010 22011 22012 22013 22014 22015 22016 22017 22018 22019 22020 22021 22022 22023 22024 22025 22026 22027 22028 22029 22030 22031 22032 22033 22034 22035 22036 22037 22038 22039 22040 22041 22042 22043 22044 22045 22046 22047 22048 22049 22050 22051 22052 22053 22054 22055 22056 22057 22058 22059 22060 22061 22062 22063 22064 22065 22066 22067 22068 22069 22070 22071 22072 22073 22074 22075 22076 22077 22078 22079 22080 22081 22082 22083 22084 22085 22086 22087 22088 22089 22090 22091 22092 22093 22094 22095 22096 22097 22098 22099 22100 22101 22102 22103 22104 22105 22106 22107 22108 22109 22110 22111 22112 22113 22114 22115 22116 22117 22118 22119 22120 22121 22122 22123 22124 22125 22126 22127 22128 22129 22130 22131 22132 22133 22134 22135 22136 22137 22138 22139 22140 22141 22142 22143 22144 22145 22146 22147 22148 22149 22150 22151 22152 22153 22154 22155 22156 22157 22158 22159 22160 22161 22162 22163 22164 22165 22166 22167 22168 22169 22170 22171 22172 22173 22174 22175 22176 22177 22178 22179 22180 22181 22182 22183 22184 22185 22186 22187 22188 22189 22190 22191 22192 22193 22194 22195 22196 22197 22198 22199 22200 22201 22202 22203 22204 22205 22206 22207 22208 22209 22210 22211 22212 22213 22214 22215 22216 22217 22218 22219 22220 22221 22222 22223 22224 22225 22226 22227 22228 22229 22230 22231 22232 22233 22234 22235 22236 22237 22238 22239 22240 22241 22242 22243 22244 22245 22246 22247 22248 22249 22250 22251 22252 22253 22254 22255 22256 22257 22258 22259 22260 22261 22262 22263 22264 22265 22266 22267 22268 22269 22270 22271 22272 22273 22274 22275 22276 22277 22278 22279 22280 22281 22282 22283 22284 22285 22286 22287 22288 22289 22290 22291 22292 22293 22294 22295 22296 22297 22298 22299 22300 22301 22302 22303 22304 22305 22306 22307 22308 22309 22310 22311 22312 22313 22314 22315 22316 22317 22318 22319 22320 22321 22322 22323 22324 22325 22326 22327 22328 22329 22330 22331 22332 22333 22334 22335 22336 22337 22338 22339 22340 22341 22342 22343 22344 22345 22346 22347 22348 22349 22350 22351 22352 22353 22354 22355 22356 22357 22358 22359 22360 22361 22362 22363 22364 22365 22366 22367 22368 22369 22370 22371 22372 22373 22374 22375 22376 22377 22378 22379 22380 22381 22382 22383 22384 22385 22386 22387 22388 22389 22390 22391 22392 22393 22394 22395 22396 22397 22398 22399 22400 22401 22402 22403 22404 22405 22406 22407 22408 22409 22410 22411 22412 22413 22414 22415 22416 22417 22418 22419 22420 22421 22422 22423 22424 22425 22426 22427 22428 22429 22430 22431 22432 22433 22434 22435 22436 22437 22438 22439 22440 22441 22442 22443 22444 22445 22446 22447 22448 22449 22450 22451 22452 22453 22454 22455 22456 22457 22458 22459 22460 22461 22462 22463 22464 22465 22466 22467 22468 22469 22470 22471 22472 22473 22474 22475 22476 22477 22478 22479 22480 22481 22482 22483 22484 22485 22486 22487 22488 22489 22490 22491 22492 22493 22494 22495 22496 22497 22498 22499 22500 22501 22502 22503 22504 22505 22506 22507 22508 22509 22510 22511 22512 22513 22514 22515 22516 22517 22518 22519 22520 22521 22522 22523 22524 22525 22526 22527 22528 22529 22530 22531 22532 22533 22534 22535 22536 22537 22538 22539 22540 22541 22542 22543 22544 22545 22546 22547 22548 22549 22550 22551 22552 22553 22554 22555 22556 22557 22558 22559 22560 22561 22562 22563 22564 22565 22566 22567 22568 22569 22570 22571 22572 22573 22574 22575 22576 22577 22578 22579 22580 22581 22582 22583 22584 22585 22586 22587 22588 22589 22590 22591 22592 22593 22594 22595 22596 22597 22598 22599 22600 22601 22602 22603 22604 22605 22606 22607 22608 22609 22610 22611 22612 22613 22614 22615 22616 22617 22618 22619 22620 22621 22622 22623 22624 22625 22626 22627 22628 22629 22630 22631 22632 22633 22634 22635 22636 22637 22638 22639 22640 22641 22642 22643 22644 22645 22646 22647 22648 22649 22650 22651 22652 22653 22654 22655 22656 22657 22658 22659 22660 22661 22662 22663 22664 22665 22666 22667 22668 22669 22670 22671 22672 22673 22674 22675 22676 22677 22678 22679 22680 22681 22682 22683 22684 22685 22686 22687 22688 22689 22690 22691 22692 22693 22694 22695 22696 22697 22698 22699 22700 22701 22702 22703 22704 22705 22706 22707 22708 22709 22710 22711 22712 22713 22714 22715 22716 22717 22718 22719 22720 22721 22722 22723 22724 22725 22726 22727 22728 22729 22730 22731 22732 22733 22734 22735 22736 22737 22738 22739 22740 22741 22742 22743 22744 22745 22746 22747 22748 22749 22750 22751 22752 22753 22754 22755 22756 22757 22758 22759 22760 22761 22762 22763 22764 22765 22766 22767 22768 22769 22770 22771 22772 22773 22774 22775 22776 22777 22778 22779 22780 22781 22782 22783 22784 22785 22786 22787 22788 22789 22790 22791 22792 22793 22794 22795 22796 22797 22798 22799 22800 22801 22802 22803 22804 22805 22806 22807 22808 22809 22810 22811 22812 22813 22814 22815 22816 22817 22818 22819 22820 22821 22822 22823 22824 22825 22826 22827 22828 22829 22830 22831 22832 22833 22834 22835 22836 22837 22838 22839 22840 22841 22842 22843 22844 22845 22846 22847 22848 22849 22850 22851 22852 22853 22854 22855 22856 22857 22858 22859 22860 22861 22862 22863 22864 22865 22866 22867 22868 22869 22870 22871 22872 22873 22874 22875 22876 22877 22878 22879 22880 22881 22882 22883 22884 22885 22886 22887 22888 22889 22890 22891 22892 22893 22894 22895 22896 22897 22898 22899 22900 22901 22902 22903 22904 22905 22906 22907 22908 22909 22910 22911 22912 22913 22914 22915 22916 22917 22918 22919 22920 22921 22922 22923 22924 22925 22926 22927 22928 22929 22930 22931 22932 22933 22934 22935 22936 22937 22938 22939 22940 22941 22942 22943 22944 22945 22946 22947 22948 22949 22950 22951 22952 22953 22954 22955 22956 22957 22958 22959 22960 22961 22962 22963 22964 22965 22966 22967 22968 22969 22970 22971 22972 22973 22974 22975 22976 22977 22978 22979 22980 22981 22982 22983 22984 22985 22986 22987 22988 22989 22990 22991 22992 22993 22994 22995 22996 22997 22998 22999 23000 23001 23002 23003 23004 23005 23006 23007 23008 23009 23010 23011 23012 23013 23014 23015 23016 23017 23018 23019 23020 23021 23022 23023 23024 23025 23026 23027 23028 23029 23030 23031 23032 23033 23034 23035 23036 23037 23038 23039 23040 23041 23042 23043 23044 23045 23046 23047 23048 23049 23050 23051 23052 23053 23054 23055 23056 23057 23058 23059 23060 23061 23062 23063 23064 23065 23066 23067 23068 23069 23070 23071 23072 23073 23074 23075 23076 23077 23078 23079 23080 23081 23082 23083 23084 23085 23086 23087 23088 23089 23090 23091 23092 23093 23094 23095 23096 23097 23098 23099 23100 23101 23102 23103 23104 23105 23106 23107 23108 23109 23110 23111 23112 23113 23114 23115 23116 23117 23118 23119 23120 23121 23122 23123 23124 23125 23126 23127 23128 23129 23130 23131 23132 23133 23134 23135 23136 23137 23138 23139 23140 23141 23142 23143 23144 23145 23146 23147 23148 23149 23150 23151 23152 23153 23154 23155 23156 23157 23158 23159 23160 23161 23162 23163 23164 23165 23166 23167 23168 23169 23170 23171 23172 23173 23174 23175 23176 23177 23178 23179 23180 23181 23182 23183 23184 23185 23186 23187 23188 23189 23190 23191 23192 23193 23194 23195 23196 23197 23198 23199 23200 23201 23202 23203 23204 23205 23206 23207 23208 23209 23210 23211 23212 23213 23214 23215 23216 23217 23218 23219 23220 23221 23222 23223 23224 23225 23226 23227 23228 23229 23230 23231 23232 23233 23234 23235 23236 23237 23238 23239 23240 23241 23242 23243 23244 23245 23246 23247 23248 23249 23250 23251 23252 23253 23254 23255 23256 23257 23258 23259 23260 23261 23262 23263 23264 23265 23266 23267 23268 23269 23270 23271 23272 23273 23274 23275 23276 23277 23278 23279 23280 23281 23282 23283 23284 23285 23286 23287 23288 23289 23290 23291 23292 23293 23294 23295 23296 23297 23298 23299 23300 23301 23302 23303 23304 23305 23306 23307 23308 23309 23310 23311 23312 23313 23314 23315 23316 23317 23318 23319 23320 23321 23322 23323 23324 23325 23326 23327 23328 23329 23330 23331 23332 23333 23334 23335 23336 23337 23338 23339 23340 23341 23342 23343 23344 23345 23346 23347 23348 23349 23350 23351 23352 23353 23354 23355 23356 23357 23358 23359 23360 23361 23362 23363 23364 23365 23366 23367 23368 23369 23370 23371 23372 23373 23374 23375 23376 23377 23378 23379 23380 23381 23382 23383 23384 23385 23386 23387 23388 23389 23390 23391 23392 23393 23394 23395 23396 23397 23398 23399 23400 23401 23402 23403 23404 23405 23406 23407 23408 23409 23410 23411 23412 23413 23414 23415 23416 23417 23418 23419 23420 23421 23422 23423 23424 23425 23426 23427 23428 23429 23430 23431 23432 23433 23434 23435 23436 23437 23438 23439 23440 23441 23442 23443 23444 23445 23446 23447 23448 23449 23450 23451 23452 23453 23454 23455 23456 23457 23458 23459 23460 23461 23462 23463 23464 23465 23466 23467 23468 23469 23470 23471 23472 23473 23474 23475 23476 23477 23478 23479 23480 23481 23482 23483 23484 23485 23486 23487 23488 23489 23490 23491 23492 23493 23494 23495 23496 23497 23498 23499 23500 23501 23502 23503 23504 23505 23506 23507 23508 23509 23510 23511 23512 23513 23514 23515 23516 23517 23518 23519 23520 23521 23522 23523 23524 23525 23526 23527 23528 23529 23530 23531 23532 23533 23534 23535 23536 23537 23538 23539 23540 23541 23542 23543 23544 23545 23546 23547 23548 23549 23550 23551 23552 23553 23554 23555 23556 23557 23558 23559 23560 23561 23562 23563 23564 23565 23566 23567 23568 23569 23570 23571 23572 23573 23574 23575 23576 23577 23578 23579 23580 23581 23582 23583 23584 23585 23586 23587 23588 23589 23590 23591 23592 23593 23594 23595 23596 23597 23598 23599 23600 23601 23602 23603 23604 23605 23606 23607 23608 23609 23610 23611 23612 23613 23614 23615 23616 23617 23618 23619 23620 23621 23622 23623 23624 23625 23626 23627 23628 23629 23630 23631 23632 23633 23634 23635 23636 23637 23638 23639 23640 23641 23642 23643 23644 23645 23646 23647 23648 23649 23650 23651 23652 23653 23654 23655 23656 23657 23658 23659 23660 23661 23662 23663 23664 23665 23666 23667 23668 23669 23670 23671 23672 23673 23674 23675 23676 23677 23678 23679 23680 23681 23682 23683 23684 23685 23686 23687 23688 23689 23690 23691 23692 23693 23694 23695 23696 23697 23698 23699 23700 23701 23702 23703 23704 23705 23706 23707 23708 23709 23710 23711 23712 23713 23714 23715 23716 23717 23718 23719 23720 23721 23722 23723 23724 23725 23726 23727 23728 23729 23730 23731 23732 23733 23734 23735 23736 23737 23738 23739 23740 23741 23742 23743 23744 23745 23746 23747 23748 23749 23750 23751 23752 23753 23754 23755 23756 23757 23758 23759 23760 23761 23762 23763 23764 23765 23766 23767 23768 23769 23770 23771 23772 23773 23774 23775 23776 23777 23778 23779 23780 23781 23782 23783 23784 23785 23786 23787 23788 23789 23790 23791 23792 23793 23794 23795 23796 23797 23798 23799 23800 23801 23802 23803 23804 23805 23806 23807 23808 23809 23810 23811 23812 23813 23814 23815 23816 23817 23818 23819 23820 23821 23822 23823 23824 23825 23826 23827 23828 23829 23830 23831 23832 23833 23834 23835 23836 23837 23838 23839 23840 23841 23842 23843 23844 23845 23846 23847 23848 23849 23850 23851 23852 23853 23854 23855 23856 23857 23858 23859 23860 23861 23862 23863 23864 23865 23866 23867 23868 23869 23870 23871 23872 23873 23874 23875 23876 23877 23878 23879 23880 23881 23882 23883 23884 23885 23886 23887 23888 23889 23890 23891 23892 23893 23894 23895 23896 23897 23898 23899 23900 23901 23902 23903 23904 23905 23906 23907 23908 23909 23910 23911 23912 23913 23914 23915 23916 23917 23918 23919 23920 23921 23922 23923 23924 23925 23926 23927 23928 23929 23930 23931 23932 23933 23934 23935 23936 23937 23938 23939 23940 23941 23942 23943 23944 23945 23946 23947 23948 23949 23950 23951 23952 23953 23954 23955 23956 23957 23958 23959 23960 23961 23962 23963 23964 23965 23966 23967 23968 23969 23970 23971 23972 23973 23974 23975 23976 23977 23978 23979 23980 23981 23982 23983 23984 23985 23986 23987 23988 23989 23990 23991 23992 23993 23994 23995 23996 23997 23998 23999 24000 24001 24002 24003 24004 24005 24006 24007 24008 24009 24010 24011 24012 24013 24014 24015 24016 24017 24018 24019 24020 24021 24022 24023 24024 24025 24026 24027 24028 24029 24030 24031 24032 24033 24034 24035 24036 24037 24038 24039 24040 24041 24042 24043 24044 24045 24046 24047 24048 24049 24050 24051 24052 24053 24054 24055 24056 24057 24058 24059 24060 24061 24062 24063 24064 24065 24066 24067 24068 24069 24070 24071 24072 24073 24074 24075 24076 24077 24078 24079 24080 24081 24082 24083 24084 24085 24086 24087 24088 24089 24090 24091 24092 24093 24094 24095 24096 24097 24098 24099 24100 24101 24102 24103 24104 24105 24106 24107 24108 24109 24110 24111 24112 24113 24114 24115 24116 24117 24118 24119 24120 24121 24122 24123 24124 24125 24126 24127 24128 24129 24130 24131 24132 24133 24134 24135 24136 24137 24138 24139 24140 24141 24142 24143 24144 24145 24146 24147 24148 24149 24150 24151 24152 24153 24154 24155 24156 24157 24158 24159 24160 24161 24162 24163 24164 24165 24166 24167 24168 24169 24170 24171 24172 24173 24174 24175 24176 24177 24178 24179 24180 24181 24182 24183 24184 24185 24186 24187 24188 24189 24190 24191 24192 24193 24194 24195 24196 24197 24198 24199 24200 24201 24202 24203 24204 24205 24206 24207 24208 24209 24210 24211 24212 24213 24214 24215 24216 24217 24218 24219 24220 24221 24222 24223 24224 24225 24226 24227 24228 24229 24230 24231 24232 24233 24234 24235 24236 24237 24238 24239 24240 24241 24242 24243 24244 24245 24246 24247 24248 24249 24250 24251 24252 24253 24254 24255 24256 24257 24258 24259 24260 24261 24262 24263 24264 24265 24266 24267 24268 24269 24270 24271 24272 24273 24274 24275 24276 24277 24278 24279 24280 24281 24282 24283 24284 24285 24286 24287 24288 24289 24290 24291 24292 24293 24294 24295 24296 24297 24298 24299 24300 24301 24302 24303 24304 24305 24306 24307 24308 24309 24310 24311 24312 24313 24314 24315 24316 24317 24318 24319 24320 24321 24322 24323 24324 24325 24326 24327 24328 24329 24330 24331 24332 24333 24334 24335 24336 24337 24338 24339 24340 24341 24342 24343 24344 24345 24346 24347 24348 24349 24350 24351 24352 24353 24354 24355 24356 24357 24358 24359 24360 24361 24362 24363 24364 24365 24366 24367 24368 24369 24370 24371 24372 24373 24374 24375 24376 24377 24378 24379 24380 24381 24382 24383 24384 24385 24386 24387 24388 24389 24390 24391 24392 24393 24394 24395 24396 24397 24398 24399 24400 24401 24402 24403 24404 24405 24406 24407 24408 24409 24410 24411 24412 24413 24414 24415 24416 24417 24418 24419 24420 24421 24422 24423 24424 24425 24426 24427 24428 24429 24430 24431 24432 24433 24434 24435 24436 24437 24438 24439 24440 24441 24442 24443 24444 24445 24446 24447 24448 24449 24450 24451 24452 24453 24454 24455 24456 24457 24458 24459 24460 24461 24462 24463 24464 24465 24466 24467 24468 24469 24470 24471 24472 24473 24474 24475 24476 24477 24478 24479 24480 24481 24482 24483 24484 24485 24486 24487 24488 24489 24490 24491 24492 24493 24494 24495 24496 24497 24498 24499 24500 24501 24502 24503 24504 24505 24506 24507 24508 24509 24510 24511 24512 24513 24514 24515 24516 24517 24518 24519 24520 24521 24522 24523 24524 24525 24526 24527 24528 24529 24530 24531 24532 24533 24534 24535 24536 24537 24538 24539 24540 24541 24542 24543 24544 24545 24546 24547 24548 24549 24550 24551 24552 24553 24554 24555 24556 24557 24558 24559 24560 24561 24562 24563 24564 24565 24566 24567 24568 24569 24570 24571 24572 24573 24574 24575 24576 24577 24578 24579 24580 24581 24582 24583 24584 24585 24586 24587 24588 24589 24590 24591 24592 24593 24594 24595 24596 24597 24598 24599 24600 24601 24602 24603 24604 24605 24606 24607 24608 24609 24610 24611 24612 24613 24614 24615 24616 24617 24618 24619 24620 24621 24622 24623 24624 24625 24626 24627 24628 24629 24630 24631 24632 24633 24634 24635 24636 24637 24638 24639 24640 24641 24642 24643 24644 24645 24646 24647 24648 24649 24650 24651 24652 24653 24654 24655 24656 24657 24658 24659 24660 24661 24662 24663 24664 24665 24666 24667 24668 24669 24670 24671 24672 24673 24674 24675 24676 24677 24678 24679 24680 24681 24682 24683 24684 24685 24686 24687 24688 24689 24690 24691 24692 24693 24694 24695 24696 24697 24698 24699 24700 24701 24702 24703 24704 24705 24706 24707 24708 24709 24710 24711 24712 24713 24714 24715 24716 24717 24718 24719 24720 24721 24722 24723 24724 24725 24726 24727 24728 24729 24730 24731 24732 24733 24734 24735 24736 24737 24738 24739 24740 24741 24742 24743 24744 24745 24746 24747 24748 24749 24750 24751 24752 24753 24754 24755 24756 24757 24758 24759 24760 24761 24762 24763 24764 24765 24766 24767 24768 24769 24770 24771 24772 24773 24774 24775 24776 24777 24778 24779 24780 24781 24782 24783 24784 24785 24786 24787 24788 24789 24790 24791 24792 24793 24794 24795 24796 24797 24798 24799 24800 24801 24802 24803 24804 24805 24806 24807 24808 24809 24810 24811 24812 24813 24814 24815 24816 24817 24818 24819 24820 24821 24822 24823 24824 24825 24826 24827 24828 24829 24830 24831 24832 24833 24834 24835 24836 24837 24838 24839 24840 24841 24842 24843 24844 24845 24846 24847 24848 24849 24850 24851 24852 24853 24854 24855 24856 24857 24858 24859 24860 24861 24862 24863 24864 24865 24866 24867 24868 24869 24870 24871 24872 24873 24874 24875 24876 24877 24878 24879 24880 24881 24882 24883 24884 24885 24886 24887 24888 24889 24890 24891 24892 24893 24894 24895 24896 24897 24898 24899 24900 24901 24902 24903 24904 24905 24906 24907 24908 24909 24910 24911 24912 24913 24914 24915 24916 24917 24918 24919 24920 24921 24922 24923 24924 24925 24926 24927 24928 24929 24930 24931 24932 24933 24934 24935 24936 24937 24938 24939 24940 24941 24942 24943 24944 24945 24946 24947 24948 24949 24950 24951 24952 24953 24954 24955 24956 24957 24958 24959 24960 24961 24962 24963 24964 24965 24966 24967 24968 24969 24970 24971 24972 24973 24974 24975 24976 24977 24978 24979 24980 24981 24982 24983 24984 24985 24986 24987 24988 24989 24990 24991 24992 24993 24994 24995 24996 24997 24998 24999 25000 25001 25002 25003 25004 25005 25006 25007 25008 25009 25010 25011 25012 25013 25014 25015 25016 25017 25018 25019 25020 25021 25022 25023 25024 25025 25026 25027 25028 25029 25030 25031 25032 25033 25034 25035 25036 25037 25038 25039 25040 25041 25042 25043 25044 25045 25046 25047 25048 25049 25050 25051 25052 25053 25054 25055 25056 25057 25058 25059 25060 25061 25062 25063 25064 25065 25066 25067 25068 25069 25070 25071 25072 25073 25074 25075 25076 25077 25078 25079 25080 25081 25082 25083 25084 25085 25086 25087 25088 25089 25090 25091 25092 25093 25094 25095 25096 25097 25098 25099 25100 25101 25102 25103 25104 25105 25106 25107 25108 25109 25110 25111 25112 25113 25114 25115 25116 25117 25118 25119 25120 25121 25122 25123 25124 25125 25126 25127 25128 25129 25130 25131 25132 25133 25134 25135 25136 25137 25138 25139 25140 25141 25142 25143 25144 25145 25146 25147 25148 25149 25150 25151 25152 25153 25154 25155 25156 25157 25158 25159 25160 25161 25162 25163 25164 25165 25166 25167 25168 25169 25170 25171 25172 25173 25174 25175 25176 25177 25178 25179 25180 25181 25182 25183 25184 25185 25186 25187 25188 25189 25190 25191 25192 25193 25194 25195 25196 25197 25198 25199 25200 25201 25202 25203 25204 25205 25206 25207 25208 25209 25210 25211 25212 25213 25214 25215 25216 25217 25218 25219 25220 25221 25222 25223 25224 25225 25226 25227 25228 25229 25230 25231 25232 25233 25234 25235 25236 25237 25238 25239 25240 25241 25242 25243 25244 25245 25246 25247 25248 25249 25250 25251 25252 25253 25254 25255 25256 25257 25258 25259 25260 25261 25262 25263 25264 25265 25266 25267 25268 25269 25270 25271 25272 25273 25274 25275 25276 25277 25278 25279 25280 25281 25282 25283 25284 25285 25286 25287 25288 25289 25290 25291 25292 25293 25294 25295 25296 25297 25298 25299 25300 25301 25302 25303 25304 25305 25306 25307 25308 25309 25310 25311 25312 25313 25314 25315 25316 25317 25318 25319 25320 25321 25322 25323 25324 25325 25326 25327 25328 25329 25330 25331 25332 25333 25334 25335 25336 25337 25338 25339 25340 25341 25342 25343 25344 25345 25346 25347 25348 25349 25350 25351 25352 25353 25354 25355 25356 25357 25358 25359 25360 25361 25362 25363 25364 25365 25366 25367 25368 25369 25370 25371 25372 25373 25374 25375 25376 25377 25378 25379 25380 25381 25382 25383 25384 25385 25386 25387 25388 25389 25390 25391 25392 25393 25394 25395 25396 25397 25398 25399 25400 25401 25402 25403 25404 25405 25406 25407 25408 25409 25410 25411 25412 25413 25414 25415 25416 25417 25418 25419 25420 25421 25422 25423 25424 25425 25426 25427 25428 25429 25430 25431 25432 25433 25434 25435 25436 25437 25438 25439 25440 25441 25442 25443 25444 25445 25446 25447 25448 25449 25450 25451 25452 25453 25454 25455 25456 25457 25458 25459 25460 25461 25462 25463 25464 25465 25466 25467 25468 25469 25470 25471 25472 25473 25474 25475 25476 25477 25478 25479 25480 25481 25482 25483 25484 25485 25486 25487 25488 25489 25490 25491 25492 25493 25494 25495 25496 25497 25498 25499 25500 25501 25502 25503 25504 25505 25506 25507 25508 25509 25510 25511 25512 25513 25514 25515 25516 25517 25518 25519 25520 25521 25522 25523 25524 25525 25526 25527 25528 25529 25530 25531 25532 25533 25534 25535 25536 25537 25538 25539 25540 25541 25542 25543 25544 25545 25546 25547 25548 25549 25550 25551 25552 25553 25554 25555 25556 25557 25558 25559 25560 25561 25562 25563 25564 25565 25566 25567 25568 25569 25570 25571 25572 25573 25574 25575 25576 25577 25578 25579 25580 25581 25582 25583 25584 25585 25586 25587 25588 25589 25590 25591 25592 25593 25594 25595 25596 25597 25598 25599 25600 25601 25602 25603 25604 25605 25606 25607 25608 25609 25610 25611 25612 25613 25614 25615 25616 25617 25618 25619 25620 25621 25622 25623 25624 25625 25626 25627 25628 25629 25630 25631 25632 25633 25634 25635 25636 25637 25638 25639 25640 25641 25642 25643 25644 25645 25646 25647 25648 25649 25650 25651 25652 25653 25654 25655 25656 25657 25658 25659 25660 25661 25662 25663 25664 25665 25666 25667 25668 25669 25670 25671 25672 25673 25674 25675 25676 25677 25678 25679 25680 25681 25682 25683 25684 25685 25686 25687 25688 25689 25690 25691 25692 25693 25694 25695 25696 25697 25698 25699 25700 25701 25702 25703 25704 25705 25706 25707 25708 25709 25710 25711 25712 25713 25714 25715 25716 25717 25718 25719 25720 25721 25722 25723 25724 25725 25726 25727 25728 25729 25730 25731 25732 25733 25734 25735 25736 25737 25738 25739 25740 25741 25742 25743 25744 25745 25746 25747 25748 25749 25750 25751 25752 25753 25754 25755 25756 25757 25758 25759 25760 25761 25762 25763 25764 25765 25766 25767 25768 25769 25770 25771 25772 25773 25774 25775 25776 25777 25778 25779 25780 25781 25782 25783 25784 25785 25786 25787 25788 25789 25790 25791 25792 25793 25794 25795 25796 25797 25798 25799 25800 25801 25802 25803 25804 25805 25806 25807 25808 25809 25810 25811 25812 25813 25814 25815 25816 25817 25818 25819 25820 25821 25822 25823 25824 25825 25826 25827 25828 25829 25830 25831 25832 25833 25834 25835 25836 25837 25838 25839 25840 25841 25842 25843 25844 25845 25846 25847 25848 25849 25850 25851 25852 25853 25854 25855 25856 25857 25858 25859 25860 25861 25862 25863 25864 25865 25866 25867 25868 25869 25870 25871 25872 25873 25874 25875 25876 25877 25878 25879 25880 25881 25882 25883 25884 25885 25886 25887 25888 25889 25890 25891 25892 25893 25894 25895 25896 25897 25898 25899 25900 25901 25902 25903 25904 25905 25906 25907 25908 25909 25910 25911 25912 25913 25914 25915 25916 25917 25918 25919 25920 25921 25922 25923 25924 25925 25926 25927 25928 25929 25930 25931 25932 25933 25934 25935 25936 25937 25938 25939 25940 25941 25942 25943 25944 25945 25946 25947 25948 25949 25950 25951 25952 25953 25954 25955 25956 25957 25958 25959 25960 25961 25962 25963 25964 25965 25966 25967 25968 25969 25970 25971 25972 25973 25974 25975 25976 25977 25978 25979 25980 25981 25982 25983 25984 25985 25986 25987 25988 25989 25990 25991 25992 25993 25994 25995 25996 25997 25998 25999 26000 26001 26002 26003 26004 26005 26006 26007 26008 26009 26010 26011 26012 26013 26014 26015 26016 26017 26018 26019 26020 26021 26022 26023 26024 26025 26026 26027 26028 26029 26030 26031 26032 26033 26034 26035 26036 26037 26038 26039 26040 26041 26042 26043 26044 26045 26046 26047 26048 26049 26050 26051 26052 26053 26054 26055 26056 26057 26058 26059 26060 26061 26062 26063 26064 26065 26066 26067 26068 26069 26070 26071 26072 26073 26074 26075 26076 26077 26078 26079 26080 26081 26082 26083 26084 26085 26086 26087 26088 26089 26090 26091 26092 26093 26094 26095 26096 26097 26098 26099 26100 26101 26102 26103 26104 26105 26106 26107 26108 26109 26110 26111 26112 26113 26114 26115 26116 26117 26118 26119 26120 26121 26122 26123 26124 26125 26126 26127 26128 26129 26130 26131 26132 26133 26134 26135 26136 26137 26138 26139 26140 26141 26142 26143 26144 26145 26146 26147 26148 26149 26150 26151 26152 26153 26154 26155 26156 26157 26158 26159 26160 26161 26162 26163 26164 26165 26166 26167 26168 26169 26170 26171 26172 26173 26174 26175 26176 26177 26178 26179 26180 26181 26182 26183 26184 26185 26186 26187 26188 26189 26190 26191 26192 26193 26194 26195 26196 26197 26198 26199 26200 26201 26202 26203 26204 26205 26206 26207 26208 26209 26210 26211 26212 26213 26214 26215 26216 26217 26218 26219 26220 26221 26222 26223 26224 26225 26226 26227 26228 26229 26230 26231 26232 26233 26234 26235 26236 26237 26238 26239 26240 26241 26242 26243 26244 26245 26246 26247 26248 26249 26250 26251 26252 26253 26254 26255 26256 26257 26258 26259 26260 26261 26262 26263 26264 26265 26266 26267 26268 26269 26270 26271 26272 26273 26274 26275 26276 26277 26278 26279 26280 26281 26282 26283 26284 26285 26286 26287 26288 26289 26290 26291 26292 26293 26294 26295 26296 26297 26298 26299 26300 26301 26302 26303 26304 26305 26306 26307 26308 26309 26310 26311 26312 26313 26314 26315 26316 26317 26318 26319 26320 26321 26322 26323 26324 26325 26326 26327 26328 26329 26330 26331 26332 26333 26334 26335 26336 26337 26338 26339 26340 26341 26342 26343 26344 26345 26346 26347 26348 26349 26350 26351 26352 26353 26354 26355 26356 26357 26358 26359 26360 26361 26362 26363 26364 26365 26366 26367 26368 26369 26370 26371 26372 26373 26374 26375 26376 26377 26378 26379 26380 26381 26382 26383 26384 26385 26386 26387 26388 26389 26390 26391 26392 26393 26394 26395 26396 26397 26398 26399 26400 26401 26402 26403 26404 26405 26406 26407 26408 26409 26410 26411 26412 26413 26414 26415 26416 26417 26418 26419 26420 26421 26422 26423 26424 26425 26426 26427 26428 26429 26430 26431 26432 26433 26434 26435 26436 26437 26438 26439 26440 26441 26442 26443 26444 26445 26446 26447 26448 26449 26450 26451 26452 26453 26454 26455 26456 26457 26458 26459 26460 26461 26462 26463 26464 26465 26466 26467 26468 26469 26470 26471 26472 26473 26474 26475 26476 26477 26478 26479 26480 26481 26482 26483 26484 26485 26486 26487 26488 26489 26490 26491 26492 26493 26494 26495 26496 26497 26498 26499 26500 26501 26502 26503 26504 26505 26506 26507 26508 26509 26510 26511 26512 26513 26514 26515 26516 26517 26518 26519 26520 26521 26522 26523 26524 26525 26526 26527 26528 26529 26530 26531 26532 26533 26534 26535 26536 26537 26538 26539 26540 26541 26542 26543 26544 26545 26546 26547 26548 26549 26550 26551 26552 26553 26554 26555 26556 26557 26558 26559 26560 26561 26562 26563 26564 26565 26566 26567 26568 26569 26570 26571 26572 26573 26574 26575 26576 26577 26578 26579 26580 26581 26582 26583 26584 26585 26586 26587 26588 26589 26590 26591 26592 26593 26594 26595 26596 26597 26598 26599 26600 26601 26602 26603 26604 26605 26606 26607 26608 26609 26610 26611 26612 26613 26614 26615 26616 26617 26618 26619 26620 26621 26622 26623 26624 26625 26626 26627 26628 26629 26630 26631 26632 26633 26634 26635 26636 26637 26638 26639 26640 26641 26642 26643 26644 26645 26646 26647 26648 26649 26650 26651 26652 26653 26654 26655 26656 26657 26658 26659 26660 26661 26662 26663 26664 26665 26666 26667 26668 26669 26670 26671 26672 26673 26674 26675 26676 26677 26678 26679 26680 26681 26682 26683 26684 26685 26686 26687 26688 26689 26690 26691 26692 26693 26694 26695 26696 26697 26698 26699 26700 26701 26702 26703 26704 26705 26706 26707 26708 26709 26710 26711 26712 26713 26714 26715 26716 26717 26718 26719 26720 26721 26722 26723 26724 26725 26726 26727 26728 26729 26730 26731 26732 26733 26734 26735 26736 26737 26738 26739 26740 26741 26742 26743 26744 26745 26746 26747 26748 26749 26750 26751 26752 26753 26754 26755 26756 26757 26758 26759 26760 26761 26762 26763 26764 26765 26766 26767 26768 26769 26770 26771 26772 26773 26774 26775 26776 26777 26778 26779 26780 26781 26782 26783 26784 26785 26786 26787 26788 26789 26790 26791 26792 26793 26794 26795 26796 26797 26798 26799 26800 26801 26802 26803 26804 26805 26806 26807 26808 26809 26810 26811 26812 26813 26814 26815 26816 26817 26818 26819 26820 26821 26822 26823 26824 26825 26826 26827 26828 26829 26830 26831 26832 26833 26834 26835 26836 26837 26838 26839 26840 26841 26842 26843 26844 26845 26846 26847 26848 26849 26850 26851 26852 26853 26854 26855 26856 26857 26858 26859 26860 26861 26862 26863 26864 26865 26866 26867 26868 26869 26870 26871 26872 26873 26874 26875 26876 26877 26878 26879 26880 26881 26882 26883 26884 26885 26886 26887 26888 26889 26890 26891 26892 26893 26894 26895 26896 26897 26898 26899 26900 26901 26902 26903 26904 26905 26906 26907 26908 26909 26910 26911 26912 26913 26914 26915 26916 26917 26918 26919 26920 26921 26922 26923 26924 26925 26926 26927 26928 26929 26930 26931 26932 26933 26934 26935 26936 26937 26938 26939 26940 26941 26942 26943 26944 26945 26946 26947 26948 26949 26950 26951 26952 26953 26954 26955 26956 26957 26958 26959 26960 26961 26962 26963 26964 26965 26966 26967 26968 26969 26970 26971 26972 26973 26974 26975 26976 26977 26978 26979 26980 26981 26982 26983 26984 26985 26986 26987 26988 26989 26990 26991 26992 26993 26994 26995 26996 26997 26998 26999 27000 27001 27002 27003 27004 27005 27006 27007 27008 27009 27010 27011 27012 27013 27014 27015 27016 27017 27018 27019 27020 27021 27022 27023 27024 27025 27026 27027 27028 27029 27030 27031 27032 27033 27034 27035 27036 27037 27038 27039 27040 27041 27042 27043 27044 27045 27046 27047 27048 27049 27050 27051 27052 27053 27054 27055 27056 27057 27058 27059 27060 27061 27062 27063 27064 27065 27066 27067 27068 27069 27070 27071 27072 27073 27074 27075 27076 27077 27078 27079 27080 27081 27082 27083 27084 27085 27086 27087 27088 27089 27090 27091 27092 27093 27094 27095 27096 27097 27098 27099 27100 27101 27102 27103 27104 27105 27106 27107 27108 27109 27110 27111 27112 27113 27114 27115 27116 27117 27118 27119 27120 27121 27122 27123 27124 27125 27126 27127 27128 27129 27130 27131 27132 27133 27134 27135 27136 27137 27138 27139 27140 27141 27142 27143 27144 27145 27146 27147 27148 27149 27150 27151 27152 27153 27154 27155 27156 27157 27158 27159 27160 27161 27162 27163 27164 27165 27166 27167 27168 27169 27170 27171 27172 27173 27174 27175 27176 27177 27178 27179 27180 27181 27182 27183 27184 27185 27186 27187 27188 27189 27190 27191 27192 27193 27194 27195 27196 27197 27198 27199 27200 27201 27202 27203 27204 27205 27206 27207 27208 27209 27210 27211 27212 27213 27214 27215 27216 27217 27218 27219 27220 27221 27222 27223 27224 27225 27226 27227 27228 27229 27230 27231 27232 27233 27234 27235 27236 27237 27238 27239 27240 27241 27242 27243 27244 27245 27246 27247 27248 27249 27250 27251 27252 27253 27254 27255 27256 27257 27258 27259 27260 27261 27262 27263 27264 27265 27266 27267 27268 27269 27270 27271 27272 27273 27274 27275 27276 27277 27278 27279 27280 27281 27282 27283 27284 27285 27286 27287 27288 27289 27290 27291 27292 27293 27294 27295 27296 27297 27298 27299 27300 27301 27302 27303 27304 27305 27306 27307 27308 27309 27310 27311 27312 27313 27314 27315 27316 27317 27318 27319 27320 27321 27322 27323 27324 27325 27326 27327 27328 27329 27330 27331 27332 27333 27334 27335 27336 27337 27338 27339 27340 27341 27342 27343 27344 27345 27346 27347 27348 27349 27350 27351 27352 27353 27354 27355 27356 27357 27358 27359 27360 27361 27362 27363 27364 27365 27366 27367 27368 27369 27370 27371 27372 27373 27374 27375 27376 27377 27378 27379 27380 27381 27382 27383 27384 27385 27386 27387 27388 27389 27390 27391 27392 27393 27394 27395 27396 27397 27398 27399 27400 27401 27402 27403 27404 27405 27406 27407 27408 27409 27410 27411 27412 27413 27414 27415 27416 27417 27418 27419 27420 27421 27422 27423 27424 27425 27426 27427 27428 27429 27430 27431 27432 27433 27434 27435 27436 27437 27438 27439 27440 27441 27442 27443 27444 27445 27446 27447 27448 27449 27450 27451 27452 27453 27454 27455 27456 27457 27458 27459 27460 27461 27462 27463 27464 27465 27466 27467 27468 27469 27470 27471 27472 27473 27474 27475 27476 27477 27478 27479 27480 27481 27482 27483 27484 27485 27486 27487 27488 27489 27490 27491 27492 27493 27494 27495 27496 27497 27498 27499 27500 27501 27502 27503 27504 27505 27506 27507 27508 27509 27510 27511 27512 27513 27514 27515 27516 27517 27518 27519 27520 27521 27522 27523 27524 27525 27526 27527 27528 27529 27530 27531 27532 27533 27534 27535 27536 27537 27538 27539 27540 27541 27542 27543 27544 27545 27546 27547 27548 27549 27550 27551 27552 27553 27554 27555 27556 27557 27558 27559 27560 27561 27562 27563 27564 27565 27566 27567 27568 27569 27570 27571 27572 27573 27574 27575 27576 27577 27578 27579 27580 27581 27582 27583 27584 27585 27586 27587 27588 27589 27590 27591 27592 27593 27594 27595 27596 27597 27598 27599 27600 27601 27602 27603 27604 27605 27606 27607 27608 27609 27610 27611 27612 27613 27614 27615 27616 27617 27618 27619 27620 27621 27622 27623 27624 27625 27626 27627 27628 27629 27630 27631 27632 27633 27634 27635 27636 27637 27638 27639 27640 27641 27642 27643 27644 27645 27646 27647 27648 27649 27650 27651 27652 27653 27654 27655 27656 27657 27658 27659 27660 27661 27662 27663 27664 27665 27666 27667 27668 27669 27670 27671 27672 27673 27674 27675 27676 27677 27678 27679 27680 27681 27682 27683 27684 27685 27686 27687 27688 27689 27690 27691 27692 27693 27694 27695 27696 27697 27698 27699 27700 27701 27702 27703 27704 27705 27706 27707 27708 27709 27710 27711 27712 27713 27714 27715 27716 27717 27718 27719 27720 27721 27722 27723 27724 27725 27726 27727 27728 27729 27730 27731 27732 27733 27734 27735 27736 27737 27738 27739 27740 27741 27742 27743 27744 27745 27746 27747 27748 27749 27750 27751 27752 27753 27754 27755 27756 27757 27758 27759 27760 27761 27762 27763 27764 27765 27766 27767 27768 27769 27770 27771 27772 27773 27774 27775 27776 27777 27778 27779 27780 27781 27782 27783 27784 27785 27786 27787 27788 27789 27790 27791 27792 27793 27794 27795 27796 27797 27798 27799 27800 27801 27802 27803 27804 27805 27806 27807 27808 27809 27810 27811 27812 27813 27814 27815 27816 27817 27818 27819 27820 27821 27822 27823 27824 27825 27826 27827 27828 27829 27830 27831 27832 27833 27834 27835 27836 27837 27838 27839 27840 27841 27842 27843 27844 27845 27846 27847 27848 27849 27850 27851 27852 27853 27854 27855 27856 27857 27858 27859 27860 27861 27862 27863 27864 27865 27866 27867 27868 27869 27870 27871 27872 27873 27874 27875 27876 27877 27878 27879 27880 27881 27882 27883 27884 27885 27886 27887 27888 27889 27890 27891 27892 27893 27894 27895 27896 27897 27898 27899 27900 27901 27902 27903 27904 27905 27906 27907 27908 27909 27910 27911 27912 27913 27914 27915 27916 27917 27918 27919 27920 27921 27922 27923 27924 27925 27926 27927 27928 27929 27930 27931 27932 27933 27934 27935 27936 27937 27938 27939 27940 27941 27942 27943 27944 27945 27946 27947 27948 27949 27950 27951 27952 27953 27954 27955 27956 27957 27958 27959 27960 27961 27962 27963 27964 27965 27966 27967 27968 27969 27970 27971 27972 27973 27974 27975 27976 27977 27978 27979 27980 27981 27982 27983 27984 27985 27986 27987 27988 27989 27990 27991 27992 27993 27994 27995 27996 27997 27998 27999 28000 28001 28002 28003 28004 28005 28006 28007 28008 28009 28010 28011 28012 28013 28014 28015 28016 28017 28018 28019 28020 28021 28022 28023 28024 28025 28026 28027 28028 28029 28030 28031 28032 28033 28034 28035 28036 28037 28038 28039 28040 28041 28042 28043 28044 28045 28046 28047 28048 28049 28050 28051 28052 28053 28054 28055 28056 28057 28058 28059 28060 28061 28062 28063 28064 28065 28066 28067 28068 28069 28070 28071 28072 28073 28074 28075 28076 28077 28078 28079 28080 28081 28082 28083 28084 28085 28086 28087 28088 28089 28090 28091 28092 28093 28094 28095 28096 28097 28098 28099 28100 28101 28102 28103 28104 28105 28106 28107 28108 28109 28110 28111 28112 28113 28114 28115 28116 28117 28118 28119 28120 28121 28122 28123 28124 28125 28126 28127 28128 28129 28130 28131 28132 28133 28134 28135 28136 28137 28138 28139 28140 28141 28142 28143 28144 28145 28146 28147 28148 28149 28150 28151 28152 28153 28154 28155 28156 28157 28158 28159 28160 28161 28162 28163 28164 28165 28166 28167 28168 28169 28170 28171 28172 28173 28174 28175 28176 28177 28178 28179 28180 28181 28182 28183 28184 28185 28186 28187 28188 28189 28190 28191 28192 28193 28194 28195 28196 28197 28198 28199 28200 28201 28202 28203 28204 28205 28206 28207 28208 28209 28210 28211 28212 28213 28214 28215 28216 28217 28218 28219 28220 28221 28222 28223 28224 28225 28226 28227 28228 28229 28230 28231 28232 28233 28234 28235 28236 28237 28238 28239 28240 28241 28242 28243 28244 28245 28246 28247 28248 28249 28250 28251 28252 28253 28254 28255 28256 28257 28258 28259 28260 28261 28262 28263 28264 28265 28266 28267 28268 28269 28270 28271 28272 28273 28274 28275 28276 28277 28278 28279 28280 28281 28282 28283 28284 28285 28286 28287 28288 28289 28290 28291 28292 28293 28294 28295 28296 28297 28298 28299 28300 28301 28302 28303 28304 28305 28306 28307 28308 28309 28310 28311 28312 28313 28314 28315 28316 28317 28318 28319 28320 28321 28322 28323 28324 28325 28326 28327 28328 28329 28330 28331 28332 28333 28334 28335 28336 28337 28338 28339 28340 28341 28342 28343 28344 28345 28346 28347 28348 28349 28350 28351 28352 28353 28354 28355 28356 28357 28358 28359 28360 28361 28362 28363 28364 28365 28366 28367 28368 28369 28370 28371 28372 28373 28374 28375 28376 28377 28378 28379 28380 28381 28382 28383 28384 28385 28386 28387 28388 28389 28390 28391 28392 28393 28394 28395 28396 28397 28398 28399 28400 28401 28402 28403 28404 28405 28406 28407 28408 28409 28410 28411 28412 28413 28414 28415 28416 28417 28418 28419 28420 28421 28422 28423 28424 28425 28426 28427 28428 28429 28430 28431 28432 28433 28434 28435 28436 28437 28438 28439 28440 28441 28442 28443 28444 28445 28446 28447 28448 28449 28450 28451 28452 28453 28454 28455 28456 28457 28458 28459 28460 28461 28462 28463 28464 28465 28466 28467 28468 28469 28470 28471 28472 28473 28474 28475 28476 28477 28478 28479 28480 28481 28482 28483 28484 28485 28486 28487 28488 28489 28490 28491 28492 28493 28494 28495 28496 28497 28498 28499 28500 28501 28502 28503 28504 28505 28506 28507 28508 28509 28510 28511 28512 28513 28514 28515 28516 28517 28518 28519 28520 28521 28522 28523 28524 28525 28526 28527 28528 28529 28530 28531 28532 28533 28534 28535 28536 28537 28538 28539 28540 28541 28542 28543 28544 28545 28546 28547 28548 28549 28550 28551 28552 28553 28554 28555 28556 28557 28558 28559 28560 28561 28562 28563 28564 28565 28566 28567 28568 28569 28570 28571 28572 28573 28574 28575 28576 28577 28578 28579 28580 28581 28582 28583 28584 28585 28586 28587 28588 28589 28590 28591 28592 28593 28594 28595 28596 28597 28598 28599 28600 28601 28602 28603 28604 28605 28606 28607 28608 28609 28610 28611 28612 28613 28614 28615 28616 28617 28618 28619 28620 28621 28622 28623 28624 28625 28626 28627 28628 28629 28630 28631 28632 28633 28634 28635 28636 28637 28638 28639 28640 28641 28642 28643 28644 28645 28646 28647 28648 28649 28650 28651 28652 28653 28654 28655 28656 28657 28658 28659 28660 28661 28662 28663 28664 28665 28666 28667 28668 28669 28670 28671 28672 28673 28674 28675 28676 28677 28678 28679 28680 28681 28682 28683 28684 28685 28686 28687 28688 28689 28690 28691 28692 28693 28694 28695 28696 28697 28698 28699 28700 28701 28702 28703 28704 28705 28706 28707 28708 28709 28710 28711 28712 28713 28714 28715 28716 28717 28718 28719 28720 28721 28722 28723 28724 28725 28726 28727 28728 28729 28730 28731 28732 28733 28734 28735 28736 28737 28738 28739 28740 28741 28742 28743 28744 28745 28746 28747 28748 28749 28750 28751 28752 28753 28754 28755 28756 28757 28758 28759 28760 28761 28762 28763 28764 28765 28766 28767 28768 28769 28770 28771 28772 28773 28774 28775 28776 28777 28778 28779 28780 28781 28782 28783 28784 28785 28786 28787 28788 28789 28790 28791 28792 28793 28794 28795 28796 28797 28798 28799 28800 28801 28802 28803 28804 28805 28806 28807 28808 28809 28810 28811 28812 28813 28814 28815 28816 28817 28818 28819 28820 28821 28822 28823 28824 28825 28826 28827 28828 28829 28830 28831 28832 28833 28834 28835 28836 28837 28838 28839 28840 28841 28842 28843 28844 28845 28846 28847 28848 28849 28850 28851 28852 28853 28854 28855 28856 28857 28858 28859 28860 28861 28862 28863 28864 28865 28866 28867 28868 28869 28870 28871 28872 28873 28874 28875 28876 28877 28878 28879 28880 28881 28882 28883 28884 28885 28886 28887 28888 28889 28890 28891 28892 28893 28894 28895 28896 28897 28898 28899 28900 28901 28902 28903 28904 28905 28906 28907 28908 28909 28910 28911 28912 28913 28914 28915 28916 28917 28918 28919 28920 28921 28922 28923 28924 28925 28926 28927 28928 28929 28930 28931 28932 28933 28934 28935 28936 28937 28938 28939 28940 28941 28942 28943 28944 28945 28946 28947 28948 28949 28950 28951 28952 28953 28954 28955 28956 28957 28958 28959 28960 28961 28962 28963 28964 28965 28966 28967 28968 28969 28970 28971 28972 28973 28974 28975 28976 28977 28978 28979 28980 28981 28982 28983 28984 28985 28986 28987 28988 28989 28990 28991 28992 28993 28994 28995 28996 28997 28998 28999 29000 29001 29002 29003 29004 29005 29006 29007 29008 29009 29010 29011 29012 29013 29014 29015 29016 29017 29018 29019 29020 29021 29022 29023 29024 29025 29026 29027 29028 29029 29030 29031 29032 29033 29034 29035 29036 29037 29038 29039 29040 29041 29042 29043 29044 29045 29046 29047 29048 29049 29050 29051 29052 29053 29054 29055 29056 29057 29058 29059 29060 29061 29062 29063 29064 29065 29066 29067 29068 29069 29070 29071 29072 29073 29074 29075 29076 29077 29078 29079 29080 29081 29082 29083 29084 29085 29086 29087 29088 29089 29090 29091 29092 29093 29094 29095 29096 29097 29098 29099 29100 29101 29102 29103 29104 29105 29106 29107 29108 29109 29110 29111 29112 29113 29114 29115 29116 29117 29118 29119 29120 29121 29122 29123 29124 29125 29126 29127 29128 29129 29130 29131 29132 29133 29134 29135 29136 29137 29138 29139 29140 29141 29142 29143 29144 29145 29146 29147 29148 29149 29150 29151 29152 29153 29154 29155 29156 29157 29158 29159 29160 29161 29162 29163 29164 29165 29166 29167 29168 29169 29170 29171 29172 29173 29174 29175 29176 29177 29178 29179 29180 29181 29182 29183 29184 29185 29186 29187 29188 29189 29190 29191 29192 29193 29194 29195 29196 29197 29198 29199 29200 29201 29202 29203 29204 29205 29206 29207 29208 29209 29210 29211 29212 29213 29214 29215 29216 29217 29218 29219 29220 29221 29222 29223 29224 29225 29226 29227 29228 29229 29230 29231 29232 29233 29234 29235 29236 29237 29238 29239 29240 29241 29242 29243 29244 29245 29246 29247 29248 29249 29250 29251 29252 29253 29254 29255 29256 29257 29258 29259 29260 29261 29262 29263 29264 29265 29266 29267 29268 29269 29270 29271 29272 29273 29274 29275 29276 29277 29278 29279 29280 29281 29282 29283 29284 29285 29286 29287 29288 29289 29290 29291 29292 29293 29294 29295 29296 29297 29298 29299 29300 29301 29302 29303 29304 29305 29306 29307 29308 29309 29310 29311 29312 29313 29314 29315 29316 29317 29318 29319 29320 29321 29322 29323 29324 29325 29326 29327 29328 29329 29330 29331 29332 29333 29334 29335 29336 29337 29338 29339 29340 29341 29342 29343 29344 29345 29346 29347 29348 29349 29350 29351 29352 29353 29354 29355 29356 29357 29358 29359 29360 29361 29362 29363 29364 29365 29366 29367 29368 29369 29370 29371 29372 29373 29374 29375 29376 29377 29378 29379 29380 29381 29382 29383 29384 29385 29386 29387 29388 29389 29390 29391 29392 29393 29394 29395 29396 29397 29398 29399 29400 29401 29402 29403 29404 29405 29406 29407 29408 29409 29410 29411 29412 29413 29414 29415 29416 29417 29418 29419 29420 29421 29422 29423 29424 29425 29426 29427 29428 29429 29430 29431 29432 29433 29434 29435 29436 29437 29438 29439 29440 29441 29442 29443 29444 29445 29446 29447 29448 29449 29450 29451 29452 29453 29454 29455 29456 29457 29458 29459 29460 29461 29462 29463 29464 29465 29466 29467 29468 29469 29470 29471 29472 29473 29474 29475 29476 29477 29478 29479 29480 29481 29482 29483 29484 29485 29486 29487 29488 29489 29490 29491 29492 29493 29494 29495 29496 29497 29498 29499 29500 29501 29502 29503 29504 29505 29506 29507 29508 29509 29510 29511 29512 29513 29514 29515 29516 29517 29518 29519 29520 29521 29522 29523 29524 29525 29526 29527 29528 29529 29530 29531 29532 29533 29534 29535 29536 29537 29538 29539 29540 29541 29542 29543 29544 29545 29546 29547 29548 29549 29550 29551 29552 29553 29554 29555 29556 29557 29558 29559 29560 29561 29562 29563 29564 29565 29566 29567 29568 29569 29570 29571 29572 29573 29574 29575 29576 29577 29578 29579 29580 29581 29582 29583 29584 29585 29586 29587 29588 29589 29590 29591 29592 29593 29594 29595 29596 29597 29598 29599 29600 29601 29602 29603 29604 29605 29606 29607 29608 29609 29610 29611 29612 29613 29614 29615 29616 29617 29618 29619 29620 29621 29622 29623 29624 29625 29626 29627 29628 29629 29630 29631 29632 29633 29634 29635 29636 29637 29638 29639 29640 29641 29642 29643 29644 29645 29646 29647 29648 29649 29650 29651 29652 29653 29654 29655 29656 29657 29658 29659 29660 29661 29662 29663 29664 29665 29666 29667 29668 29669 29670 29671 29672 29673 29674 29675 29676 29677 29678 29679 29680 29681 29682 29683 29684 29685 29686 29687 29688 29689 29690 29691 29692 29693 29694 29695 29696 29697 29698 29699 29700 29701 29702 29703 29704 29705 29706 29707 29708 29709 29710 29711 29712 29713 29714 29715 29716 29717 29718 29719 29720 29721 29722 29723 29724 29725 29726 29727 29728 29729 29730 29731 29732 29733 29734 29735 29736 29737 29738 29739 29740 29741 29742 29743 29744 29745 29746 29747 29748 29749 29750 29751 29752 29753 29754 29755 29756 29757 29758 29759 29760 29761 29762 29763 29764 29765 29766 29767 29768 29769 29770 29771 29772 29773 29774 29775 29776 29777 29778 29779 29780 29781 29782 29783 29784 29785 29786 29787 29788 29789 29790 29791 29792 29793 29794 29795 29796 29797 29798 29799 29800 29801 29802 29803 29804 29805 29806 29807 29808 29809 29810 29811 29812 29813 29814 29815 29816 29817 29818 29819 29820 29821 29822 29823 29824 29825 29826 29827 29828 29829 29830 29831 29832 29833 29834 29835 29836 29837 29838 29839 29840 29841 29842 29843 29844 29845 29846 29847 29848 29849 29850 29851 29852 29853 29854 29855 29856 29857 29858 29859 29860 29861 29862 29863 29864 29865 29866 29867 29868 29869 29870 29871 29872 29873 29874 29875 29876 29877 29878 29879 29880 29881 29882 29883 29884 29885 29886 29887 29888 29889 29890 29891 29892 29893 29894 29895 29896 29897 29898 29899 29900 29901 29902 29903 29904 29905 29906 29907 29908 29909 29910 29911 29912 29913 29914 29915 29916 29917 29918 29919 29920 29921 29922 29923 29924 29925 29926 29927 29928 29929 29930 29931 29932 29933 29934 29935 29936 29937 29938 29939 29940 29941 29942 29943 29944 29945 29946 29947 29948 29949 29950 29951 29952 29953 29954 29955 29956 29957 29958 29959 29960 29961 29962 29963 29964 29965 29966 29967 29968 29969 29970 29971 29972 29973 29974 29975 29976 29977 29978 29979 29980 29981 29982 29983 29984 29985 29986 29987 29988 29989 29990 29991 29992 29993 29994 29995 29996 29997 29998 29999 30000 30001 30002 30003 30004 30005 30006 30007 30008 30009 30010 30011 30012 30013 30014 30015 30016 30017 30018 30019 30020 30021 30022 30023 30024 30025 30026 30027 30028 30029 30030 30031 30032 30033 30034 30035 30036 30037 30038 30039 30040 30041 30042 30043 30044 30045 30046 30047 30048 30049 30050 30051 30052 30053 30054 30055 30056 30057 30058 30059 30060 30061 30062 30063 30064 30065 30066 30067 30068 30069 30070 30071 30072 30073 30074 30075 30076 30077 30078 30079 30080 30081 30082 30083 30084 30085 30086 30087 30088 30089 30090 30091 30092 30093 30094 30095 30096 30097 30098 30099 30100 30101 30102 30103 30104 30105 30106 30107 30108 30109 30110 30111 30112 30113 30114 30115 30116 30117 30118 30119 30120 30121 30122 30123 30124 30125 30126 30127 30128 30129 30130 30131 30132 30133 30134 30135 30136 30137 30138 30139 30140 30141 30142 30143 30144 30145 30146 30147 30148 30149 30150 30151 30152 30153 30154 30155 30156 30157 30158 30159 30160 30161 30162 30163 30164 30165 30166 30167 30168 30169 30170 30171 30172 30173 30174 30175 30176 30177 30178 30179 30180 30181 30182 30183 30184 30185 30186 30187 30188 30189 30190 30191 30192 30193 30194 30195 30196 30197 30198 30199 30200 30201 30202 30203 30204 30205 30206 30207 30208 30209 30210 30211 30212 30213 30214 30215 30216 30217 30218 30219 30220 30221 30222 30223 30224 30225 30226 30227 30228 30229 30230 30231 30232 30233 30234 30235 30236 30237 30238 30239 30240 30241 30242 30243 30244 30245 30246 30247 30248 30249 30250 30251 30252 30253 30254 30255 30256 30257 30258 30259 30260 30261 30262 30263 30264 30265 30266 30267 30268 30269 30270 30271 30272 30273 30274 30275 30276 30277 30278 30279 30280 30281 30282 30283 30284 30285 30286 30287 30288 30289 30290 30291 30292 30293 30294 30295 30296 30297 30298 30299 30300 30301 30302 30303 30304 30305 30306 30307 30308 30309 30310 30311 30312 30313 30314 30315 30316 30317 30318 30319 30320 30321 30322 30323 30324 30325 30326 30327 30328 30329 30330 30331 30332 30333 30334 30335 30336 30337 30338 30339 30340 30341 30342 30343 30344 30345 30346 30347 30348 30349 30350 30351 30352 30353 30354 30355 30356 30357 30358 30359 30360 30361 30362 30363 30364 30365 30366 30367 30368 30369 30370 30371 30372 30373 30374 30375 30376 30377 30378 30379 30380 30381 30382 30383 30384 30385 30386 30387 30388 30389 30390 30391 30392 30393 30394 30395 30396 30397 30398 30399 30400 30401 30402 30403 30404 30405 30406 30407 30408 30409 30410 30411 30412 30413 30414 30415 30416 30417 30418 30419 30420 30421 30422 30423 30424 30425 30426 30427 30428 30429 30430 30431 30432 30433 30434 30435 30436 30437 30438 30439 30440 30441 30442 30443 30444 30445 30446 30447 30448 30449 30450 30451 30452 30453 30454 30455 30456 30457 30458 30459 30460 30461 30462 30463 30464 30465 30466 30467 30468 30469 30470 30471 30472 30473 30474 30475 30476 30477 30478 30479 30480 30481 30482 30483 30484 30485 30486 30487 30488 30489 30490 30491 30492 30493 30494 30495 30496 30497 30498 30499 30500 30501 30502 30503 30504 30505 30506 30507 30508 30509 30510 30511 30512 30513 30514 30515 30516 30517 30518 30519 30520 30521 30522 30523 30524 30525 30526 30527 30528 30529 30530 30531 30532 30533 30534 30535 30536 30537 30538 30539 30540 30541 30542 30543 30544 30545 30546 30547 30548 30549 30550 30551 30552 30553 30554 30555 30556 30557 30558 30559 30560 30561 30562 30563 30564 30565 30566 30567 30568 30569 30570 30571 30572 30573 30574 30575 30576 30577 30578 30579 30580 30581 30582 30583 30584 30585 30586 30587 30588 30589 30590 30591 30592 30593 30594 30595 30596 30597 30598 30599 30600 30601 30602 30603 30604 30605 30606 30607 30608 30609 30610 30611 30612 30613 30614 30615 30616 30617 30618 30619 30620 30621 30622 30623 30624 30625 30626 30627 30628 30629 30630 30631 30632 30633 30634 30635 30636 30637 30638 30639 30640 30641 30642 30643 30644 30645 30646 30647 30648 30649 30650 30651 30652 30653 30654 30655 30656 30657 30658 30659 30660 30661 30662 30663 30664 30665 30666 30667 30668 30669 30670 30671 30672 30673 30674 30675 30676 30677 30678 30679 30680 30681 30682 30683 30684 30685 30686 30687 30688 30689 30690 30691 30692 30693 30694 30695 30696 30697 30698 30699 30700 30701 30702 30703 30704 30705 30706 30707 30708 30709 30710 30711 30712 30713 30714 30715 30716 30717 30718 30719 30720 30721 30722 30723 30724 30725 30726 30727 30728 30729 30730 30731 30732 30733 30734 30735 30736 30737 30738 30739 30740 30741 30742 30743 30744 30745 30746 30747 30748 30749 30750 30751 30752 30753 30754 30755 30756 30757 30758 30759 30760 30761 30762 30763 30764 30765 30766 30767 30768 30769 30770 30771 30772 30773 30774 30775 30776 30777 30778 30779 30780 30781 30782 30783 30784 30785 30786 30787 30788 30789 30790 30791 30792 30793 30794 30795 30796 30797 30798 30799 30800 30801 30802 30803 30804 30805 30806 30807 30808 30809 30810 30811 30812 30813 30814 30815 30816 30817 30818 30819 30820 30821 30822 30823 30824 30825 30826 30827 30828 30829 30830 30831 30832 30833 30834 30835 30836 30837 30838 30839 30840 30841 30842 30843 30844 30845 30846 30847 30848 30849 30850 30851 30852 30853 30854 30855 30856 30857 30858 30859 30860 30861 30862 30863 30864 30865 30866 30867 30868 30869 30870 30871 30872 30873 30874 30875 30876 30877 30878 30879 30880 30881 30882 30883 30884 30885 30886 30887 30888 30889 30890 30891 30892 30893 30894 30895 30896 30897 30898 30899 30900 30901 30902 30903 30904 30905 30906 30907 30908 30909 30910 30911 30912 30913 30914 30915 30916 30917 30918 30919 30920 30921 30922 30923 30924 30925 30926 30927 30928 30929 30930 30931 30932 30933 30934 30935 30936 30937 30938 30939 30940 30941 30942 30943 30944 30945 30946 30947 30948 30949 30950 30951 30952 30953 30954 30955 30956 30957 30958 30959 30960 30961 30962 30963 30964 30965 30966 30967 30968 30969 30970 30971 30972 30973 30974 30975 30976 30977 30978 30979 30980 30981 30982 30983 30984 30985 30986 30987 30988 30989 30990 30991 30992 30993 30994 30995 30996 30997 30998 30999 31000 31001 31002 31003 31004 31005 31006 31007 31008 31009 31010 31011 31012 31013 31014 31015 31016 31017 31018 31019 31020 31021 31022 31023 31024 31025 31026 31027 31028 31029 31030 31031 31032 31033 31034 31035 31036 31037 31038 31039 31040 31041 31042 31043 31044 31045 31046 31047 31048 31049 31050 31051 31052 31053 31054 31055 31056 31057 31058 31059 31060 31061 31062 31063 31064 31065 31066 31067 31068 31069 31070 31071 31072 31073 31074 31075 31076 31077 31078 31079 31080 31081 31082 31083 31084 31085 31086 31087 31088 31089 31090 31091 31092 31093 31094 31095 31096 31097 31098 31099 31100 31101 31102 31103 31104 31105 31106 31107 31108 31109 31110 31111 31112 31113 31114 31115 31116 31117 31118 31119 31120 31121 31122 31123 31124 31125 31126 31127 31128 31129 31130 31131 31132 31133 31134 31135 31136 31137 31138 31139 31140 31141 31142 31143 31144 31145 31146 31147 31148 31149 31150 31151 31152 31153 31154 31155 31156 31157 31158 31159 31160 31161 31162 31163 31164 31165 31166 31167 31168 31169 31170 31171 31172 31173 31174 31175 31176 31177 31178 31179 31180 31181 31182 31183 31184 31185 31186 31187 31188 31189 31190 31191 31192 31193 31194 31195 31196 31197 31198 31199 31200 31201 31202 31203 31204 31205 31206 31207 31208 31209 31210 31211 31212 31213 31214 31215 31216 31217 31218 31219 31220 31221 31222 31223 31224 31225 31226 31227 31228 31229 31230 31231 31232 31233 31234 31235 31236 31237 31238 31239 31240 31241 31242 31243 31244 31245 31246 31247 31248 31249 31250 31251 31252 31253 31254 31255 31256 31257 31258 31259 31260 31261 31262 31263 31264 31265 31266 31267 31268 31269 31270 31271 31272 31273 31274 31275 31276 31277 31278 31279 31280 31281 31282 31283 31284 31285 31286 31287 31288 31289 31290 31291 31292 31293 31294 31295 31296 31297 31298 31299 31300 31301 31302 31303 31304 31305 31306 31307 31308 31309 31310 31311 31312 31313 31314 31315 31316 31317 31318 31319 31320 31321 31322 31323 31324 31325 31326 31327 31328 31329 31330 31331 31332 31333 31334 31335 31336 31337 31338 31339 31340 31341 31342 31343 31344 31345 31346 31347 31348 31349 31350 31351 31352 31353 31354 31355 31356 31357 31358 31359 31360 31361 31362 31363 31364 31365 31366 31367 31368 31369 31370 31371 31372 31373 31374 31375 31376 31377 31378 31379 31380 31381 31382 31383 31384 31385 31386 31387 31388 31389 31390 31391 31392 31393 31394 31395 31396 31397 31398 31399 31400 31401 31402 31403 31404 31405 31406 31407 31408 31409 31410 31411 31412 31413 31414 31415 31416 31417 31418 31419 31420 31421 31422 31423 31424 31425 31426 31427 31428 31429 31430 31431 31432 31433 31434 31435 31436 31437 31438 31439 31440 31441 31442 31443 31444 31445 31446 31447 31448 31449 31450 31451 31452 31453 31454 31455 31456 31457 31458 31459 31460 31461 31462 31463 31464 31465 31466 31467 31468 31469 31470 31471 31472 31473 31474 31475 31476 31477 31478 31479 31480 31481 31482
|
2008-08-10 Jan Michael Alonzo <jmalonzo@webkit.org>
Reviewed (and updated) by Alp Toker.
https://bugs.webkit.org/show_bug.cgi?id=16620
[GTK] Autotools make dist and make check support
Get make dist working.
Note that not all possible configurations have been tested yet.
* GNUmakefile.am:
2008-08-09 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Sam Weinig.
Added same heap debug checks to more code paths.
* kjs/JSActivation.cpp:
(KJS::JSActivation::put):
(KJS::JSActivation::putWithAttributes):
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::putWithAttributes):
* kjs/JSObject.h:
(KJS::JSObject::putDirect):
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::symbolTablePut):
(KJS::JSVariableObject::symbolTablePutWithAttributes):
2008-08-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Fix some style issues in the sampling tool.
* VM/SamplingTool.cpp:
(KJS::sleepForMicroseconds):
(KJS::SamplingTool::dump):
2008-08-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Revision 35651, despite being a rather trivial change, introduced a
large regression on the regexp-dna SunSpider test. This regression
stemmed from an increase in the size of CodeBlock::dump(). There is
no reason for this method (and several related methods) to be compiled
in non-debug builds with the sampling tool disabled. This patch
conditionally compiles them, reversing the regression on SunSpider.
* JavaScriptCore.exp:
* VM/CodeBlock.cpp:
* VM/CodeBlock.h:
* VM/Machine.cpp:
2008-08-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Bug 20330: JSCore crash loading any filehurricane media page
<https://bugs.webkit.org/show_bug.cgi?id=20330>
Fix a typo in the constant loading patch. Also, add a case for
op_unexpected_load to CodeBlock::dump().
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::addUnexpectedConstant):
2008-08-08 Matt Lilek <webkit@mattlilek.com>
Not reviewed, build fix.
* JavaScriptCore.exp:
2008-08-08 Oliver Hunt <oliver@apple.com>
Reviewed by Cameron Zwarich.
Improve performance of arithmetic operators
Added a fast (non-virtual) mechanism to determine if a non-immediate JSValue*
is a JSNumberCell. We then use this to allow improved specialisation in many
arithmetic operators. SunSpider reports a 2.5% progression overall, with greater
than 10% progressions on a number of arithmetic heavy tests.
* VM/Machine.cpp:
(KJS::fastIsNumber):
(KJS::fastToInt32):
(KJS::fastToUInt32):
(KJS::jsLess):
(KJS::jsLessEq):
(KJS::jsAdd):
(KJS::Machine::privateExecute):
* kjs/JSNumberCell.h:
(KJS::JSNumberCell::fastToInt32):
(KJS::JSNumberCell::fastToUInt32):
* kjs/collector.cpp:
(KJS::allocateBlock):
(KJS::Heap::heapAllocate):
* kjs/collector.h:
(KJS::Heap::fastIsNumber):
2008-08-06 Adam Roben <aroben@apple.com>
Try to fix the Windows build bots
* API/JSBase.cpp: Touch this to force JSC to rebuild and re-copy the
WTF headers.
2008-08-06 Tor Arne Vestbø <tavestbo@trolltech.com>
Revert change 35595.
* wtf/RetainPtr.h:
2008-08-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
Fix non-Mac build.
* wtf/RetainPtr.h: CoreFoundation only for PLATFORM(MAC)
2008-08-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
Fix non-Mac build.
* wtf/RetainPtr.h: CoreFoundation only for PLATFORM(MAC)
2008-08-06 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
Reviewed by Darin. Landed by Cameron.
Bug 20272: typo in JavaScriptCore
<https://bugs.webkit.org/show_bug.cgi?id=20272>
Correct the documentation for op_not. (typo)
Fix #undef. (typo)
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-08-06 Cameron Zwarich <cwzwarich@webkit.org>
Reviewed by Maciej.
Bug 20286: Load constants all at once instead of using op_load
<https://bugs.webkit.org/show_bug.cgi?id=20286>
Load constants all at once into temporary registers instead of using
individual instances of op_load.
This is a 2.6% speedup on SunSpider.
* JavaScriptCore.exp:
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
(KJS::CodeBlock::mark):
* VM/CodeBlock.h:
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::CodeGenerator):
(KJS::CodeGenerator::newTemporary):
(KJS::CodeGenerator::addConstant):
(KJS::CodeGenerator::addUnexpectedConstant):
(KJS::CodeGenerator::emitLoad):
(KJS::CodeGenerator::emitUnexpectedLoad):
(KJS::CodeGenerator::emitNewError):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::slideRegisterWindowForCall):
(KJS::Machine::unwindCallFrame):
(KJS::Machine::throwException):
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
* VM/Machine.h:
* VM/Opcode.h:
* VM/RegisterID.h:
(KJS::RegisterID::RegisterID):
(KJS::RegisterID::makeConstant):
(KJS::RegisterID::isTemporary):
* kjs/NodeInfo.h:
* kjs/Parser.cpp:
(KJS::Parser::didFinishParsing):
* kjs/Parser.h:
(KJS::Parser::parse):
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::NullNode::emitCode):
(KJS::BooleanNode::emitCode):
(KJS::NumberNode::emitCode):
(KJS::StringNode::emitCode):
(KJS::ArrayNode::emitCode):
(KJS::DeleteResolveNode::emitCode):
(KJS::DeleteValueNode::emitCode):
(KJS::VoidNode::emitCode):
(KJS::ConstDeclNode::emitCodeSingle):
(KJS::ReturnNode::emitCode):
(KJS::ScopeNode::ScopeNode):
(KJS::ProgramNode::ProgramNode):
(KJS::ProgramNode::create):
(KJS::EvalNode::EvalNode):
(KJS::EvalNode::create):
(KJS::FunctionBodyNode::FunctionBodyNode):
(KJS::FunctionBodyNode::create):
(KJS::FunctionBodyNode::emitCode):
* kjs/nodes.h:
(KJS::ScopeNode::neededConstants):
2008-08-05 Maciej Stachowiak <mjs@apple.com>
Reviewed by Cameron.
- add fast path for immediates to % operator, as we have for many other math ops
This fixes handling for a 0 divisor relative to the last patch. Only an 0.2% speedup on SunSpider but
still a 1.4x win on Oliver's prime test.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-08-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Darin.
Bug 20293: Crash in JavaScript codegen for eval("const a;")
<https://bugs.webkit.org/show_bug.cgi?id=20293>
Correctly handle constant declarations in eval code with no initializer.
* kjs/nodes.cpp:
(KJS::ConstDeclNode::emitCodeSingle):
2008-08-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Roll out r35555 because of correctness issues.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-08-05 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- add fast path for immediates to % operator, as we have for many other math ops
0.6% speedup on SunSpider. 1.4x speedup on a prime testing torture test that Oliver whipped up.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-07-31 Oliver Hunt <oliver@apple.com>
Reviewed by Cameron Zwarich.
Bug 19359: JavaScriptCore behaves differently from FF2/3 and IE when handling context in catch statement
<https://bugs.webkit.org/show_bug.cgi?id=19359>
Make our catch behave like Firefox and IE, we do this by using a StaticScopeObject
instead of a generic JSObject for the scope node. We still don't make use of the
fact that we have a static scope inside the catch block, so the internal performance
of the catch block is not improved, even though technically it would be possible to
do so.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitPushNewScope):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::createExceptionScope):
(KJS::Machine::privateExecute):
* VM/Machine.h:
* VM/Opcode.h:
* kjs/JSStaticScopeObject.cpp:
(KJS::JSStaticScopeObject::toThisObject):
(KJS::JSStaticScopeObject::put):
* kjs/JSStaticScopeObject.h:
* kjs/nodes.cpp:
(KJS::TryNode::emitCode):
2008-08-02 Rob Gowin <robg@gowin.net>
Reviewed by Eric Seidel.
Added JavaScriptCore/API/WebKitAvailability to list of files in
javascriptcore_h_api.
* GNUmakefile.am:
2008-08-01 Alexey Proskuryakov <ap@webkit.org>
Rubber-stamped by Maciej.
Remove JSGlobalData::DataInstance. It was only needed when we had per-thread JSGlobalData
instances.
* kjs/JSGlobalData.h:
2008-07-31 Kevin Ollivier <kevino@theolliviers.com>
Second attempt at Windows/wx build fix. Instead of avoiding inclusion of windows.h,
use defines, etc. to avoid conflicts in each affected file. Also, change PLATFORM(WIN)
to PLATFORM(WIN_OS) so that other ports using Windows headers get the right impls.
* VM/SamplingTool.cpp:
* wtf/Threading.h:
2008-07-31 Anders Carlsson <andersca@apple.com>
Reviewed by Adam.
Fix Windows build.
* kjs/collector.h:
* wtf/FastMalloc.cpp:
2008-07-31 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
Reviewed by Simon.
Bug 20170: [Qt] missing namespace defines in JavaScriptCore.pro
<https://bugs.webkit.org/show_bug.cgi?id=20170>
* JavaScriptCore.pro: Added missing define.
2008-07-31 Alexey Proskuryakov <ap@webkit.org>
Rubber-stamped by Maciej.
Eliminate JSLock (it was already disabled, removing the stub implementaion and all
call sites now).
* API/JSBase.cpp:
(JSEvaluateScript):
(JSCheckScriptSyntax):
(JSGarbageCollect):
* API/JSCallbackConstructor.cpp:
(KJS::constructJSCallback):
* API/JSCallbackFunction.cpp:
(KJS::JSCallbackFunction::call):
* API/JSCallbackObjectFunctions.h:
(KJS::::init):
(KJS::::getOwnPropertySlot):
(KJS::::put):
(KJS::::deleteProperty):
(KJS::::construct):
(KJS::::hasInstance):
(KJS::::call):
(KJS::::getPropertyNames):
(KJS::::toNumber):
(KJS::::toString):
(KJS::::staticValueGetter):
(KJS::::callbackGetter):
* API/JSContextRef.cpp:
(JSGlobalContextCreateInGroup):
(JSGlobalContextRetain):
(JSGlobalContextRelease):
* API/JSObjectRef.cpp:
(JSObjectMake):
(JSObjectMakeFunctionWithCallback):
(JSObjectMakeConstructor):
(JSObjectMakeFunction):
(JSObjectHasProperty):
(JSObjectGetProperty):
(JSObjectSetProperty):
(JSObjectGetPropertyAtIndex):
(JSObjectSetPropertyAtIndex):
(JSObjectDeleteProperty):
(JSObjectCallAsFunction):
(JSObjectCallAsConstructor):
(JSObjectCopyPropertyNames):
(JSPropertyNameArrayRelease):
(JSPropertyNameAccumulatorAddName):
* API/JSStringRef.cpp:
(JSStringRelease):
* API/JSValueRef.cpp:
(JSValueIsEqual):
(JSValueIsInstanceOfConstructor):
(JSValueMakeNumber):
(JSValueMakeString):
(JSValueToNumber):
(JSValueToStringCopy):
(JSValueToObject):
(JSValueProtect):
(JSValueUnprotect):
* ForwardingHeaders/JavaScriptCore/JSLock.h: Removed.
* GNUmakefile.am:
* JavaScriptCore.exp:
* JavaScriptCore.order:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* kjs/AllInOneFile.cpp:
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::JSGlobalData):
* kjs/JSGlobalData.h:
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::~JSGlobalObject):
(KJS::JSGlobalObject::init):
* kjs/JSLock.cpp: Removed.
* kjs/JSLock.h: Removed.
* kjs/Shell.cpp:
(functionGC):
(jscmain):
* kjs/collector.cpp:
(KJS::Heap::~Heap):
(KJS::Heap::heapAllocate):
(KJS::Heap::setGCProtectNeedsLocking):
(KJS::Heap::protect):
(KJS::Heap::unprotect):
(KJS::Heap::collect):
* kjs/identifier.cpp:
* kjs/interpreter.cpp:
(KJS::Interpreter::checkSyntax):
(KJS::Interpreter::evaluate):
2008-07-31 Alexey Proskuryakov <ap@webkit.org>
Rubber-stamped by Oliver Hunt.
Fix the Mac project to not display "test/" as part of file name for tests.
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-07-31 Eric Seidel <eric@webkit.org>
Reviewed by Alexey Proskuryakov.
Rename USE(MULTIPLE_THREADS) to ENABLE(JSC_MULTIPLE_THREADS)
to better match the use/enable pattern (and better describe
the usage of the feature in question.)
I also fixed a couple other ENABLE_ macros to be pre-processor
definition override-able to match the rest of the ENABLE_ macros
since it seems to be our convention that build systems can set
ENABLE_ macros in Makefiles.
* kjs/InitializeThreading.cpp:
(KJS::initializeThreadingOnce):
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::JSGlobalData):
(KJS::JSGlobalData::~JSGlobalData):
* kjs/MathObject.cpp:
* kjs/collector.cpp:
(KJS::Heap::Heap):
(KJS::Heap::~Heap):
(KJS::allocateBlock):
(KJS::Heap::markStackObjectsConservatively):
* kjs/collector.h:
* kjs/dtoa.cpp:
(KJS::pow5mult):
(KJS::rv_alloc):
(KJS::freedtoa):
(KJS::dtoa):
* wtf/FastMalloc.cpp:
* wtf/Platform.h:
* wtf/RefCountedLeakCounter.cpp:
2008-07-30 Eric Seidel <eric@webkit.org>
Reviewed by Mark Rowe.
Try to clean up our usage of USE(MULTIPLE_THREADS) vs. USE(PTHREADS) a little.
It looks like JSC assumes that if MULTIPLE_THREADS is defined, then pthreads will always be available
I'm not sure that's always the case for gtk, certainly not for Windows. We should eventually go back
and fix wtf/Threading.h to cover all these cases some day.
* kjs/JSLock.cpp:
* kjs/collector.h:
* wtf/Platform.h:
2008-07-30 Eric Seidel <eric@webkit.org>
Reviewed by Oliver.
MSVC warns when structs are called classes or vice versa.
Make all the source refer to JSGlobalData as a class.
* kjs/CommonIdentifiers.h:
* kjs/JSGlobalData.h:
* kjs/Parser.h:
* kjs/lexer.h:
2008-07-30 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff Garen.
Add consistency checks to UString to document and enforce its design.
* kjs/ustring.cpp:
(KJS::UString::Rep::create):
(KJS::UString::Rep::destroy):
(KJS::UString::Rep::checkConsistency):
(KJS::UString::expandCapacity):
(KJS::UString::expandPreCapacity):
(KJS::UString::UString):
(KJS::UString::spliceSubstringsWithSeparators):
(KJS::UString::append):
* kjs/ustring.h:
(KJS::UString::Rep::checkConsistency):
2008-07-30 Gavin Barraclough <barraclough@apple.com>
Reviewed by Geoff Garen.
Fixes for Windows and non-AllInOne file build with SamplingTool, plus review fixes.
* GNUmakefile.am: Adding SamplingTool.cpp to build.
* JavaScriptCore.exp: Export hooks to init & control SamplingTool.
* JavaScriptCore.pri: Adding SamplingTool.cpp to build.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Adding SamplingTool.cpp to build.
* JavaScriptCore.xcodeproj/project.pbxproj: Adding SamplingTool.cpp to build.
* JavaScriptCoreSources.bkl: Adding SamplingTool.cpp to build.
* VM/Machine.cpp: MACHINE_SAMPLING_callingNativeFunction renamed MACHINE_SAMPLING_callingHostFunction
* VM/Machine.h:
* VM/Opcode.cpp: SamplingTool moved to SamplingTool.cpp/.h, opcodeNames generated from FOR_EACH_OPCODE_ID.
* VM/Opcode.h:
* VM/SamplingTool.cpp: Added .cpp/.h for SamplingTool.
* VM/SamplingTool.h:
* kjs/Shell.cpp: Switched SAMPLING_TOOL_ENABLED to ENABLE_SAMPLING_TOOL.
* wtf/Platform.h: Added ENABLE_SAMPLING_TOOL config option.
* kjs/nodes.cpp: Header include to fix non-AllInOne builds.
2008-07-30 Ariya Hidayat <ariya.hidayat@trolltech.com>
Reviewed by Alexey Proskuryakov.
Fix compilation without multi-threading support.
* kjs/collector.cpp:
(KJS::Heap::Heap):
2008-07-30 Anders Carlsson <andersca@apple.com>
Add WebKitAvailability.h forwarding header.
* ForwardingHeaders/JavaScriptCore/WebKitAvailability.h: Added.
2008-07-30 Anders Carlsson <andersca@apple.com>
Fix the else.
* API/WebKitAvailability.h:
2008-07-30 Anders Carlsson <andersca@apple.com>
* API/WebKitAvailability.h:
Fix Windows (and other non-Mac builds).
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
Add WebKitAvailability.h to the project.
2008-07-30 Anders Carlsson <andersca@apple.com>
One step closer towards fixing the Windows build.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
Make sure to copy WebKitAvailability.h
2008-07-29 Gavin Barraclough <barraclough@apple.com>
Reviewed by Geoff Garen.
Bug 20209: Atomize constant strings
<https://bugs.webkit.org/show_bug.cgi?id=20209>
Prevents significant performance degradation seen when a script contains multiple
identical strings that are used as keys to identify properties on objects.
No performance change on SunSpider.
* kjs/nodes.cpp: Atomize constant strings.
2008-07-30 Oliver Hunt <oliver@apple.com>
Reviewed by Alexey Proskuryakov.
<rdar://problem/6111648> JavaScript exceptions fail if the scope chain includes the global object
In an attempt to remove the branch I just added to KJS::depth I
used the existence of a Variable Object at a point in the scope
chain as an indicator of function or global scope activation.
However this assumption results in incorrect behaviour if the
global object is injected into the scope chain with 'with'.
* VM/Machine.cpp:
(KJS::depth):
2008-07-30 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff Garen.
Don't call JSGarbageCollect() on a released context.
* API/testapi.c: (main):
2008-07-29 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff Garen.
Implement JSContextGroup APIs to make concurrent execution possible for
JavaScriptCore clients.
This changes the behavior of JSGlobalContextCreate(), so that it now uses a private context
group for each context, making JSlock implicit locking unnecessary.
* API/JSContextRef.h:
* API/JSContextRef.cpp:
(JSContextGroupCreate):
(JSContextGroupRetain):
(JSContextGroupRelease):
(JSGlobalContextCreate):
(JSGlobalContextCreateInGroup):
(JSGlobalContextRelease):
(JSContextGetGroup):
Added new methods. JSGlobalContextCreate() calls JSGlobalContextCreateInGroup() now.
* API/APICast.h: (toJS): (toRef): Added converters for JSContextGroupRef.
* API/JSBase.cpp: (JSGarbageCollect): JSGarbageCollect(0) is now a no-op, and the passed in
context is actually used.
* API/JSBase.h: Aded a typedef for JSContextGroupRef. Updated documentation for
JSGarbageCollect().
* JavaScriptCore.exp: Removed JSGlobalData::sharedInstance().
* kjs/JSGlobalData.cpp:
* kjs/JSGlobalData.h:
Removed support for JSGlobalData shared instance. JSGlobalData::isSharedInstance member
variable still remains, to be deleted in a followup patch.
* kjs/JSLock.cpp: (KJS::JSLock::JSLock): Disabled JSLock, to be deleted in a follow-up patch.
* kjs/collector.cpp:
(KJS::Heap::markOtherThreadConservatively): Removed an assertion that referenced
JSGlobalData::sharedInstance.
* kjs/collector.h: Made Heap destructor public, so that JSContextRelease can use it.
2008-07-29 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff Garen.
Fix a leak of ThreadRegistrar objects.
As the heap is usually deleted when registered threads still exist, ThreadSpecific doesn't
have a chance to clean up per-thread object. Switched to native pthread calls, storing a
plain pointer that doesn't require cleanup.
* kjs/collector.cpp:
(KJS::PlatformThread::PlatformThread):
(KJS::Heap::Thread::Thread):
(KJS::Heap::Heap):
(KJS::Heap::~Heap):
(KJS::Heap::registerThread):
(KJS::Heap::unregisterThread):
* kjs/collector.h:
2008-07-29 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Sam Weinig.
https://bugs.webkit.org/show_bug.cgi?id=20169
Memory allocated with fastMalloc is freed with delete
* VM/JSPropertyNameIterator.cpp:
(KJS::JSPropertyNameIterator::invalidate): Free the array properly.
(KJS::JSPropertyNameIterator::~JSPropertyNameIterator): Delete the array by calling
invalidate().
2008-07-29 Mark Rowe <mrowe@apple.com>
Attempt to fix the Qt build.
* wtf/ThreadingQt.cpp: Add the extra argument to createThread.
2008-07-29 Adam Roben <aroben@apple.com>
Change Vector::find to return an index instead of an iterator
Indices are more natural than iterators when working with Vector.
Reviewed by John Sullivan.
* wtf/Vector.h:
(WTF::Vector::find): Changed to iterate the Vector manually and return
the index of the found item, rather than an iterator. When the item
could not be found, we return WTF::notFound.
2008-07-29 Adam Roben <aroben@apple.com>
Windows build fix
* wtf/ThreadingWin.cpp:
(WTF::setThreadName): Move a misplaced assertion to here...
(WTF::createThread): ...from here.
2008-07-29 Adam Roben <aroben@apple.com>
Add support for setting thread names on Windows
These thread names make it much easier to identify particular threads
in Visual Studio's Threads panel.
WTF::createThread now takes a const char* representing the thread's
name. On Windows, we throw a special exception to set this string as
the thread's name. Other platforms do nothing with this name for now.
Reviewed by Anders Carlsson.
* JavaScriptCore.exp: Export the new version of createThread that
takes 3 arguments (the old one continues to be exported for backward
compatibility).
* wtf/Threading.h: Add a threadName argument to createThread.
* wtf/ThreadingGtk.cpp:
(WTF::createThread):
* wtf/ThreadingNone.cpp:
(WTF::createThread):
Updated for function signature change.
* wtf/ThreadingPthreads.cpp:
(WTF::createThread): Updated for function signature change. We keep
around the old 2-argument version of createThread for backward
compatibility.
* wtf/ThreadingWin.cpp:
(WTF::setThreadName): Added. This function's implementation came from
MSDN.
(WTF::initializeThreading): Set the name of the main thread.
(WTF::createThread): Call setThreadName. We keep around the old
2-argument version of createThread for backward compatibility.
2008-07-29 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Oliver Hunt.
Store UString::Rep::isStatic bit in identifierTable pointer instead of reportedCost for
slightly nicer code and a 0.5% SunSpider improvement.
* API/JSClassRef.cpp:
(OpaqueJSClass::~OpaqueJSClass):
(OpaqueJSClassContextData::OpaqueJSClassContextData):
* API/JSStringRef.cpp:
(JSStringRelease):
* kjs/PropertyNameArray.cpp:
(KJS::PropertyNameArray::add):
* kjs/identifier.cpp:
(KJS::IdentifierTable::~IdentifierTable):
(KJS::IdentifierTable::add):
(KJS::Identifier::addSlowCase):
(KJS::Identifier::remove):
* kjs/identifier.h:
(KJS::Identifier::add):
* kjs/ustring.cpp:
(KJS::):
(KJS::UString::Rep::create):
(KJS::UString::Rep::destroy):
* kjs/ustring.h:
(KJS::UString::Rep::identifierTable):
(KJS::UString::Rep::setIdentifierTable):
(KJS::UString::Rep::isStatic):
(KJS::UString::Rep::setStatic):
(KJS::UString::cost):
2008-07-28 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Renamed "ConstructTypeNative" => "ConstructTypeHost".
2008-07-26 Mark Rowe <mrowe@apple.com>
Speculative fix for the wx build.
* JavaScriptCoreSources.bkl: Add JSStaticScopeObject.cpp to the list of source files.
2008-07-25 Oliver Hunt <oliver@apple.com>
RS=Cameron Zwarich.
Whoops, forgot to save style correction.
* kjs/JSStaticScopeObject.h:
2008-07-25 Oliver Hunt <oliver@apple.com>
Reviewed by Cameron Zwarich.
Bug 19718: Named anonymous functions are slow accessing global variables
<https://bugs.webkit.org/show_bug.cgi?id=19718>
To fix this we switch over to an activation-like scope object for
on which we attach the function name property, and add logic to
prevent cross scope assignment to read only properties.
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::findScopedProperty):
(KJS::CodeGenerator::emitResolve):
* VM/CodeGenerator.h:
* kjs/AllInOneFile.cpp:
* kjs/JSStaticScopeObject.cpp: Added.
(KJS::JSStaticScopeObject::putWithAttributes):
(KJS::JSStaticScopeObject::isDynamicScope):
(KJS::JSStaticScopeObject::~JSStaticScopeObject):
(KJS::JSStaticScopeObject::getOwnPropertySlot):
* kjs/JSStaticScopeObject.h: Added.
(KJS::JSStaticScopeObject::JSStaticScopeObjectData::JSStaticScopeObjectData):
(KJS::JSStaticScopeObject::JSStaticScopeObject):
* kjs/nodes.cpp:
(KJS::FunctionCallResolveNode::emitCode):
(KJS::PostfixResolveNode::emitCode):
(KJS::PrefixResolveNode::emitCode):
(KJS::ReadModifyResolveNode::emitCode):
(KJS::AssignResolveNode::emitCode):
(KJS::FuncExprNode::makeFunction):
2008-07-25 kevino <kevino@theolliviers.com>
wx build fix for Win.
On wx/Win, including windows.h in Threading.h causes multiply-defined symbol errors
for libjpeg and wx, and also wx needs to include windows.h itself first for wx
includes to work right. So until we can find a better solution to this problem,
on wx, we work around the need to include windows.h here.
* wtf/Threading.h:
2008-07-25 Adam Roben <aroben@apple.com>
Windows build fix
* JavaScriptCore.vcproj/testapi/testapi.vcproj: Add API/ to the
include path.
2008-07-25 Simon Hausmann <hausmann@webkit.org>
Fix the build of jsc on Qt/Windows, make sure os-win32 is in the
include search path (added by WebKit.pri).
* kjs/jsc.pro:
2008-07-25 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Simon Hausmann.
Move JavaScriptCore API tests into a subdirectory of their own to avoid header name
conflicts and developer confusion.
* API/JSNode.c: Removed.
* API/JSNode.h: Removed.
* API/JSNodeList.c: Removed.
* API/JSNodeList.h: Removed.
* API/Node.c: Removed.
* API/Node.h: Removed.
* API/NodeList.c: Removed.
* API/NodeList.h: Removed.
* API/minidom.c: Removed.
* API/minidom.html: Removed.
* API/minidom.js: Removed.
* API/testapi.c: Removed.
* API/testapi.js: Removed.
* API/tests: Added.
* API/tests/JSNode.c: Copied from JavaScriptCore/API/JSNode.c.
* API/tests/JSNode.h: Copied from JavaScriptCore/API/JSNode.h.
* API/tests/JSNodeList.c: Copied from JavaScriptCore/API/JSNodeList.c.
* API/tests/JSNodeList.h: Copied from JavaScriptCore/API/JSNodeList.h.
* API/tests/Node.c: Copied from JavaScriptCore/API/Node.c.
* API/tests/Node.h: Copied from JavaScriptCore/API/Node.h.
* API/tests/NodeList.c: Copied from JavaScriptCore/API/NodeList.c.
* API/tests/NodeList.h: Copied from JavaScriptCore/API/NodeList.h.
* API/tests/minidom.c: Copied from JavaScriptCore/API/minidom.c.
* API/tests/minidom.html: Copied from JavaScriptCore/API/minidom.html.
* API/tests/minidom.js: Copied from JavaScriptCore/API/minidom.js.
* API/tests/testapi.c: Copied from JavaScriptCore/API/testapi.c.
* API/tests/testapi.js: Copied from JavaScriptCore/API/testapi.js.
* GNUmakefile.am:
* JavaScriptCore.vcproj/testapi/testapi.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-07-25 Simon Hausmann <hausmann@webkit.org>
Prospective WX build fix, add JavaScriptCore/API to the include search
path.
* jscore.bkl:
2008-07-25 Simon Hausmann <hausmann@webkit.org>
Rubber-stamped by Lars.
Fix the build on Windows. operator new for ArgList is implemented using fastMalloc()
but operator delete was not implemented. Unfortunately MSVC decides to call/reference
the function, so a simple implementation using fastFree() fixes the build.
* kjs/ArgList.h:
(KJS::ArgList::operator delete):
2008-07-25 Simon Hausmann <hausmann@webkit.org>
Discussed with and rubber-stamped by Lars.
Fix the build system for the Qt port.
Recent JavaScriptCore changes require the addition of JavaScriptCore/API to the
include search path. With a build process that combines JavaScriptCore and
WebCore in one build process/Makefile the existance of
JavaScriptCore/API/Node.h and WebCore/dom/Node.h causes include conflicts.
This commit solves this by introducing a separate build of JavaScriptCore into
a static library.
As a result of the split-up a race-condition due to broken dependencies of
regular source files to header files of generated sources showed up very
frequently when doing parallel builds (which the buildbot does). This commit at
the same time tries to address the dependency problem by making the
addExtraCompiler() function also generate a pseudo extra compiler that
represents the header file output, so that qmake is aware of the creation of
the header file for dependency calculation.
At the same time I removed a lot of cruft from the pro files to ease maintenance.
* JavaScriptCore.pri:
* JavaScriptCore.pro: Added.
* kjs/jsc.pro:
2008-07-24 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Fixed a strict aliasing violation, which caused hash tables with floating
point keys not to find items that were indeed in the tables
(intermittently, and only in release builds, of course).
SunSpider reports no change.
This bug doesn't seem to affect any existing code, but it causes obvious
crashes in some new code I'm working on.
* wtf/HashFunctions.h:
(WTF::FloatHash::hash): Use a union when punning between a float / double
and an unsigned (bucket of bits). With strict aliasing enabled, unions
are the only safe way to do this kind of type punning.
* wtf/HashTable.h: When rehashing, ASSERT that the item we just added to
the table is indeed in the table. In the buggy case described above, this
ASSERT fires.
2008-07-24 Oliver Hunt <oliver@apple.com>
Reviewed by Alexey Proskuryakov.
Bug 20142: REGRESSION(r35245): /=/ weirdness
<https://bugs.webkit.org/show_bug.cgi?id=20142>
When adding all the meta data needed for exception error messages
I accidentally clobbered the handling of regex beginning with /=.
* kjs/grammar.y:
2008-07-23 Alp Toker <alp@nuanti.com>
Build fix after r35293: Add API/ to the include path.
* GNUmakefile.am:
2008-07-23 Adam Roben <aroben@apple.com>
Windows build fixes
Build fix after r35293:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add API/
to the include path.
Build fix after r35305:
* VM/Machine.cpp:
* VM/Machine.h:
* VM/Opcode.cpp:
* VM/Opcode.h:
Completely compile out all sampler-related code when
SAMPLING_TOOL_ENABLED is 0. The sampler code can't be compiled 1) on
non-AllInOne configurations due to circular header dependencies, and
2) on platforms that don't have a usleep() function, such as Windows.
2008-07-23 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff Garen and Sam Weinig.
Improve switch performance.
Improve switch performance by converting to a hashmap based jump
table to avoid the sequence of dispatches that would otherwise be
needed. This results in a 9-19x performance win for string switches
based on ad hoc testing, and a 6x improvement for integer switch
statements. SunSpider reports a 1.2% progression.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
(KJS::SimpleJumpTable::offsetForValue):
* VM/CodeBlock.h:
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::beginSwitch):
(KJS::prepareJumpTableForImmediateSwitch):
(KJS::prepareJumpTableForCharacterSwitch):
(KJS::prepareJumpTableForStringSwitch):
(KJS::CodeGenerator::endSwitch):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::offsetForStringSwitch):
(KJS::Machine::privateExecute):
* VM/Opcode.cpp:
(KJS::):
* VM/Opcode.h:
* kjs/JSImmediate.h:
* kjs/nodes.cpp:
(KJS::):
(KJS::processClauseList):
(KJS::CaseBlockNode::tryOptimisedSwitch):
(KJS::CaseBlockNode::emitCodeForBlock):
* kjs/nodes.h:
(KJS::SwitchInfo::):
2008-07-23 Gavin Barraclough <barraclough@apple.com>
Reviewed by Geoff Garen.
Sampling tool to analyze cost of instruction execution and identify hot regions of JS code.
Enable Switches by setting SAMPLING_TOOL_ENABLED in Opcode.h.
* JavaScriptCore.exp: Export symbols for Shell.cpp.
* VM/Machine.cpp: Added sampling hooks.
* VM/Machine.h: Machine contains a pointer to a sampler, when sampling.
* VM/Opcode.cpp: Tool implementation.
* VM/Opcode.h: Tool declaration.
* kjs/Shell.cpp: Initialize the sampler, if enabled.
* kjs/nodes.cpp: Added sampling hooks.
2008-07-23 Gabor Loki <loki@inf.u-szeged.hu>
Bug 20097: [Qt] 20% Sunspider slow-down
<https://bugs.webkit.org/show_bug.cgi?id=20097>
Reviewed by Simon Hausmann.
* kjs/jsc.pro: Added missing NDEBUG define for release builds.
2008-07-23 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff Garen.
JSClassRef is created context-free, but gets infatuated with the first context it sees.
The implicit API contract is that JSClassRef can be used with any context on any thread.
This no longer worked, because UStrings in the class were turned into per-context
identifiers, and the cached JSObject prototype was tied to JSGlobalData, too.
* API/JSClassRef.h: Made a separate struct for context-dependent parts of OpaqueJSClass.
* API/JSClassRef.cpp:
(OpaqueJSClass::OpaqueJSClass): Updated for renames and changed member variable order.
(OpaqueJSClass::~OpaqueJSClass): Assert that string members are not identifiers.
(clearReferenceToPrototype): Update for the new reference location.
(OpaqueJSClassContextData::OpaqueJSClassContextData): Make a deep copy of all strings.
(OpaqueJSClass::contextData): Added a function that finds the per-context part of
OpaqueJSClass in JSGlobalData, or creates it if not found.
(OpaqueJSClass::className): Always make a deep copy. Callers of this function do not have
a way to access JSGlobalData, so a per-context copy could not be made.
(OpaqueJSClass::staticValues): Updated for new data location.
(OpaqueJSClass::staticFunctions): Ditto.
(OpaqueJSClass::prototype): Changed to take an internal type for consistency.
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::JSGlobalData):
(KJS::JSGlobalData::~JSGlobalData):
* kjs/JSGlobalData.h:
Keep a HashMap to access per-context JSClass data given a pointr to the shared part.
* API/JSCallbackObjectFunctions.h:
(KJS::::className):
(KJS::::getOwnPropertySlot):
(KJS::::put):
(KJS::::deleteProperty):
(KJS::::getPropertyNames):
(KJS::::staticValueGetter):
(KJS::::staticFunctionGetter):j
Use function accessors instead of accessing OpaqueJSClass members directly.
* API/JSContextRef.cpp: (JSGlobalContextCreate): Updated for the change in
OpaqueJSClass::prototype() argument type.
* API/JSObjectRef.cpp:
(JSObjectMake): Updated for the change in OpaqueJSClass::prototype() argument type.
(JSObjectMakeConstructor): Ditto.
2008-07-23 Alexey Proskuryakov <ap@webkit.org>
Build fix.
* kjs/ArgList.h: (KJS::ArgList::operator new): removed an extraneous "ArgList::" inside the
class definition.
2008-07-22 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt and Sam Weinig.
Next step toward putting doubles in registers: Prepare the Register class
and its clients for registers that don't contain JSValue*s.
This means a few things:
1. Register::jsValue() clients, including ArgList clients, must now supply
an ExecState* when accessing an entry in an ArgList, in case the entry
will need to create a JSValue* on the fly.
2. Register clients that definitely don't want to create a JSValue* on
the fly now use different APIs: getJSValue() for clients that know
the register contains a JSValue*, and v() for clients who just want a
void*.
3. I had to change some headers around in order to resolve dependency
problems created by using a Register in the ArgList header.
SunSpider reports no change.
2008-07-22 Gavin Barraclough <barraclough@apple.com>
Reviewed by Alexey Proskuryakov.
Prevent integer overflow when reallocating storage vector for arrays.
Sunspider reports 1.005x as fast (no change expected).
* kjs/JSArray.cpp:
2008-07-21 Mark Rowe <mrowe@apple.com>
Reviewed by Sam Weinig.
<rdar://problem/6091287> Revamp the handling of CFBundleShortVersionString to be fixed at the major component of the version number.
* Configurations/Version.xcconfig:
* Info.plist:
2008-07-21 Adam Roben <aroben@apple.com>
Add Vector::find
This is a convenience wrapper around std::find.
Reviewed by Anders Carlsson.
* wtf/Vector.h:
2008-07-19 Oliver Hunt <oliver@apple.com>
Reviewed by Cameron Zwarich.
Bug 20104: Exception in tables/mozilla_expected_failures/bugs/bug92868_1.html includes the equals operator in the quoted expression
<https://bugs.webkit.org/show_bug.cgi?id=20104>
To make this correct we make the dot and bracket assign nodes emit the information to indicate
the failure range is the dot/bracket accessor.
* kjs/grammar.y:
2008-07-18 Steve Falkenburg <sfalken@apple.com>
Windows build fix.
* kjs/JSGlobalObjectFunctions.cpp:
(KJS::isStrWhiteSpace):
2008-07-18 Steve Falkenburg <sfalken@apple.com>
Windows build fix.
* kjs/nodes.h:
(KJS::ThrowableExpressionData::ThrowableExpressionData):
2008-07-18 Oliver Hunt <oliver@apple.com>
Reviewed by Cameron Zwarich.
Bug 18774: SQUIRRELFISH: print meaningful error messages <https://bugs.webkit.org/show_bug.cgi?id=18774>
<rdar://problem/5769353> SQUIRRELFISH: JavaScript error messages are missing informative text
Add support for decent error messages in JavaScript. This patch achieves this by providing
ensuring the common errors and exceptions have messages that provide the text of expression
that trigger the exception. In addition it attaches a number of properties to the exception
object detailing where in the source the expression came from.
* JavaScriptCore.exp:
* VM/CodeBlock.cpp:
(KJS::CodeBlock::lineNumberForVPC):
(KJS::CodeBlock::expressionRangeForVPC):
Function to recover the expression range for an instruction
that triggered an exception.
* VM/CodeBlock.h:
(KJS::ExpressionRangeInfo::):
(KJS::CodeBlock::CodeBlock):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitCall):
(KJS::CodeGenerator::emitCallEval):
Emit call needed to be modified so to place the expression range info internally,
as the CodeGenerator emits the arguments nodes itself, rather than the various call
nodes.
* VM/CodeGenerator.h:
(KJS::CodeGenerator::emitExpressionInfo):
Record the expression range info.
* VM/ExceptionHelpers.cpp:
(KJS::createErrorMessage):
(KJS::createInvalidParamError):
(KJS::createUndefinedVariableError):
(KJS::createNotAConstructorError):
(KJS::createNotAFunctionError):
(KJS::createNotAnObjectErrorStub):
(KJS::createNotAnObjectError):
Rewrite all the code for the error messages so that they make use of the newly available
information.
* VM/ExceptionHelpers.h:
* VM/Machine.cpp:
(KJS::isNotObject): Now needs vPC and codeBlock
(KJS::Machine::throwException):
New logic to handle the NotAnObjectErrorStub and to handle the absurd "no default value" edge case
(KJS::Machine::privateExecute):
* VM/Machine.h:
* kjs/DebuggerCallFrame.cpp:
(KJS::DebuggerCallFrame::evaluate):
* kjs/Error.cpp:
(KJS::Error::create):
* kjs/Error.h:
* kjs/JSGlobalObjectFunctions.cpp:
* kjs/JSImmediate.cpp:
(KJS::JSImmediate::toObject):
(KJS::JSImmediate::prototype):
My changes to the JSNotAnObject constructor needed to be handled here.
* kjs/JSNotAnObject.h:
(KJS::JSNotAnObjectErrorStub::JSNotAnObjectErrorStub):
(KJS::JSNotAnObjectErrorStub::isNull):
(KJS::JSNotAnObjectErrorStub::isNotAnObjectErrorStub):
Added a JSNotAnObjectErrorStub class to ease the handling of toObject failure exceptions,
and potentially allow even more detailed error messages in future.
* kjs/JSObject.h:
* kjs/Parser.h:
(KJS::Parser::parse):
* kjs/SourceRange.h:
* kjs/grammar.y:
Large amounts of position propagation.
* kjs/lexer.cpp:
(KJS::Lexer::Lexer):
(KJS::Lexer::shift):
(KJS::Lexer::lex):
The lexer needed a few changes to be able to correctly track token character positions.
* kjs/lexer.h:
* kjs/nodes.cpp:
(KJS::ThrowableExpressionData::emitThrowError):
(KJS::StatementNode::StatementNode):
(KJS::ResolveNode::emitCode):
(KJS::BracketAccessorNode::emitCode):
(KJS::DotAccessorNode::emitCode):
(KJS::NewExprNode::emitCode):
(KJS::EvalFunctionCallNode::emitCode):
(KJS::FunctionCallValueNode::emitCode):
(KJS::FunctionCallResolveNode::emitCode):
(KJS::FunctionCallBracketNode::emitCode):
(KJS::FunctionCallDotNode::emitCode):
(KJS::PostfixResolveNode::emitCode):
(KJS::PostfixBracketNode::emitCode):
(KJS::PostfixDotNode::emitCode):
(KJS::DeleteResolveNode::emitCode):
(KJS::DeleteBracketNode::emitCode):
(KJS::DeleteDotNode::emitCode):
(KJS::PrefixResolveNode::emitCode):
(KJS::PrefixBracketNode::emitCode):
(KJS::PrefixDotNode::emitCode):
(KJS::ThrowableBinaryOpNode::emitCode):
(KJS::ReadModifyResolveNode::emitCode):
(KJS::AssignResolveNode::emitCode):
(KJS::AssignDotNode::emitCode):
(KJS::ReadModifyDotNode::emitCode):
(KJS::AssignBracketNode::emitCode):
(KJS::ReadModifyBracketNode::emitCode):
(KJS::ForInNode::ForInNode):
(KJS::ForInNode::emitCode):
(KJS::WithNode::emitCode):
(KJS::LabelNode::emitCode):
(KJS::ThrowNode::emitCode):
(KJS::ProgramNode::ProgramNode):
(KJS::ProgramNode::create):
(KJS::EvalNode::generateCode):
(KJS::FunctionBodyNode::create):
(KJS::FunctionBodyNode::generateCode):
(KJS::ProgramNode::generateCode):
All of these methods were handling the position information.
Constructors and create methods were modified to store the information.
All the emitCall implementations listed needed to be updated to actually
record the position information we have so carefully collected.
* kjs/nodes.h:
(KJS::ThrowableExpressionData::ThrowableExpressionData):
(KJS::ThrowableExpressionData::setExceptionSourceRange):
(KJS::ThrowableExpressionData::divot):
(KJS::ThrowableExpressionData::startOffset):
(KJS::ThrowableExpressionData::endOffset):
(KJS::ThrowableSubExpressionData::ThrowableSubExpressionData):
(KJS::ThrowableSubExpressionData::setSubexpressionInfo):
(KJS::ThrowablePrefixedSubExpressionData::ThrowablePrefixedSubExpressionData):
(KJS::ThrowablePrefixedSubExpressionData::setSubexpressionInfo):
ThrowableExpressionData is just a uniform mechanism for storing the position
information.
(KJS::ResolveNode::):
(KJS::PrePostResolveNode::):
(KJS::ThrowableBinaryOpNode::):
(KJS::WithNode::):
2008-07-18 Geoffrey Garen <ggaren@apple.com>
Reviewed by Cameron Zwarich.
Three renames:
"CallTypeNative" => "CallTypeHost"
"code" => "byteCode"
"generatedCode" => "generatedByteCode"
2008-07-18 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Optimized <= for immediate number cases.
SunSpider reports no overall change, but a 10% speedup on access-nsieve.
2008-07-18 Mark Rowe <mrowe@apple.com>
Rubber-stamped by Sam Weinig.
Fix some casts added in a previous build fix to match the style used
throughout WebKit.
* VM/Machine.cpp:
(KJS::Machine::initializeCallFrame):
* VM/Register.h:
(KJS::Register::Register):
2008-07-18 Landry Breuil <landry@openbsd.org>
Bug 19975: [OpenBSD] Patches to enable build of WebKit
<https://bugs.webkit.org/show_bug.cgi?id=19975>
Reviewed by David Kilzer.
Support for OpenBSD, mostly threading and libm tweaks.
* kjs/collector.cpp: #include <pthread.h>
(KJS::currentThreadStackBase): use pthread_stackseg_np() to get stack base
* kjs/config.h: OpenBSD also provides <pthread_np.h>
* wtf/MathExtras.h: #include <sys/types.h> and <machine/ieee.h>
(isfinite), (signbit): as long as we don't have those functions provide fallback implementations
* wtf/Platform.h: Add support for PLATFORM(OPENBSD) and PLATFORM(SPARC64) macro
2008-07-17 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Next step toward putting doubles in registers: Store constant pool
entries as registers, not JSValue*s.
SunSpider reports no change.
2008-07-17 Geoffrey Garen <ggaren@apple.com>
Reviewed by John Sullivan and Oliver Hunt.
A tiny bit of tidying in function call register allocation.
This patch saves one register when invoking a function expression and/or
a new expression that is stored in a temporary.
Since it's just one register, I can't make a testcase for it.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitCall): No need to ref the function we're calling
or its base. We'd like the call frame to overlap with them, if possible.
op_call will read the function and its base before writing the call frame,
so this is safe.
* kjs/nodes.cpp:
(KJS::NewExprNode::emitCode): No need to ref the function we're new-ing,
for the same reasons stated above.
(KJS::FunctionCallValueNode::emitCode): ditto
2008-07-17 Steve Falkenburg <sfalken@apple.com>
Build fix.
* kjs/InternalFunction.cpp:
2008-07-17 Sam Weinig <sam@webkit.org>
Roll out r35199 as it is causing failures on the PPC build.
2008-07-17 Geoffrey Garen <ggaren@apple.com>
Reviewed by David Kilzer.
Fixed https://bugs.webkit.org/show_bug.cgi?id=20067
Support function.name (Firefox extension)
Pretty straight-forward.
2008-07-17 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fixed <rdar://problem/6081636> Functions calls use more temporary
registers than necessary
Holding a reference to the last statement result register caused each
successive statement to output its result to an even higher register.
Happily, statements don't actually need to return a result register
at all. I hope to make this clearer in a future cleanup patch,
but this change will fix the major bug for now.
* kjs/nodes.cpp:
(KJS::statementListEmitCode):
2008-07-17 Gavin Barraclough <barraclough@apple.com>
Reviewed by Sam Weinig.
Merge pre&post dot nodes to simplify the parse tree.
Sunspider results show 0.6% progression (no performance change expected).
* kjs/grammar.y:
* kjs/nodes.cpp:
* kjs/nodes.h:
* kjs/nodes2string.cpp:
2008-07-17 Gavin Barraclough <barraclough@apple.com>
Reviewed by Cameron Zwarich.
Merge pre&post resolve nodes to simplify the parse tree.
Sunspider results show no performance change.
* kjs/grammar.y:
* kjs/nodes.cpp:
* kjs/nodes.h:
* kjs/nodes2string.cpp:
2008-07-17 Gavin Barraclough <barraclough@apple.com>
Reviewed by Cameron Zwarich.
Merge logical nodes to simplify the parse tree.
Sunspider results show 0.6% progression (no performance change expected).
* kjs/grammar.y:
* kjs/nodes.cpp:
* kjs/nodes.h:
* kjs/nodes2string.cpp:
2008-07-17 Ariya Hidayat <ariya.hidayat@trolltech.com>
Reviewed by Simon.
Fix MinGW build (broken in r35198) and simplify getLocalTime().
* kjs/DateMath.cpp:
(KJS::getLocalTime):
2008-07-17 Gavin Barraclough <barraclough@apple.com>
Reviewed by Sam Weinig.
Merge pre&post bracket nodes to simplify the parse tree.
Sunspider results show no performance change.
* kjs/grammar.y:
* kjs/nodes.cpp:
* kjs/nodes.h:
* kjs/nodes2string.cpp:
2008-07-17 Ariya Hidayat <ariya.hidayat@trolltech.com>
Reviewed by Simon.
Fix the 32-bit gcc builds, conversion from "long int" to Register is
ambiguous. Explicitly choose the intptr_t constructor.
* VM/Machine.cpp:
(KJS::Machine::initializeCallFrame):
* VM/Register.h:
(KJS::Register::Register):
2008-07-16 Mark Rowe <mrowe@apple.com>
Rubber-stamped by Geoff Garen.
Fix JavaScript in 64-bit by using a pointer-sized integer
type in the Register union. Also includes a rename of
the intType constant to IntType.
* VM/Machine.cpp:
(KJS::Machine::initializeCallFrame):
* VM/Register.h:
(KJS::Register::):
(KJS::Register::Register):
2008-07-17 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
First step toward putting doubles in registers: Turned Register into a
proper abstraction layer. It is no longer possible to cast a Register
to a JSValue*, or a Register& to a JSValue*&, or to access the union
inside a Register directly.
SunSpider reports no change.
In support of this change, I had to make the following mechanical changes
in a lot of places:
1. Clients now use explicit accessors to read data out of Registers, and
implicit copy constructors to write data into registers.
So, assignment that used to look like
x.u.jsValue = y;
now looks like
x = y;
And access that used to look like
x = y.u.jsValue;
now looks like
x = y.jsValue();
2. I made generic flow control specific in opcodes that made their flow
control generic by treating a Register& as a JSValue*&. This had the
added benefit of removing some exception checking branches from immediate
number code.
3. I beefed up PropertySlot to support storing a Register* in a property
slot. For now, only JSVariableObject's symbolTableGet and symbolTablePut
use this functionality, but I expect more clients to use it in the future.
4. I changed ArgList to be a buffer of Registers, not JSValue*'s, and I
changed ArgList iterator clients to iterate Registers, not JSValue*'s.
2008-07-16 Ada Chan <adachan@apple.com>
Fixed build.
* kjs/JSGlobalObject.cpp:
2008-07-16 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam and Geoff.
<rdar://problem/5958840> Navigating to another page while profiler is
attached results in slow JavaScript for all time.
- The UNLIKELY keeps this from being a sunspider performance regression.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::~JSGlobalObject): Stop the profiler associated
with this exec state.
2008-07-16 Sam Weinig <sam@webkit.org>
Reviewed by Steve Falkenburg.
Replace adopting UString constructor in favor of explicit
static adopt method.
* API/JSStringRefCF.cpp:
(JSStringCreateWithCFString):
* kjs/StringConstructor.cpp:
(KJS::stringFromCharCode):
* kjs/StringPrototype.cpp:
(KJS::stringProtoFuncToLowerCase):
(KJS::stringProtoFuncToUpperCase):
(KJS::stringProtoFuncToLocaleLowerCase):
(KJS::stringProtoFuncToLocaleUpperCase):
* kjs/ustring.cpp:
(KJS::UString::adopt):
* kjs/ustring.h:
(KJS::UString::UString):
(KJS::UString::~UString):
2008-07-16 Ariya Hidayat <ariya.hidayat@trolltech.com>
Reviewed by Simon.
http://trolltech.com/developer/task-tracker/index_html?method=entry&id=216179
Fix potential crash (on Qt for Windows port) when performing JavaScript date
conversion.
* kjs/DateMath.cpp:
(KJS::getLocalTime): For the Qt port, prefer to use Windows code, i.e.
localtime_s() instead of localtime() since the latter might crash (on Windows)
given a non-sensible, e.g. NaN, argument.
2008-07-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Anders and Geoff.
https://bugs.webkit.org/show_bug.cgi?id=20023
Failed assertion in PropertyNameArray.cpp
This is already tested by testapi.
* API/JSObjectRef.cpp: (JSPropertyNameAccumulatorAddName): Add the string to identifier
table to appease PropertyNameArray.
2008-07-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff.
Dereference identifiers when deleting a hash table (fixes leaks with private JSGlobalData
objects).
* kjs/JSGlobalData.cpp: (KJS::JSGlobalData::~JSGlobalData):
* kjs/lookup.cpp: (KJS::HashTable::deleteTable):
* kjs/lookup.h:
* kjs/lexer.cpp: (KJS::Lexer::~Lexer)
HashTable cannot have a destructor, because check-for-global-initializers complains about
having a global constructor then.
2008-07-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff.
Check pthread_key_create return value.
This check was helpful when debugging a crash in run-webkit-tests --threaded that happened
because JSGlobalData objects were not deleted, and we were running out of pthread keys soon.
It also looks useful for production builds.
* wtf/ThreadSpecific.h: (WTF::::ThreadSpecific):
2008-07-15 Kevin McCullough <kmccullough@apple.com>
Reviewed by Geoff.
Rename pageGroupIdentifier to profileGroup to keep mention of a
pageGroup out of JavaScriptCore.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::init):
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::setProfileGroup):
(KJS::JSGlobalObject::profileGroup):
* profiler/ProfileGenerator.cpp:
(KJS::ProfileGenerator::create):
(KJS::ProfileGenerator::ProfileGenerator):
* profiler/ProfileGenerator.h:
(KJS::ProfileGenerator::profileGroup):
* profiler/Profiler.cpp:
(KJS::Profiler::startProfiling):
(KJS::dispatchFunctionToProfiles):
(KJS::Profiler::willExecute):
(KJS::Profiler::didExecute):
2008-07-14 Mark Rowe <mrowe@apple.com>
Reviewed by Sam Weinig.
Fix https://bugs.webkit.org/show_bug.cgi?id=20037
Bug 20037: GCC 4.2 build broken due to strict aliasing violation.
* kjs/ustring.cpp:
(KJS::UString::Rep::computeHash): Add a version of computeHash that takes a char* and explicit length.
* kjs/ustring.h:
* profiler/CallIdentifier.h:
(WTF::): Use new version of computeHash that takes a char* and explicit length to avoid unsafe aliasing.
2008-07-14 David Hyatt <hyatt@apple.com>
Fix a crashing bug in ListHashSet's -- operator. Make sure that end() can be -- by special-casing the null
position.
Reviewed by Maciej
* wtf/ListHashSet.h:
(WTF::ListHashSetConstIterator::operator--):
2008-07-14 David Hyatt <hyatt@apple.com>
Buidl fix. Make sure the second insertBefore method returns a value.
* wtf/ListHashSet.h:
(WTF::::insertBefore):
2008-07-14 Adam Roben <aroben@apple.com>
Windows build fix
* JavaScriptCore.vcproj/jsc/jsc.vcproj: Added include/pthreads to the
include path.
2008-07-14 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Kevin McCullough.
Make JSGlobalData refcounted in preparation to adding a way to create contexts that share
global data.
* JavaScriptCore.exp:
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::create):
* kjs/JSGlobalData.h:
Made contructor private, and added a static create() method. Made the class inherit from
RefCounted.
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::globalData):
JSGlobalData is now owned by JSGlobalObject (except for the shared one, and the common
WebCore one, which are never deleted).
* kjs/Shell.cpp: (main): Create JSGlobalData with create() method.
2008-07-14 Simon Hausmann <hausmann@webkit.org>
Fix the single-threaded build.
* kjs/JSLock.cpp: Removed undeclared registerThread() function.
* kjs/collector.cpp:
(KJS::Heap::registerThread): Added dummy implementation.
2008-07-14 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff Garen.
Eliminate per-thread JavaScript global data instance support and make arbitrary
global data/global object combinations possible.
* kjs/collector.cpp:
(KJS::Heap::Heap): Store a JSGlobalData pointer instead of multiple pointers to its members.
This allows for going from any JS object to its associated global data, currently used in
JSGlobalObject constructor to initialize its JSGlobalData pointer.
(KJS::Heap::registerThread): Changed thread registration data to be per-heap. Previously,
only the shared heap could be used from multiple threads, so it was the only one that needed
thread registration, but now this can happen to any heap.
(KJS::Heap::unregisterThread): Ditto.
(KJS::Heap::markStackObjectsConservatively): Adapt for the above changes.
(KJS::Heap::setGCProtectNeedsLocking): Ditto.
(KJS::Heap::protect): Ditto.
(KJS::Heap::unprotect): Ditto.
(KJS::Heap::collect): Ditto.
(KJS::Heap::globalObjectCount): Use global object list associated with the current heap,
not the late per-thread one.
(KJS::Heap::protectedGlobalObjectCount): Ditto.
* kjs/collector.h:
(KJS::Heap::ThreadRegistrar): Added a helper object that unregisters a thread when it is
destroyed.
* kjs/JSLock.cpp:
(KJS::JSLock::JSLock):
* kjs/JSLock.h:
(KJS::JSLock::JSLock):
Don't use JSLock to implicitly register threads. I've added registerThread() calls to most
places that use JSLock - we cannot guarantee absolute safety unless we always mark all
threads in the process, but these implicit registration calls should cover reasonable usage
scenarios, I hope.
* API/JSBase.cpp:
(JSEvaluateScript): Explicitly register the current thread.
(JSCheckScriptSyntax): Explicitly register the current thread.
(JSGarbageCollect): Changed to use the passed in context. Unfortunately, this creates a race
condition for clients that pass an already released context to JSGarbageCollect - but it is
unlikely to create real life problems.
To maintain compatibility, the shared heap is collected if NULL is passed.
* API/JSContextRef.cpp:
(JSGlobalContextCreate): Use a new syntax for JSGlobalObject allocation.
(JSGlobalContextRetain): Register the thread.
(JSContextGetGlobalObject): Register the thread.
* API/JSObjectRef.cpp:
(JSObjectMake):
(JSObjectMakeFunctionWithCallback):
(JSObjectMakeConstructor):
(JSObjectMakeFunction):
(JSObjectHasProperty):
(JSObjectGetProperty):
(JSObjectSetProperty):
(JSObjectGetPropertyAtIndex):
(JSObjectSetPropertyAtIndex):
(JSObjectDeleteProperty):
(JSObjectCallAsFunction):
(JSObjectCallAsConstructor):
(JSObjectCopyPropertyNames):
(JSPropertyNameAccumulatorAddName):
* API/JSValueRef.cpp:
(JSValueIsEqual):
(JSValueIsInstanceOfConstructor):
(JSValueMakeNumber):
(JSValueMakeString):
(JSValueToNumber):
(JSValueToStringCopy):
(JSValueToObject):
(JSValueProtect):
(JSValueUnprotect):
Register the thread.
* API/JSStringRef.cpp: (JSStringRelease): Changed a comment to not mention per-thread contexts.
* API/JSStringRefCF.cpp: Removed an unnecessary include of JSLock.h.
* JavaScriptCore.exp: Export JSGlobalData constructor/destructor, now that anyone can have
their own instances. Adapt to other changes, too.
* JavaScriptCore.xcodeproj/project.pbxproj: Made ThreadSpecific.h private, as it is now
included by collector.h and is thus needed in other projects.
* kjs/InitializeThreading.cpp: (KJS::initializeThreadingOnce): Don't initialize per-thread
global data, as it no longer exists.
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::JSGlobalData):
(KJS::JSGlobalData::~JSGlobalData):
* kjs/JSGlobalData.h:
Removed support for per-thread instance. Made constructor and destructor public.
* kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::init): Get to now arbitrary JSGlobalData
via the heap.
(KJS::JSGlobalObject::operator new): Changed ot take JSGlobalDatra pointer.
* kjs/JSGlobalObject.h:
* kjs/Shell.cpp:
(main):
(jscmain):
Changed to maintain a custom JSGlobalData pointer instead of a per-thread one.
2008-07-13 Ada Chan <adachan@apple.com>
Windows build fix: Add wtf/RefCountedLeakCounter to the project.
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
2008-07-12 Jan Michael Alonzo <jmalonzo@webkit.org>
Gtk, Qt and Wx build fix: Add wtf/RefCountedLeakCounter in the
build scripts
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCoreSources.bkl:
2008-07-11 Stephanie Lewis <slewis@apple.com>
Reviewed by Darin Adler and Oliver Hunt.
Refactor RefCounting Leak counting code into a common class.
In order to export the symbols I needed to put the debug defines inside the function names
Before we had a separate channel for each Logging each Leak type. Since the leak channels were only used in one location, and only at quit for simplicity I combined them all into one leak channel.
* JavaScriptCore.exp:
* JavaScriptCore.xcodeproj/project.pbxproj: add new class
* kjs/nodes.cpp: remove old leak counting code
* wtf/RefCountedLeakCounter.cpp: Added. create a common leak counting class
* wtf/RefCountedLeakCounter.h: Added.
2008-07-11 David Hyatt <hyatt@apple.com>
Add an insertBefore method to ListHashSet to allow for insertions in the middle of the list (rather than just
at the end).
Reviewed by Anders
* wtf/ListHashSet.h:
(WTF::::insertBefore):
(WTF::::insertNodeBefore):
2008-07-11 Sam Weinig <sam@webkit.org>
Rubber-stamped by Darin Adler.
Move call function to CallData.cpp and construct to ConstructData.cpp.
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* kjs/AllInOneFile.cpp:
* kjs/CallData.cpp: Copied from kjs/JSValue.cpp.
* kjs/ConstructData.cpp: Copied from kjs/JSValue.cpp.
* kjs/JSValue.cpp:
2008-07-10 Mark Rowe <mrowe@apple.com>
Reviewed by Sam Weinig.
Define WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST when building WebKit to ensure that no symbols end up with the weak_import attribute.
* Configurations/Base.xcconfig:
2008-07-10 Mark Rowe <mrowe@apple.com>
Reviewed by Sam Weinig.
Fix the Tiger build by omitting annotations from methods declared in categories when using old versions of GCC.
* API/WebKitAvailability.h:
2008-07-10 Kevin McCullough <kmccullough@apple.com>
Reviewed by Darin.
-Minor cleanup. Renamed callTree() to head() and no longer use m_head
directly but instead keep it private and access via a method().
* profiler/HeavyProfile.cpp:
(KJS::HeavyProfile::HeavyProfile):
(KJS::HeavyProfile::generateHeavyStructure):
(KJS::HeavyProfile::addNode):
* profiler/Profile.h:
(KJS::Profile::head):
* profiler/ProfileGenerator.cpp:
(KJS::ProfileGenerator::ProfileGenerator):
2008-07-10 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Mark Rowe.
Eliminate CollectorHeapIntrospector.
CollectorHeapIntrospector was added primarily in the hopes to improve leaks tool output,
a result that it didn't deliver. Also, it helped by labeling JSC heap regions as reported by
vmmap tool, but at the same time, it made them mislabeled as malloc'd ones - the correct
way to label mapped regions is to use a VM tag.
So, it makes more sense to remove it completely than to make it work with multiple heaps.
* JavaScriptCore.exp:
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/AllInOneFile.cpp:
* kjs/InitializeThreading.cpp:
(KJS::initializeThreading):
* kjs/collector.cpp:
* kjs/collector.h:
* kjs/CollectorHeapIntrospector.cpp: Removed.
* kjs/CollectorHeapIntrospector.h: Removed.
2008-07-09 Kevin McCullough <kmccullough@apple.com>
Reviewed by Darin.
<rdar://problem/5951532> JSProfiler: Implement heavy (or bottom-up)
view (19228)
- Implemented the time and call count portionof heavy. Now all that we
need is some UI.
* profiler/CallIdentifier.h: Removed an unused constructor.
* profiler/HeavyProfile.cpp:
(KJS::HeavyProfile::HeavyProfile): Set the initial time of the head
node so that percentages work correctly.
(KJS::HeavyProfile::mergeProfiles): Sum the times and call count of
nodes being merged.
* profiler/ProfileNode.cpp: Set the intital values of time and call
count when copying ProfileNodes.
(KJS::ProfileNode::ProfileNode):
2008-07-10 Jan Michael Alonzo <jmalonzo@webkit.org>
Gtk build fix.
* GNUmakefile.am: Add HeavyProfile.cpp
2008-07-09 Mark Rowe <mrowe@apple.com>
Reviewed by Geoff Garen.
Don't warn about deprecated functions in production builds.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
2008-07-09 Darin Adler <darin@apple.com>
* JavaScriptCore.pri: Fix Qt build by adding HeavyProfile.cpp.
2008-07-09 Kevin Ollivier <kevino@theolliviers.com>
wx biuld fix. Add HeavyProfile.cpp to build files.
* JavaScriptCoreSources.bkl:
2008-07-09 Kevin McCullough <kmccullough@apple.com>
- Windows build fix.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2008-07-09 Kevin McCullough <kmccullough@apple.com>
- Build fix.
* profiler/HeavyProfile.cpp:
(KJS::HeavyProfile::mergeProfiles):
2008-07-09 Kevin McCullough <kmccullough@apple.com>
Reviewed by Geoff and Adam.
<rdar://problem/5951532> JSProfiler: Implement Bottom-Up view (19228)
- This is the plumbing for bottom-up, but does not include calculating
time, mostly because I'm still undclear about what the end result should
look like.
- This, obviously, does not include the UI to expose this in the
inspector yet.
* JavaScriptCore.xcodeproj/project.pbxproj:
* profiler/CallIdentifier.h:
(KJS::CallIdentifier::CallIdentifier):
(WTF::): Added HashTraits for CallIdentifiers to be used by a HashMap.
* profiler/HeavyProfile.cpp: Added.
(KJS::HeavyProfile::HeavyProfile):
(KJS::HeavyProfile::generateHeavyStructure):
(KJS::HeavyProfile::addNode):
(KJS::HeavyProfile::mergeProfiles):
(KJS::HeavyProfile::addAncestorsAsChildren):
* profiler/HeavyProfile.h: Added.
(KJS::HeavyProfile::create):
(KJS::HeavyProfile::heavyProfile):
(KJS::HeavyProfile::treeProfile):
* profiler/Profile.cpp: Removed old commented out includes.
* profiler/Profile.h: The m_head is needed by the HeavyProfile so it
is now protected as opposed to private.
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::ProfileNode): Created a constructor to copy
ProfileNodes.
(KJS::ProfileNode::findChild): Added a null check to make HeavyProfile
children finding easier and avoid a potential crasher.
* profiler/ProfileNode.h: Mostly moved things around but also added some
functionality needed by HeavyProfile.
(KJS::ProfileNode::create):
(KJS::ProfileNode::functionName):
(KJS::ProfileNode::url):
(KJS::ProfileNode::lineNumber):
(KJS::ProfileNode::head):
(KJS::ProfileNode::setHead):
(KJS::ProfileNode::setNextSibling):
(KJS::ProfileNode::actualTotalTime):
(KJS::ProfileNode::actualSelfTime):
* profiler/TreeProfile.cpp: Implemented the ability to get a
HeavyProfile.
(KJS::TreeProfile::heavyProfile):
* profiler/TreeProfile.h:
2008-07-08 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Added support for checking if an object has custom properties in its
property map. WebCore uses this to optimize marking DOM wrappers.
2008-07-08 Simon Hausmann <hausmann@webkit.org>
Prospective Gtk/Wx build fixes, add ProfileGenerator.cpp to the build.
* GNUmakefile.am:
* JavaScriptCoreSources.bkl:
2008-07-08 Simon Hausmann <hausmann@webkit.org>
Fix the Qt build, add ProfileGenerator.cpp to the build.
* JavaScriptCore.pri:
2008-07-07 David Kilzer <ddkilzer@apple.com>
releaseFastMallocFreeMemory() should always be defined
Reviewed by Darin.
* JavaScriptCore.exp: Changed to export C++ binding for
WTF::releaseFastMallocFreeMemory() instead of C binding for
releaseFastMallocFreeMemory().
* wtf/FastMalloc.cpp: Moved definitions of
releaseFastMallocFreeMemory() to be in the WTF namespace
regardless whether FORCE_SYSTEM_MALLOC is defined.
* wtf/FastMalloc.h: Moved releaseFastMallocFreeMemory() from
extern "C" binding to WTF::releaseFastMallocFreeMemory().
2008-07-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Geoff.
Bug 19926: URL causes crash within a minute
<https://bugs.webkit.org/show_bug.cgi?id=19926>
Add a check that lastGlobalObject is non-null in Machine::execute()
before copying its globals to the current register file.
In theory, it is possible to make a test case for this, but it will
take a while to get it right.
* VM/Machine.cpp:
(KJS::Machine::execute):
2008-07-07 Darin Adler <darin@apple.com>
Rubber stamped by Adele.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Fix a typo in a comment.
2008-07-07 Steve Falkenburg <sfalken@apple.com>
Build fixes.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.vcproj/testapi/testapi.vcproj:
2008-07-07 Kevin McCullough <kmccullough@apple.com>
Reviewed by Darin.
When the profiler is running it gathers information and creates a
Profile. After it finishes the Profile can be sorted and have other
data refinements run over it. Both of these were done in the same class
before. Now I split the gathering operations into a new class called
ProfileGenerator.
* JavaScriptCore.xcodeproj/project.pbxproj:
* profiler/Profile.cpp: Removed code related to the gather stage of a
Profile's creation.
(KJS::Profile::create):
(KJS::Profile::Profile):
* profiler/Profile.h: Ditto.
(KJS::Profile::title):
(KJS::Profile::callTree):
(KJS::Profile::setHead):
* profiler/ProfileGenerator.cpp: Added. This is the class that will
handle the stage of creating a Profile. Once the Profile is finished
being created, this class goes away.
(KJS::ProfileGenerator::create):
(KJS::ProfileGenerator::ProfileGenerator):
(KJS::ProfileGenerator::title):
(KJS::ProfileGenerator::willExecute):
(KJS::ProfileGenerator::didExecute):
(KJS::ProfileGenerator::stopProfiling):
(KJS::ProfileGenerator::didFinishAllExecution):
(KJS::ProfileGenerator::removeProfileStart):
(KJS::ProfileGenerator::removeProfileEnd):
* profiler/ProfileGenerator.h: Added.
(KJS::ProfileGenerator::profile):
(KJS::ProfileGenerator::originatingGlobalExec):
(KJS::ProfileGenerator::pageGroupIdentifier):
(KJS::ProfileGenerator::client):
(KJS::ProfileGenerator::stoppedProfiling):
* profiler/Profiler.cpp: Now operates with the ProfileGenerator instead
of the Profile.
(KJS::Profiler::startProfiling):
(KJS::Profiler::stopProfiling):
(KJS::Profiler::didFinishAllExecution): It is here that the Profile is
handed off to its client and the Profile Generator is no longer needed.
(KJS::dispatchFunctionToProfiles):
(KJS::Profiler::willExecute):
(KJS::Profiler::didExecute):
* profiler/Profiler.h: Cleaned up the includes and subsequently the
forward declarations. Also use the new ProfileGenerator.
(KJS::ProfilerClient::~ProfilerClient):
(KJS::Profiler::currentProfiles):
* profiler/TreeProfile.cpp: Use Profile's new interface.
(KJS::TreeProfile::create):
(KJS::TreeProfile::TreeProfile):
* profiler/TreeProfile.h:
2008-07-07 Sam Weinig <sam@webkit.org>
Reviewed by Cameron Zwarich.
Third step in broad cleanup effort.
[ File list elided ]
2008-07-06 Sam Weinig <sam@webkit.org>
Reviewed by Cameron Zwarich.
Second step in broad cleanup effort.
[ File list elided ]
2008-07-05 Sam Weinig <sam@webkit.org>
Reviewed by Cameron Zwarich.
First step in broad cleanup effort.
[ File list elided ]
2008-07-05 Sam Weinig <sam@webkit.org>
Rubber-stamped by Cameron Zwarich.
Rename list.h/cpp to ArgList.h/cpp.
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* VM/Machine.h:
* kjs/AllInOneFile.cpp:
* kjs/ArgList.cpp: Copied from JavaScriptCore/kjs/list.cpp.
* kjs/ArgList.h: Copied from JavaScriptCore/kjs/list.h.
* kjs/IndexToNameMap.cpp:
* kjs/JSGlobalData.cpp:
* kjs/JSGlobalData.h:
* kjs/JSObject.h:
* kjs/collector.cpp:
* kjs/list.cpp: Removed.
* kjs/list.h: Removed.
2008-07-05 Sam Weinig <sam@webkit.org>
Fix non-AllInOne builds again.
* kjs/BooleanPrototype.cpp:
* kjs/ErrorPrototype.cpp:
* kjs/FunctionPrototype.cpp:
* kjs/NumberPrototype.cpp:
* kjs/ObjectPrototype.cpp:
2008-07-05 Sam Weinig <sam@webkit.org>
Fix build on case-sensitive build systems.
* kjs/IndexToNameMap.cpp:
2008-07-05 Sam Weinig <sam@webkit.org>
Fix build.
* kjs/Arguments.cpp:
* kjs/BooleanPrototype.cpp:
* kjs/DateConstructor.cpp:
* kjs/ErrorPrototype.cpp:
* kjs/FunctionPrototype.cpp:
* kjs/NumberPrototype.cpp:
* kjs/ObjectPrototype.cpp:
* kjs/RegExpPrototype.cpp:
* kjs/StringConstructor.cpp:
* kjs/lookup.cpp:
2008-07-05 Sam Weinig <sam@webkit.org>
Fix non-AllInOne build.
* kjs/JSGlobalObject.cpp:
2008-07-05 Sam Weinig <sam@webkit.org>
Rubber-stamped by Cameron Zwarich.
Split Arguments, IndexToNameMap, PrototypeFunction, GlobalEvalFunction and
the functions on the global object out of JSFunction.h/cpp.
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* VM/Machine.cpp:
* kjs/AllInOneFile.cpp:
* kjs/Arguments.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
* kjs/Arguments.h: Copied from JavaScriptCore/kjs/JSFunction.h.
* kjs/GlobalEvalFunction.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
* kjs/GlobalEvalFunction.h: Copied from JavaScriptCore/kjs/JSFunction.h.
* kjs/IndexToNameMap.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
* kjs/IndexToNameMap.h: Copied from JavaScriptCore/kjs/JSFunction.h.
* kjs/JSActivation.cpp:
* kjs/JSFunction.cpp:
* kjs/JSFunction.h:
* kjs/JSGlobalObject.cpp:
* kjs/JSGlobalObjectFunctions.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
* kjs/JSGlobalObjectFunctions.h: Copied from JavaScriptCore/kjs/JSFunction.h.
The functions on the global object should be in JSGlobalObject.cpp, but putting them there
was a 0.5% regression.
* kjs/PrototypeFunction.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
* kjs/PrototypeFunction.h: Copied from JavaScriptCore/kjs/JSFunction.h.
* kjs/Shell.cpp:
* kjs/lexer.cpp:
* kjs/ustring.cpp:
2008-07-04 Sam Weinig <sam@webkit.org>
Really fix the mac build.
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-07-04 Sam Weinig <sam@webkit.org>
Fix mac build.
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-07-04 Sam Weinig <sam@webkit.org>
Fix non-AllInOne builds.
* kjs/Error.cpp:
* kjs/GetterSetter.cpp:
* kjs/JSImmediate.cpp:
* kjs/operations.cpp:
2008-07-04 Sam Weinig <sam@webkit.org>
Rubber-stamped by Dan Bernstein.
Split Error and GetterSetter out of JSObject.h.
* API/JSCallbackObjectFunctions.h:
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* kjs/AllInOneFile.cpp:
* kjs/ClassInfo.h: Copied from JavaScriptCore/kjs/JSObject.h.
* kjs/Error.cpp: Copied from JavaScriptCore/kjs/JSObject.cpp.
* kjs/Error.h: Copied from JavaScriptCore/kjs/JSObject.h.
* kjs/GetterSetter.cpp:
* kjs/GetterSetter.h: Copied from JavaScriptCore/kjs/JSObject.h.
* kjs/JSObject.cpp:
* kjs/JSObject.h:
* kjs/nodes.h:
2008-07-04 Simon Hausmann <hausmann@webkit.org>
Fix the Wx build, added TreeProfile.cpp to the build.
* JavaScriptCoreSources.bkl:
2008-07-03 Mark Rowe <mrowe@apple.com>
Reviewed by Oliver Hunt.
Fix output path of recently-added script phase to reference the correct file.
This prevents Xcode from running the script phase unnecessarily, which caused
the generated header to be recreated and lead to AllInOneFile.cpp rebuilding.
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-07-03 Mark Rowe <mrowe@apple.com>
Follow-up to the 64-bit build fix. Use intptr_t rather than ssize_t as
the latter is non-standard and does not exist on Windows.
* kjs/JSLock.cpp:
(KJS::JSLock::lockCount):
(KJS::JSLock::lock):
(KJS::JSLock::unlock):
(KJS::JSLock::DropAllLocks::DropAllLocks):
* kjs/JSLock.h:
2008-07-02 Mark Rowe <mrowe@apple.com>
Fix the 64-bit build. pthread_getspecific works with pointer-sized values,
so use ssize_t rather than int to track the lock count to avoid warnings about
truncating the result of pthread_getspecific.
* kjs/JSLock.cpp:
(KJS::JSLock::lockCount):
(KJS::JSLock::lock):
(KJS::JSLock::unlock):
(KJS::JSLock::DropAllLocks::DropAllLocks):
* kjs/JSLock.h:
2008-07-03 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Removed checking for the array get/put fast case from the array code.
Callers who want the fast case should call getIndex and/or setIndex
instead. (get_by_val and put_by_val already do this.)
SunSpider reports no change overall, but a 1.4% speedup on fannkuch and
a 3.6% speedup on nsieve.
2008-07-03 Dan Bernstein <mitz@apple.com>
- Windows build fix
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added TreeProfile.{h,cpp}.
2008-07-03 Dan Bernstein <mitz@apple.com>
Reviewed by Anders Carlsson.
- Windows build fix
* VM/Machine.cpp:
(KJS::Machine::Machine):
2008-07-03 Simon Hausmann <hausmann@webkit.org>
Reviewed by Alexey Proskuryakov.
Fix the non-threaded build.
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::threadInstanceInternal):
2008-07-03 Simon Hausmann <hausmann@webkit.org>
Fix the Qt build, added TreeProfile to the build.
* JavaScriptCore.pri:
2008-07-02 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff.
Don't create unnecessary JSGlobalData instances.
* kjs/JSGlobalData.h:
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::threadInstanceExists):
(KJS::JSGlobalData::sharedInstanceExists):
(KJS::JSGlobalData::threadInstance):
(KJS::JSGlobalData::sharedInstance):
(KJS::JSGlobalData::threadInstanceInternal):
(KJS::JSGlobalData::sharedInstanceInternal):
Added methods to query instance existence.
* kjs/InitializeThreading.cpp:
(KJS::initializeThreadingOnce):
Initialize thread instance static in a new way.
* API/JSBase.cpp:
(JSGarbageCollect):
* kjs/collector.cpp:
(KJS::Heap::collect):
Check for instance existence before accessing it.
2008-07-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Cameron Zwarich.
Fixed https://bugs.webkit.org/show_bug.cgi?id=19862
REGRESSION (r34907): Gmail crashes in JavaScriptCore code while editing drafts
I was never able to reproduce this issue, but Cameron could, and he says
that this patch fixes it.
The crash seems tied to a timer or event handler callback. In such a case,
the sole reference to the global object may be in the current call frame,
so we can't depend on the global object to mark the call frame area in
the register file.
The new GC marking rule is: the global object is not responsible for
marking the whole register file -- it's just responsible for the globals
section it's tied to. The heap is responsible for marking the call frame area.
2008-07-02 Mark Rowe <mrowe@apple.com>
Reviewed by Sam Weinig.
Add the ability to trace JavaScriptCore garabge collections using dtrace.
* JavaScriptCore.xcodeproj/project.pbxproj: Generate the dtrace probe header
file when building on a new enough version of Mac OS X.
* JavaScriptCorePrefix.h: Add our standard Mac OS X version detection macros.
* kjs/Tracing.d: Declare three dtrace probes.
* kjs/Tracing.h: Include the generated dtrace macros if dtrace is available,
otherwise provide versions that do nothing.
* kjs/collector.cpp:
(KJS::Heap::collect): Fire dtrace probes when starting a collection, after the
mark phase has completed, and when the collection is complete.
* wtf/Platform.h: Define HAVE_DTRACE when building on a new enough version of Mac OS X.
2008-07-02 Geoffrey Garen <ggaren@apple.com>
Rubber stamped by Oliver Hunt.
Reduced the max register file size from 8MB to 2MB.
We still allow about 20,000 levels of recursion.
2008-07-02 Alp Toker <alp@nuanti.com>
Build fix for r34960. Add TreeProfile.cpp to build.
* GNUmakefile.am:
2008-07-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Optimized a[n] get for cases when a is an array or a string. When a is
an array, we optimize both get and put. When a is a string, we only
optimize get, since you can't put to a string.
SunSpider says 3.4% faster.
2008-07-02 Kevin McCullough <kmccullough@apple.com>
Reviewed by Darin.
-Small cleanup in preparation for implementing Bottom-up.
* profiler/CallIdentifier.h: Rename debug function to make it clear of
its output and intention to be debug only.
(KJS::CallIdentifier::operator const char* ): Implement in terms of
c_str.
(KJS::CallIdentifier::c_str):
* profiler/ProfileNode.cpp: Impelment findChild() which will be needed
by the bottom-up implementation.
(KJS::ProfileNode::findChild):
* profiler/ProfileNode.h: Added comments to make the collections of
functions more clear.
(KJS::ProfileNode::operator==):
(KJS::ProfileNode::c_str):
2008-07-02 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Darin.
Bug 19776: Number.toExponential() is incorrect for numbers between 0.1 and 1
<https://bugs.webkit.org/show_bug.cgi?id=19776>
Perform the sign check for the exponent on the actual exponent value,
which is 1 less than the value of decimalPoint, instead of on the value
of decimalPoint itself.
* kjs/NumberPrototype.cpp:
(KJS::exponentialPartToString):
2008-07-02 Kevin McCullough <kmccullough@apple.com>
Reviewed by Darin.
<rdar://problem/5951532> JSProfiler: Implement Bottom-Up view (19228)
- Subclass TreeProfile as I prepare for a HeavyProfile to be comming
later.
* JavaScriptCore.xcodeproj/project.pbxproj:
* profiler/Profile.cpp: By default we create a TreeProfile.
(KJS::Profile::create):
* profiler/Profile.h: Changes to the Profile class to make it amenable
to be inherited from.
(KJS::Profile::~Profile):
* profiler/TreeProfile.cpp: Added.
(KJS::TreeProfile::create):
(KJS::TreeProfile::TreeProfile):
(KJS::TreeProfile::heavyProfile):
* profiler/TreeProfile.h: Added.
(KJS::TreeProfile::treeProfile):
2008-07-02 Kevin McCullough <kmccullough@apple.com>
Reviewed by Dan.
Broke CallIdentifier out into its own file. I did this because it's
going to grow a lot soon and I wanted this to be a separate patch.
* JavaScriptCore.xcodeproj/project.pbxproj:
* profiler/CallIdentifier.h: Added.
(KJS::CallIdentifier::CallIdentifier):
(KJS::CallIdentifier::operator==):
(KJS::CallIdentifier::operator!=):
(KJS::CallIdentifier::operator const char* ):
(KJS::CallIdentifier::toString):
* profiler/ProfileNode.h:
2008-07-02 Simon Hausmann <hausmann@webkit.org>
Build fix. Implemented missing functions for single-threaded build.
* kjs/JSLock.cpp:
(KJS::JSLock::JSLock):
(KJS::JSLock::lock):
(KJS::JSLock::unlock):
(KJS::JSLock::DropAllLocks::DropAllLocks):
2008-07-02 Alexey Proskuryakov <ap@webkit.org>
Another non-AllInOne build fix.
* kjs/JSGlobalObject.cpp: Include JSLock.h here, too.
2008-07-02 Alexey Proskuryakov <ap@webkit.org>
Non-AllInOne build fix.
* kjs/interpreter.cpp: Include JSLock.h.
2008-06-30 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Disable JSLock for per-thread contexts.
No change on SunSpider.
* kjs/JSGlobalData.h:
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::JSGlobalData):
(KJS::JSGlobalData::sharedInstance):
Added isSharedInstance as a better way to tell whether the instance is shared (legacy).
* kjs/JSLock.cpp:
(KJS::createJSLockCount):
(KJS::JSLock::lockCount):
(KJS::setLockCount):
(KJS::JSLock::JSLock):
(KJS::JSLock::lock):
(KJS::JSLock::unlock):
(KJS::JSLock::currentThreadIsHoldingLock):
(KJS::JSLock::DropAllLocks::DropAllLocks):
(KJS::JSLock::DropAllLocks::~DropAllLocks):
* kjs/JSLock.h:
(KJS::JSLock::JSLock):
(KJS::JSLock::~JSLock):
Made JSLock and JSLock::DropAllLocks constructors take a parameter to decide whether to
actually lock a mutex, or only to increment recursion count. We cannot turn it into no-op
if we want to keep existing assertions working.
Made recursion count per-thread, now that locks may not lock.
* API/JSBase.cpp:
(JSEvaluateScript): Take JSLock after casting JSContextRef to ExecState* (which doesn't need
locking in any case), so that a decision whether to actually lock can be made.
(JSCheckScriptSyntax): Ditto.
(JSGarbageCollect): Only lock while collecting the shared heap, not the per-thread one.
* API/JSObjectRef.cpp:
(JSClassCreate): Don't lock, as there is no reason to.
(JSClassRetain): Ditto.
(JSClassRelease): Ditto.
(JSPropertyNameArrayRetain): Ditto.
(JSPropertyNameArrayRelease): Only lock while deleting the array, as that may touch
identifier table.
(JSPropertyNameAccumulatorAddName): Adding a string also involves an identifier table
lookup, and possibly modification.
* API/JSStringRef.cpp:
(JSStringCreateWithCharacters):
(JSStringCreateWithUTF8CString):
(JSStringRetain):
(JSStringRelease):
(JSStringGetUTF8CString):
(JSStringIsEqual):
* API/JSStringRefCF.cpp:
(JSStringCreateWithCFString):
JSStringRef operations other than releasing do not need locking.
* VM/Machine.cpp: Don't include unused JSLock.h.
* kjs/CollectorHeapIntrospector.cpp: (KJS::CollectorHeapIntrospector::statistics):
Don't take the lock for real, as heap introspection pauses the process anyway. It seems that
the existing code could cause deadlocks.
* kjs/Shell.cpp:
(functionGC):
(main):
(jscmain):
The test tool uses a per-thread context, so no real locking is required.
* kjs/collector.h:
(KJS::Heap::setGCProtectNeedsLocking): Optionally protect m_protectedValues access with a
per-heap mutex. This is only needed for WebCore Database code, which violates the "no data
migration between threads" by using ProtectedPtr on a background thread.
(KJS::Heap::isShared): Keep a shared flag here, as well.
* kjs/protect.h:
(KJS::::ProtectedPtr):
(KJS::::~ProtectedPtr):
(KJS::::operator):
(KJS::operator==):
(KJS::operator!=):
ProtectedPtr is ony used from WebCore, so it doesn't need to take JSLock. An assertion in
Heap::protect/unprotect guards agains possible future unlocked uses of ProtectedPtr in JSC.
* kjs/collector.cpp:
(KJS::Heap::Heap): Initialize m_isShared.
(KJS::Heap::~Heap): No need to lock for real during destruction, but must keep assertions
in sweep() working.
(KJS::destroyRegisteredThread): Registered thread list is only accessed for shared heap,
so locking is always needed here.
(KJS::Heap::registerThread): Ditto.
(KJS::Heap::markStackObjectsConservatively): Use m_isShared instead of comparing to a shared
instance for a small speedup.
(KJS::Heap::setGCProtectNeedsLocking): Create m_protectedValuesMutex. There is currently no
way to undo this - and ideally, Database code will be fixed to lo longer require this quirk.
(KJS::Heap::protect): Take m_protectedValuesMutex (if it exists) while accessing
m_protectedValues.
(KJS::Heap::unprotect): Ditto.
(KJS::Heap::markProtectedObjects): Ditto.
(KJS::Heap::protectedGlobalObjectCount): Ditto.
(KJS::Heap::protectedObjectCount): Ditto.
(KJS::Heap::protectedObjectTypeCounts): Ditto.
* kjs/ustring.cpp:
* kjs/ustring.h:
Don't include JSLock.h, which is no longer used here. As a result, an explicit include had
to be added to many files in JavaScriptGlue, WebCore and WebKit.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::init):
* API/JSCallbackConstructor.cpp:
(KJS::constructJSCallback):
* API/JSCallbackFunction.cpp:
(KJS::JSCallbackFunction::call):
* API/JSCallbackObjectFunctions.h:
(KJS::::init):
(KJS::::getOwnPropertySlot):
(KJS::::put):
(KJS::::deleteProperty):
(KJS::::construct):
(KJS::::hasInstance):
(KJS::::call):
(KJS::::getPropertyNames):
(KJS::::toNumber):
(KJS::::toString):
(KJS::::staticValueGetter):
(KJS::::callbackGetter):
* API/JSContextRef.cpp:
(JSGlobalContextCreate):
(JSGlobalContextRetain):
(JSGlobalContextRelease):
* API/JSValueRef.cpp:
(JSValueIsEqual):
(JSValueIsStrictEqual):
(JSValueIsInstanceOfConstructor):
(JSValueMakeNumber):
(JSValueMakeString):
(JSValueToNumber):
(JSValueToStringCopy):
(JSValueToObject):
(JSValueProtect):
(JSValueUnprotect):
* JavaScriptCore.exp:
* kjs/PropertyNameArray.h:
(KJS::PropertyNameArray::globalData):
* kjs/interpreter.cpp:
(KJS::Interpreter::checkSyntax):
(KJS::Interpreter::evaluate):
Pass a parameter to JSLock/JSLock::DropAllLocks to decide whether the lock needs to be taken.
2008-07-01 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
https://bugs.webkit.org/show_bug.cgi?id=19834
Failed assertion in JavaScriptCore/VM/SegmentedVector.h:82
Creating a global object with a custom prototype resets it twice (wasteful!).
So, addStaticGlobals() was called twice, but JSGlobalObject::reset() didn't reset
the register array.
* kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::reset): Call setRegisterArray(0, 0).
* kjs/JSVariableObject.h: Changed registerArray to OwnArrayPtr. Also, added private copy
constructor and operator= to ensure that no one attempts to copy this object (for whatever
reason, I couldn't make Noncopyable work).
* kjs/JSGlobalObject.h: (KJS::JSGlobalObject::addStaticGlobals): Allocate registerArray
with new[].
* kjs/JSVariableObject.cpp:
(KJS::JSVariableObject::copyRegisterArray): Allocate registerArray with new[].
(KJS::JSVariableObject::setRegisterArray): Avoid hitting an assertion in OwnArrayPtr when
"changing" the value from 0 to 0.
2008-07-01 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Removed and/or reordered exception checks in array-style a[n] access.
SunSpider says 1.4% faster.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): No need to check for exceptions before
calling toString, toNumber and/or get. If the call ends up being observable
through toString, valueOf, or a getter, we short-circuit it there, instead.
In the op_del_by_val case, I removed the incorrect comment without actually
removing the code, since I didn't want to tempt the GCC fates!
* kjs/JSObject.cpp:
(KJS::callDefaultValueFunction): Added exception check to prevent
toString and valueOf functions from observing execution after an exception
has been thrown. This removes some of the burden of exception checking
from the machine.
(KJS::JSObject::defaultValue): Removed redundant exception check here.
* kjs/PropertySlot.cpp:
(KJS::PropertySlot::functionGetter): Added exception check to prevent
getter functions from observing execution after an exception has been
thrown. This removes some of the burden of exception checking from the
machine.
2008-07-01 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Optimized a[n] get and put for cases where n is an immediate unsigned
value.
SunSpider says 3.5% faster.
2008-07-01 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Darin.
Bug 19844: JavaScript Switch statement modifies "this"
<https://bugs.webkit.org/show_bug.cgi?id=19844>
Use a temporary when generating code for switch clauses to avoid
overwriting 'this' or a local variable.
* kjs/nodes.cpp:
(KJS::CaseBlockNode::emitCodeForBlock):
2008-07-01 Christian Dywan <christian@twotoasts.de>
Gtk+ build fix.
* kjs/list.cpp: Include "JSCell.h"
2008-07-01 Kevin McCullough <kmccullough@apple.com>
Build fix.
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-07-01 Dan Bernstein <mitz@apple.com>
Reviewed by Anders Carlsson.
- Mac release build fix
* JavaScriptCore.exp:
2008-07-01 Sam Weinig <sam@webkit.org>
Try and fix mac builds.
* JavaScriptCore.exp:
2008-07-01 Sam Weinig <sam@webkit.org>
Fix non-AllInOne builds.
* kjs/DateMath.cpp:
2008-07-01 Sam Weinig <sam@webkit.org>
Reviewed by Darin Adler.
Split JSCell and JSNumberCell class declarations out of JSValue.h
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* VM/JSPropertyNameIterator.h:
* kjs/AllInOneFile.cpp:
* kjs/JSCell.cpp: Copied from JavaScriptCore/kjs/JSValue.cpp.
* kjs/JSCell.h: Copied from JavaScriptCore/kjs/JSValue.h.
(KJS::JSValue::getJSNumber):
* kjs/JSNumberCell.cpp:
* kjs/JSNumberCell.h: Copied from JavaScriptCore/kjs/JSValue.h.
* kjs/JSObject.h:
* kjs/JSString.cpp:
(KJS::jsString):
(KJS::jsOwnedString):
* kjs/JSString.h:
(KJS::JSValue::toThisJSString):
* kjs/JSValue.cpp:
* kjs/JSValue.h:
2008-07-01 Anders Carlsson <andersca@apple.com>
Build fixes.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::addStaticGlobals):
2008-07-01 Simon Hausmann <hausmann@webkit.org>
Build fix, include OwnPtr.h.
* kjs/RegExpConstructor.h:
2008-06-30 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fixed a global object leak caused by the switch to one register file.
Don't unconditionally mark the register file, since that logically
makes all global variables GC roots, even when their global object is
no longer reachable.
Instead, make the global object associated with the register file
responsible for marking the register file.
2008-06-30 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Removed the "registerBase" abstraction. Since the register file never
reallocates, we can keep direct pointers into it, instead of
<registerBase, offset> tuples.
SunSpider says 0.8% faster.
2008-06-30 Oliver Hunt <oliver@apple.com>
Reviewed by NOBODY (build fix).
Fix build by adding all (hopefully) the missing includes.
* kjs/BooleanPrototype.cpp:
* kjs/DateConstructor.cpp:
* kjs/ErrorPrototype.cpp:
* kjs/FunctionPrototype.cpp:
* kjs/NativeErrorConstructor.cpp:
* kjs/NumberPrototype.cpp:
* kjs/ObjectPrototype.cpp:
* kjs/RegExpConstructor.cpp:
* kjs/StringConstructor.cpp:
* kjs/StringPrototype.cpp:
2008-06-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Bug 19830: REGRESSION (r34883): Google Reader doesn't show up feed list on sidebar
<https://bugs.webkit.org/show_bug.cgi?id=19830>
Ensure that we do not eliminate a write to a local register when doing
peephole optimizations.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitJumpIfTrue):
(KJS::CodeGenerator::emitJumpIfFalse):
2008-06-30 Sam Weinig <sam@webkit.org>
Rubber-stamped by Darin Alder.
Split InternalFunction into its own header file.
* API/JSCallbackFunction.h:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/ArrayConstructor.h:
* kjs/BooleanConstructor.h:
* kjs/DateConstructor.h:
* kjs/ErrorConstructor.h:
* kjs/FunctionConstructor.h:
* kjs/FunctionPrototype.h:
* kjs/InternalFunction.h: Copied from kjs/JSFunction.h.
* kjs/JSFunction.h:
* kjs/NativeErrorConstructor.h:
* kjs/NumberConstructor.h:
* kjs/ObjectConstructor.h:
* kjs/RegExpConstructor.h:
* kjs/StringConstructor.h:
* profiler/Profiler.cpp:
2008-06-30 Sam Weinig <sam@webkit.org>
Reviewed by Kevin McCullough.
Remove empty files Instruction.cpp, LabelID.cpp, Register.cpp and RegisterID.cpp.
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* VM/Instruction.cpp: Removed.
* VM/LabelID.cpp: Removed.
* VM/Register.cpp: Removed.
* VM/RegisterID.cpp: Removed.
2008-06-30 Sam Weinig <sam@webkit.org>
Rubber-stamped (reluctantly) by Kevin McCullough.
Rename date_object.h/cpp to DateInstance.h/cpp
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* kjs/AllInOneFile.cpp:
* kjs/DateConstructor.cpp:
* kjs/DateInstance.cpp: Copied from kjs/date_object.cpp.
* kjs/DateInstance.h: Copied from kjs/date_object.h.
* kjs/DatePrototype.cpp:
* kjs/DatePrototype.h:
* kjs/date_object.cpp: Removed.
* kjs/date_object.h: Removed.
2008-06-30 Sam Weinig <sam@webkit.org>
Rubber-stamped by Darin Adler.
Remove internal.cpp and move its contents to there own .cpp files.
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* kjs/AllInOneFile.cpp:
* kjs/GetterSetter.cpp: Copied from kjs/internal.cpp.
* kjs/InternalFunction.cpp: Copied from kjs/internal.cpp.
* kjs/JSNumberCell.cpp: Copied from kjs/internal.cpp.
* kjs/JSString.cpp: Copied from kjs/internal.cpp.
* kjs/JSString.h:
* kjs/LabelStack.cpp: Copied from kjs/internal.cpp.
* kjs/NumberConstructor.cpp:
* kjs/NumberObject.cpp:
(KJS::constructNumber):
(KJS::constructNumberFromImmediateNumber):
* kjs/internal.cpp: Removed.
2008-06-30 Adam Roben <aroben@apple.com>
Fix <rdar://5954749> Assertion failure due to HashTable's use of
operator&
HashTable was passing &value to constructDeletedValue, which in
classes like WebCore::COMPtr would cause an assertion. We now pass
value by reference instead of by address so that the HashTraits
implementations have more flexibility in constructing the deleted
value.
Reviewed by Ada Chan.
* VM/CodeGenerator.h: Updated for changes to HashTraits.
* wtf/HashTable.h:
(WTF::::deleteBucket): Changed to pass bucket by reference instead of
by address.
(WTF::::checkKey): Ditto.
* wtf/HashTraits.h:
(WTF::): Updated HashTraits for HashTable change.
2008-07-01 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Cameron Zwarich.
Make RegisterFile really unmap memory on destruction.
This fixes run-webkit-tests --threaded, which ran out of address space in a few seconds.
* VM/RegisterFile.cpp: (KJS::RegisterFile::~RegisterFile): Unmap all the memory, not just
1/4 of it.
* kjs/JSGlobalObject.h: Don't include RegisterFile.h, so that changes to it don't make
half of WebCore rebuild.
* VM/Machine.h: Don't forward declare RegisterFile, as RegisterFile.h is included already.
* VM/RegisterFile.h: (KJS::RegisterFile::RegisterFile): Assert that the allocation succeeded.
2008-06-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Rubber-stamped by Oliver.
Correct the documentation for op_put_by_index.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-06-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Bug 19821: Merge the instruction pair (less, jfalse)
<https://bugs.webkit.org/show_bug.cgi?id=19821>
This is a 2.4% win on SunSpider. I needed to add an ALWAYS_INLINE
intrinisc to CodeGenerator::rewindBinaryOp() to avoid a massive
regression in regexp-dna.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::rewindBinaryOp):
(KJS::CodeGenerator::emitJumpIfFalse):
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.cpp:
(KJS::):
* VM/Opcode.h:
2008-06-29 Sam Weinig <sam@webkit.org>
Fix non-AllInOne builds.
* kjs/JSObject.cpp:
* kjs/JSValue.cpp:
2008-06-29 Sam Weinig <sam@webkit.org>
Build fix for Qt.
* kjs/DateMath.cpp:
* kjs/DatePrototype.cpp:
2008-06-29 Sam Weinig <sam@webkit.org>
Rubber-stamped by Cameron Zwarich.
Splits ErrorConstructor, ErrorPrototype, NativeErrorConstructor and
NativeErrorPrototype out of error_object.h/cpp and renames it ErrorInstance.
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* kjs/AllInOneFile.cpp:
* kjs/ArrayConstructor.cpp:
* kjs/ArrayPrototype.cpp:
* kjs/BooleanPrototype.cpp:
* kjs/DatePrototype.cpp:
* kjs/ErrorConstructor.cpp: Copied from kjs/error_object.cpp.
* kjs/ErrorConstructor.h: Copied from kjs/error_object.h.
* kjs/ErrorInstance.cpp: Copied from kjs/error_object.cpp.
* kjs/ErrorInstance.h: Copied from kjs/error_object.h.
* kjs/ErrorPrototype.cpp: Copied from kjs/error_object.cpp.
* kjs/ErrorPrototype.h: Copied from kjs/error_object.h.
* kjs/JSGlobalObject.cpp:
* kjs/JSObject.cpp:
* kjs/JSValue.cpp:
* kjs/NativeErrorConstructor.cpp: Copied from kjs/error_object.cpp.
* kjs/NativeErrorConstructor.h: Copied from kjs/error_object.h.
* kjs/NativeErrorPrototype.cpp: Copied from kjs/error_object.cpp.
* kjs/NativeErrorPrototype.h: Copied from kjs/error_object.h.
* kjs/NumberPrototype.cpp:
* kjs/RegExpConstructor.cpp:
* kjs/RegExpObject.cpp:
* kjs/RegExpPrototype.cpp:
* kjs/StringPrototype.cpp:
* kjs/error_object.cpp: Removed.
* kjs/error_object.h: Removed.
* kjs/internal.cpp:
2008-06-29 Sam Weinig <sam@webkit.org>
Fix non-AllInOne build.
* kjs/DateConstructor.cpp:
* kjs/DateMath.cpp:
* kjs/JSObject.cpp:
2008-06-29 Sam Weinig <sam@webkit.org>
Rubber-stamped by Oliver Hunt.
Splits DateConstructor and DatePrototype out of date_object.h/cpp
Moves shared Date code into DateMath.
* DerivedSources.make:
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* kjs/AllInOneFile.cpp:
* kjs/DateConstructor.cpp: Copied from kjs/date_object.cpp.
* kjs/DateConstructor.h: Copied from kjs/date_object.h.
* kjs/DateMath.cpp:
(KJS::ymdhmsToSeconds):
(KJS::):
(KJS::skipSpacesAndComments):
(KJS::findMonth):
(KJS::parseDate):
(KJS::timeClip):
(KJS::formatDate):
(KJS::formatDateUTCVariant):
(KJS::formatTime):
* kjs/DateMath.h:
(KJS::gmtoffset):
* kjs/DatePrototype.cpp: Copied from kjs/date_object.cpp.
* kjs/DatePrototype.h: Copied from kjs/date_object.h.
* kjs/JSGlobalObject.cpp:
* kjs/JSObject.cpp:
* kjs/date_object.cpp:
* kjs/date_object.h:
* kjs/internal.cpp:
2008-06-29 Jan Michael Alonzo <jmalonzo@webkit.org>
Rubber-stamped by Cameron Zwarich
Fix Gtk non-AllInOne build
* GNUmakefile.am: include JSVariableObject.cpp
* kjs/RegExpConstructor.cpp: include RegExpObject.h
* kjs/RegExpObject.h: forward declare RegExpPrototype
2008-06-28 Darin Adler <darin@apple.com>
Reviewed by Sam and Cameron.
- fix https://bugs.webkit.org/show_bug.cgi?id=19805
Array.concat turns missing array elements into "undefined"
Test: fast/js/array-holes.html
* JavaScriptCore.exp: No longer export JSArray::getItem.
* kjs/ArrayPrototype.cpp:
(KJS::arrayProtoFuncConcat): Changed to use getProperty instead of
JSArray::getItem -- need to handle properties from the prototype chain
instead of ignoring them.
* kjs/JSArray.cpp: Removed getItem.
* kjs/JSArray.h: Ditto.
2008-06-28 Darin Adler <darin@apple.com>
Reviewed by Cameron.
- https://bugs.webkit.org/show_bug.cgi?id=19804
optimize access to arrays without "holes"
SunSpider says 1.8% faster.
* kjs/JSArray.cpp:
(KJS::JSArray::JSArray): Initialize m_fastAccessCutoff when creating
arrays. Also updated for new location of m_vectorLength.
(KJS::JSArray::getItem): Updated for new location of m_vectorLength.
(KJS::JSArray::getSlowCase): Added. Broke out the non-hot parts of
getOwnPropertySlot to make the hot part faster.
(KJS::JSArray::getOwnPropertySlot): Added a new faster case for
indices lower than m_fastAccessCutoff. We can do theese with no
additional checks or branches.
(KJS::JSArray::put): Added a new faster case for indices lower than
m_fastAccessCutoff. We can do theese with no additional checks or
branches. Moved the maxArrayIndex handling out of this function.
Added code to set m_fastAccessCutoff when the very last hole in
an array is filled; this is how the cutoff gets set for most arrays.
(KJS::JSArray::putSlowCase): Moved the rest of the put function logic
in here, to make the hot part of the put function faster.
(KJS::JSArray::deleteProperty): Added code to lower m_fastAccessCutoff
when a delete makes a new hole in the array.
(KJS::JSArray::getPropertyNames): Updated for new location of
m_vectorLength.
(KJS::JSArray::increaseVectorLength): Ditto.
(KJS::JSArray::setLength): Added code to lower m_fastAccessCutoff
when setLength makes the array smaller.
(KJS::JSArray::mark): Updated for new location of m_vectorLength.
(KJS::JSArray::sort): Ditto. Set m_fastAccessCutoff after moving
all the holes to the end of the array.
(KJS::JSArray::compactForSorting): Ditto.
(KJS::JSArray::checkConsistency): Added consistency checks fro
m_fastAccessCutoff and updated for the new location of m_vectorLength.
* kjs/JSArray.h: Added declarations for slow case functions.
Replaced m_vectorLength with m_fastAccessCutoff.
2008-06-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Sam.
When executing a native call, check for an exception before writing the
return value.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-06-28 Mark Rowe <mrowe@apple.com>
Build fix. Flag headers as private or public as is appropriate.
These settings were accidentally removed during some project file cleanup.
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-06-28 Sam Weinig <sam@webkit.org>
Rubber-stamped by Darin Adler.
Splits RegExpConstructor and RegExpPrototype out of RegExpObject.h/cpp
* DerivedSources.make:
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* VM/Machine.cpp:
* kjs/AllInOneFile.cpp:
* kjs/JSGlobalObject.cpp:
* kjs/RegExpConstructor.cpp: Copied from kjs/RegExpObject.cpp.
* kjs/RegExpConstructor.h: Copied from kjs/RegExpObject.h.
* kjs/RegExpObject.cpp:
* kjs/RegExpObject.h:
* kjs/RegExpPrototype.cpp: Copied from kjs/RegExpObject.cpp.
* kjs/RegExpPrototype.h: Copied from kjs/RegExpObject.h.
* kjs/StringPrototype.cpp:
* kjs/internal.cpp:
2008-06-28 Sam Weinig <sam@webkit.org>
Fix non-AllInOne builds.
* kjs/StringConstructor.cpp:
2008-06-28 Sam Weinig <sam@webkit.org>
Rubber-stamped by Darin Adler.
Rename string_object.h/cpp to StringObject.h/cpp and split out StringObjectThatMasqueradesAsUndefined,
StringConstructor and StringPrototype.
* DerivedSources.make:
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* kjs/AllInOneFile.cpp:
* kjs/JSGlobalObject.cpp:
* kjs/StringConstructor.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
* kjs/StringConstructor.h: Copied from JavaScriptCore/kjs/string_object.h.
* kjs/StringObject.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
* kjs/StringObject.h: Copied from JavaScriptCore/kjs/string_object.h.
* kjs/StringObjectThatMasqueradesAsUndefined.h: Copied from JavaScriptCore/kjs/string_object.h.
* kjs/StringPrototype.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
* kjs/StringPrototype.h: Copied from JavaScriptCore/kjs/string_object.h.
* kjs/internal.cpp:
* kjs/string_object.cpp: Removed.
* kjs/string_object.h: Removed.
2008-06-28 Jan Michael Alonzo <jmalonzo@webkit.org>
Gtk build fix: JSVariableObject is now part of AllInOne
* GNUmakefile.am:
2008-06-28 Darin Adler <darin@apple.com>
Reviewed by Oliver.
- https://bugs.webkit.org/show_bug.cgi?id=19801
add a feature so we can tell what regular expressions are taking time
* pcre/pcre_compile.cpp:
(jsRegExpCompile): Compile in the string if REGEXP_HISTOGRAM is on.
* pcre/pcre_exec.cpp:
(jsRegExpExecute): Add hook to time execution.
(Histogram::~Histogram): Print a sorted list of what took time.
(Histogram::add): Accumulate records of what took time.
(HistogramTimeLogger::~HistogramTimeLogger): Hook that calls
Histogram::add at the right moment and creates the global histogram
object.
* pcre/pcre_internal.h: Define REGEXP_HISTOGRAM.
* pcre/pcre_tables.cpp: Added missing include of "config.h". Not needed
any more, but an omissions an earlier version of this patch detected.
* pcre/pcre_ucp_searchfuncs.cpp: Ditto.
* pcre/pcre_xclass.cpp: Ditto.
2008-06-28 Sam Weinig <sam@webkit.org>
Try and fix the Windows build again.
* kjs/RegExpObject.cpp:
* kjs/date_object.cpp:
* kjs/error_object.cpp:
2008-06-28 Sam Weinig <sam@webkit.org>
Rubber-stamped by Darin Adler.
Remove unused StringConstructorFunction class.
* kjs/string_object.h:
2008-06-28 Sam Weinig <sam@webkit.org>
Fix windows build.
* kjs/ArrayPrototype.cpp:
* kjs/BooleanPrototype.cpp:
* kjs/BooleanPrototype.h:
* kjs/FunctionPrototype.cpp:
* kjs/JSImmediate.cpp:
* kjs/JSObject.cpp:
* kjs/MathObject.cpp:
* kjs/NumberPrototype.cpp:
* kjs/NumberPrototype.h:
* kjs/ObjectConstructor.cpp:
* kjs/RegExpObject.h:
* kjs/error_object.h:
* kjs/string_object.cpp:
2008-06-28 Sam Weinig <sam@webkit.org>
Rubber-stamped by Oliver Hunt.
Splits FunctionConstructor out of FunctionPrototype.h/cpp
Splits NumberConstructor and NumberPrototype out of NumberObject.h/cpp
Rename object_object.h/cpp to ObjectPrototype.h/cpp and split out ObjectConstructor.
* API/JSCallbackConstructor.cpp:
* API/JSClassRef.cpp:
* API/JSObjectRef.cpp:
* DerivedSources.make:
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* VM/Machine.cpp:
* kjs/AllInOneFile.cpp:
* kjs/ArrayConstructor.cpp:
* kjs/ArrayConstructor.h:
* kjs/FunctionConstructor.cpp: Copied from JavaScriptCore/kjs/FunctionPrototype.cpp.
* kjs/FunctionConstructor.h: Copied from JavaScriptCore/kjs/FunctionPrototype.h.
* kjs/FunctionPrototype.cpp:
* kjs/FunctionPrototype.h:
* kjs/JSFunction.cpp:
* kjs/JSGlobalObject.cpp:
* kjs/JSImmediate.cpp:
* kjs/MathObject.h:
* kjs/NumberConstructor.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
* kjs/NumberConstructor.h: Copied from JavaScriptCore/kjs/NumberObject.h.
* kjs/NumberObject.cpp:
* kjs/NumberObject.h:
* kjs/NumberPrototype.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
* kjs/NumberPrototype.h: Copied from JavaScriptCore/kjs/NumberObject.h.
* kjs/ObjectConstructor.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
* kjs/ObjectConstructor.h: Copied from JavaScriptCore/kjs/object_object.h.
* kjs/ObjectPrototype.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
* kjs/ObjectPrototype.h: Copied from JavaScriptCore/kjs/object_object.h.
* kjs/RegExpObject.h:
* kjs/Shell.cpp:
* kjs/error_object.h:
* kjs/internal.cpp:
* kjs/nodes.cpp:
* kjs/object_object.cpp: Removed.
* kjs/object_object.h: Removed.
* kjs/string_object.h:
2008-06-28 Darin Adler <darin@apple.com>
Reviewed by Oliver.
- fix https://bugs.webkit.org/show_bug.cgi?id=19796
optimize expressions with ignored results (especially post-increment)
SunSpider says 0.9% faster.
* VM/CodeGenerator.h:
(KJS::CodeGenerator::tempDestination): Create a new temporary for
ignoredResult() too, just as we would for 0.
(KJS::CodeGenerator::finalDestination): Use the temporary if the
register passed in is ignoredResult() too, just as we would for 0.
(KJS::CodeGenerator::destinationForAssignResult): Return 0 if the
passed in register is ignoredResult(), just as we would for 0.
(KJS::CodeGenerator::moveToDestinationIfNeeded): Return 0 if the
register passed in is ignoredResult(). What matters is that we
don't want to emit a move. The return value won't be looked at.
(KJS::CodeGenerator::emitNode): Allow ignoredResult() and pass it
through to the node's emitCode function.
* VM/RegisterID.h:
(KJS::ignoredResult): Added. Special value to indicate the result of
a node will be ignored and need not be put in any register.
* kjs/nodes.cpp:
(KJS::NullNode::emitCode): Do nothing if dst == ignoredResult().
(KJS::BooleanNode::emitCode): Ditto.
(KJS::NumberNode::emitCode): Ditto.
(KJS::StringNode::emitCode): Ditto.
(KJS::RegExpNode::emitCode): Ditto.
(KJS::ThisNode::emitCode): Ditto.
(KJS::ResolveNode::emitCode): Do nothing if dst == ignoredResult() and
the identifier resolves to a local variable.
(KJS::ObjectLiteralNode::emitCode): Do nothing if dst == ignoredResult()
and the object is empty.
(KJS::PostIncResolveNode::emitCode): If dst == ignoredResult(), then do
nothing for the local constant case, and do a pre-increment in all the
other cases.
(KJS::PostDecResolveNode::emitCode): Ditto.
(KJS::PostIncBracketNode::emitCode): Ditto.
(KJS::PostDecBracketNode::emitCode): Ditto.
(KJS::PostIncDotNode::emitCode): Ditto.
(KJS::PostDecDotNode::emitCode): Ditto.
(KJS::DeleteValueNode::emitCode): Pass ignoredResult() when evaluating
the expression.
(KJS::VoidNode::emitCode): Ditto.
(KJS::TypeOfResolveNode::emitCode): If dst == ignoredResult(), do nothing
if the identifier resolves to a local variable, and don't bother generating
a typeof opcode in the other case.
(KJS::TypeOfValueNode::emitCode): Ditto.
(KJS::PreIncResolveNode::emitCode): Do nothing if dst == ignoredResult() and
the identifier resolves to a local constant.
(KJS::PreDecResolveNode::emitCode): Ditto.
(KJS::AssignResolveNode::emitCode): Turn ignoredResult() into 0 in a couple
places, because we need to put the result into a register so we can assign
it. At other sites this is taken care of by functions like finalDestination.
(KJS::CommaNode::emitCode): Pass ignoredResult() when evaluating the first
expression.
(KJS::ForNode::emitCode): Pass ignoredResult() when evaluating the first and
third expressions.
(KJS::ForInNode::emitCode): Pass ignoredResult() when evaluating the first
expression.
2008-06-28 Darin Adler <darin@apple.com>
Reviewed by Oliver.
- https://bugs.webkit.org/show_bug.cgi?id=19787
create most arrays from values in registers rather than with multiple put operations
SunSpider says 0.8% faster.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump): Added argv and argc parameters to new_array.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Ditto.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitNewArray): Added.
* VM/CodeGenerator.h: Added ElementNode* argument to emitNewArray.
* kjs/nodes.cpp:
(KJS::ArrayNode::emitCode): Pass the ElementNode to emitNewArray so it can be
initialized with as many elements as possible. If the array doesn't have any
holes in it, that's all that's needed. If there are holes, then emit some separate
put operations for the other values in the array and for the length as needed.
* kjs/nodes.h: Added some accessors to ElementNode so the code generator can
iterate through elements and generate code to evaluate them. Now ArrayNode does
not need to be a friend. Also took out some unused PlacementNewAdoptType
constructors.
2008-06-28 Darin Adler <darin@apple.com>
Reviewed by Oliver.
* kjs/nodes.h: Remove obsolete PlacementNewAdopt constructors.
We no longer mutate the AST in place.
2008-06-28 Jan Michael Alonzo <jmalonzo@webkit.org>
Reviewed by Oliver Hunt.
Build fix
* VM/Machine.cpp: include stdio.h for printf
2008-06-27 Sam Weinig <sam@webkit.org>
Reviewed by Oliver Hunt.
Fix platforms that don't use AllInOne.cpp
* kjs/BooleanConstructor.h:
* kjs/BooleanPrototype.h:
* kjs/FunctionPrototype.cpp:
2008-06-27 Sam Weinig <sam@webkit.org>
Rubber-stamped by Oliver Hunt.
Splits ArrayConstructor out of ArrayPrototype.h/cpp
Splits BooleanConstructor and BooleanPrototype out of BooleanObject.h/cpp
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* VM/Machine.cpp:
* kjs/AllInOneFile.cpp:
* kjs/ArrayConstructor.cpp: Copied from kjs/ArrayPrototype.cpp.
* kjs/ArrayConstructor.h: Copied from kjs/ArrayPrototype.h.
* kjs/ArrayPrototype.cpp:
* kjs/ArrayPrototype.h:
* kjs/BooleanConstructor.cpp: Copied from kjs/BooleanObject.cpp.
* kjs/BooleanConstructor.h: Copied from kjs/BooleanObject.h.
* kjs/BooleanObject.cpp:
* kjs/BooleanObject.h:
* kjs/BooleanPrototype.cpp: Copied from kjs/BooleanObject.cpp.
* kjs/BooleanPrototype.h: Copied from kjs/BooleanObject.h.
* kjs/CommonIdentifiers.h:
* kjs/FunctionPrototype.cpp:
* kjs/JSArray.cpp:
* kjs/JSGlobalObject.cpp:
* kjs/JSImmediate.cpp:
* kjs/Shell.cpp:
* kjs/internal.cpp:
* kjs/nodes.cpp:
* kjs/string_object.cpp:
2008-06-27 Oliver Hunt <oliver@apple.com>
Reviewed by Sam.
Bug 18626: SQUIRRELFISH: support the "slow script" dialog <https://bugs.webkit.org/show_bug.cgi?id=18626>
<rdar://problem/5973931> Slow script dialog needs to be reimplemented for squirrelfish
Adds support for the slow script dialog in squirrelfish. This requires the addition
of three new op codes, op_loop, op_loop_if_true, and op_loop_if_less which have the
same behaviour as their simple jump equivalents but have an additional time out check.
Additional assertions were added to other jump instructions to prevent accidentally
creating loops with jump types that do not support time out checks.
Sunspider does not report a regression, however this appears very sensitive to code
layout and hardware, so i would expect up to a 1% regression on other systems.
Part of this required moving the old timeout logic from JSGlobalObject and into Machine
which is the cause of a number of the larger diff blocks.
* JavaScriptCore.exp:
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitJumpIfTrue):
(KJS::CodeGenerator::emitJumpScopes):
* VM/ExceptionHelpers.cpp:
(KJS::InterruptedExecutionError::isWatchdogException):
(KJS::createInterruptedExecutionException):
* VM/ExceptionHelpers.h:
* VM/LabelID.h:
* VM/Machine.cpp:
(KJS::Machine::Machine):
(KJS::Machine::throwException):
(KJS::Machine::resetTimeoutCheck):
(KJS::getCurrentTime):
(KJS::Machine::checkTimeout):
(KJS::Machine::privateExecute):
* VM/Machine.h:
(KJS::Machine::setTimeoutTime):
(KJS::Machine::startTimeoutCheck):
(KJS::Machine::stopTimeoutCheck):
(KJS::Machine::initTimeout):
* VM/Opcode.cpp:
(KJS::):
* VM/Opcode.h:
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::init):
(KJS::JSGlobalObject::setTimeoutTime):
(KJS::JSGlobalObject::startTimeoutCheck):
* kjs/JSGlobalObject.h:
* kjs/JSObject.h:
* kjs/interpreter.cpp:
(KJS::Interpreter::evaluate):
2008-06-27 Jan Michael Alonzo <jmalonzo@webkit.org>
Gtk and Qt build fix: Remove RegisterFileStack from the build
scripts.
* GNUmakefile.am:
* JavaScriptCore.pri:
2008-06-27 Adele Peterson <adele@apple.com>
Reviewed by Geoff.
Build fixes.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* VM/RegisterFile.h:
(KJS::RegisterFile::RegisterFile):
* kjs/JSGlobalObject.cpp:
* kjs/collector.cpp:
2008-06-27 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
One RegisterFile to rule them all!
SunSpider reports a 0.2% speedup.
This patch removes the RegisterFileStack abstraction and replaces it with
a single register file that
(a) allocates a fixed storage area, including a fixed area for global
vars, so that no operation may cause the register file to reallocate
and
(b) swaps between global storage areas when executing code in different
global objects.
This patch also changes the layout of the register file so that all call
frames, including call frames for global code, get a header. This is
required to support re-entrant global code. It also just makes things simpler.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::addGlobalVar): New function. Differs from addVar in
that
(a) global vars don't contribute to a CodeBlock's numLocals count, since
global storage is fixed and allocated at startup
and
(b) references to global vars get shifted to elide intermediate stack
between "r" and the global storage area.
* VM/Machine.cpp:
(KJS::Machine::dumpRegisters): Updated this function to match the new
register file layout, and added the ability to dump exact identifiers
for the different parts of a call frame.
(KJS::Machine::unwindCallFrame): Updated this function to match the new
register file layout.
(KJS::Machine::execute): Updated this function to initialize a call frame
header for global code, and to swap global storage areas when switching
to execution in a new global object.
(KJS::Machine::privateExecute): Got rid of "safeForReentry" and re-reading
of registerBase because the register file is always safe for reentry now,
and registerBase never changes.
* VM/Machine.h: Moved the call frame header enum from Machine to RegisterFile,
to resolve a header dependency problem (a good sign that the enum belonged
in RegisterFile all along!)
* VM/RegisterFile.cpp:
* VM/RegisterFile.h: Changed RegisterFile to mmap a fixed size register
area. This allows us to avoid re-allocting the register file later on.
Instead, we rely on the OS to allocate physical pages to the register
file as necessary.
* VM/RegisterFileStack.cpp: Removed. Tada!
* VM/RegisterFileStack.h: Removed. Tada!
* kjs/DebuggerCallFrame.cpp: Updated this class to match the new
register file layout, greatly simplifying it in the process.
* kjs/JSActivation.h:
* kjs/JSActivation.cpp: Moved some of this logic up to JSVariableObject,
since the global object now needs to be able to tear off its registers
just like the activation object.
* kjs/JSFunction.cpp: No need to fiddle with the register file anymore.
* kjs/JSGlobalObject.h:
* kjs/JSGlobalObject.cpp: Updated JSGlobalObject to support moving its
global storage area into and out of the register file.
* kjs/PropertySlot.cpp: No need to fiddle with the register file anymore.
* kjs/collector.cpp: Renamed markStackObjectConservatively to
markConservatively, since we don't just mark stack objects this way.
Also, added code to mark the machine's register file.
* kjs/config.h: Moved some platforms #defines from here...
* wtf/Platform.h: ...to here, to support mmap/VirtualAlloc detection
in RegisterFile.h.
2008-06-26 Mark Rowe <mrowe@apple.com>
Speculative fix for the Windows build.
* kjs/JSImmediate.cpp:
2008-06-26 Mark Rowe <mrowe@apple.com>
Reviewed by Darin Adler and Geoff Garen.
Fix the malloc zone introspection functions so that malloc_zone_statistics does not give
bogus output in an application that uses JavaScriptCore.
* kjs/CollectorHeapIntrospector.cpp:
(KJS::CollectorHeapIntrospector::statistics): Return statistics about memory allocated by the collector.
* kjs/CollectorHeapIntrospector.h:
* wtf/FastMalloc.cpp: Zero out the statistics. FastMalloc doesn't track this information at present.
Returning zero for all values is preferable to returning bogus data.
2008-06-26 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- https://bugs.webkit.org/show_bug.cgi?id=19721
speed up JavaScriptCore by not wrapping strings in objects just
to call functions on them
- optimize UString append and the replace function a bit
SunSpider says 1.8% faster.
* JavaScriptCore.exp: Updated.
* VM/JSPropertyNameIterator.cpp: Added include of JSString.h, now needed
because jsString returns a JSString*.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Removed the toObject call from native
function calls. Also removed code to put the this value into a register.
* kjs/BooleanObject.cpp:
(KJS::booleanProtoFuncToString): Rewrite to handle false and true
separately.
* kjs/FunctionPrototype.cpp:
(KJS::constructFunction): Use single-character append rather than building
a string for each character.
* kjs/JSFunction.cpp:
(KJS::globalFuncUnescape): Ditto.
* kjs/JSImmediate.cpp:
(KJS::JSImmediate::prototype): Added. Gets the appropriate prototype for
use with an immediate value. To be used instead of toObject when doing a
get on an immediate value.
* kjs/JSImmediate.h: Added prototype.
* kjs/JSObject.cpp:
(KJS::JSObject::toString): Tweaked formatting.
* kjs/JSObject.h:
(KJS::JSValue::get): Use prototype instead of toObject to avoid creating
an object wrapper just to search for properties. This also saves an
unnecessary hash table lookup since the object wrappers themselves don't
have any properties.
* kjs/JSString.h: Added toThisString and toThisJSString.
* kjs/JSValue.cpp:
(KJS::JSCell::toThisString): Added.
(KJS::JSCell::toThisJSString): Added.
(KJS::JSCell::getJSNumber): Added.
(KJS::jsString): Changed return type to JSString*.
(KJS::jsOwnedString): Ditto.
* kjs/JSValue.h:
(KJS::JSValue::toThisString): Added.
(KJS::JSValue::toThisJSString): Added.
(KJS::JSValue::getJSNumber): Added.
* kjs/NumberObject.cpp:
(KJS::NumberObject::getJSNumber): Added.
(KJS::integer_part_noexp): Append C string directly rather than first
turning it into a UString.
(KJS::numberProtoFuncToString): Use getJSNumber to check if the value
is a number rather than isObject(&NumberObject::info). This works for
immediate numbers, number cells, and NumberObject instances.
(KJS::numberProtoFuncToLocaleString): Ditto.
(KJS::numberProtoFuncValueOf): Ditto.
(KJS::numberProtoFuncToFixed): Ditto.
(KJS::numberProtoFuncToExponential): Ditto.
(KJS::numberProtoFuncToPrecision): Ditto.
* kjs/NumberObject.h: Added getJSNumber.
* kjs/PropertySlot.cpp: Tweaked comment.
* kjs/internal.cpp:
(KJS::JSString::toThisString): Added.
(KJS::JSString::toThisJSString): Added.
(KJS::JSString::getOwnPropertySlot): Changed code that searches the
prototype chain to start with the string prototype and not create a
string object.
(KJS::JSNumberCell::toThisString): Added.
(KJS::JSNumberCell::getJSNumber): Added.
* kjs/lookup.cpp:
(KJS::staticFunctionGetter): Moved here, because there's no point in
having a function that's only used for a function pointer be inline.
(KJS::setUpStaticFunctionSlot): New function for getStaticFunctionSlot.
* kjs/lookup.h:
(KJS::staticValueGetter): Don't mark this inline. It doesn't make sense
to have a function that's only used for a function pointer be inline.
(KJS::getStaticFunctionSlot): Changed to get properties from the parent
first before doing any handling of functions. This is the fastest way
to return the function once the initial setup is done.
* kjs/string_object.cpp:
(KJS::StringObject::getPropertyNames): Call value() instead of getString(),
avoiding an unnecessary virtual function call (the call to the type()
function in the implementation of the isString() function).
(KJS::StringObject::toString): Added.
(KJS::StringObject::toThisString): Added.
(KJS::StringObject::toThisJSString): Added.
(KJS::substituteBackreferences): Rewrote to use a appending algorithm
instead of a the old one that tried to replace in place.
(KJS::stringProtoFuncReplace): Merged this function and the replace function.
Replaced the hand-rolled dynamic arrays for source ranges and replacements
with Vector.
(KJS::stringProtoFuncToString): Handle JSString as well as StringObject.
Removed the separate valueOf implementation, since it can just share this.
(KJS::stringProtoFuncCharAt): Use toThisString, which handles JSString as
well as StringObject, and is slightly more efficient than the old code too.
(KJS::stringProtoFuncCharCodeAt): Ditto.
(KJS::stringProtoFuncConcat): Ditto.
(KJS::stringProtoFuncIndexOf): Ditto.
(KJS::stringProtoFuncLastIndexOf): Ditto.
(KJS::stringProtoFuncMatch): Ditto.
(KJS::stringProtoFuncSearch): Ditto.
(KJS::stringProtoFuncSlice): Ditto.
(KJS::stringProtoFuncSplit): Ditto.
(KJS::stringProtoFuncSubstr): Ditto.
(KJS::stringProtoFuncSubstring): Ditto.
(KJS::stringProtoFuncToLowerCase): Use toThisJSString.
(KJS::stringProtoFuncToUpperCase): Ditto.
(KJS::stringProtoFuncToLocaleLowerCase): Ditto.
(KJS::stringProtoFuncToLocaleUpperCase): Ditto.
(KJS::stringProtoFuncLocaleCompare): Ditto.
(KJS::stringProtoFuncBig): Use toThisString.
(KJS::stringProtoFuncSmall): Ditto.
(KJS::stringProtoFuncBlink): Ditto.
(KJS::stringProtoFuncBold): Ditto.
(KJS::stringProtoFuncFixed): Ditto.
(KJS::stringProtoFuncItalics): Ditto.
(KJS::stringProtoFuncStrike): Ditto.
(KJS::stringProtoFuncSub): Ditto.
(KJS::stringProtoFuncSup): Ditto.
(KJS::stringProtoFuncFontcolor): Ditto.
(KJS::stringProtoFuncFontsize): Ditto.
(KJS::stringProtoFuncAnchor): Ditto.
(KJS::stringProtoFuncLink): Ditto.
* kjs/string_object.h: Added toString, toThisString, and toThisJSString.
* kjs/ustring.cpp:
(KJS::UString::append): Added a version that takes a character pointer and
size, so we don't have to create a UString just to append to another UString.
* kjs/ustring.h:
2008-06-26 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Maciej.
Make JSGlobalData per-thread.
No change on SunSpider total.
* wtf/ThreadSpecific.h: Re-enabled the actual implementation.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::~JSGlobalObject): Re-added a JSLock-related assertion. We'll probably
want to preserve these somehow to keep legacy behavior in working condition.
(KJS::JSGlobalObject::init): Initialize globalData pointer earlier, so that it is ready
when updating JSGlobalObject linked list.
* kjs/JSGlobalObject.h: (KJS::JSGlobalObject::head): Changed head() to be non-static, and
to use JSGlobalData associated with the current object.
* kjs/InitializeThreading.cpp: (KJS::initializeThreadingOnce): Removed a no longer needed
Heap::registerAsMainThread() call.
* kjs/JSGlobalData.h: Removed a lying lie comment - parserObjectExtraRefCounts is not
transient, and while newParserObjects may conceptually be such, there is still some node
manipulation going on outside Parser::parse which touches it.
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::~JSGlobalData): Delete recently added members.
(KJS::JSGlobalData::sharedInstance): Actually use a separate instance.
* kjs/collector.cpp:
(KJS::Heap::Heap):
(KJS::Heap::~Heap): Added a destructor, which unconditionally deletes everything.
(KJS::Heap::sweep): Removed code related to "collect on main thread only" logic.
(KJS::Heap::collect): Ditto.
(KJS::Heap::globalObjectCount): Explicitly use per-thread instance of JSGlobalObject linked
list now that JSGlobalObject::head() is not static. Curently, WebCoreStatistics methods only
work with the main thread currently anyway.
(KJS::Heap::protectedGlobalObjectCount): Ditto.
* kjs/collector.h: Removed code related to "collect on main thread only" logic.
* JavaScriptCore.exp: Removed Heap::collectOnMainThreadOnly.
2008-06-26 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
https://bugs.webkit.org/show_bug.cgi?id=19767
REGRESSION: Crash in sort() when visiting http://www.onnyturf.com/subway/
* kjs/JSArray.cpp: (KJS::AVLTreeAbstractorForArrayCompare::set_balance_factor):
Made changing balance factor from -1 to +1 work correctly.
* wtf/AVLTree.h: (KJS::AVLTreeDefaultBSet::operator[]): Added an assertion that catches
this slightly earlier.
2008-06-25 Timothy Hatcher <timothy@apple.com>
Fixes an ASSERT in the profiler when starting multiple profiles
with the same name inside the same function/program.
Reviewed by Kevin McCullough.
* profiler/Profile.cpp:
(KJS::Profile::Profile): Initialize m_stoppedCallDepth to zero.
(KJS::Profile::stopProfiling): Set the current node to the parent,
because we are in a call that will not get a didExecute call.
(KJS::Profile::removeProfile): Increment m_stoppedCallDepth to
account for didExecute not being called for profile.
(KJS::Profile::willExecute): Increment m_stoppedCallDepth if stopped.
(KJS::Profile::didExecute): Decrement m_stoppedCallDepth if stopped and
greater than zero, and return early.
* profiler/Profile.h: Added stoppedProfiling().
* profiler/Profiler.cpp:
(KJS::Profiler::findProfile): Removed.
(KJS::Profiler::startProfiling): Don't return early for stopped profiles.
(KJS::Profiler::stopProfiling): Skipp stopped profiles.
(KJS::Profiler::didFinishAllExecution): Code clean-up.
* profiler/Profiler.h: Removed findProfile.
2008-06-25 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Alexey Proskuryakov.
Attempt to fix Windows debug build. The compiler gives a warning when
Structured Exception Handling and destructors are used in the same
function. Using manual locking and unlocking instead of constructors
and destructors should fix the warning.
* kjs/Shell.cpp:
(main):
2008-06-25 Alexey Proskuryakov <ap@webkit.org>
Forgot to address a review comment about better names for tracked objects, doing it now.
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::JSGlobalData):
* kjs/JSGlobalData.h:
* kjs/nodes.cpp:
(KJS::ParserRefCounted::ParserRefCounted):
(KJS::ParserRefCounted::ref):
(KJS::ParserRefCounted::deref):
(KJS::ParserRefCounted::hasOneRef):
(KJS::ParserRefCounted::deleteNewObjects):
2008-06-25 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff.
Remove more threadInstance() calls.
* kjs/JSFunction.cpp:
(KJS::JSFunction::getParameterName):
(KJS::IndexToNameMap::unMap):
(KJS::Arguments::deleteProperty):
* kjs/JSFunction.h:
Access nullIdentifier without going to thread specific storage.
* JavaScriptCore.exp:
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::JSGlobalData):
* kjs/JSGlobalData.h:
* kjs/Parser.cpp:
(KJS::Parser::parse):
* kjs/Parser.h:
(KJS::ParserRefCountedData::ParserRefCountedData):
(KJS::Parser::parse):
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::ParserRefCounted::ParserRefCounted):
(KJS::ParserRefCounted::ref):
(KJS::ParserRefCounted::deref):
(KJS::ParserRefCounted::hasOneRef):
(KJS::ParserRefCounted::deleteNewObjects):
(KJS::Node::Node):
(KJS::StatementNode::StatementNode):
(KJS::BreakpointCheckStatement::BreakpointCheckStatement):
(KJS::ConstDeclNode::ConstDeclNode):
(KJS::BlockNode::BlockNode):
(KJS::ForInNode::ForInNode):
(KJS::ScopeNode::ScopeNode):
(KJS::ProgramNode::ProgramNode):
(KJS::ProgramNode::create):
(KJS::EvalNode::EvalNode):
(KJS::EvalNode::create):
(KJS::FunctionBodyNode::FunctionBodyNode):
(KJS::FunctionBodyNode::create):
* kjs/nodes.h:
(KJS::ExpressionNode::):
(KJS::NullNode::):
(KJS::BooleanNode::):
(KJS::NumberNode::):
(KJS::ImmediateNumberNode::):
(KJS::StringNode::):
(KJS::RegExpNode::):
(KJS::ThisNode::):
(KJS::ResolveNode::):
(KJS::ElementNode::):
(KJS::ArrayNode::):
(KJS::PropertyNode::):
(KJS::PropertyListNode::):
(KJS::ObjectLiteralNode::):
(KJS::BracketAccessorNode::):
(KJS::DotAccessorNode::):
(KJS::ArgumentListNode::):
(KJS::ArgumentsNode::):
(KJS::NewExprNode::):
(KJS::EvalFunctionCallNode::):
(KJS::FunctionCallValueNode::):
(KJS::FunctionCallResolveNode::):
(KJS::FunctionCallBracketNode::):
(KJS::FunctionCallDotNode::):
(KJS::PrePostResolveNode::):
(KJS::PostIncResolveNode::):
(KJS::PostDecResolveNode::):
(KJS::PostfixBracketNode::):
(KJS::PostIncBracketNode::):
(KJS::PostDecBracketNode::):
(KJS::PostfixDotNode::):
(KJS::PostIncDotNode::):
(KJS::PostDecDotNode::):
(KJS::PostfixErrorNode::):
(KJS::DeleteResolveNode::):
(KJS::DeleteBracketNode::):
(KJS::DeleteDotNode::):
(KJS::DeleteValueNode::):
(KJS::VoidNode::):
(KJS::TypeOfResolveNode::):
(KJS::TypeOfValueNode::):
(KJS::PreIncResolveNode::):
(KJS::PreDecResolveNode::):
(KJS::PrefixBracketNode::):
(KJS::PreIncBracketNode::):
(KJS::PreDecBracketNode::):
(KJS::PrefixDotNode::):
(KJS::PreIncDotNode::):
(KJS::PreDecDotNode::):
(KJS::PrefixErrorNode::):
(KJS::UnaryOpNode::UnaryOpNode):
(KJS::UnaryPlusNode::):
(KJS::NegateNode::):
(KJS::BitwiseNotNode::):
(KJS::LogicalNotNode::):
(KJS::BinaryOpNode::BinaryOpNode):
(KJS::ReverseBinaryOpNode::ReverseBinaryOpNode):
(KJS::MultNode::):
(KJS::DivNode::):
(KJS::ModNode::):
(KJS::AddNode::):
(KJS::SubNode::):
(KJS::LeftShiftNode::):
(KJS::RightShiftNode::):
(KJS::UnsignedRightShiftNode::):
(KJS::LessNode::):
(KJS::GreaterNode::):
(KJS::LessEqNode::):
(KJS::GreaterEqNode::):
(KJS::InstanceOfNode::):
(KJS::InNode::):
(KJS::EqualNode::):
(KJS::NotEqualNode::):
(KJS::StrictEqualNode::):
(KJS::NotStrictEqualNode::):
(KJS::BitAndNode::):
(KJS::BitOrNode::):
(KJS::BitXOrNode::):
(KJS::LogicalAndNode::):
(KJS::LogicalOrNode::):
(KJS::ConditionalNode::):
(KJS::ReadModifyResolveNode::):
(KJS::AssignResolveNode::):
(KJS::ReadModifyBracketNode::):
(KJS::AssignBracketNode::):
(KJS::AssignDotNode::):
(KJS::ReadModifyDotNode::):
(KJS::AssignErrorNode::):
(KJS::CommaNode::):
(KJS::VarDeclCommaNode::):
(KJS::ConstStatementNode::):
(KJS::SourceElements::SourceElements):
(KJS::EmptyStatementNode::):
(KJS::DebuggerStatementNode::):
(KJS::ExprStatementNode::):
(KJS::VarStatementNode::):
(KJS::IfNode::):
(KJS::IfElseNode::):
(KJS::DoWhileNode::):
(KJS::WhileNode::):
(KJS::ForNode::):
(KJS::ContinueNode::):
(KJS::BreakNode::):
(KJS::ReturnNode::):
(KJS::WithNode::):
(KJS::LabelNode::):
(KJS::ThrowNode::):
(KJS::TryNode::):
(KJS::ParameterNode::):
(KJS::FuncExprNode::):
(KJS::FuncDeclNode::):
(KJS::CaseClauseNode::):
(KJS::ClauseListNode::):
(KJS::CaseBlockNode::):
(KJS::SwitchNode::):
Changed ParserRefCounted to hold a JSGlobalData pointer, and used it to replace
threadInstance calls.
2008-06-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Alexey Proskuryakov.
Make the JavaScript shell collect the heap from main() instead of
jscmain() to suppress leak messages in debug builds.
* kjs/Shell.cpp:
(main):
(jscmain):
2008-06-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Make the conversion of the pair (less, jtrue) to jless use register
reference counting information for safety instead of requiring callers
to decide whether it is safe.
No changes on SunSpider codegen.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitJumpIfTrue):
* VM/CodeGenerator.h:
* kjs/nodes.cpp:
(KJS::DoWhileNode::emitCode):
(KJS::WhileNode::emitCode):
(KJS::ForNode::emitCode):
(KJS::CaseBlockNode::emitCodeForBlock):
2008-06-24 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim.
<rdar://problem/6031594> JSProfiler: Profiler goes into an infinite
loop sometimes.
<rdar://problem/6031603> JSProfiler: Profiler asserts in debug and
give the wrong times in release
Fixed two issues found by Tim in the same test.
* profiler/Profile.cpp:
(KJS::Profile::removeProfileStart): No longer take profile's time from
all ancestors, but instead attribute it to its parent. Also add an
Assert to ensure we only delete the child we mean to.
(KJS::Profile::removeProfileEnd): Ditto for profileEnd.
(KJS::Profile::didExecute): Cleaned up the execution order and correctly
attribute all of the parent's time to the new node.
* profiler/ProfileNode.cpp: If this node does not have a startTime it
should not get a giant total time, but instead be 0.
(KJS::ProfileNode::endAndRecordCall):
* profiler/ProfileNode.h:
(KJS::ProfileNode::removeChild): Should reset the sibling pointers since
one of them has been removed.
2008-06-24 Darin Adler <darin@apple.com>
Reviewed by Cameron.
- fix https://bugs.webkit.org/show_bug.cgi?id=19739
REGRESSION: fast/js/property-getters-and-setters.html fails
* kjs/JSObject.cpp:
(KJS::JSObject::put): Remove an untested optimization I checked in by accident.
The two loops up the prototype chain both need to start from this; instead the
second loop was starting where the first loop left off.
2008-06-24 Steve Falkenburg <sfalken@apple.com>
Build fix.
* kjs/nodes.cpp:
2008-06-24 Joerg Bornemann <joerg.bornemann@trolltech.com>
Reviewed by Simon.
For the Qt build on Windows don't depend on the presence of GNU CPP
but use MSVC's preprocessor instead.
dftables accepts a --preprocessor option which is set in pcre.pri for MSVC platforms.
* pcre/dftables: Added support for specifying the preprocessor command
to use via --preprocessor, similar to
WebCore/bindings/scripts/generate-bindings.pl.
* pcre/pcre.pri: Pass --preprocessor='cl /e' to dftables, or more
generally speaking QMAKE_CC /E for the win32-msvc buildspecs.
2008-06-24 Simon Hausmann <hausmann@webkit.org>
Fix the Qt build, added missing include.
* kjs/PropertySlot.cpp:
2008-06-24 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Cameron Zwarich.
Make ParserRefCountedCounter actually perform a leak check.
* kjs/nodes.cpp:
(KJS::ParserRefCountedCounter::~ParserRefCountedCounter): Check for leaks in destructor,
not in constructor.
(KJS::ParserRefCountedCounter::increment):
(KJS::ParserRefCountedCounter::decrement):
(KJS::ParserRefCounted::ParserRefCounted):
(KJS::ParserRefCounted::~ParserRefCounted):
While at it, also made counting thread-safe.
2008-06-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Bug 19730: REGRESSION (r34497): Text in alerts in "Leisure suit Larry" is not wrapped
<https://bugs.webkit.org/show_bug.cgi?id=19730>
Do not convert the pair (less, jtrue) to jless when jtrue is a jump
target. An example of this is when the condition of a while loop is a
LogicalOrNode.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitLabel):
2008-06-20 Ariya Hidayat <ariya.hidayat@trolltech.com>
Reviewed by Adam Roben.
Fix compile with MinGW.
* kjs/Shell.cpp:
* wtf/Threading.h:
(WTF::atomicIncrement):
(WTF::atomicDecrement):
2008-06-23 Mark Rowe <mrowe@apple.com>
Reviewed by Oliver Hunt.
Prepration for returning memory to the OS on Windows. Track whether a portion of a span of memory was returned to the OS.
If it was, ask that it be recommitted before returning it to the application as an allocated region.
* wtf/FastMalloc.cpp:
(WTF::TCMalloc_PageHeap::New): If the span was decommitted, ask that it be recommitted before returning it.
(WTF::TCMalloc_PageHeap::AllocLarge): Ditto.
(WTF::TCMalloc_PageHeap::Carve): When splitting a span, ensure that the decommitted state propogates to the two new spans.
(WTF::TCMalloc_PageHeap::Delete): When merging a span, ensure that the resulting span is marked as decommitted if any of the
spans being merged were marked as decommitted.
(WTF::TCMalloc_PageHeap::IncrementalScavenge): Mark as decommitted after releasing the span.
(WTF::TCMalloc_Central_FreeList::FetchFromSpans): Add an assertion to catch a decommitted span being returned to the application
without first being recommitted.
(WTF::TCMalloc_Central_FreeList::Populate): Ditto.
* wtf/TCSystemAlloc.cpp: Stub out TCMalloc_SystemCommit.
* wtf/TCSystemAlloc.h:
2008-06-23 Mark Rowe <mrowe@apple.com>
Reviewed by Sam Weinig.
Remove the sample member of Span when NO_TCMALLOC_SAMPLES is defined.
* wtf/FastMalloc.cpp:
(WTF::TCMalloc_PageHeap::Delete): Only update Span::sample if NO_TCMALLOC_SAMPLES is not defined.
(WTF::TCMallocStats::do_free): Ditto.
2008-06-23 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- work toward https://bugs.webkit.org/show_bug.cgi?id=19721
More preparation toward making functions work on primitive types without
creating wrapper objects. No speedup this time, but prepares for a future
speedup without slowing things down.
SunSpider reports no change.
- Eliminated the implementsCall, callAsFunction and construct virtual
functions from JSObject. Instead, the CallData and ConstructData for
a native function includes a function pointer that the caller can use
directly. Changed all call sites to use CallData and ConstructData.
- Changed the "this" argument to native functions to be a JSValue rather
than a JSObject. This prepares us for passing primitives into these
functions. The conversion to an object now must be done inside the
function. Critically, if it's a function that can be called on a DOM
window object, then we have to be sure to call toThisObject on the
argument before we use it for anything even if it's already an object.
- Eliminated the practice of using constructor objects in the global
object to make objects of the various basic types. Since these
constructors can't be replaced by script, there's no reason to involve
a constructor object at all. Added functions to do the construction
directly.
- Made some more class members private and protected, including virtual
function overrides. This can catch code using unnecessarily slow virtual
function code paths when the type of an object is known statically. If we
later find a new reason use the members outside the class it's easy to
make them public again.
- Moved the declarations of the native implementations for functions out
of header files. These can have internal linkage and be declared inside
the source file.
- Changed PrototypeFunction to take function pointers with the right
arguments to be put directly into CallData. This eliminates the
need to have a separate PrototypeReflexiveFunction, and reveals that the
real purpose of that class included something else specific to eval --
storage of a cached global object. So renamed PrototypeReflexiveFunction
to GlobalEvalFunction.
* API/JSCallbackConstructor.cpp:
(KJS::constructJSCallback):
(KJS::JSCallbackConstructor::getConstructData):
* API/JSCallbackConstructor.h:
* API/JSCallbackFunction.cpp:
(KJS::JSCallbackFunction::implementsHasInstance):
(KJS::JSCallbackFunction::call):
(KJS::JSCallbackFunction::getCallData):
* API/JSCallbackFunction.h:
(KJS::JSCallbackFunction::classInfo):
* API/JSCallbackObject.h:
(KJS::JSCallbackObject::classRef):
(KJS::JSCallbackObject::classInfo):
* API/JSCallbackObjectFunctions.h:
(KJS::::getConstructData):
(KJS::::construct):
(KJS::::getCallData):
(KJS::::call):
* API/JSObjectRef.cpp:
(JSObjectMakeFunction):
(JSObjectIsFunction):
(JSObjectCallAsFunction):
(JSObjectCallAsConstructor):
* JavaScriptCore.exp:
* VM/Machine.cpp:
(KJS::jsTypeStringForValue):
(KJS::Machine::privateExecute):
* kjs/ArrayPrototype.cpp:
(KJS::arrayProtoFuncToString):
(KJS::arrayProtoFuncToLocaleString):
(KJS::arrayProtoFuncJoin):
(KJS::arrayProtoFuncConcat):
(KJS::arrayProtoFuncPop):
(KJS::arrayProtoFuncPush):
(KJS::arrayProtoFuncReverse):
(KJS::arrayProtoFuncShift):
(KJS::arrayProtoFuncSlice):
(KJS::arrayProtoFuncSort):
(KJS::arrayProtoFuncSplice):
(KJS::arrayProtoFuncUnShift):
(KJS::arrayProtoFuncFilter):
(KJS::arrayProtoFuncMap):
(KJS::arrayProtoFuncEvery):
(KJS::arrayProtoFuncForEach):
(KJS::arrayProtoFuncSome):
(KJS::arrayProtoFuncIndexOf):
(KJS::arrayProtoFuncLastIndexOf):
(KJS::ArrayConstructor::ArrayConstructor):
(KJS::constructArrayWithSizeQuirk):
(KJS::constructWithArrayConstructor):
(KJS::ArrayConstructor::getConstructData):
(KJS::callArrayConstructor):
(KJS::ArrayConstructor::getCallData):
* kjs/ArrayPrototype.h:
* kjs/BooleanObject.cpp:
(KJS::booleanProtoFuncToString):
(KJS::booleanProtoFuncValueOf):
(KJS::constructBoolean):
(KJS::constructWithBooleanConstructor):
(KJS::BooleanConstructor::getConstructData):
(KJS::callBooleanConstructor):
(KJS::BooleanConstructor::getCallData):
(KJS::constructBooleanFromImmediateBoolean):
* kjs/BooleanObject.h:
* kjs/CallData.h:
(KJS::):
* kjs/ConstructData.h:
(KJS::):
* kjs/FunctionPrototype.cpp:
(KJS::callFunctionPrototype):
(KJS::FunctionPrototype::getCallData):
(KJS::functionProtoFuncToString):
(KJS::functionProtoFuncApply):
(KJS::functionProtoFuncCall):
(KJS::constructWithFunctionConstructor):
(KJS::FunctionConstructor::getConstructData):
(KJS::callFunctionConstructor):
(KJS::FunctionConstructor::getCallData):
(KJS::constructFunction):
* kjs/FunctionPrototype.h:
* kjs/JSArray.cpp:
(KJS::AVLTreeAbstractorForArrayCompare::compare_key_key):
(KJS::JSArray::sort):
(KJS::constructEmptyArray):
(KJS::constructArray):
* kjs/JSArray.h:
(KJS::JSArray::classInfo):
* kjs/JSFunction.cpp:
(KJS::JSFunction::call):
(KJS::globalFuncEval):
(KJS::globalFuncParseInt):
(KJS::globalFuncParseFloat):
(KJS::globalFuncIsNaN):
(KJS::globalFuncIsFinite):
(KJS::globalFuncDecodeURI):
(KJS::globalFuncDecodeURIComponent):
(KJS::globalFuncEncodeURI):
(KJS::globalFuncEncodeURIComponent):
(KJS::globalFuncEscape):
(KJS::globalFuncUnescape):
(KJS::globalFuncKJSPrint):
(KJS::PrototypeFunction::PrototypeFunction):
(KJS::PrototypeFunction::getCallData):
(KJS::GlobalEvalFunction::GlobalEvalFunction):
(KJS::GlobalEvalFunction::mark):
* kjs/JSFunction.h:
(KJS::InternalFunction::classInfo):
(KJS::InternalFunction::functionName):
(KJS::JSFunction::classInfo):
(KJS::GlobalEvalFunction::cachedGlobalObject):
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::reset):
(KJS::JSGlobalObject::mark):
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::JSGlobalObject):
(KJS::JSGlobalObject::evalFunction):
* kjs/JSImmediate.cpp:
(KJS::JSImmediate::toObject):
* kjs/JSNotAnObject.cpp:
* kjs/JSNotAnObject.h:
* kjs/JSObject.cpp:
(KJS::JSObject::put):
(KJS::callDefaultValueFunction):
(KJS::JSObject::defaultValue):
(KJS::JSObject::lookupGetter):
(KJS::JSObject::lookupSetter):
(KJS::JSObject::hasInstance):
(KJS::JSObject::fillGetterPropertySlot):
(KJS::Error::create):
(KJS::constructEmptyObject):
* kjs/JSObject.h:
(KJS::GetterSetter::GetterSetter):
(KJS::GetterSetter::getter):
(KJS::GetterSetter::setGetter):
(KJS::GetterSetter::setter):
(KJS::GetterSetter::setSetter):
* kjs/JSValue.cpp:
(KJS::JSCell::deleteProperty):
(KJS::call):
(KJS::construct):
* kjs/JSValue.h:
* kjs/MathObject.cpp:
(KJS::mathProtoFuncAbs):
(KJS::mathProtoFuncACos):
(KJS::mathProtoFuncASin):
(KJS::mathProtoFuncATan):
(KJS::mathProtoFuncATan2):
(KJS::mathProtoFuncCeil):
(KJS::mathProtoFuncCos):
(KJS::mathProtoFuncExp):
(KJS::mathProtoFuncFloor):
(KJS::mathProtoFuncLog):
(KJS::mathProtoFuncMax):
(KJS::mathProtoFuncMin):
(KJS::mathProtoFuncPow):
(KJS::mathProtoFuncRandom):
(KJS::mathProtoFuncRound):
(KJS::mathProtoFuncSin):
(KJS::mathProtoFuncSqrt):
(KJS::mathProtoFuncTan):
* kjs/MathObject.h:
* kjs/NumberObject.cpp:
(KJS::numberProtoFuncToString):
(KJS::numberProtoFuncToLocaleString):
(KJS::numberProtoFuncValueOf):
(KJS::numberProtoFuncToFixed):
(KJS::numberProtoFuncToExponential):
(KJS::numberProtoFuncToPrecision):
(KJS::NumberConstructor::NumberConstructor):
(KJS::constructWithNumberConstructor):
(KJS::NumberConstructor::getConstructData):
(KJS::callNumberConstructor):
(KJS::NumberConstructor::getCallData):
(KJS::constructNumber):
(KJS::constructNumberFromImmediateNumber):
* kjs/NumberObject.h:
(KJS::NumberObject::classInfo):
(KJS::NumberConstructor::classInfo):
* kjs/PropertySlot.cpp:
(KJS::PropertySlot::functionGetter):
* kjs/RegExpObject.cpp:
(KJS::regExpProtoFuncTest):
(KJS::regExpProtoFuncExec):
(KJS::regExpProtoFuncCompile):
(KJS::regExpProtoFuncToString):
(KJS::callRegExpObject):
(KJS::RegExpObject::getCallData):
(KJS::constructRegExp):
(KJS::constructWithRegExpConstructor):
(KJS::RegExpConstructor::getConstructData):
(KJS::callRegExpConstructor):
(KJS::RegExpConstructor::getCallData):
* kjs/RegExpObject.h:
(KJS::RegExpConstructor::classInfo):
* kjs/Shell.cpp:
(GlobalObject::GlobalObject):
(functionPrint):
(functionDebug):
(functionGC):
(functionVersion):
(functionRun):
(functionLoad):
(functionReadline):
(functionQuit):
* kjs/date_object.cpp:
(KJS::gmtoffset):
(KJS::formatLocaleDate):
(KJS::fillStructuresUsingDateArgs):
(KJS::DateInstance::getTime):
(KJS::DateInstance::getUTCTime):
(KJS::DateConstructor::DateConstructor):
(KJS::constructDate):
(KJS::DateConstructor::getConstructData):
(KJS::callDate):
(KJS::DateConstructor::getCallData):
(KJS::dateParse):
(KJS::dateNow):
(KJS::dateUTC):
(KJS::dateProtoFuncToString):
(KJS::dateProtoFuncToUTCString):
(KJS::dateProtoFuncToDateString):
(KJS::dateProtoFuncToTimeString):
(KJS::dateProtoFuncToLocaleString):
(KJS::dateProtoFuncToLocaleDateString):
(KJS::dateProtoFuncToLocaleTimeString):
(KJS::dateProtoFuncValueOf):
(KJS::dateProtoFuncGetTime):
(KJS::dateProtoFuncGetFullYear):
(KJS::dateProtoFuncGetUTCFullYear):
(KJS::dateProtoFuncToGMTString):
(KJS::dateProtoFuncGetMonth):
(KJS::dateProtoFuncGetUTCMonth):
(KJS::dateProtoFuncGetDate):
(KJS::dateProtoFuncGetUTCDate):
(KJS::dateProtoFuncGetDay):
(KJS::dateProtoFuncGetUTCDay):
(KJS::dateProtoFuncGetHours):
(KJS::dateProtoFuncGetUTCHours):
(KJS::dateProtoFuncGetMinutes):
(KJS::dateProtoFuncGetUTCMinutes):
(KJS::dateProtoFuncGetSeconds):
(KJS::dateProtoFuncGetUTCSeconds):
(KJS::dateProtoFuncGetMilliSeconds):
(KJS::dateProtoFuncGetUTCMilliseconds):
(KJS::dateProtoFuncGetTimezoneOffset):
(KJS::dateProtoFuncSetTime):
(KJS::setNewValueFromTimeArgs):
(KJS::setNewValueFromDateArgs):
(KJS::dateProtoFuncSetMilliSeconds):
(KJS::dateProtoFuncSetUTCMilliseconds):
(KJS::dateProtoFuncSetSeconds):
(KJS::dateProtoFuncSetUTCSeconds):
(KJS::dateProtoFuncSetMinutes):
(KJS::dateProtoFuncSetUTCMinutes):
(KJS::dateProtoFuncSetHours):
(KJS::dateProtoFuncSetUTCHours):
(KJS::dateProtoFuncSetDate):
(KJS::dateProtoFuncSetUTCDate):
(KJS::dateProtoFuncSetMonth):
(KJS::dateProtoFuncSetUTCMonth):
(KJS::dateProtoFuncSetFullYear):
(KJS::dateProtoFuncSetUTCFullYear):
(KJS::dateProtoFuncSetYear):
(KJS::dateProtoFuncGetYear):
* kjs/date_object.h:
(KJS::DateInstance::internalNumber):
(KJS::DateInstance::classInfo):
* kjs/error_object.cpp:
(KJS::errorProtoFuncToString):
(KJS::constructError):
(KJS::constructWithErrorConstructor):
(KJS::ErrorConstructor::getConstructData):
(KJS::callErrorConstructor):
(KJS::ErrorConstructor::getCallData):
(KJS::NativeErrorConstructor::construct):
(KJS::constructWithNativeErrorConstructor):
(KJS::NativeErrorConstructor::getConstructData):
(KJS::callNativeErrorConstructor):
(KJS::NativeErrorConstructor::getCallData):
* kjs/error_object.h:
(KJS::NativeErrorConstructor::classInfo):
* kjs/internal.cpp:
(KJS::JSNumberCell::toObject):
(KJS::JSNumberCell::toThisObject):
(KJS::GetterSetter::mark):
(KJS::GetterSetter::toPrimitive):
(KJS::GetterSetter::toBoolean):
(KJS::GetterSetter::toNumber):
(KJS::GetterSetter::toString):
(KJS::GetterSetter::toObject):
(KJS::InternalFunction::InternalFunction):
(KJS::InternalFunction::implementsHasInstance):
* kjs/lookup.h:
(KJS::HashEntry::):
* kjs/nodes.cpp:
(KJS::FuncDeclNode::makeFunction):
(KJS::FuncExprNode::makeFunction):
* kjs/object_object.cpp:
(KJS::objectProtoFuncValueOf):
(KJS::objectProtoFuncHasOwnProperty):
(KJS::objectProtoFuncIsPrototypeOf):
(KJS::objectProtoFuncDefineGetter):
(KJS::objectProtoFuncDefineSetter):
(KJS::objectProtoFuncLookupGetter):
(KJS::objectProtoFuncLookupSetter):
(KJS::objectProtoFuncPropertyIsEnumerable):
(KJS::objectProtoFuncToLocaleString):
(KJS::objectProtoFuncToString):
(KJS::ObjectConstructor::ObjectConstructor):
(KJS::constructObject):
(KJS::constructWithObjectConstructor):
(KJS::ObjectConstructor::getConstructData):
(KJS::callObjectConstructor):
(KJS::ObjectConstructor::getCallData):
* kjs/object_object.h:
* kjs/string_object.cpp:
(KJS::replace):
(KJS::stringProtoFuncToString):
(KJS::stringProtoFuncValueOf):
(KJS::stringProtoFuncCharAt):
(KJS::stringProtoFuncCharCodeAt):
(KJS::stringProtoFuncConcat):
(KJS::stringProtoFuncIndexOf):
(KJS::stringProtoFuncLastIndexOf):
(KJS::stringProtoFuncMatch):
(KJS::stringProtoFuncSearch):
(KJS::stringProtoFuncReplace):
(KJS::stringProtoFuncSlice):
(KJS::stringProtoFuncSplit):
(KJS::stringProtoFuncSubstr):
(KJS::stringProtoFuncSubstring):
(KJS::stringProtoFuncToLowerCase):
(KJS::stringProtoFuncToUpperCase):
(KJS::stringProtoFuncToLocaleLowerCase):
(KJS::stringProtoFuncToLocaleUpperCase):
(KJS::stringProtoFuncLocaleCompare):
(KJS::stringProtoFuncBig):
(KJS::stringProtoFuncSmall):
(KJS::stringProtoFuncBlink):
(KJS::stringProtoFuncBold):
(KJS::stringProtoFuncFixed):
(KJS::stringProtoFuncItalics):
(KJS::stringProtoFuncStrike):
(KJS::stringProtoFuncSub):
(KJS::stringProtoFuncSup):
(KJS::stringProtoFuncFontcolor):
(KJS::stringProtoFuncFontsize):
(KJS::stringProtoFuncAnchor):
(KJS::stringProtoFuncLink):
(KJS::stringFromCharCode):
(KJS::StringConstructor::StringConstructor):
(KJS::constructWithStringConstructor):
(KJS::StringConstructor::getConstructData):
(KJS::callStringConstructor):
(KJS::StringConstructor::getCallData):
* kjs/string_object.h:
2008-06-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Bug 19716: REGRESSION (SquirrelFish): Reproducible crash after entering a username at mint.com
<https://bugs.webkit.org/show_bug.cgi?id=19716>
When unwinding callframes for exceptions, check whether the callframe
was created by a reentrant native call to JavaScript after tearing off
the local variables instead of before.
* VM/Machine.cpp:
(KJS::Machine::unwindCallFrame):
2008-06-23 Mark Rowe <mrowe@apple.com>
Reviewed by Oliver Hunt.
Get testapi passing again in a debug build.
* API/testapi.c:
(main): Update the expected output of calling JSValueMakeString on a function object.
2008-06-21 Mark Rowe <mrowe@apple.com>
Reviewed by Sam Weinig.
Print a blank line when exiting the jsc interactive mode to ensure that the shell
prompt will start on a new line.
* kjs/Shell.cpp:
(runInteractive):
2008-06-21 Mark Rowe <mrowe@apple.com>
Rubber-stamped by Sam Weinig.
Tweak the paths of the items in the "tests" group to clean things up a little.
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-06-21 Mark Rowe <mrowe@apple.com>
Rubber-stamped by Sam Weinig.
Fix jsc to link against libedit.dylib rather than libedit.2.dylib.
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-06-21 Mark Rowe <mrowe@apple.com>
Reviewed by Sam Weinig.
Copy the JavaScriptCore shell (jsc) into JavaScriptCore.framework so that it will
be included in nightly builds.
https://bugs.webkit.org/show_bug.cgi?id=19691
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-06-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Mark Rowe.
Fix the build for non-Mac Darwin platforms by disabling their support
for readline in the JavaScript shell.
* kjs/config.h:
2008-06-20 Timothy Hatcher <timothy@apple.com>
Use member function pointers for the Profile::forEach function.
Eliminating a few static functions and simplified things a little.
Reviewed by Alexey Proskuryakov.
* JavaScriptCore.exp: Change the symbol for forEach.
* profiler/Profile.cpp:
(KJS::Profile::forEach): Use a member function pointer.
* profiler/Profile.h:
(KJS::Profile::sortTotalTimeDescending): Pass a function pointer.
(KJS::Profile::sortTotalTimeAscending): Ditto.
(KJS::Profile::sortSelfTimeDescending): Ditto.
(KJS::Profile::sortSelfTimeAscending): Ditto.
(KJS::Profile::sortCallsDescending): Ditto.
* profiler/ProfileNode.h:
(KJS::ProfileNode::sortTotalTimeDescending): No longer static.
(KJS::ProfileNode::sortTotalTimeAscending): Ditto.
(KJS::ProfileNode::sortSelfTimeDescending): Ditto.
(KJS::ProfileNode::sortSelfTimeAscending): Ditto.
(KJS::ProfileNode::sortCallsDescending): Ditto.
2008-06-20 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Remove unused destructors.
* kjs/nodes.cpp:
* kjs/nodes.h:
2008-06-20 Timothy Hatcher <timothy@apple.com>
Fixed an ASSERT(m_actualSelfTime <= m_actualTotalTime) when starting
and stopping a profile from the Develop menu. Also prevents
inserting an incorrect parent node as the new head after profiling
is stopped from the Develop menu.
Reviewed by Dan Bernstein.
* profiler/Profile.cpp:
(KJS::Profile::stopProfiling): If the current node is already the head
then there is no more need to record future nodes in didExecute.
(KJS::Profile::didExecute): Move the code of setupCurrentNodeAsStopped
into here since this was the only caller. When setting the total time
keep any current total time while adding the self time of the head.
(KJS::Profile::setupCurrentNodeAsStopped): Removed.
* profiler/Profile.h: Removed setupCurrentNodeAsStopped.
2008-06-20 Kevin Ollivier <kevino@theolliviers.com>
!USE(MULTIPLE_THREADS) on Darwin build fix
* kjs/InitializeThreading.cpp:
(KJS::initializeThreading):
* kjs/collector.h:
2008-06-20 Kevin McCullough <kmccullough@apple.com>
-Leopard Build Fix.
* profiler/Profile.cpp:
(KJS::Profile::removeProfileStart):
(KJS::Profile::removeProfileEnd):
2008-06-20 Kevin McCullough <kmccullough@apple.com>
Just giving credit.
* ChangeLog:
2008-06-20 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim and Dan.
<rdar://problem/6024846> JSProfiler: ASSERT hit in Profiler.
- Because InspectorController can call startProfiling() and
stopProfiling() we cannot assert that console.profile() and
console.profileEnd() will be in the profile tree.
* profiler/Profile.cpp:
(KJS::Profile::removeProfileStart):
(KJS::Profile::removeProfileEnd):
2008-06-20 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim.
<rdar://problem/5958770> JSProfiler: Time incorrectly given to (idle)
if profiling is started and finished within the same function. (19230)
- Now we profile one more stack frame up from the last frame to allocate
the time spent in it, if it exists.
* JavaScriptCore.exp:
* VM/Machine.cpp: We need to let the profiler know when the JS program
has finished since that is what will actually stop the profiler instead
of just calling stopProfiling().
(KJS::Machine::execute):
* profiler/Profile.cpp:
(KJS::Profile::create): Moved from Profile.h since it was getting pretty
long.
(KJS::Profile::Profile): We now have a client, which is a listener who
we will return this profile to, once it has actually finished.
(KJS::Profile::stopProfiling): Instead of fully stopping the profiler
here, we set the flag and keep it profiling in the background.
(KJS::Profile::didFinishAllExecution): This is where the profiler
actually finishes and creates the (idle) node if one should be made.
(KJS::Profile::removeProfileStart): Don't use m_currentNode since it is
needed by the profiler as it runs silently in the background.
(KJS::Profile::removeProfileEnd): Ditto.
(KJS::Profile::willExecute): Don't profile new functions if we have
stopped profiling.
(KJS::Profile::didExecute): Only record one more return as all the
remaining time will be attributed to that function.
(KJS::Profile::setupCurrentNodeAsStopped): Sets the current node's time.
* profiler/Profile.h: Added functions and variables for the above
changes.
(KJS::Profile::client):
* profiler/ProfileNode.h:
(KJS::CallIdentifier::toString): Debug method.
* profiler/Profiler.cpp: Added support for the ProfilerClient.
(KJS::Profiler::startProfiling):
(KJS::Profiler::stopProfiling): No longer return sthe profile.
(KJS::Profiler::didFinishAllExecution): Now returns the profile to the
client instead of stopProfiling.
* profiler/Profiler.h:
(KJS::ProfilerClient::~ProfilerClient): Clients will implement this
interface.
2008-06-19 Ariya Hidayat <ariya.hidayat@trolltech.com>
Reviewed by Simon.
Surpress compiler warning (int vs unsigned comparison).
* wtf/unicode/qt4/UnicodeQt4.h:
(WTF::Unicode::toLower):
2008-06-19 Ariya Hidayat <ariya.hidayat@trolltech.com>
Reviewed by Timothy Hatcher.
Introduce compiler define for MinGW, to have COMPILER(MINGW).
* wtf/Platform.h:
2008-06-19 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff.
Make Machine per-JSGlobalData.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitOpcode):
* VM/Machine.cpp:
(KJS::callEval):
(KJS::Machine::unwindCallFrame):
(KJS::Machine::throwException):
(KJS::Machine::execute):
(KJS::Machine::debug):
* VM/Machine.h:
* kjs/DebuggerCallFrame.cpp:
(KJS::DebuggerCallFrame::evaluate):
* kjs/DebuggerCallFrame.h:
(KJS::DebuggerCallFrame::DebuggerCallFrame):
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState):
* kjs/ExecState.h:
(KJS::ExecState::machine):
* kjs/JSFunction.cpp:
(KJS::JSFunction::callAsFunction):
(KJS::JSFunction::argumentsGetter):
(KJS::JSFunction::callerGetter):
(KJS::JSFunction::construct):
(KJS::globalFuncEval):
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::JSGlobalData):
* kjs/JSGlobalData.h:
* kjs/interpreter.cpp:
(KJS::Interpreter::evaluate):
2008-06-19 Alp Toker <alp@nuanti.com>
GTK+/autotools build fix. JSGlobalObject.cpp in now in
AllInOneFile.cpp and shouldn't be built separately.
* GNUmakefile.am:
2008-06-19 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Get rid of some threadInstance calls.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::init):
* kjs/Parser.cpp:
(KJS::Parser::parse):
* kjs/Shell.cpp:
(jscmain):
2008-06-19 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Sam.
Fix an assertion failure at startup.
* kjs/JSObject.h: (KJS::JSObject::JSObject): Allow jsNull prototype in an assertion (I had
it fixed in a wrong copy of the file, so I wasn't getting the failure).
2008-06-19 Alexey Proskuryakov <ap@webkit.org>
Build fix.
* kjs/collector.cpp:
(KJS::Heap::Heap):
(KJS::allocateBlock):
* kjs/collector.h:
No, #if PLATFORM(UNIX) was not right. I've just moved the unsafe initialization back for now,
as the platforms that use that code path do not use multiple threads yet.
2008-06-19 Alexey Proskuryakov <ap@webkit.org>
Windows and Qt build fixes.
* kjs/collector.h:
* kjs/collector.cpp:
(KJS::Heap::Heap):
Wrapped m_pagesize in #if PLATFORM(UNIX), which should better match the sequence of #elifs
in allocateBlock(). Changed MIN_ARRAY_SIZE to be explicitly size_t, as this type is different
on different platforms.
2008-06-17 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Prepare JavaScript heap for being per-thread.
* kjs/ExecState.h: Shuffle includes, making it possible to include ExecState.h in JSValue.h.
(KJS::ExecState::heap): Added an accessor.
* API/JSBase.cpp: (JSGarbageCollect): Collect both shared and per-thread heaps.
* API/JSContextRef.cpp: (JSGlobalContextCreate): When allocating JSGlobalObject, indicate
that it belongs to a shared heap.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/AllInOneFile.cpp:
Moved JSGlobalObject.cpp to AllInOneFile, as a build fix for inlineAllocate magic.
* VM/CodeGenerator.h: (KJS::CodeGenerator::globalExec): Added an accessor (working via
m_scopeChain).
* VM/RegisterFile.h:
(KJS::RegisterFile::mark):
* VM/RegisterFileStack.h:
(KJS::RegisterFileStack::mark):
Made these pseudo-mark functions take Heap*.
* kjs/InitializeThreading.cpp:
(KJS::initializeThreading): Initialize heap introspector.
* kjs/JSGlobalData.h: Added Heap to the structure.
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::JSGlobalData): Initialize Heap.
(KJS::JSGlobalData::sharedInstance): Added a method to access shared global data instance
for legacy clients.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::~JSGlobalObject): Changed to work with per-thread head; fixed list
maintenance logic.
(KJS::JSGlobalObject::init): Changed to work with per-thread head.
(KJS::JSGlobalObject::put): Assert that a cross-heap operation is not being attempted.
(KJS::JSGlobalObject::reset): Pass ExecState* where now required.
(KJS::JSGlobalObject::mark): Pass the current heap to RegisterFileStack::mark.
(KJS::JSGlobalObject::operator new): Overload operator new to use per-thread or shared heap.
* kjs/JSGlobalObject.h: Removed static s_head member.
* kjs/PropertyMap.h: (KJS::PropertyMap::PropertyMap): Removed unused SavedProperty.
* kjs/collector.h: Turned Collector into an actual object with its own data, renamed to Heap.
(KJS::Heap::initializeHeapIntrospector): Added.
(KJS::Heap::heap): Added a method to determine which heap a JSValue is in, if any.
(KJS::Heap::allocate): Made non-static.
(KJS::Heap::inlineAllocateNumber): Ditto.
(KJS::Heap::markListSet): Ditto.
(KJS::Heap::cellBlock): Ditto.
(KJS::Heap::cellOffset): Ditto.
(KJS::Heap::isCellMarked): Ditto.
(KJS::Heap::markCell): Ditto.
(KJS::Heap::reportExtraMemoryCost): Ditto.
(KJS::CollectorBlock): Added a back-reference to Heap for Heap::heap() method.
(KJS::SmallCellCollectorBlock): Ditto.
* kjs/collector.cpp: Changed MIN_ARRAY_SIZE to a #define to avoid a PIC branch. Removed
main thread related machinery.
(KJS::Heap::Heap): Initialize the newly added data members.
(KJS::allocateBlock): Marked NEVER_INLINE, as this is a rare case that uses a PIC branch.
Moved static pagesize to the class to make it safely initialized.
(KJS::Heap::heapAllocate): Initialize heap back reference after a new block is allocated.
(KJS::Heap::registerThread): Removed introspector initialization, as it is now performed
in InitializeThreading.cpp.
(KJS::Heap::markOtherThreadConservatively): Assert that the "other thread" case only occurs
for legacy clients using a shared heap.
(KJS::Heap::markStackObjectsConservatively): Moved fastMallocForbid/Allow down here, since
it doesn't need to be forbidden during other GC phases.
* kjs/JSImmediate.h:
(KJS::jsUndefined):
(KJS::jsNull):
(KJS::jsBoolean):
Moved from JSvalue.h, to make these usable in files that cannot include JSValue.h (such
as list.h).
* API/JSCallbackObjectFunctions.h:
(KJS::::staticFunctionGetter):
* API/JSClassRef.cpp:
(OpaqueJSClass::prototype):
* API/JSObjectRef.cpp:
(JSObjectMake):
(JSObjectMakeFunctionWithCallback):
(JSObjectMakeConstructor):
(JSObjectMakeFunction):
* API/JSValueRef.cpp:
(JSValueMakeNumber):
(JSValueMakeString):
* JavaScriptCore.exp:
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitLoad):
* VM/JSPropertyNameIterator.cpp:
(KJS::JSPropertyNameIterator::create):
(KJS::JSPropertyNameIterator::next):
* VM/Machine.cpp:
(KJS::jsAddSlowCase):
(KJS::jsAdd):
(KJS::jsTypeStringForValue):
(KJS::scopeChainForCall):
(KJS::Machine::throwException):
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
(KJS::Machine::retrieveArguments):
* kjs/ArrayPrototype.cpp:
(KJS::arrayProtoFuncToString):
(KJS::arrayProtoFuncToLocaleString):
(KJS::arrayProtoFuncJoin):
(KJS::arrayProtoFuncConcat):
(KJS::arrayProtoFuncPop):
(KJS::arrayProtoFuncPush):
(KJS::arrayProtoFuncShift):
(KJS::arrayProtoFuncSlice):
(KJS::arrayProtoFuncSplice):
(KJS::arrayProtoFuncUnShift):
(KJS::arrayProtoFuncFilter):
(KJS::arrayProtoFuncMap):
(KJS::arrayProtoFuncEvery):
(KJS::arrayProtoFuncForEach):
(KJS::arrayProtoFuncSome):
(KJS::arrayProtoFuncIndexOf):
(KJS::arrayProtoFuncLastIndexOf):
(KJS::ArrayConstructor::ArrayConstructor):
(KJS::ArrayConstructor::construct):
(KJS::ArrayConstructor::callAsFunction):
* kjs/BooleanObject.cpp:
(KJS::BooleanPrototype::BooleanPrototype):
(KJS::booleanProtoFuncToString):
(KJS::BooleanConstructor::BooleanConstructor):
(KJS::BooleanConstructor::construct):
* kjs/FunctionPrototype.cpp:
(KJS::FunctionPrototype::FunctionPrototype):
(KJS::functionProtoFuncToString):
(KJS::FunctionConstructor::FunctionConstructor):
(KJS::FunctionConstructor::construct):
* kjs/JSActivation.cpp:
(KJS::JSActivation::createArgumentsObject):
* kjs/JSArray.cpp:
(KJS::JSArray::JSArray):
(KJS::JSArray::lengthGetter):
* kjs/JSFunction.cpp:
(KJS::JSFunction::lengthGetter):
(KJS::JSFunction::construct):
(KJS::Arguments::Arguments):
(KJS::encode):
(KJS::decode):
(KJS::globalFuncParseInt):
(KJS::globalFuncParseFloat):
(KJS::globalFuncEscape):
(KJS::globalFuncUnescape):
(KJS::PrototypeFunction::PrototypeFunction):
(KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
* kjs/JSImmediate.cpp:
(KJS::JSImmediate::toObject):
* kjs/JSLock.cpp:
(KJS::JSLock::registerThread):
* kjs/JSObject.cpp:
(KJS::JSObject::put):
(KJS::JSObject::defineGetter):
(KJS::JSObject::defineSetter):
(KJS::Error::create):
* kjs/JSObject.h:
(KJS::JSObject::putDirect):
* kjs/JSString.h:
(KJS::JSString::JSString):
* kjs/JSValue.cpp:
(KJS::JSCell::operator new):
(KJS::jsString):
(KJS::jsOwnedString):
* kjs/JSValue.h:
(KJS::JSNumberCell::operator new):
(KJS::jsNumberCell):
(KJS::jsNaN):
(KJS::jsNumber):
(KJS::JSCell::marked):
(KJS::JSCell::mark):
(KJS::JSValue::toJSNumber):
* kjs/MathObject.cpp:
(KJS::MathObject::getValueProperty):
(KJS::mathProtoFuncAbs):
(KJS::mathProtoFuncACos):
(KJS::mathProtoFuncASin):
(KJS::mathProtoFuncATan):
(KJS::mathProtoFuncATan2):
(KJS::mathProtoFuncCeil):
(KJS::mathProtoFuncCos):
(KJS::mathProtoFuncExp):
(KJS::mathProtoFuncFloor):
(KJS::mathProtoFuncLog):
(KJS::mathProtoFuncMax):
(KJS::mathProtoFuncMin):
(KJS::mathProtoFuncPow):
(KJS::mathProtoFuncRandom):
(KJS::mathProtoFuncRound):
(KJS::mathProtoFuncSin):
(KJS::mathProtoFuncSqrt):
(KJS::mathProtoFuncTan):
* kjs/NumberObject.cpp:
(KJS::NumberPrototype::NumberPrototype):
(KJS::numberProtoFuncToString):
(KJS::numberProtoFuncToLocaleString):
(KJS::numberProtoFuncToFixed):
(KJS::numberProtoFuncToExponential):
(KJS::numberProtoFuncToPrecision):
(KJS::NumberConstructor::NumberConstructor):
(KJS::NumberConstructor::getValueProperty):
(KJS::NumberConstructor::construct):
(KJS::NumberConstructor::callAsFunction):
* kjs/RegExpObject.cpp:
(KJS::RegExpPrototype::RegExpPrototype):
(KJS::regExpProtoFuncToString):
(KJS::RegExpObject::getValueProperty):
(KJS::RegExpConstructor::RegExpConstructor):
(KJS::RegExpMatchesArray::fillArrayInstance):
(KJS::RegExpConstructor::arrayOfMatches):
(KJS::RegExpConstructor::getBackref):
(KJS::RegExpConstructor::getLastParen):
(KJS::RegExpConstructor::getLeftContext):
(KJS::RegExpConstructor::getRightContext):
(KJS::RegExpConstructor::getValueProperty):
(KJS::RegExpConstructor::construct):
* kjs/RegExpObject.h:
* kjs/Shell.cpp:
(GlobalObject::GlobalObject):
(functionGC):
(functionRun):
(functionReadline):
(jscmain):
* kjs/date_object.cpp:
(KJS::formatLocaleDate):
(KJS::DatePrototype::DatePrototype):
(KJS::DateConstructor::DateConstructor):
(KJS::DateConstructor::construct):
(KJS::DateConstructor::callAsFunction):
(KJS::DateFunction::DateFunction):
(KJS::DateFunction::callAsFunction):
(KJS::dateProtoFuncToString):
(KJS::dateProtoFuncToUTCString):
(KJS::dateProtoFuncToDateString):
(KJS::dateProtoFuncToTimeString):
(KJS::dateProtoFuncToLocaleString):
(KJS::dateProtoFuncToLocaleDateString):
(KJS::dateProtoFuncToLocaleTimeString):
(KJS::dateProtoFuncValueOf):
(KJS::dateProtoFuncGetTime):
(KJS::dateProtoFuncGetFullYear):
(KJS::dateProtoFuncGetUTCFullYear):
(KJS::dateProtoFuncToGMTString):
(KJS::dateProtoFuncGetMonth):
(KJS::dateProtoFuncGetUTCMonth):
(KJS::dateProtoFuncGetDate):
(KJS::dateProtoFuncGetUTCDate):
(KJS::dateProtoFuncGetDay):
(KJS::dateProtoFuncGetUTCDay):
(KJS::dateProtoFuncGetHours):
(KJS::dateProtoFuncGetUTCHours):
(KJS::dateProtoFuncGetMinutes):
(KJS::dateProtoFuncGetUTCMinutes):
(KJS::dateProtoFuncGetSeconds):
(KJS::dateProtoFuncGetUTCSeconds):
(KJS::dateProtoFuncGetMilliSeconds):
(KJS::dateProtoFuncGetUTCMilliseconds):
(KJS::dateProtoFuncGetTimezoneOffset):
(KJS::dateProtoFuncSetTime):
(KJS::setNewValueFromTimeArgs):
(KJS::setNewValueFromDateArgs):
(KJS::dateProtoFuncSetYear):
(KJS::dateProtoFuncGetYear):
* kjs/error_object.cpp:
(KJS::ErrorPrototype::ErrorPrototype):
(KJS::errorProtoFuncToString):
(KJS::ErrorConstructor::ErrorConstructor):
(KJS::ErrorConstructor::construct):
(KJS::NativeErrorPrototype::NativeErrorPrototype):
(KJS::NativeErrorConstructor::NativeErrorConstructor):
(KJS::NativeErrorConstructor::construct):
* kjs/identifier.h:
* kjs/internal.cpp:
(KJS::StringObject::create):
(KJS::JSString::lengthGetter):
(KJS::JSString::indexGetter):
(KJS::JSString::indexNumericPropertyGetter):
* kjs/interpreter.cpp:
* kjs/list.cpp:
(KJS::ArgList::slowAppend):
* kjs/list.h:
* kjs/lookup.h:
(KJS::staticFunctionGetter):
(KJS::cacheGlobalObject):
* kjs/nodes.cpp:
(KJS::Node::emitThrowError):
(KJS::StringNode::emitCode):
(KJS::ArrayNode::emitCode):
(KJS::FuncDeclNode::makeFunction):
(KJS::FuncExprNode::makeFunction):
* kjs/nodes.h:
* kjs/object_object.cpp:
(KJS::ObjectPrototype::ObjectPrototype):
(KJS::objectProtoFuncToLocaleString):
(KJS::objectProtoFuncToString):
(KJS::ObjectConstructor::ObjectConstructor):
(KJS::ObjectConstructor::construct):
* kjs/protect.h:
(KJS::gcProtect):
(KJS::gcUnprotect):
* kjs/string_object.cpp:
(KJS::StringObject::StringObject):
(KJS::StringPrototype::StringPrototype):
(KJS::replace):
(KJS::stringProtoFuncCharAt):
(KJS::stringProtoFuncCharCodeAt):
(KJS::stringProtoFuncConcat):
(KJS::stringProtoFuncIndexOf):
(KJS::stringProtoFuncLastIndexOf):
(KJS::stringProtoFuncMatch):
(KJS::stringProtoFuncSearch):
(KJS::stringProtoFuncReplace):
(KJS::stringProtoFuncSlice):
(KJS::stringProtoFuncSplit):
(KJS::stringProtoFuncSubstr):
(KJS::stringProtoFuncSubstring):
(KJS::stringProtoFuncToLowerCase):
(KJS::stringProtoFuncToUpperCase):
(KJS::stringProtoFuncToLocaleLowerCase):
(KJS::stringProtoFuncToLocaleUpperCase):
(KJS::stringProtoFuncLocaleCompare):
(KJS::stringProtoFuncBig):
(KJS::stringProtoFuncSmall):
(KJS::stringProtoFuncBlink):
(KJS::stringProtoFuncBold):
(KJS::stringProtoFuncFixed):
(KJS::stringProtoFuncItalics):
(KJS::stringProtoFuncStrike):
(KJS::stringProtoFuncSub):
(KJS::stringProtoFuncSup):
(KJS::stringProtoFuncFontcolor):
(KJS::stringProtoFuncFontsize):
(KJS::stringProtoFuncAnchor):
(KJS::stringProtoFuncLink):
(KJS::StringConstructor::StringConstructor):
(KJS::StringConstructor::construct):
(KJS::StringConstructor::callAsFunction):
(KJS::StringConstructorFunction::StringConstructorFunction):
(KJS::StringConstructorFunction::callAsFunction):
* kjs/string_object.h:
(KJS::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
* kjs/ustring.h:
Updated for the above changes.
2008-06-17 Timothy Hatcher <timothy@apple.com>
Added a type to DebuggerCallFrame so the under interface can
distinguish anonymous functions and program call frames.
https://bugs.webkit.org/show_bug.cgi?id=19585
Reviewed by Geoff Garen.
* JavaScriptCore.exp: Export the DebuggerCallFrame::type symbol.
* kjs/DebuggerCallFrame.cpp:
(KJS::DebuggerCallFrame::type): Added.
* kjs/DebuggerCallFrame.h:
2008-06-17 Eric Seidel <eric@webkit.org>
Reviewed by Tim H.
Remove bogus ASSERT which tripped every time for those who use PAC files.
* kjs/Parser.cpp:
(KJS::Parser::parse):
2008-06-17 Kevin McCullough <kmccullough@apple.com>
Reviewed by Geoff.
<rdar://problem/5951534> JSProfiler: Don't profile console.profile()
or console.profileEnd()
* profiler/Profile.cpp:
(KJS::Profile::stopProfiling): Moved the creation of the (idle) node to
the Profile (not ProfileNode). This makes sense since the Profile
should be the one to modify the profile tree. Also each stopProfiling()
does not need to check if it's the head node anymore. Also fixed an
oddity where I was using willExecute to create the node.
(KJS::Profile::removeProfileStart): Removes the call to console.profile
that started this profile.
(KJS::Profile::removeProfileEnd): Removes the call to console.profileEnd
that ended this profile.
* profiler/Profile.h:
* profiler/ProfileNode.cpp: Moved the creation of the (idle) node to
the Profile object.
(KJS::ProfileNode::stopProfiling):
* profiler/ProfileNode.h: Added some helper functions and whitespace to
facilitate readability and the removal of profile() and profileEnd()
from the Profile tree.
(KJS::CallIdentifier::operator const char* ):
(KJS::ProfileNode::firstChild):
(KJS::ProfileNode::lastChild):
(KJS::ProfileNode::removeChild):
(KJS::ProfileNode::toString):
2008-06-17 Ariya Hidayat <ariya.hidayat@trolltech.com>
Rubber stamped by Adam Roben.
Include JSGlobalObject.h to fix the build.
* kjs/ScopeChain.cpp:
2008-06-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Reduce code duplication in emitReadModifyAssignment().
* kjs/nodes.cpp:
(KJS::emitReadModifyAssignment):
2008-06-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Sort includes alphabetically.
* kjs/nodes.cpp:
2008-06-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Bug 19596: LEAK: Gmail leaks SegmentedVector<RegisterID>
<https://bugs.webkit.org/show_bug.cgi?id=19596>
When growing SegmentedVector, we start adding segments at the position
of the last segment, overwriting it. The destructor frees allocated
segments starting at the segment of index 1, because the segment of
index 0 is assumed to be the initial inline segment. This causes a leak
of the segment that is referenced by index 0. Modifying grow() so that
it starts adding segments at the position after the last segment fixes
the leak.
Since the initial segment is a special case in the lookup code, this
bug never manifested itself via incorrect results.
* VM/SegmentedVector.h:
(KJS::SegmentedVector::grow):
2008-06-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Alexey.
- removed nearly unused types.h and LocalStorageEntry.h headers
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/ExecState.h:
* kjs/LocalStorageEntry.h: Removed.
* kjs/RegExpObject.cpp:
* kjs/error_object.cpp:
* kjs/grammar.y:
* kjs/nodes.cpp:
* kjs/types.h: Removed.
2008-06-16 Alp Toker <alp@nuanti.com>
Rubber-stamped by Geoff.
Change c++ to c in minidom and testapi emacs mode line comments.
* API/Node.h:
* API/NodeList.c:
* API/NodeList.h:
* API/testapi.c:
2008-06-16 Alexey Proskuryakov <ap@webkit.org>
Trying to fix Windows build.
* kjs/PropertyNameArray.h:
* kjs/identifier.cpp:
Include ExecState.h
2008-06-16 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Slight cleanup to the SymbolTableEntry class.
Renamed isEmpty to isNull, since we usually use "empty" to mean "holds
the valid, empty value", and "null" to mean "holds no value".
Changed an "== 0" to a "!", to match our style guidelines.
Added some ASSERTs to verify the (possibly questionable) assumption that
all register indexes will have their high two bits set. Also clarified a
comment to make that assumption clear.
2008-06-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Initialize functionQueueMutex in a safe manner.
* wtf/MainThread.cpp:
(WTF::functionQueueMutex): Made it an AtomicallyInitializedStatic.
(WTF::dispatchFunctionsFromMainThread):
(WTF::setMainThreadCallbacksPaused):
Assert that the current thread is main, meaning that the callbacksPaused static can be
accessed.
2008-06-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff Garen.
Make Identifier construction use an explicitly passed IdentifierTable.
No change on SunSpider total.
* API/JSCallbackObjectFunctions.h:
(KJS::::getOwnPropertySlot):
(KJS::::put):
(KJS::::deleteProperty):
(KJS::::getPropertyNames):
* API/JSObjectRef.cpp:
(JSObjectMakeFunctionWithCallback):
(JSObjectMakeFunction):
(JSObjectHasProperty):
(JSObjectGetProperty):
(JSObjectSetProperty):
(JSObjectDeleteProperty):
(OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
(JSObjectCopyPropertyNames):
* JavaScriptCore.exp:
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::CodeGenerator):
(KJS::CodeGenerator::registerForLocal):
(KJS::CodeGenerator::isLocal):
(KJS::CodeGenerator::addConstant):
(KJS::CodeGenerator::findScopedProperty):
* VM/CodeGenerator.h:
(KJS::CodeGenerator::globalData):
(KJS::CodeGenerator::propertyNames):
* VM/JSPropertyNameIterator.cpp:
(KJS::JSPropertyNameIterator::create):
* VM/Machine.cpp:
(KJS::Machine::throwException):
(KJS::Machine::privateExecute):
* kjs/ArrayPrototype.cpp:
(KJS::ArrayConstructor::ArrayConstructor):
* kjs/BooleanObject.cpp:
(KJS::BooleanConstructor::BooleanConstructor):
* kjs/FunctionPrototype.cpp:
(KJS::FunctionConstructor::FunctionConstructor):
(KJS::FunctionConstructor::construct):
* kjs/JSArray.cpp:
(KJS::JSArray::inlineGetOwnPropertySlot):
(KJS::JSArray::put):
(KJS::JSArray::deleteProperty):
(KJS::JSArray::getPropertyNames):
* kjs/JSFunction.cpp:
(KJS::Arguments::Arguments):
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::JSGlobalData):
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::reset):
* kjs/JSObject.cpp:
(KJS::JSObject::getOwnPropertySlot):
(KJS::JSObject::put):
(KJS::JSObject::putWithAttributes):
(KJS::JSObject::deleteProperty):
(KJS::JSObject::findPropertyHashEntry):
(KJS::JSObject::getPropertyNames):
(KJS::Error::create):
* kjs/JSVariableObject.cpp:
(KJS::JSVariableObject::getPropertyNames):
* kjs/NumberObject.cpp:
(KJS::NumberConstructor::NumberConstructor):
* kjs/PropertyNameArray.cpp:
(KJS::PropertyNameArray::add):
* kjs/PropertyNameArray.h:
(KJS::PropertyNameArray::PropertyNameArray):
(KJS::PropertyNameArray::addKnownUnique):
* kjs/PropertySlot.h:
(KJS::PropertySlot::getValue):
* kjs/RegExpObject.cpp:
(KJS::RegExpConstructor::RegExpConstructor):
* kjs/ScopeChain.cpp:
(KJS::ScopeChainNode::print):
* kjs/Shell.cpp:
(GlobalObject::GlobalObject):
* kjs/date_object.cpp:
(KJS::DateConstructor::DateConstructor):
* kjs/error_object.cpp:
(KJS::ErrorConstructor::ErrorConstructor):
(KJS::NativeErrorConstructor::NativeErrorConstructor):
* kjs/grammar.y:
* kjs/identifier.cpp:
(KJS::Identifier::add):
(KJS::Identifier::addSlowCase):
* kjs/identifier.h:
(KJS::Identifier::Identifier):
(KJS::Identifier::from):
(KJS::Identifier::equal):
(KJS::Identifier::add):
(KJS::operator==):
(KJS::operator!=):
* kjs/internal.cpp:
(KJS::JSString::getOwnPropertySlot):
* kjs/lexer.cpp:
(KJS::Lexer::Lexer):
(KJS::Lexer::lex):
(KJS::Lexer::makeIdentifier):
* kjs/lexer.h:
* kjs/lookup.cpp:
(KJS::HashTable::createTable):
* kjs/lookup.h:
(KJS::HashTable::initializeIfNeeded):
(KJS::HashTable::entry):
(KJS::getStaticPropertySlot):
(KJS::getStaticFunctionSlot):
(KJS::getStaticValueSlot):
(KJS::lookupPut):
* kjs/object_object.cpp:
(KJS::objectProtoFuncHasOwnProperty):
(KJS::objectProtoFuncDefineGetter):
(KJS::objectProtoFuncDefineSetter):
(KJS::objectProtoFuncLookupGetter):
(KJS::objectProtoFuncLookupSetter):
(KJS::objectProtoFuncPropertyIsEnumerable):
(KJS::ObjectConstructor::ObjectConstructor):
* kjs/string_object.cpp:
(KJS::StringObject::getOwnPropertySlot):
(KJS::StringObject::getPropertyNames):
(KJS::StringConstructor::StringConstructor):
Just pass ExecState or JSGlobalData everywhere. Identifier construction is now always
explicit.
* kjs/nodes.cpp: (KJS::RegExpNode::emitCode): Here, Identifier was created from a non-literal
char*, which was incorrect, as that uses the pointer value as a key.
2008-06-16 Thiago Macieira <tjmaciei@trolltech.com>
Reviewed by Darin.
https://bugs.webkit.org/show_bug.cgi?id=19577
Fix compilation in C++ environments where C99 headers are not present
The stdbool.h header is a C99 feature, defining the "_Bool" type as well as the
"true" and "false" constants. But it's completely unnecessary in C++ as the
language already defines the "bool" type and its two values.
* API/JSBase.h:
* API/JSContextRef.h:
* API/JSObjectRef.h:
* API/JSStringRef.h:
* API/JSValueRef.h:
2008-06-16 Kevin McCullough <kmccullough@apple.com>
Reviewed by John.
<rdar://problem/6012509> JSProfiler: %s are incorrect if you exclude a
top level node like (idle)
* profiler/Profile.cpp:
(KJS::Profile::focus):
(KJS::Profile::exclude): Subtract the selfTime from the totalTime of the
head since its self time will only be non-zero when one of its children
were excluded. Since the head's totalTime is used to calculate %s when
its totalTime is the same as the sum of all its visible childrens' times
their %s will sum to 100%.
2008-06-16 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam Weinig.
<rdar://problem/5969992> JSProfiler: Remove the recursion limit in the profiler.
* profiler/Profile.cpp:
(KJS::Profile::willExecute):
2008-06-16 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam.
<rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
profiler.
- Remove the last of the uses of recursion in the profiler.
* JavaScriptCore.exp: Export the new function's signature.
* profiler/Profile.cpp:
(KJS::calculateVisibleTotalTime): Added a new static method for
recalculating the visibleTotalTime of methods after focus has changed
which are visible.
(KJS::stopProfiling):
(KJS::Profile::focus): Implemented focus without recursion.
* profiler/Profile.h: Moved implementation into the definition file.
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::traverseNextNodePreOrder): Added an argument for
whether or not to process the children nodes, this allows focus to skip
sub trees which have been set as not visible.
(KJS::ProfileNode::calculateVisibleTotalTime): This function set's a
node's total visible time to the sum of its self time and its children's
total times.
(KJS::ProfileNode::focus): Implemented focus without recursion.
* profiler/ProfileNode.h:
(KJS::CallIdentifier::operator!= ):
(KJS::ProfileNode::setActualTotalTime): Expanded setting the total time
so that focus could modify only the visible total time.
(KJS::ProfileNode::setVisibleTotalTime):
2008-06-16 Christian Dywan <christian@twotoasts.de>
Reviewed by Sam.
https://bugs.webkit.org/show_bug.cgi?id=19552
JavaScriptCore headers use C++ style comments
Replace all C++ style comments with C style multiline
comments and remove all "mode" lines.
* API/JSBase.h:
* API/JSClassRef.h:
* API/JSContextRef.h:
* API/JSObjectRef.h:
* API/JSStringRef.h:
* API/JSStringRefBSTR.h:
* API/JSStringRefCF.h:
* API/JSValueRef.h:
* API/JavaScript.h:
* API/JavaScriptCore.h:
2008-06-16 Christian Dywan <christian@twotoasts.de>
Reviewed by Sam.
https://bugs.webkit.org/show_bug.cgi?id=19557
(JavaScriptCore) minidom uses C++ style comments
Use only C style comments in minidom sources
* API/JSNode.c:
(JSNode_appendChild):
(JSNode_removeChild):
* API/JSNode.h:
* API/JSNodeList.c:
(JSNodeList_getProperty):
* API/JSNodeList.h:
* API/Node.c:
* API/Node.h:
* API/NodeList.c:
(NodeList_new):
(NodeList_item):
* API/NodeList.h:
* API/minidom.c:
(createStringWithContentsOfFile):
* wtf/Assertions.h:
* wtf/UnusedParam.h:
2008-06-16 Adriaan de Groot <groot@kde.org>
Reviewed by Simon.
Fix compilation on Solaris
On some systems, munmap takes a char* instead of a void* (contrary to POSIX and
Single Unix Specification). Since you can always convert from char* to void*
but not vice-versa, do the casting to char*.
* kjs/collector.cpp:
(KJS::allocateBlock):
(KJS::freeBlock):
2008-06-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Make a UnaryOpNode class to reduce boilerplate code for UnaryPlusNode,
NegateNode, BitwiseNotNode, and LogicalNotNode.
* VM/CodeGenerator.h:
(KJS::CodeGenerator::emitToJSNumber):
* kjs/nodes.cpp:
(KJS::UnaryOpNode::emitCode):
* kjs/nodes.h:
(KJS::UnaryOpNode::UnaryOpNode):
(KJS::UnaryPlusNode::):
(KJS::NegateNode::):
(KJS::NegateNode::precedence):
(KJS::BitwiseNotNode::):
(KJS::BitwiseNotNode::precedence):
(KJS::LogicalNotNode::):
(KJS::LogicalNotNode::precedence):
2008-06-16 Jan Michael Alonzo <jmalonzo@webkit.org>
Gtk build fix
* GNUmakefile.am:
2008-06-15 Darin Adler <darin@apple.com>
- rename KJS::List to KJS::ArgList
* API/JSCallbackConstructor.cpp:
(KJS::JSCallbackConstructor::construct):
* API/JSCallbackConstructor.h:
* API/JSCallbackFunction.cpp:
(KJS::JSCallbackFunction::callAsFunction):
* API/JSCallbackFunction.h:
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(KJS::::construct):
(KJS::::callAsFunction):
* API/JSObjectRef.cpp:
(JSObjectMakeFunction):
(JSObjectCallAsFunction):
(JSObjectCallAsConstructor):
* JavaScriptCore.exp:
* VM/Machine.cpp:
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
* VM/Machine.h:
* kjs/ArrayPrototype.cpp:
(KJS::arrayProtoFuncToString):
(KJS::arrayProtoFuncToLocaleString):
(KJS::arrayProtoFuncJoin):
(KJS::arrayProtoFuncConcat):
(KJS::arrayProtoFuncPop):
(KJS::arrayProtoFuncPush):
(KJS::arrayProtoFuncReverse):
(KJS::arrayProtoFuncShift):
(KJS::arrayProtoFuncSlice):
(KJS::arrayProtoFuncSort):
(KJS::arrayProtoFuncSplice):
(KJS::arrayProtoFuncUnShift):
(KJS::arrayProtoFuncFilter):
(KJS::arrayProtoFuncMap):
(KJS::arrayProtoFuncEvery):
(KJS::arrayProtoFuncForEach):
(KJS::arrayProtoFuncSome):
(KJS::arrayProtoFuncIndexOf):
(KJS::arrayProtoFuncLastIndexOf):
(KJS::ArrayConstructor::construct):
(KJS::ArrayConstructor::callAsFunction):
* kjs/ArrayPrototype.h:
* kjs/BooleanObject.cpp:
(KJS::booleanProtoFuncToString):
(KJS::booleanProtoFuncValueOf):
(KJS::BooleanConstructor::construct):
(KJS::BooleanConstructor::callAsFunction):
* kjs/BooleanObject.h:
* kjs/CommonIdentifiers.h:
* kjs/ExecState.h:
(KJS::ExecState::emptyList):
* kjs/FunctionPrototype.cpp:
(KJS::FunctionPrototype::callAsFunction):
(KJS::functionProtoFuncToString):
(KJS::functionProtoFuncApply):
(KJS::functionProtoFuncCall):
(KJS::FunctionConstructor::construct):
(KJS::FunctionConstructor::callAsFunction):
* kjs/FunctionPrototype.h:
* kjs/JSActivation.cpp:
(KJS::JSActivation::createArgumentsObject):
* kjs/JSArray.cpp:
(KJS::JSArray::JSArray):
(KJS::AVLTreeAbstractorForArrayCompare::compare_key_key):
* kjs/JSArray.h:
* kjs/JSFunction.cpp:
(KJS::JSFunction::callAsFunction):
(KJS::JSFunction::construct):
(KJS::IndexToNameMap::IndexToNameMap):
(KJS::Arguments::Arguments):
(KJS::encode):
(KJS::decode):
(KJS::globalFuncEval):
(KJS::globalFuncParseInt):
(KJS::globalFuncParseFloat):
(KJS::globalFuncIsNaN):
(KJS::globalFuncIsFinite):
(KJS::globalFuncDecodeURI):
(KJS::globalFuncDecodeURIComponent):
(KJS::globalFuncEncodeURI):
(KJS::globalFuncEncodeURIComponent):
(KJS::globalFuncEscape):
(KJS::globalFuncUnescape):
(KJS::globalFuncKJSPrint):
(KJS::PrototypeFunction::callAsFunction):
(KJS::PrototypeReflexiveFunction::callAsFunction):
* kjs/JSFunction.h:
* kjs/JSGlobalData.h:
* kjs/JSImmediate.cpp:
(KJS::JSImmediate::toObject):
* kjs/JSNotAnObject.cpp:
(KJS::JSNotAnObject::construct):
(KJS::JSNotAnObject::callAsFunction):
* kjs/JSNotAnObject.h:
* kjs/JSObject.cpp:
(KJS::JSObject::put):
(KJS::JSObject::construct):
(KJS::JSObject::callAsFunction):
(KJS::Error::create):
* kjs/JSObject.h:
* kjs/MathObject.cpp:
(KJS::mathProtoFuncAbs):
(KJS::mathProtoFuncACos):
(KJS::mathProtoFuncASin):
(KJS::mathProtoFuncATan):
(KJS::mathProtoFuncATan2):
(KJS::mathProtoFuncCeil):
(KJS::mathProtoFuncCos):
(KJS::mathProtoFuncExp):
(KJS::mathProtoFuncFloor):
(KJS::mathProtoFuncLog):
(KJS::mathProtoFuncMax):
(KJS::mathProtoFuncMin):
(KJS::mathProtoFuncPow):
(KJS::mathProtoFuncRandom):
(KJS::mathProtoFuncRound):
(KJS::mathProtoFuncSin):
(KJS::mathProtoFuncSqrt):
(KJS::mathProtoFuncTan):
* kjs/MathObject.h:
* kjs/NumberObject.cpp:
(KJS::numberProtoFuncToString):
(KJS::numberProtoFuncToLocaleString):
(KJS::numberProtoFuncValueOf):
(KJS::numberProtoFuncToFixed):
(KJS::numberProtoFuncToExponential):
(KJS::numberProtoFuncToPrecision):
(KJS::NumberConstructor::construct):
(KJS::NumberConstructor::callAsFunction):
* kjs/NumberObject.h:
* kjs/RegExpObject.cpp:
(KJS::regExpProtoFuncTest):
(KJS::regExpProtoFuncExec):
(KJS::regExpProtoFuncCompile):
(KJS::regExpProtoFuncToString):
(KJS::RegExpObject::match):
(KJS::RegExpObject::test):
(KJS::RegExpObject::exec):
(KJS::RegExpObject::callAsFunction):
(KJS::RegExpConstructor::construct):
(KJS::RegExpConstructor::callAsFunction):
* kjs/RegExpObject.h:
* kjs/Shell.cpp:
(functionPrint):
(functionDebug):
(functionGC):
(functionVersion):
(functionRun):
(functionLoad):
(functionReadline):
(functionQuit):
* kjs/collector.cpp:
(KJS::Collector::collect):
* kjs/collector.h:
(KJS::Collector::markListSet):
* kjs/date_object.cpp:
(KJS::formatLocaleDate):
(KJS::fillStructuresUsingTimeArgs):
(KJS::fillStructuresUsingDateArgs):
(KJS::DateConstructor::construct):
(KJS::DateConstructor::callAsFunction):
(KJS::DateFunction::callAsFunction):
(KJS::dateProtoFuncToString):
(KJS::dateProtoFuncToUTCString):
(KJS::dateProtoFuncToDateString):
(KJS::dateProtoFuncToTimeString):
(KJS::dateProtoFuncToLocaleString):
(KJS::dateProtoFuncToLocaleDateString):
(KJS::dateProtoFuncToLocaleTimeString):
(KJS::dateProtoFuncValueOf):
(KJS::dateProtoFuncGetTime):
(KJS::dateProtoFuncGetFullYear):
(KJS::dateProtoFuncGetUTCFullYear):
(KJS::dateProtoFuncToGMTString):
(KJS::dateProtoFuncGetMonth):
(KJS::dateProtoFuncGetUTCMonth):
(KJS::dateProtoFuncGetDate):
(KJS::dateProtoFuncGetUTCDate):
(KJS::dateProtoFuncGetDay):
(KJS::dateProtoFuncGetUTCDay):
(KJS::dateProtoFuncGetHours):
(KJS::dateProtoFuncGetUTCHours):
(KJS::dateProtoFuncGetMinutes):
(KJS::dateProtoFuncGetUTCMinutes):
(KJS::dateProtoFuncGetSeconds):
(KJS::dateProtoFuncGetUTCSeconds):
(KJS::dateProtoFuncGetMilliSeconds):
(KJS::dateProtoFuncGetUTCMilliseconds):
(KJS::dateProtoFuncGetTimezoneOffset):
(KJS::dateProtoFuncSetTime):
(KJS::setNewValueFromTimeArgs):
(KJS::setNewValueFromDateArgs):
(KJS::dateProtoFuncSetMilliSeconds):
(KJS::dateProtoFuncSetUTCMilliseconds):
(KJS::dateProtoFuncSetSeconds):
(KJS::dateProtoFuncSetUTCSeconds):
(KJS::dateProtoFuncSetMinutes):
(KJS::dateProtoFuncSetUTCMinutes):
(KJS::dateProtoFuncSetHours):
(KJS::dateProtoFuncSetUTCHours):
(KJS::dateProtoFuncSetDate):
(KJS::dateProtoFuncSetUTCDate):
(KJS::dateProtoFuncSetMonth):
(KJS::dateProtoFuncSetUTCMonth):
(KJS::dateProtoFuncSetFullYear):
(KJS::dateProtoFuncSetUTCFullYear):
(KJS::dateProtoFuncSetYear):
(KJS::dateProtoFuncGetYear):
* kjs/date_object.h:
* kjs/debugger.h:
* kjs/error_object.cpp:
(KJS::errorProtoFuncToString):
(KJS::ErrorConstructor::construct):
(KJS::ErrorConstructor::callAsFunction):
(KJS::NativeErrorConstructor::construct):
(KJS::NativeErrorConstructor::callAsFunction):
* kjs/error_object.h:
* kjs/internal.cpp:
(KJS::JSNumberCell::toObject):
(KJS::JSNumberCell::toThisObject):
* kjs/list.cpp:
(KJS::ArgList::getSlice):
(KJS::ArgList::markLists):
(KJS::ArgList::slowAppend):
* kjs/list.h:
(KJS::ArgList::ArgList):
(KJS::ArgList::~ArgList):
* kjs/object_object.cpp:
(KJS::objectProtoFuncValueOf):
(KJS::objectProtoFuncHasOwnProperty):
(KJS::objectProtoFuncIsPrototypeOf):
(KJS::objectProtoFuncDefineGetter):
(KJS::objectProtoFuncDefineSetter):
(KJS::objectProtoFuncLookupGetter):
(KJS::objectProtoFuncLookupSetter):
(KJS::objectProtoFuncPropertyIsEnumerable):
(KJS::objectProtoFuncToLocaleString):
(KJS::objectProtoFuncToString):
(KJS::ObjectConstructor::construct):
(KJS::ObjectConstructor::callAsFunction):
* kjs/object_object.h:
* kjs/string_object.cpp:
(KJS::replace):
(KJS::stringProtoFuncToString):
(KJS::stringProtoFuncValueOf):
(KJS::stringProtoFuncCharAt):
(KJS::stringProtoFuncCharCodeAt):
(KJS::stringProtoFuncConcat):
(KJS::stringProtoFuncIndexOf):
(KJS::stringProtoFuncLastIndexOf):
(KJS::stringProtoFuncMatch):
(KJS::stringProtoFuncSearch):
(KJS::stringProtoFuncReplace):
(KJS::stringProtoFuncSlice):
(KJS::stringProtoFuncSplit):
(KJS::stringProtoFuncSubstr):
(KJS::stringProtoFuncSubstring):
(KJS::stringProtoFuncToLowerCase):
(KJS::stringProtoFuncToUpperCase):
(KJS::stringProtoFuncToLocaleLowerCase):
(KJS::stringProtoFuncToLocaleUpperCase):
(KJS::stringProtoFuncLocaleCompare):
(KJS::stringProtoFuncBig):
(KJS::stringProtoFuncSmall):
(KJS::stringProtoFuncBlink):
(KJS::stringProtoFuncBold):
(KJS::stringProtoFuncFixed):
(KJS::stringProtoFuncItalics):
(KJS::stringProtoFuncStrike):
(KJS::stringProtoFuncSub):
(KJS::stringProtoFuncSup):
(KJS::stringProtoFuncFontcolor):
(KJS::stringProtoFuncFontsize):
(KJS::stringProtoFuncAnchor):
(KJS::stringProtoFuncLink):
(KJS::StringConstructor::construct):
(KJS::StringConstructor::callAsFunction):
(KJS::StringConstructorFunction::callAsFunction):
* kjs/string_object.h:
2008-06-15 Darin Adler <darin@apple.com>
- new names for more JavaScriptCore files
* API/JSCallbackFunction.cpp:
* API/JSObjectRef.cpp:
* DerivedSources.make:
* GNUmakefile.am:
* JavaScriptCore.exp:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* VM/Machine.cpp:
* kjs/AllInOneFile.cpp:
* kjs/ArrayPrototype.cpp: Copied from JavaScriptCore/kjs/array_object.cpp.
* kjs/ArrayPrototype.h: Copied from JavaScriptCore/kjs/array_object.h.
* kjs/BooleanObject.cpp: Copied from JavaScriptCore/kjs/bool_object.cpp.
* kjs/BooleanObject.h: Copied from JavaScriptCore/kjs/bool_object.h.
* kjs/ExecState.cpp:
* kjs/ExecState.h:
* kjs/FunctionPrototype.cpp: Copied from JavaScriptCore/kjs/function_object.cpp.
* kjs/FunctionPrototype.h: Copied from JavaScriptCore/kjs/function_object.h.
* kjs/JSArray.cpp: Copied from JavaScriptCore/kjs/array_instance.cpp.
* kjs/JSArray.h: Copied from JavaScriptCore/kjs/array_instance.h.
* kjs/JSFunction.cpp:
* kjs/JSFunction.h:
* kjs/JSGlobalObject.cpp:
* kjs/JSImmediate.cpp:
* kjs/JSObject.h:
* kjs/JSString.h:
* kjs/JSValue.h:
* kjs/JSVariableObject.cpp:
* kjs/MathObject.cpp: Copied from JavaScriptCore/kjs/math_object.cpp.
* kjs/MathObject.h: Copied from JavaScriptCore/kjs/math_object.h.
* kjs/NumberObject.cpp: Copied from JavaScriptCore/kjs/number_object.cpp.
* kjs/NumberObject.h: Copied from JavaScriptCore/kjs/number_object.h.
* kjs/PropertyMap.cpp: Copied from JavaScriptCore/kjs/property_map.cpp.
* kjs/PropertyMap.h: Copied from JavaScriptCore/kjs/property_map.h.
* kjs/PropertySlot.cpp: Copied from JavaScriptCore/kjs/property_slot.cpp.
* kjs/PropertySlot.h: Copied from JavaScriptCore/kjs/property_slot.h.
* kjs/RegExpObject.cpp: Copied from JavaScriptCore/kjs/regexp_object.cpp.
* kjs/RegExpObject.h: Copied from JavaScriptCore/kjs/regexp_object.h.
* kjs/ScopeChain.cpp: Copied from JavaScriptCore/kjs/scope_chain.cpp.
* kjs/ScopeChain.h: Copied from JavaScriptCore/kjs/scope_chain.h.
* kjs/ScopeChainMark.h: Copied from JavaScriptCore/kjs/scope_chain_mark.h.
* kjs/Shell.cpp:
* kjs/array_instance.cpp: Removed.
* kjs/array_instance.h: Removed.
* kjs/array_object.cpp: Removed.
* kjs/array_object.h: Removed.
* kjs/bool_object.cpp: Removed.
* kjs/bool_object.h: Removed.
* kjs/error_object.h:
* kjs/function_object.cpp: Removed.
* kjs/function_object.h: Removed.
* kjs/internal.cpp:
* kjs/math_object.cpp: Removed.
* kjs/math_object.h: Removed.
* kjs/nodes.cpp:
* kjs/number_object.cpp: Removed.
* kjs/number_object.h: Removed.
* kjs/object_object.cpp:
* kjs/property_map.cpp: Removed.
* kjs/property_map.h: Removed.
* kjs/property_slot.cpp: Removed.
* kjs/property_slot.h: Removed.
* kjs/regexp_object.cpp: Removed.
* kjs/regexp_object.h: Removed.
* kjs/scope_chain.cpp: Removed.
* kjs/scope_chain.h: Removed.
* kjs/scope_chain_mark.h: Removed.
* kjs/string_object.cpp:
* kjs/string_object.h:
2008-06-15 Darin Adler <darin@apple.com>
- new names for a few key JavaScriptCore files
* API/JSBase.cpp:
* API/JSCallbackConstructor.h:
* API/JSCallbackFunction.cpp:
* API/JSCallbackFunction.h:
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
* API/JSClassRef.h:
* API/JSContextRef.cpp:
* API/JSObjectRef.cpp:
* API/JSStringRef.cpp:
* API/JSStringRefCF.cpp:
* API/JSValueRef.cpp:
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* VM/CodeBlock.cpp:
* VM/CodeGenerator.cpp:
* VM/ExceptionHelpers.cpp:
* VM/ExceptionHelpers.h:
* VM/JSPropertyNameIterator.cpp:
* VM/JSPropertyNameIterator.h:
* VM/Machine.cpp:
* kjs/AllInOneFile.cpp:
* kjs/DateMath.cpp:
* kjs/DebuggerCallFrame.cpp:
* kjs/ExecState.cpp:
* kjs/JSActivation.cpp:
* kjs/JSFunction.cpp: Copied from JavaScriptCore/kjs/function.cpp.
* kjs/JSFunction.h: Copied from JavaScriptCore/kjs/function.h.
* kjs/JSImmediate.cpp:
* kjs/JSNotAnObject.h:
* kjs/JSObject.cpp: Copied from JavaScriptCore/kjs/object.cpp.
* kjs/JSObject.h: Copied from JavaScriptCore/kjs/object.h.
* kjs/JSString.h: Copied from JavaScriptCore/kjs/internal.h.
* kjs/JSValue.cpp: Copied from JavaScriptCore/kjs/value.cpp.
* kjs/JSValue.h: Copied from JavaScriptCore/kjs/value.h.
* kjs/JSVariableObject.h:
* kjs/JSWrapperObject.h:
* kjs/Shell.cpp:
* kjs/SymbolTable.h:
* kjs/array_instance.h:
* kjs/collector.cpp:
* kjs/date_object.cpp:
* kjs/date_object.h:
* kjs/error_object.cpp:
* kjs/function.cpp: Removed.
* kjs/function.h: Removed.
* kjs/function_object.cpp:
* kjs/function_object.h:
* kjs/grammar.y:
* kjs/internal.cpp:
* kjs/internal.h: Removed.
* kjs/lexer.cpp:
* kjs/list.h:
* kjs/lookup.h:
* kjs/nodes.h:
* kjs/object.cpp: Removed.
* kjs/object.h: Removed.
* kjs/object_object.h:
* kjs/operations.cpp:
* kjs/property_map.cpp:
* kjs/property_slot.cpp:
* kjs/property_slot.h:
* kjs/protect.h:
* kjs/regexp_object.cpp:
* kjs/scope_chain.cpp:
* kjs/string_object.h:
* kjs/ustring.cpp:
* kjs/value.cpp: Removed.
* kjs/value.h: Removed.
* profiler/Profile.cpp:
* profiler/Profiler.cpp:
2008-06-15 Darin Adler <darin@apple.com>
Rubber stamped by Sam.
- cut down on confusing uses of "Object" and "Imp" in
JavaScriptCore class names
* API/JSCallbackFunction.cpp:
(KJS::JSCallbackFunction::JSCallbackFunction):
* API/JSCallbackFunction.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* kjs/ExecState.h:
(KJS::ExecState::regExpTable):
(KJS::ExecState::regExpConstructorTable):
* kjs/JSGlobalData.cpp:
(KJS::JSGlobalData::JSGlobalData):
(KJS::JSGlobalData::~JSGlobalData):
* kjs/JSGlobalData.h:
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::reset):
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::objectConstructor):
(KJS::JSGlobalObject::functionConstructor):
(KJS::JSGlobalObject::arrayConstructor):
(KJS::JSGlobalObject::booleanConstructor):
(KJS::JSGlobalObject::stringConstructor):
(KJS::JSGlobalObject::numberConstructor):
(KJS::JSGlobalObject::dateConstructor):
(KJS::JSGlobalObject::regExpConstructor):
(KJS::JSGlobalObject::errorConstructor):
(KJS::JSGlobalObject::evalErrorConstructor):
(KJS::JSGlobalObject::rangeErrorConstructor):
(KJS::JSGlobalObject::referenceErrorConstructor):
(KJS::JSGlobalObject::syntaxErrorConstructor):
(KJS::JSGlobalObject::typeErrorConstructor):
(KJS::JSGlobalObject::URIErrorConstructor):
* kjs/array_object.cpp:
(KJS::ArrayConstructor::ArrayConstructor):
(KJS::ArrayConstructor::getConstructData):
(KJS::ArrayConstructor::construct):
(KJS::ArrayConstructor::callAsFunction):
* kjs/array_object.h:
* kjs/bool_object.cpp:
(KJS::BooleanObject::BooleanObject):
(KJS::BooleanPrototype::BooleanPrototype):
(KJS::booleanProtoFuncToString):
(KJS::booleanProtoFuncValueOf):
(KJS::BooleanConstructor::BooleanConstructor):
(KJS::BooleanConstructor::getConstructData):
(KJS::BooleanConstructor::construct):
(KJS::BooleanConstructor::callAsFunction):
* kjs/bool_object.h:
* kjs/date_object.cpp:
(KJS::DatePrototype::DatePrototype):
(KJS::DateConstructor::DateConstructor):
(KJS::DateConstructor::getConstructData):
(KJS::DateConstructor::construct):
(KJS::DateConstructor::callAsFunction):
(KJS::DateFunction::DateFunction):
(KJS::DateFunction::callAsFunction):
* kjs/date_object.h:
* kjs/error_object.cpp:
(KJS::ErrorPrototype::ErrorPrototype):
(KJS::ErrorConstructor::ErrorConstructor):
(KJS::ErrorConstructor::getConstructData):
(KJS::ErrorConstructor::construct):
(KJS::ErrorConstructor::callAsFunction):
(KJS::NativeErrorConstructor::NativeErrorConstructor):
(KJS::NativeErrorConstructor::getConstructData):
(KJS::NativeErrorConstructor::construct):
(KJS::NativeErrorConstructor::callAsFunction):
(KJS::NativeErrorConstructor::mark):
* kjs/error_object.h:
* kjs/function.cpp:
(KJS::JSFunction::JSFunction):
(KJS::JSFunction::mark):
(KJS::JSFunction::getOwnPropertySlot):
(KJS::JSFunction::put):
(KJS::JSFunction::deleteProperty):
(KJS::PrototypeFunction::PrototypeFunction):
(KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
(KJS::PrototypeReflexiveFunction::mark):
* kjs/function.h:
* kjs/function_object.cpp:
(KJS::functionProtoFuncToString):
(KJS::FunctionConstructor::FunctionConstructor):
(KJS::FunctionConstructor::getConstructData):
(KJS::FunctionConstructor::construct):
(KJS::FunctionConstructor::callAsFunction):
* kjs/function_object.h:
* kjs/internal.cpp:
(KJS::StringObject::create):
(KJS::JSString::toObject):
(KJS::JSString::toThisObject):
(KJS::JSString::getOwnPropertySlot):
(KJS::InternalFunction::InternalFunction):
(KJS::InternalFunction::getCallData):
(KJS::InternalFunction::implementsHasInstance):
* kjs/math_object.cpp:
(KJS::MathObject::MathObject):
(KJS::MathObject::getOwnPropertySlot):
(KJS::MathObject::getValueProperty):
* kjs/math_object.h:
* kjs/number_object.cpp:
(KJS::NumberObject::NumberObject):
(KJS::NumberPrototype::NumberPrototype):
(KJS::numberProtoFuncToString):
(KJS::numberProtoFuncToLocaleString):
(KJS::numberProtoFuncValueOf):
(KJS::numberProtoFuncToFixed):
(KJS::numberProtoFuncToExponential):
(KJS::numberProtoFuncToPrecision):
(KJS::NumberConstructor::NumberConstructor):
(KJS::NumberConstructor::getOwnPropertySlot):
(KJS::NumberConstructor::getValueProperty):
(KJS::NumberConstructor::getConstructData):
(KJS::NumberConstructor::construct):
(KJS::NumberConstructor::callAsFunction):
* kjs/number_object.h:
* kjs/object.cpp:
(KJS::JSObject::putDirectFunction):
* kjs/object.h:
* kjs/object_object.cpp:
(KJS::ObjectConstructor::ObjectConstructor):
(KJS::ObjectConstructor::getConstructData):
(KJS::ObjectConstructor::construct):
(KJS::ObjectConstructor::callAsFunction):
* kjs/object_object.h:
* kjs/regexp.cpp:
(KJS::RegExp::RegExp):
* kjs/regexp_object.cpp:
(KJS::regExpProtoFuncTest):
(KJS::regExpProtoFuncExec):
(KJS::regExpProtoFuncCompile):
(KJS::regExpProtoFuncToString):
(KJS::RegExpObject::RegExpObject):
(KJS::RegExpObject::~RegExpObject):
(KJS::RegExpObject::getOwnPropertySlot):
(KJS::RegExpObject::getValueProperty):
(KJS::RegExpObject::put):
(KJS::RegExpObject::putValueProperty):
(KJS::RegExpObject::match):
(KJS::RegExpObject::test):
(KJS::RegExpObject::exec):
(KJS::RegExpObject::getCallData):
(KJS::RegExpObject::callAsFunction):
(KJS::RegExpConstructorPrivate::RegExpConstructorPrivate):
(KJS::RegExpConstructor::RegExpConstructor):
(KJS::RegExpConstructor::performMatch):
(KJS::RegExpMatchesArray::RegExpMatchesArray):
(KJS::RegExpMatchesArray::~RegExpMatchesArray):
(KJS::RegExpMatchesArray::fillArrayInstance):
(KJS::RegExpConstructor::arrayOfMatches):
(KJS::RegExpConstructor::getBackref):
(KJS::RegExpConstructor::getLastParen):
(KJS::RegExpConstructor::getLeftContext):
(KJS::RegExpConstructor::getRightContext):
(KJS::RegExpConstructor::getOwnPropertySlot):
(KJS::RegExpConstructor::getValueProperty):
(KJS::RegExpConstructor::put):
(KJS::RegExpConstructor::putValueProperty):
(KJS::RegExpConstructor::getConstructData):
(KJS::RegExpConstructor::construct):
(KJS::RegExpConstructor::callAsFunction):
(KJS::RegExpConstructor::input):
* kjs/regexp_object.h:
* kjs/string_object.cpp:
(KJS::StringObject::StringObject):
(KJS::StringObject::getOwnPropertySlot):
(KJS::StringObject::put):
(KJS::StringObject::deleteProperty):
(KJS::StringObject::getPropertyNames):
(KJS::StringPrototype::StringPrototype):
(KJS::StringPrototype::getOwnPropertySlot):
(KJS::replace):
(KJS::stringProtoFuncToString):
(KJS::stringProtoFuncValueOf):
(KJS::stringProtoFuncCharAt):
(KJS::stringProtoFuncCharCodeAt):
(KJS::stringProtoFuncConcat):
(KJS::stringProtoFuncIndexOf):
(KJS::stringProtoFuncLastIndexOf):
(KJS::stringProtoFuncMatch):
(KJS::stringProtoFuncSearch):
(KJS::stringProtoFuncReplace):
(KJS::stringProtoFuncSlice):
(KJS::stringProtoFuncSplit):
(KJS::stringProtoFuncSubstr):
(KJS::stringProtoFuncSubstring):
(KJS::stringProtoFuncToLowerCase):
(KJS::stringProtoFuncToUpperCase):
(KJS::stringProtoFuncToLocaleLowerCase):
(KJS::stringProtoFuncToLocaleUpperCase):
(KJS::stringProtoFuncLocaleCompare):
(KJS::stringProtoFuncBig):
(KJS::stringProtoFuncSmall):
(KJS::stringProtoFuncBlink):
(KJS::stringProtoFuncBold):
(KJS::stringProtoFuncFixed):
(KJS::stringProtoFuncItalics):
(KJS::stringProtoFuncStrike):
(KJS::stringProtoFuncSub):
(KJS::stringProtoFuncSup):
(KJS::stringProtoFuncFontcolor):
(KJS::stringProtoFuncFontsize):
(KJS::stringProtoFuncAnchor):
(KJS::stringProtoFuncLink):
(KJS::StringConstructor::StringConstructor):
(KJS::StringConstructor::getConstructData):
(KJS::StringConstructor::construct):
(KJS::StringConstructor::callAsFunction):
(KJS::StringConstructorFunction::StringConstructorFunction):
(KJS::StringConstructorFunction::callAsFunction):
* kjs/string_object.h:
(KJS::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
* profiler/Profiler.cpp:
(KJS::createCallIdentifier):
2008-06-15 Darin Adler <darin@apple.com>
Rubber stamped by Sam.
- use JS prefix and simpler names for basic JavaScriptCore types,
to complement JSValue and JSObject
* JavaScriptCore.exp:
* VM/Machine.cpp:
(KJS::jsLess):
(KJS::jsLessEq):
(KJS::jsAdd):
(KJS::callEval):
(KJS::Machine::execute):
(KJS::Machine::retrieveArguments):
(KJS::Machine::retrieveCaller):
(KJS::Machine::getCallFrame):
(KJS::Machine::getFunctionAndArguments):
* VM/Machine.h:
* VM/Register.h:
* kjs/DebuggerCallFrame.cpp:
(KJS::DebuggerCallFrame::functionName):
* kjs/ExecState.h:
* kjs/JSActivation.cpp:
(KJS::JSActivation::createArgumentsObject):
* kjs/array_instance.cpp:
(KJS::JSArray::checkConsistency):
(KJS::JSArray::JSArray):
(KJS::JSArray::~JSArray):
(KJS::JSArray::getItem):
(KJS::JSArray::lengthGetter):
(KJS::JSArray::inlineGetOwnPropertySlot):
(KJS::JSArray::getOwnPropertySlot):
(KJS::JSArray::put):
(KJS::JSArray::deleteProperty):
(KJS::JSArray::getPropertyNames):
(KJS::JSArray::increaseVectorLength):
(KJS::JSArray::setLength):
(KJS::JSArray::mark):
(KJS::JSArray::sort):
(KJS::JSArray::compactForSorting):
(KJS::JSArray::lazyCreationData):
(KJS::JSArray::setLazyCreationData):
* kjs/array_instance.h:
* kjs/array_object.cpp:
(KJS::ArrayPrototype::ArrayPrototype):
(KJS::ArrayPrototype::getOwnPropertySlot):
(KJS::arrayProtoFuncToString):
(KJS::arrayProtoFuncToLocaleString):
(KJS::arrayProtoFuncConcat):
(KJS::arrayProtoFuncSort):
(KJS::ArrayObjectImp::construct):
* kjs/array_object.h:
* kjs/completion.h:
* kjs/function.cpp:
(KJS::JSFunction::JSFunction):
(KJS::JSFunction::mark):
(KJS::JSFunction::getCallData):
(KJS::JSFunction::callAsFunction):
(KJS::JSFunction::argumentsGetter):
(KJS::JSFunction::callerGetter):
(KJS::JSFunction::lengthGetter):
(KJS::JSFunction::getOwnPropertySlot):
(KJS::JSFunction::put):
(KJS::JSFunction::deleteProperty):
(KJS::JSFunction::getParameterName):
(KJS::JSFunction::getConstructData):
(KJS::JSFunction::construct):
(KJS::IndexToNameMap::IndexToNameMap):
(KJS::Arguments::Arguments):
* kjs/function.h:
* kjs/function_object.cpp:
(KJS::functionProtoFuncToString):
(KJS::functionProtoFuncApply):
(KJS::FunctionObjectImp::construct):
* kjs/internal.cpp:
(KJS::JSString::toPrimitive):
(KJS::JSString::getPrimitiveNumber):
(KJS::JSString::toBoolean):
(KJS::JSString::toNumber):
(KJS::JSString::toString):
(KJS::StringInstance::create):
(KJS::JSString::toObject):
(KJS::JSString::toThisObject):
(KJS::JSString::lengthGetter):
(KJS::JSString::indexGetter):
(KJS::JSString::indexNumericPropertyGetter):
(KJS::JSString::getOwnPropertySlot):
(KJS::JSNumberCell::type):
(KJS::JSNumberCell::toPrimitive):
(KJS::JSNumberCell::getPrimitiveNumber):
(KJS::JSNumberCell::toBoolean):
(KJS::JSNumberCell::toNumber):
(KJS::JSNumberCell::toString):
(KJS::JSNumberCell::toObject):
(KJS::JSNumberCell::toThisObject):
(KJS::JSNumberCell::getUInt32):
(KJS::JSNumberCell::getTruncatedInt32):
(KJS::JSNumberCell::getTruncatedUInt32):
(KJS::GetterSetter::mark):
(KJS::GetterSetter::toPrimitive):
(KJS::GetterSetter::getPrimitiveNumber):
(KJS::GetterSetter::toBoolean):
(KJS::GetterSetter::toNumber):
(KJS::GetterSetter::toString):
(KJS::GetterSetter::toObject):
(KJS::GetterSetter::getOwnPropertySlot):
(KJS::GetterSetter::put):
(KJS::GetterSetter::toThisObject):
* kjs/internal.h:
(KJS::JSString::JSString):
(KJS::JSString::getStringPropertySlot):
* kjs/nodes.cpp:
(KJS::FuncDeclNode::makeFunction):
(KJS::FuncExprNode::makeFunction):
* kjs/nodes.h:
* kjs/object.cpp:
(KJS::JSObject::put):
(KJS::JSObject::deleteProperty):
(KJS::JSObject::defineGetter):
(KJS::JSObject::defineSetter):
(KJS::JSObject::lookupGetter):
(KJS::JSObject::lookupSetter):
(KJS::JSObject::fillGetterPropertySlot):
* kjs/object.h:
(KJS::GetterSetter::GetterSetter):
* kjs/operations.cpp:
(KJS::equal):
(KJS::strictEqual):
* kjs/property_map.cpp:
(KJS::PropertyMap::containsGettersOrSetters):
* kjs/regexp_object.cpp:
(KJS::RegExpMatchesArray::getOwnPropertySlot):
(KJS::RegExpMatchesArray::put):
(KJS::RegExpMatchesArray::deleteProperty):
(KJS::RegExpMatchesArray::getPropertyNames):
(KJS::RegExpMatchesArray::RegExpMatchesArray):
(KJS::RegExpMatchesArray::fillArrayInstance):
* kjs/string_object.cpp:
(KJS::StringInstance::StringInstance):
(KJS::replace):
(KJS::stringProtoFuncReplace):
(KJS::stringProtoFuncToLowerCase):
(KJS::stringProtoFuncToUpperCase):
(KJS::stringProtoFuncToLocaleLowerCase):
(KJS::stringProtoFuncToLocaleUpperCase):
* kjs/string_object.h:
(KJS::StringInstance::internalValue):
* kjs/value.cpp:
(KJS::JSCell::getNumber):
(KJS::JSCell::getString):
(KJS::JSCell::getObject):
(KJS::jsString):
(KJS::jsOwnedString):
* kjs/value.h:
(KJS::JSNumberCell::JSNumberCell):
(KJS::jsNumberCell):
(KJS::JSValue::uncheckedGetNumber):
* profiler/Profiler.cpp:
(KJS::createCallIdentifier):
(KJS::createCallIdentifierFromFunctionImp):
2008-06-15 Maciej Stachowiak <mjs@apple.com>
Reviewed by Alexey.
- add emitUnaryOp, emitNullaryOp and emitUnaryOpNoDst; use them
This removes some boilerplate code and also reduces the number of
places that will need to be changed to do on-demand emit of
loads (and thus support k operands).
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitUnaryOp):
(KJS::CodeGenerator::emitNullaryOp):
(KJS::CodeGenerator::emitUnaryOpNoDst):
(KJS::CodeGenerator::emitPushScope):
* VM/CodeGenerator.h:
(KJS::CodeGenerator::emitNewObject):
(KJS::CodeGenerator::emitNewArray):
(KJS::CodeGenerator::emitNot):
(KJS::CodeGenerator::emitBitNot):
(KJS::CodeGenerator::emitToJSNumber):
(KJS::CodeGenerator::emitNegate):
(KJS::CodeGenerator::emitInstanceOf):
(KJS::CodeGenerator::emitTypeOf):
(KJS::CodeGenerator::emitIn):
(KJS::CodeGenerator::emitReturn):
(KJS::CodeGenerator::emitEnd):
(KJS::CodeGenerator::emitGetPropertyNames):
2008-06-15 Alp Toker <alp@nuanti.com>
Rubber-stamped by Maciej.
Install 'jsc' application by default.
* GNUmakefile.am:
2008-06-15 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- rename testkjs to jsc
* GNUmakefile.am:
* JavaScriptCore.vcproj/JavaScriptCore.sln:
* JavaScriptCore.vcproj/jsc: Added.
* JavaScriptCore.vcproj/jsc/jsc.vcproj: Copied from JavaScriptCore.vcproj/testkjs/testkjs.vcproj.
* JavaScriptCore.vcproj/testkjs: Removed.
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Removed.
* JavaScriptCore.xcodeproj/project.pbxproj:
* jscore.bkl:
* kjs/Shell.cpp: Copied from kjs/testkjs.cpp.
(main):
(printUsageStatement):
(jscmain):
* kjs/jsc.pro: Copied from kjs/testkjs.pro.
* kjs/testkjs.cpp: Removed.
* kjs/testkjs.pro: Removed.
* tests/mozilla/expected.html:
* tests/mozilla/js1_2/Array/tostring_1.js:
* tests/mozilla/js1_2/Array/tostring_2.js:
* tests/mozilla/jsDriver.pl:
2008-06-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Mac build fix.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/nodes.h:
2008-06-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Change the spelling of PrecMultiplicitave to PrecMultiplicative.
* kjs/nodes.h:
(KJS::MultNode::precedence):
(KJS::DivNode::precedence):
(KJS::ModNode::precedence):
2008-06-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Remove unused preprocessor macros related to exceptions in the old
interpreter.
* kjs/nodes.cpp:
2008-06-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Bug 19484: More instructions needs to use temporary registers
<https://bugs.webkit.org/show_bug.cgi?id=19484>
Fix codegen for all binary operations so that temporaries are used if
necessary. This was done by making BinaryOpNode and ReverseBinaryOpNode
subclasses of ExpressionNode, and eliminating the custom emitCode()
methods for the individual node classes.
This only adds 3 new instructions to SunSpider code, and there is no
difference in SunSpider execution time.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitBitNot):
(KJS::CodeGenerator::emitBinaryOp):
* VM/CodeGenerator.h:
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::PreIncResolveNode::emitCode):
(KJS::PreDecResolveNode::emitCode):
(KJS::BinaryOpNode::emitCode):
(KJS::ReverseBinaryOpNode::emitCode):
(KJS::emitReadModifyAssignment):
(KJS::CaseBlockNode::emitCodeForBlock):
* kjs/nodes.h:
(KJS::BinaryOpNode::BinaryOpNode):
(KJS::ReverseBinaryOpNode::ReverseBinaryOpNode):
(KJS::MultNode::):
(KJS::DivNode::):
(KJS::DivNode::precedence):
(KJS::ModNode::):
(KJS::ModNode::precedence):
(KJS::AddNode::):
(KJS::AddNode::precedence):
(KJS::SubNode::):
(KJS::SubNode::precedence):
(KJS::LeftShiftNode::):
(KJS::LeftShiftNode::precedence):
(KJS::RightShiftNode::):
(KJS::RightShiftNode::precedence):
(KJS::UnsignedRightShiftNode::):
(KJS::UnsignedRightShiftNode::precedence):
(KJS::LessNode::):
(KJS::LessNode::precedence):
(KJS::GreaterNode::):
(KJS::GreaterNode::precedence):
(KJS::LessEqNode::):
(KJS::LessEqNode::precedence):
(KJS::GreaterEqNode::):
(KJS::GreaterEqNode::precedence):
(KJS::InstanceOfNode::):
(KJS::InstanceOfNode::precedence):
(KJS::InNode::):
(KJS::InNode::precedence):
(KJS::EqualNode::):
(KJS::EqualNode::precedence):
(KJS::NotEqualNode::):
(KJS::NotEqualNode::precedence):
(KJS::StrictEqualNode::):
(KJS::StrictEqualNode::precedence):
(KJS::NotStrictEqualNode::):
(KJS::NotStrictEqualNode::precedence):
(KJS::BitAndNode::):
(KJS::BitAndNode::precedence):
(KJS::BitOrNode::):
(KJS::BitOrNode::precedence):
(KJS::BitXOrNode::):
(KJS::BitXOrNode::precedence):
* kjs/nodes2string.cpp:
(KJS::LessNode::streamTo):
(KJS::GreaterNode::streamTo):
(KJS::LessEqNode::streamTo):
(KJS::GreaterEqNode::streamTo):
(KJS::InstanceOfNode::streamTo):
(KJS::InNode::streamTo):
(KJS::EqualNode::streamTo):
(KJS::NotEqualNode::streamTo):
(KJS::StrictEqualNode::streamTo):
(KJS::NotStrictEqualNode::streamTo):
(KJS::BitAndNode::streamTo):
(KJS::BitXOrNode::streamTo):
(KJS::BitOrNode::streamTo):
2008-06-14 Darin Adler <darin@apple.com>
Rubber stamped by Sam.
- rename a bunch of local symbols within the regular expression code to
follow our usual coding style, and do a few other name tweaks
* pcre/pcre_compile.cpp:
(CompileData::CompileData):
(checkEscape):
(readRepeatCounts):
(compileBranch):
(compileBracket):
(calculateCompiledPatternLength):
(returnError):
(jsRegExpCompile):
* pcre/pcre_exec.cpp:
(MatchStack::MatchStack):
(MatchStack::canUseStackBufferForNextFrame):
(MatchStack::popCurrentFrame):
(match):
(tryFirstByteOptimization):
(tryRequiredByteOptimization):
(jsRegExpExecute):
* pcre/pcre_internal.h:
2008-06-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Darin.
Remove redundant uses of get().
* kjs/nodes.cpp:
(KJS::BracketAccessorNode::emitCode):
(KJS::AddNode::emitCode):
(KJS::SubNode::emitCode):
(KJS::ReadModifyResolveNode::emitCode):
(KJS::AssignDotNode::emitCode):
(KJS::ReadModifyDotNode::emitCode):
(KJS::AssignBracketNode::emitCode):
(KJS::ReadModifyBracketNode::emitCode):
2008-06-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Make code generation not use a temporary for the left-hand side of an
expression if the right-hand side is a local variable.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::isLocal):
* VM/CodeGenerator.h:
(KJS::CodeGenerator::leftHandSideNeedsCopy):
(KJS::CodeGenerator::emitNodeForLeftHandSide):
* kjs/nodes.cpp:
(KJS::ResolveNode::isPure):
(KJS::BracketAccessorNode::emitCode):
(KJS::AddNode::emitCode):
(KJS::SubNode::emitCode):
(KJS::ReadModifyResolveNode::emitCode):
(KJS::AssignDotNode::emitCode):
(KJS::ReadModifyDotNode::emitCode):
(KJS::AssignBracketNode::emitCode):
(KJS::ReadModifyBracketNode::emitCode):
* kjs/nodes.h:
(KJS::ExpressionNode::):
(KJS::BooleanNode::):
(KJS::NumberNode::):
(KJS::StringNode::):
2008-06-14 Darin Adler <darin@apple.com>
Reviewed by Sam.
- more of https://bugs.webkit.org/show_bug.cgi?id=17257
start ref counts at 1 instead of 0 for speed
* kjs/nodes.cpp:
(KJS::ParserRefCounted::hasOneRef): Added. Replaces refcount.
* kjs/nodes.h: Replaced refcount with hasOneRef.
* wtf/ListRefPtr.h:
(WTF::ListRefPtr::~ListRefPtr): Changed to use hasOneRef instead of
refcount, so this class can be used with the RefCounted template.
* wtf/RefCounted.h:
(WTF::RefCounted::hasOneRef): Made const, since there's no reason for
it to be non-const.
2008-06-14 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- initialize local vars as side effect of call instead of in bytecode
1.004x speedup on SunSpider.
This removes just the dispatch overhead for these loads - in the
future, dead store elimination might be able to eliminate them
entirely.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::CodeGenerator): For function blocks, don't
emit loads of undefined for var initialization.
* VM/Machine.cpp:
(KJS::slideRegisterWindowForCall): Instead, initialize locals
as part of the call.
2008-06-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Remove helper functions in the parser that are no longer needed.
* kjs/grammar.y:
2008-06-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Bug 19484: More instructions needs to use temporary registers
<https://bugs.webkit.org/show_bug.cgi?id=19484>
Make code generation for AddNode and SubNode use temporaries when
necessary.
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::AddNode::emitCode):
(KJS::SubNode::emitCode):
* kjs/nodes.h:
(KJS::AddNode::):
(KJS::SubNode::):
2008-06-13 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Combine TrueNode and FalseNode to make BooleanNode, and remove the
unused class PlaceholderTrueNode.
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::BooleanNode::emitCode):
* kjs/nodes.h:
(KJS::BooleanNode::):
(KJS::BooleanNode::precedence):
* kjs/nodes2string.cpp:
(KJS::BooleanNode::streamTo):
2008-06-13 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Eliminate the use of temporaries to store the left hand side of an
expression when the right hand side is a constant. This slightly
improves the generated bytecode for a few SunSpider tests, but it is
mostly in preparation for fixing
Bug 19484: More instructions needs to use temporary registers
<https://bugs.webkit.org/show_bug.cgi?id=19484>
* VM/CodeGenerator.h:
(KJS::CodeGenerator::leftHandSideNeedsCopy):
(KJS::CodeGenerator::emitNodeForLeftHandSide):
* kjs/nodes.cpp:
(KJS::BracketAccessorNode::emitCode):
(KJS::ReadModifyResolveNode::emitCode):
(KJS::AssignDotNode::emitCode):
(KJS::ReadModifyDotNode::emitCode):
(KJS::AssignBracketNode::emitCode):
(KJS::ReadModifyBracketNode::emitCode):
* kjs/nodes.h:
(KJS::ExpressionNode::):
(KJS::FalseNode::):
(KJS::TrueNode::):
(KJS::NumberNode::):
(KJS::StringNode::):
2008-06-13 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- prettify opcode stats output
I changed things to be a bit more aligned, also there is a new
section listing most common opcodes and most common sequences that
include them.
* VM/Opcode.cpp:
(KJS::OpcodeStats::~OpcodeStats):
* VM/Opcode.h:
2008-06-13 Kevin McCullough <kmccullough@apple.com>
Reviewed by Geoff.
<rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
profiler.
- Remove recursion from exclude(). This leaves only focus() to fix.
* JavaScriptCore.exp: Change the signatures of the exported functions.
* profiler/Profile.cpp:
(KJS::Profile::forEach): I added a traverseNextNodePreOrder() function
and so needed to distinguish the other function by labeling it
traverseNextNodePostOrder().
(KJS::Profile::exclude): All new exclude that iteratively walks the tree
* profiler/Profile.h:
(KJS::Profile::focus): Add a null check for m_head.
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::traverseNextNodePostOrder): Renamed
(KJS::ProfileNode::traverseNextNodePreOrder): Walks the tree in pre-
order, where the parent is processed before the children.
(KJS::ProfileNode::setTreeVisible): Iterate over the sub-tree and set
all of the nodes visible value. This changes another function that used
recursion.
(KJS::ProfileNode::exclude): Remove recursion from this function.
Because we now check for m_visible and we are walking the tree in pre-
order we do not need to check if an excluded node is in an excluded
sub-tree.
* profiler/ProfileNode.h: Added specific selfTime functions to
facilitate exclude().
(KJS::ProfileNode::setSelfTime):
(KJS::ProfileNode::setActualSelfTime):
(KJS::ProfileNode::setVisibleSelfTime):
2008-06-12 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- https://bugs.webkit.org/show_bug.cgi?id=19434
speed up SunSpider by avoiding some string boxing
Speeds up SunSpider by 1.1%.
Optimized code path for getting built-in properties from strings -- avoid
boxing with a string object in that case. We can make further changes to avoid
even more boxing, but this change alone is a win.
* API/JSCallbackObjectFunctions.h:
(KJS::JSCallbackObject::staticValueGetter): Use isObject instead of inherits
in asssert, since the type of slotBase() is now JSValue, not JSObject.
(KJS::JSCallbackObject::staticFunctionGetter): Ditto.
(KJS::JSCallbackObject::callbackGetter): Ditto.
* kjs/internal.cpp:
(KJS::StringImp::getPrimitiveNumber): Updated for change of data member name.
(KJS::StringImp::toBoolean): Ditto.
(KJS::StringImp::toNumber): Ditto.
(KJS::StringImp::toString): Ditto.
(KJS::StringInstance::create): Added; avoids a bit of cut and paste code.
(KJS::StringImp::toObject): Use StringInstance::create.
(KJS::StringImp::toThisObject): Ditto.
(KJS::StringImp::lengthGetter): Added. Replaces the getter that used to live in
the StringInstance class.
(KJS::StringImp::indexGetter): Ditto.
(KJS::StringImp::indexNumericPropertyGetter): Ditto.
(KJS::StringImp::getOwnPropertySlot): Added. Deals with built in properties of
the string class without creating a StringInstance.
* kjs/internal.h:
(KJS::StringImp::getStringPropertySlot): Added. To be used by both the string
and string object getOwnPropertySlot function.
* kjs/lookup.h:
(KJS::staticFunctionGetter): Updated since slotBase() is now a JSValue rather
than a JSObject.
* kjs/object.h: Removed PropertySlot::slotBase() function, which can now move
back into property_slot.h where it belongs since it doesn't have to cast to
JSObject*.
* kjs/property_slot.cpp:
(KJS::PropertySlot::functionGetter): Updated since slot.slotBase() is now a JSValue*
instead of JSObject*. setGetterSlot still guarantees the base is a JSObject*.
* kjs/property_slot.h:
(KJS::PropertySlot::PropertySlot): Changed base to JSValue* intead of JSCell*.
(KJS::PropertySlot::setStaticEntry): Ditto.
(KJS::PropertySlot::setCustom): Ditto.
(KJS::PropertySlot::setCustomIndex): Ditto.
(KJS::PropertySlot::setCustomNumeric): Ditto.
(KJS::PropertySlot::slotBase): Moved inline here since it no longer involves a
downcast to JSObject*.
(KJS::PropertySlot::setBase): Changed to JSValue*.
* kjs/string_object.cpp:
(KJS::StringInstance::getOwnPropertySlot): Changed to use getStringPropertySlot
instead of coding the properties here. This allows sharing the code with StringImp.
* kjs/string_object.h: Removed inlineGetOwnPropertySlot, lengthGetter, and indexGetter.
Made one of the constructors protected.
* kjs/value.h: Made getOwnPropertySlot private in the JSCell class -- this is better
since it's not the real JSObject getOwnPropertySlot semantic and most callers shouldn't
use it.
2008-06-12 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Maciej.
Preparation to making JavaScript heap per-thread.
* kjs/collector.cpp:
(KJS::Collector::collect):
* kjs/collector.h:
(KJS::Collector::markListSet):
The collector now holds the list of protected lists itself, to be made per-instance.
* kjs/list.h: Changed to hold a pointer to a mark set this list is in, if any.
(KJS::List::List): Explicitly initialize m_size with zero, as m_vector.size() is
guaranteed to be such anyway.
(KJS::List::append): Changed the fast case to only be executed as long as inline buffer
is used, because otherwise, we now do more expensive checks.
* kjs/list.cpp:
(KJS::List::markLists): Renamed from markProtectedListsSlowCase, made it take the list set
as a parameter.
(KJS::List::slowAppend): If a non-immediate value is appended, the list needs to be added
to an appropriate Heap's protected list. For now, a static Collector::markListSet() is
used, but the code is layed out in preparation to making the switch to multiple heaps.
* JavaScriptCore.exp: Updated export list.
2008-06-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Bug 19510: CodeBlock::needsFullScopeChain not always set for global code
<https://bugs.webkit.org/show_bug.cgi?id=19510>
This fixes the symptoms by using CodeGenerator::m_codeType to determine
when to use temporaries instead of CodeBlock::needsFullScopeChain, but
it does not fix the problem itself.
* VM/CodeGenerator.h:
(KJS::CodeGenerator::leftHandSideNeedsCopy):
2008-06-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Bug 19498: REGRESSION (r34497): crash while loading GMail
<https://bugs.webkit.org/show_bug.cgi?id=19498>
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitJumpIfTrueMayCombine):
(KJS::CodeGenerator::emitJumpIfTrue):
* VM/CodeGenerator.h:
* kjs/nodes.cpp:
(KJS::DoWhileNode::emitCode):
(KJS::WhileNode::emitCode):
(KJS::ForNode::emitCode):
(KJS::CaseBlockNode::emitCodeForBlock):
2008-06-11 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- a little bit of cleanup and prep for some upcoming optimizations
* JavaScriptCore.exp: Re-sorted this file (with sort command line tool).
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump): Fixed printf to avoid warnings -- to use %lu we
need to make sure the type is unsigned long.
* kjs/object.cpp:
(KJS::Error::create): Eliminated unused error names array, and also put
the strings into the code since there was already a switch statment.
This also avoids having to contemplate a hypothetical access past the
end of the array.
* kjs/object.h: Got rid of errorNames.
* kjs/property_slot.cpp: Deleted unused ungettableGetter.
* kjs/property_slot.h: Ditto.
* wtf/AlwaysInline.h: Added LIKELY alongside UNLIKELY.
2008-06-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Darin.
Bug 19457: Create fused opcodes for tests and conditional jumps
<https://bugs.webkit.org/show_bug.cgi?id=19457>
Add a new jless instruction, and modify the code generator to emit it
instead of the pair (less, jtrue).
Gives a 3.6% improvement on SunSpider.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::CodeGenerator):
(KJS::CodeGenerator::emitOpcode):
(KJS::CodeGenerator::retrieveLastBinaryOp):
(KJS::CodeGenerator::rewindBinaryOp):
(KJS::CodeGenerator::emitJump):
(KJS::CodeGenerator::emitJumpIfTrue):
(KJS::CodeGenerator::emitJumpIfFalse):
(KJS::CodeGenerator::emitMove):
(KJS::CodeGenerator::emitNot):
(KJS::CodeGenerator::emitEqual):
(KJS::CodeGenerator::emitNotEqual):
(KJS::CodeGenerator::emitStrictEqual):
(KJS::CodeGenerator::emitNotStrictEqual):
(KJS::CodeGenerator::emitLess):
(KJS::CodeGenerator::emitLessEq):
(KJS::CodeGenerator::emitPreInc):
(KJS::CodeGenerator::emitPreDec):
(KJS::CodeGenerator::emitPostInc):
(KJS::CodeGenerator::emitPostDec):
(KJS::CodeGenerator::emitToJSNumber):
(KJS::CodeGenerator::emitNegate):
(KJS::CodeGenerator::emitAdd):
(KJS::CodeGenerator::emitMul):
(KJS::CodeGenerator::emitDiv):
(KJS::CodeGenerator::emitMod):
(KJS::CodeGenerator::emitSub):
(KJS::CodeGenerator::emitLeftShift):
(KJS::CodeGenerator::emitRightShift):
(KJS::CodeGenerator::emitUnsignedRightShift):
(KJS::CodeGenerator::emitBitAnd):
(KJS::CodeGenerator::emitBitXOr):
(KJS::CodeGenerator::emitBitOr):
(KJS::CodeGenerator::emitBitNot):
(KJS::CodeGenerator::emitInstanceOf):
(KJS::CodeGenerator::emitTypeOf):
(KJS::CodeGenerator::emitIn):
(KJS::CodeGenerator::emitLoad):
(KJS::CodeGenerator::emitNewObject):
(KJS::CodeGenerator::emitNewArray):
(KJS::CodeGenerator::emitResolve):
(KJS::CodeGenerator::emitGetScopedVar):
(KJS::CodeGenerator::emitPutScopedVar):
(KJS::CodeGenerator::emitResolveBase):
(KJS::CodeGenerator::emitResolveWithBase):
(KJS::CodeGenerator::emitResolveFunction):
(KJS::CodeGenerator::emitGetById):
(KJS::CodeGenerator::emitPutById):
(KJS::CodeGenerator::emitPutGetter):
(KJS::CodeGenerator::emitPutSetter):
(KJS::CodeGenerator::emitDeleteById):
(KJS::CodeGenerator::emitGetByVal):
(KJS::CodeGenerator::emitPutByVal):
(KJS::CodeGenerator::emitDeleteByVal):
(KJS::CodeGenerator::emitPutByIndex):
(KJS::CodeGenerator::emitNewFunction):
(KJS::CodeGenerator::emitNewRegExp):
(KJS::CodeGenerator::emitNewFunctionExpression):
(KJS::CodeGenerator::emitCall):
(KJS::CodeGenerator::emitReturn):
(KJS::CodeGenerator::emitEnd):
(KJS::CodeGenerator::emitConstruct):
(KJS::CodeGenerator::emitPushScope):
(KJS::CodeGenerator::emitPopScope):
(KJS::CodeGenerator::emitDebugHook):
(KJS::CodeGenerator::emitComplexJumpScopes):
(KJS::CodeGenerator::emitJumpScopes):
(KJS::CodeGenerator::emitNextPropertyName):
(KJS::CodeGenerator::emitGetPropertyNames):
(KJS::CodeGenerator::emitCatch):
(KJS::CodeGenerator::emitThrow):
(KJS::CodeGenerator::emitNewError):
(KJS::CodeGenerator::emitJumpSubroutine):
(KJS::CodeGenerator::emitSubroutineReturn):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.cpp:
* VM/Opcode.h:
2008-06-11 Darin Adler <darin@apple.com>
Reviewed by Alexey.
- fix https://bugs.webkit.org/show_bug.cgi?id=19442
JavaScript array implementation doesn't maintain m_numValuesInVector when sorting
* kjs/array_instance.cpp:
(KJS::ArrayInstance::checkConsistency): Added. Empty inline version for when
consistency checks are turned off.
(KJS::ArrayInstance::ArrayInstance): Check consistency after construction.
(KJS::ArrayInstance::~ArrayInstance): Check consistency before destruction.
(KJS::ArrayInstance::put): Check consistency before and after.
(KJS::ArrayInstance::deleteProperty): Ditto.
(KJS::ArrayInstance::setLength): Ditto.
(KJS::compareByStringPairForQSort): Use typedef for clarity.
(KJS::ArrayInstance::sort): Check consistency before and after. Also broke the loop
to set up sorting into two separate passes. Added FIXMEs about various exception
safety issues. Added code to set m_numValuesInVector after sorting.
(KJS::ArrayInstance::compactForSorting): Ditto.
* kjs/array_instance.h: Added a definition of an enum for the types of consistency
check and a declaration of the consistency checking function.
2008-06-10 Kevin Ollivier <kevino@theolliviers.com>
wx build fix. Link against libedit on Mac since HAVE(READLINE) is defined there.
* jscore.bkl:
2008-06-10 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
https://bugs.webkit.org/show_bug.cgi?id=16503
match limit takes at least 13% of the time on the SunSpider regexp-dna test
Make the limit test slightly more efficient. It is not clear how much of a win it is,
as the improvement on regexp-dna varies from 2.3% to 0.6% depending on what revision I
apply the patch to. Today, the win on regexp-dna was minimal, but the total win was whopping
0.5%, due to random code generation changes.
* pcre/pcre_exec.cpp: (match): Avoid loading a constant on each iteration.
2008-06-09 Alp Toker <alp@nuanti.com>
gcc3/autotools build fix. Add explicit -O2 -fno-strict-aliasing to
each of the tools since these are no longer set globally.
* GNUmakefile.am:
2008-06-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Sam.
Add an include for readline/history.h to fix the build for Darwin users
with the GNU readline library installed. Also, clean up the style of
the HAVE(READLINE) check.
* kjs/testkjs.cpp:
(runInteractive):
2008-06-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Darin.
Bug 17531: Add interactive mode to testkjs
<https://bugs.webkit.org/show_bug.cgi?id=17531>
This is a cleaned up version of Sam's earlier patch to add an
interactive mode to testkjs.
Readline support is only enabled on Darwin platforms for now, but
other ports can enable it by defining HAVE_READLINE in kjs/config.h.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/config.h:
* kjs/testkjs.cpp:
(Options::Options):
(runWithScripts):
(runInteractive):
(printUsageStatement):
(parseArguments):
(kjsmain):
2008-06-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Darin.
Bug 19346: REGRESSION: Mootools 1.2 Class inheritance broken in post-SquirrelFish merge
<https://bugs.webkit.org/show_bug.cgi?id=19346>
A check for whether a function's caller is eval code accidentally included
the case where the caller's caller is native code. Add a CodeType field to
CodeBlock and use this for the eval caller test instead.
* VM/CodeBlock.h:
(KJS::CodeBlock::CodeBlock):
(KJS::ProgramCodeBlock::ProgramCodeBlock):
(KJS::EvalCodeBlock::EvalCodeBlock):
* VM/Machine.cpp:
(KJS::getCallerFunctionOffset):
* kjs/nodes.cpp:
(KJS::FunctionBodyNode::generateCode):
(KJS::ProgramNode::generateCode):
2008-06-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Dan Bernstein.
Bug 17928: testkjs shouldn't require "-f"
<https://bugs.webkit.org/show_bug.cgi?id=17928>
* kjs/testkjs.cpp:
(printUsageStatement):
(parseArguments):
2008-06-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Eric.
Bug 17548: JavaScriptCore print(a, b) differs from Spidermonkey Behavior
<https://bugs.webkit.org/show_bug.cgi?id=17548>
* kjs/testkjs.cpp:
(functionPrint):
2008-06-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Sam.
Bug 17547: JavaScriptCore print() differs from Spidermonkey Behavior
<https://bugs.webkit.org/show_bug.cgi?id=17547>
* kjs/testkjs.cpp:
(functionPrint):
2008-06-07 Alexey Proskuryakov <ap@webkit.org>
More build fixes.
* kjs/JSGlobalData.cpp: Fixed an included file name for case-sensitive file systems, fixed
JSGlobalData::threadInstance() for non-multithreaded builds.
2008-06-07 Alexey Proskuryakov <ap@webkit.org>
Build fix - actually adding JSGlobalData.cpp to non-Mac builds!
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCoreSources.bkl:
2008-06-07 Alexey Proskuryakov <ap@webkit.org>
Try to fix Gtk/gcc 4.3 build.
* kjs/JSGlobalData.h: Include ustring.h instead of forward-declaring UString::Rep.
2008-06-06 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Combine per-thread objects into one, to make it easier to support legacy clients (for
which they shouldn't be really per-thread).
No change on SunSpider total.
* JavaScriptCore.xcodeproj/project.pbxproj: Added JSGlobalData.{h,cpp}
* kjs/JSGlobalData.cpp: Added.
(KJS::JSGlobalData::JSGlobalData):
(KJS::JSGlobalData::~JSGlobalData):
(KJS::JSGlobalData::threadInstance):
* kjs/JSGlobalData.h: Added.
This class encapsulates all data that should be per-thread (or shared between legacy clients).
It will also keep a Heap pointer, but right now, Heap (Collector) methods are all static.
* kjs/identifier.h:
(KJS::Identifier::Identifier):
Added a constructor explicitly taking JSGlobalData to access IdentifierTable. Actually,
all of them should, but this will be a separate patch.
* kjs/identifier.cpp:
(KJS::IdentifierTable::literalTable):
(KJS::createIdentifierTable):
(KJS::deleteIdentifierTable):
(KJS::Identifier::add):
(KJS::Identifier::addSlowCase):
Combined IdentifierTable and LiteralIdentifierTable into a single class for simplicity.
* kjs/grammar.y: kjsyyparse now takes JSGlobalData, not just a Lexer.
* kjs/nodes.cpp:
(KJS::Node::Node):
(KJS::EvalFunctionCallNode::emitCode):
(KJS::ScopeNode::ScopeNode):
Changed to access Lexer and Parser via JSGlobalData::threadInstance(). This is also a
temporary measure, they will need to use JSGlobalData explicitly.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::CodeGenerator):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::callEval):
* kjs/CommonIdentifiers.cpp:
(KJS::CommonIdentifiers::CommonIdentifiers):
* kjs/CommonIdentifiers.h:
* kjs/DebuggerCallFrame.cpp:
(KJS::DebuggerCallFrame::evaluate):
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState):
* kjs/ExecState.h:
(KJS::ExecState::globalData):
(KJS::ExecState::identifierTable):
(KJS::ExecState::propertyNames):
(KJS::ExecState::emptyList):
(KJS::ExecState::lexer):
(KJS::ExecState::parser):
(KJS::ExecState::arrayTable):
(KJS::ExecState::dateTable):
(KJS::ExecState::mathTable):
(KJS::ExecState::numberTable):
(KJS::ExecState::RegExpImpTable):
(KJS::ExecState::RegExpObjectImpTable):
(KJS::ExecState::stringTable):
* kjs/InitializeThreading.cpp:
(KJS::initializeThreadingOnce):
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::init):
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
(KJS::JSGlobalObject::head):
(KJS::JSGlobalObject::globalData):
* kjs/Parser.cpp:
(KJS::Parser::parse):
* kjs/Parser.h:
* kjs/function.cpp:
(KJS::FunctionImp::getParameterName):
(KJS::IndexToNameMap::unMap):
(KJS::globalFuncEval):
* kjs/function_object.cpp:
(KJS::FunctionObjectImp::construct):
* kjs/interpreter.cpp:
(KJS::Interpreter::checkSyntax):
(KJS::Interpreter::evaluate):
* kjs/lexer.cpp:
(kjsyylex):
* kjs/lexer.h:
* kjs/testkjs.cpp:
(prettyPrintScript):
Updated for the above changes. Most of threadInstance uses here will need to be replaced with
explicitly passed pointers to support legacy JSC clients.
* JavaScriptCore.exp: Removed KJS::parser().
2008-06-06 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Bug 19424: Add support for logging opcode pair counts
<https://bugs.webkit.org/show_bug.cgi?id=19424>
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.cpp:
(KJS::OpcodeStats::OpcodeStats):
(KJS::compareOpcodeIndices):
(KJS::compareOpcodePairIndices):
(KJS::OpcodeStats::~OpcodeStats):
(KJS::OpcodeStats::recordInstruction):
(KJS::OpcodeStats::resetLastInstruction):
* VM/Opcode.h:
2008-06-06 Kevin McCullough <kmccullough@apple.com>
Reviewed by Adam.
<rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
profiler.
- Change the remaining functions that do not take arguments, from using
recursion to using iteration.
* JavaScriptCore.exp:
* profiler/Profile.cpp:
(KJS::stopProfiling):
(KJS::restoreAll):
(KJS::Profile::stopProfiling): Use foreach instead of recursion.
(KJS::Profile::restoreAll): Ditto.
* profiler/Profile.h:
* profiler/ProfileNode.cpp: Remove recursion.
(KJS::ProfileNode::stopProfiling):
(KJS::ProfileNode::restore):
* profiler/ProfileNode.h:
2008-06-05 Oliver Hunt <oliver@apple.com>
Reviewed by Alexey.
Fix Greater and GreaterEq nodes to emit code for the left
and right sub-expressions in the correct order.
* kjs/nodes.cpp:
(KJS::GreaterNode::emitCode):
(KJS::GreaterEqNode::emitCode):
2008-06-05 Antti Koivisto <antti@apple.com>
Reviewed by Alp Toker.
Fix whitespaces.
* kjs/collector.cpp:
(KJS::getPlatformThreadRegisters):
2008-06-05 Antti Koivisto <antti@apple.com>
Reviewed by Darin.
Support compiling JavaScriptCore for ARM.
* kjs/collector.cpp:
(KJS::getPlatformThreadRegisters):
(KJS::otherThreadStackPointer):
2008-06-05 Kevin McCullough <kmccullough@apple.com>
Reviewed by Jon.
- Name changes.
* JavaScriptCore.exp:
* profiler/Profile.cpp:
(KJS::Profile::Profile):
(KJS::Profile::stopProfiling):
(KJS::Profile::didExecute):
(KJS::Profile::forEach):
(KJS::Profile::debugPrintData):
(KJS::Profile::debugPrintDataSampleStyle):
* profiler/Profile.h:
(KJS::Profile::callTree):
(KJS::Profile::totalTime):
(KJS::Profile::sortTotalTimeDescending):
(KJS::Profile::sortTotalTimeAscending):
(KJS::Profile::sortSelfTimeDescending):
(KJS::Profile::sortSelfTimeAscending):
(KJS::Profile::sortCallsDescending):
(KJS::Profile::sortCallsAscending):
(KJS::Profile::sortFunctionNameDescending):
(KJS::Profile::sortFunctionNameAscending):
(KJS::Profile::focus):
(KJS::Profile::exclude):
(KJS::Profile::restoreAll):
2008-06-05 Geoffrey Garen <ggaren@apple.com>
Reviewed by Stephanie Lewis.
Added the -fno-move-loop-invariants flag to the pcre_exec.cpp build, to
tell GCC not to perform loop invariant motion, since GCC's loop
invariant motion doesn't do very well with computed goto code.
SunSpider reports no change.
2008-06-05 Geoffrey Garen <ggaren@apple.com>
Reviewed by Stephanie Lewis.
Added the -fno-tree-pre flag to the Machine.cpp build, to tell GCC not
to perform Partial Redundancy Elimination (PRE) on trees in Machine.cpp,
since GCC's PRE doesn't do very well with computed goto code.
SunSpider reports a .7% speedup.
2008-06-05 Geoffrey Garen <ggaren@apple.com>
Reviewed by Stephanie Lewis (or maybe the other way around).
Minor change to PCRE to help out certain compilers.
SunSpider reports no change, maybe a small speedup.
* pcre/pcre_exec.cpp:
(match): Use instructionPtr++ a little less, to avoid confusing the
optimizer.
2008-06-05 Alexey Proskuryakov <ap@webkit.org>
Re-landing an independent part of a previously rolled out threading patch.
* wtf/ThreadSpecific.h: Make sure to initialize POD thread-specific varaibles, too
(replaced "new T" with "new T()").
2008-06-05 Maciej Stachowiak <mjs@apple.com>
Reviewed by Hyatt.
- force inlining of a template function that only has one call site per specialization
1.3% speedup on SunSpider
* kjs/collector.cpp:
(KJS::Collector::heapAllocate): This template function is only
called from allocate() and allocateNumber() (once per
specialization) and the extra call overhead for GC allocation
shows up, so force inlining.
2008-06-05 Maciej Stachowiak <mjs@apple.com>
Reviewed by Alexey and Oliver.
- remove profiler fetch hack
I measure an 0.5% progression from this, others show a wash. It seems not needed any more.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-06-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Bug 19400: subscript operator does not protect base when necessary
<https://bugs.webkit.org/show_bug.cgi?id=19400>
Use a temporary for the base in BracketAccessorNode if the subscript
might possibly modify it.
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::BracketAccessorNode::emitCode):
* kjs/nodes.h:
(KJS::BracketAccessorNode::):
2008-06-04 Sam Weinig <sam@webkit.org>
Reviewed by Maciej Stachowiak.
Big cleanup of formatting and whitespace.
2008-06-04 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Add an option to dump statistics on executed instructions.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.cpp:
(KJS::OpcodeStats::~OpcodeStats):
(KJS::OpcodeStats::recordInstruction):
* VM/Opcode.h:
2008-06-04 Kevin McCullough <kmccullough@apple.com>
Reviewed by Geoff.
<rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
profiler.
- This patch removes the use of recursion for the sort functions.
* JavaScriptCore.exp: Change the signatures of the functions being
exported.
* profiler/Profile.cpp:
(KJS::Profile::sort): This generic function will accept any of the
static sort functions and apply them to the whole tree.
* profiler/Profile.h: All of the sorting functions now call the new
sort() function.
(KJS::Profile::sortTotalTimeDescending):
(KJS::Profile::sortTotalTimeAscending):
(KJS::Profile::sortSelfTimeDescending):
(KJS::Profile::sortSelfTimeAscending):
(KJS::Profile::sortCallsDescending):
(KJS::Profile::sortCallsAscending):
(KJS::Profile::sortFunctionNameDescending):
(KJS::Profile::sortFunctionNameAscending):
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::ProfileNode): m_head used to point to the head node
if this was the head node. It now points to null to make iteration easy
(KJS::ProfileNode::willExecute): Now must check if m_head is null, this
check used to happend in the constructor.
(KJS::ProfileNode::stopProfiling): Again the check is slightly different
to determine if this is the head.
(KJS::ProfileNode::traverseNextNode): This function returns the next
node in post order.
(KJS::ProfileNode::sort): This generic function will sort according to
the comparator passed in, then reset the children pointers to macth the
new order.
* profiler/ProfileNode.h: The sorting function were removed from the
definition file and instead use the new generic sort() function
(KJS::ProfileNode::totalPercent): because the head can now be empty we
need to check here too for the head node.
(KJS::ProfileNode::selfPercent): Ditto
(KJS::ProfileNode::firstChild): This function is necessary for the
iterative algorithm in Profile.cpp.
(KJS::ProfileNode::sortTotalTimeDescending):
(KJS::ProfileNode::sortTotalTimeAscending):
(KJS::ProfileNode::sortSelfTimeDescending):
(KJS::ProfileNode::sortSelfTimeAscending):
(KJS::ProfileNode::sortCallsDescending):
(KJS::ProfileNode::sortCallsAscending):
(KJS::ProfileNode::sortFunctionNameDescending):
(KJS::ProfileNode::sortFunctionNameAscending):
(KJS::ProfileNode::childrenBegin):
(KJS::ProfileNode::childrenEnd):
(KJS::ProfileNode::totalTimeDescendingComparator):
(KJS::ProfileNode::totalTimeAscendingComparator):
(KJS::ProfileNode::selfTimeDescendingComparator):
(KJS::ProfileNode::selfTimeAscendingComparator):
(KJS::ProfileNode::callsDescendingComparator):
(KJS::ProfileNode::callsAscendingComparator):
(KJS::ProfileNode::functionNameDescendingComparator):
(KJS::ProfileNode::functionNameAscendingComparator):
2008-06-04 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Fix JSClassCreate to work with old JSCore API threading model.
No change on SunSpider.
* API/JSClassRef.cpp: (OpaqueJSClass::OpaqueJSClass): Since JSClass is constructed without
a context, there is no way for it to create Identifiers.
Also, added initializeThreading(), just for good measure.
* API/JSCallbackObjectFunctions.h: (KJS::::getPropertyNames): Make an Identifier out of the
string here, because propertyNames.add() needs that.
* kjs/identifier.cpp:
* kjs/identifier.h:
(KJS::Identifier::equal):
* kjs/ustring.cpp:
(KJS::equal):
Moved equal() from identifier.h to ustring.h, because it's not really about Identifiers,
and to make it possible to use it from StrHash.
Include StrHash.h from ustring.h to avoid having the behavior depend on headers that happen
to be included.
* wtf/StrHash.h: Removed.
* kjs/ustring.h: Made RefPtr<UString::Rep> use the same default hash as UString::Rep* (it
used to default to pointer equality). Moved the whole StrHash header into ustring.h.
* JavaScriptCore.exp: Export equal() for WebCore use (this StrHash is used in c_class.cpp,
jni_class.cpp, and npruntime.cpp).
2008-06-04 Alexey Proskuryakov <ap@webkit.org>
Rubber-stamped by Darin.
Fix spacing in collector.{h,cpp}.
* kjs/collector.cpp:
* kjs/collector.h:
2008-06-03 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Build fix. The cleanup in r34355 missed a method.
* kjs/nodes.cpp:
* kjs/nodes.h:
2008-06-03 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- https://bugs.webkit.org/show_bug.cgi?id=19269
speed up SunSpider by eliminating the toObject call for most get/put/delete
Makes standalone SunSpider 1.025x as fast as before.
The getOwnPropertySlot virtual function now takes care of the toObject call
for get. Similarly, the put function (and later deleteProperty) does the
same for those operations. To do this, the virtual functions were moved from
the JSObject class to the JSCell class. Also, since the caller no longer knows
the identity of the "original object", which is used by JavaScript-function
based getters, changed the PropertySlot class so the original object is
already stored in the slot when getOwnPropertySlot is called, if the caller
intends to call getValue.
This affected the old interpreter code enough that the easiest thing for me
was to just delete it. While I am not certain the mysterious slowdown is not
still occurring, the net change is definitely a significant speedup.
* JavaScriptCore.exp: Updated.
* VM/Machine.cpp: Moved the UNLIKELY macro into AlwaysInline.h.
(KJS::resolve): Set up the originalObject in the PropertySlot before
calling getPropertySlot. Also removed the originalObject argument from
getValue.
(KJS::resolve_skip): Ditto.
(KJS::resolveBaseAndProperty): Ditto.
(KJS::resolveBaseAndFunc): Ditto.
(KJS::Machine::privateExecute): Removed the toObject calls from the get and
put functions where possible, instead calling directly with JSValue and letting
the JSValue and JSCell calls handle toObject. Same for toThisObject.
* kjs/ExecState.h: Removed OldInterpreterExecState.
* API/JSBase.cpp: Updated includes.
* kjs/LocalStorageEntry.h: Removed contents. Later we can remove the file too.
* kjs/array_instance.cpp:
(KJS::ArrayInstance::lengthGetter): Removed originalObject argumet.
(KJS::ArrayInstance::inlineGetOwnPropertySlot): Don't pass a base value to
setValueSlot. Also use UNLIKELY around the "getting elements past the end of
the array" code path; less common than successfully getting an element.
* kjs/array_object.cpp:
(KJS::getProperty): Initialize the PropertySlot with the original object.
Don't pass the original object to the get function.
(KJS::arrayProtoFuncFilter): Ditto.
(KJS::arrayProtoFuncMap): Ditto.
(KJS::arrayProtoFuncEvery): Ditto.
(KJS::arrayProtoFuncForEach): Ditto.
(KJS::arrayProtoFuncSome): Ditto.
* kjs/function_object.cpp:
(KJS::FunctionObjectImp::construct): Removed an obsolete comment.
* kjs/grammar.y: Eliminated support for some of the node types that were
used to optimize executing from the syntax tree.
* kjs/internal.cpp:
(KJS::StringImp::toThisObject): Added. Same as toObject.
(KJS::NumberImp::toThisObject): Ditto.
(KJS::GetterSetterImp::getOwnPropertySlot): Added. Not reached.
(KJS::GetterSetterImp::put): Ditto.
(KJS::GetterSetterImp::toThisObject): Ditto.
* kjs/internal.h: Added toThisObject to NumberImp for speed.
* kjs/lexer.cpp:
(KJS::Lexer::shift): Changed shift to just do a single character, to unroll
the loop and especially to make the one character case faster.
(KJS::Lexer::setCode): Call shift multiple times instead of passing a number.
(KJS::Lexer::lex): Ditto.
(KJS::Lexer::matchPunctuator): Ditto. Also removed unneeded elses after returns.
(KJS::Lexer::scanRegExp): Ditto.
* kjs/lexer.h: Removed the count argument from shift.
* kjs/math_object.cpp:
(KJS::mathProtoFuncPow): Call jsNaN instead of jsNumber(NaN).
* kjs/nodes.cpp: Removed some of the things needed only for the pre-SquirrelFish
execution model.
(KJS::ForNode::emitCode): Handle cases where some expressions are missing by
not emitting any code at all. The old way was to emit code for "true", but
this is an unnecessary remnant of the old way of doing things.
* kjs/nodes.h: Removed some of the things needed only for the pre-SquirrelFish
execution model.
* kjs/object.cpp:
(KJS::JSObject::fillGetterPropertySlot): Changed to only pass in the getter
function. The old code passed in a base, but it was never used when
actually getting the property; the toThisObject call was pointless. Also
changed to not pass a base for setUndefined.
* kjs/object.h: Added the new JSCell operations to GetterSetterImp.
Never called.
(KJS::JSObject::get): Initialize the object in the PropertySlot and don't
pass it in getValue.
(KJS::JSObject::getOwnPropertySlotForWrite): Removed the base argument
in calls to setValueSlot.
(KJS::JSObject::getOwnPropertySlot): Ditto.
(KJS::JSValue::get): Added. Here because it calls through to JSObject.
A version of JSObject::get that also handles the other types of JSValue
by creating the appropriate wrapper. Saves the virtual call to toObject.
(KJS::JSValue::put): Ditto.
(KJS::JSValue::deleteProperty): Ditto.
* kjs/property_slot.cpp:
(KJS::PropertySlot::undefinedGetter): Removed the originalObject argument.
(KJS::PropertySlot::ungettableGetter): Ditto.
(KJS::PropertySlot::functionGetter): Ditto. Use the value in the base
as the "this" object, which will be set to the original object by the new
PropertySlot initialization code. Also call toThisObject. The old code did
not do this, but needed to so we can properly handle the activation object
like the other similar code paths.
* kjs/property_slot.h:
(KJS::PropertySlot::PropertySlot): Added a constructor that takes a base
object. In debug builds, set the base to 0 if you don't pass one.
(KJS::PropertySlot::getValue): Don't take or pass the originalObject.
(KJS::PropertySlot::setValueSlot): Don't take a base object, and clear the
base object in debug builds.
(KJS::PropertySlot::setGetterSlot): Ditto.
(KJS::PropertySlot::setUndefined): Ditto.
(KJS::PropertySlot::setUngettable): Ditto.
(KJS::PropertySlot::slotBase): Assert that a base object is present.
This will fire if someone actually calls the get function without having
passed in a base object and the getter needs it.
(KJS::PropertySlot::setBase): Added. Used by the code that implements
toObject so it can supply the original object after the fact.
(KJS::PropertySlot::clearBase): Added. Clears the base, but is debug-only
code because it's an error to fetch the base if you don't have a guarantee
it was set.
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(KJS::JSCallbackObject::cachedValueGetter):
(KJS::JSCallbackObject::staticValueGetter):
(KJS::JSCallbackObject::staticFunctionGetter):
(KJS::JSCallbackObject::callbackGetter):
* kjs/JSActivation.cpp:
(KJS::JSActivation::getOwnPropertySlot):
(KJS::JSActivation::argumentsGetter):
* kjs/JSActivation.h:
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::symbolTableGet):
* kjs/array_instance.h:
* kjs/function.cpp:
(KJS::FunctionImp::argumentsGetter):
(KJS::FunctionImp::callerGetter):
(KJS::FunctionImp::lengthGetter):
(KJS::Arguments::mappedIndexGetter):
* kjs/function.h:
* kjs/lookup.h:
(KJS::staticFunctionGetter):
(KJS::staticValueGetter):
* kjs/string_object.cpp:
(KJS::StringInstance::lengthGetter):
(KJS::StringInstance::indexGetter):
(KJS::stringInstanceNumericPropertyGetter):
* kjs/string_object.h:
Removed originalObject arguments from getters. Don't pass base values to
the various PropertySlot functions that no longer take them.
* kjs/value.cpp:
(KJS::JSCell::getOwnPropertySlot): Added. Calls toObject and then sets the slot.
This function has to always return true, because the caller can't walk the prototype
chain. Because of that, we do a getPropertySlot, not getOwnPropertySlot, which works
for the caller. This is private, only called by getOwnPropertySlotInternal.
(KJS::JSCell::put): Added. Calls toObject and then put.
(KJS::JSCell::toThisObject): Added. Calls toObject.
* kjs/value.h: Added get, put, and toThisObject to both JSValue
and JSCell. These take care of the toObject operation without an additional virtual
function call, and so make the common "already an object" case faster.
* wtf/AlwaysInline.h: Moved the UNLIKELY macro here for now. Maybe we can find a
better place later, or rename this header.
2008-06-03 Oliver Hunt <oliver@apple.com>
Reviewed by Tim.
Bug 12983: Web Inspector break on the debugger keyword
<https://bugs.webkit.org/show_bug.cgi?id=12983>
Added a DebuggerStatementNode to handle codegen, and added a new
DidReachBreakPoint debug event (which will hopefully be useful
if we ever move breakpoint management into JSC proper). Also
added didReachBreakpoint to Debugger to allow us to actually respond
to this event.
* VM/CodeBlock.cpp:
(KJS::debugHookName):
* VM/Machine.cpp:
(KJS::Machine::debug):
* VM/Machine.h:
* kjs/debugger.h:
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::DebuggerStatementNode::emitCode):
(KJS::DebuggerStatementNode::execute):
* kjs/nodes.h:
(KJS::DebuggerStatementNode::):
* kjs/nodes2string.cpp:
(KJS::DebuggerStatementNode::streamTo):
2008-06-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- document remaining opcodes.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Document call, call_eval,
construct, ret and end opcodes.
2008-06-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Document throw and catch opcodes.
2008-06-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Alexey Proskuryakov.
Removed JSObject::call, since it just called JSObject::callAsFunction.
SunSpider reports no change.
2008-06-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
A little cleanup in the CodeGenerator.
* VM/CodeGenerator.cpp: A few changes here.
(1) Removed remaining cases of the old hack of putting "this" into the
symbol table; replaced with explicit tracking of m_thisRegister.
(2) Made m_thisRegister behave the same for function, eval, and program
code, removing the static programCodeThis() function.
(3) Added a feature to nix a ScopeNode's declaration stacks when done
compiling, to save memory.
(4) Removed code that copied eval declarations into special vectors: we
just use the originals in the ScopeNode now.
* VM/CodeGenerator.h: Removed unneded parameters from the CodeGenerator
constructor: we just use get that data from the ScopeNode now.
* VM/Machine.cpp:
(KJS::Machine::execute): When executing an eval node, don't iterate a
special copy of its declarations; iterate the originals, instead.
* kjs/nodes.cpp: Moved responsibility for knowing what AST data to throw
away into the CodeGenerator. Nodes no longer call shrinkCapacity on
their data directly.
* kjs/nodes.h: Changed FunctionStack to ref its contents, so declaration
data stays around even after we've thrown away the AST, unless we explicitly
throw away the declaration data, too. This is useful for eval code, which
needs to reference its declaration data at execution time. (Soon, it will
be useful for program code, too, since program code should do the same.)
2008-06-02 Adam Roben <aroben@apple.com>
Build fix for non-AllInOne builds
* kjs/array_object.cpp: Added a missing #include.
2008-06-02 Kevin McCullough <kmccullough@apple.com>
Took out accidental confilct lines I checked in.
* ChangeLog:
2008-06-02 Kevin McCullough <kmccullough@apple.com>
Reviewed by Darin.
<rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
profiler
Implement Next Sibling pointers as groundwork for removing the recursion
limit in the profiler.
* profiler/ProfileNode.cpp: Also I renamed parentNode and headNode since
'node' is redundant.
(KJS::ProfileNode::ProfileNode): Initialize the nextSibling.
(KJS::ProfileNode::willExecute): If there are already children then the
new child needs to be the nextSibling of the last child.
(KJS::ProfileNode::didExecute):
(KJS::ProfileNode::addChild): Ditto.
(KJS::ProfileNode::stopProfiling):
(KJS::ProfileNode::sortTotalTimeDescending): For all of the sorting
algorithms once the children are sorted their nextSibling pointers need
to be reset to reflect the new order.
(KJS::ProfileNode::sortTotalTimeAscending):
(KJS::ProfileNode::sortSelfTimeDescending):
(KJS::ProfileNode::sortSelfTimeAscending):
(KJS::ProfileNode::sortCallsDescending):
(KJS::ProfileNode::sortCallsAscending):
(KJS::ProfileNode::sortFunctionNameDescending):
(KJS::ProfileNode::sortFunctionNameAscending):
(KJS::ProfileNode::resetChildrensSiblings): This new function simply
loops over all of the children and sets their nextSibling pointers to
the next child in the Vector
(KJS::ProfileNode::debugPrintData):
* profiler/ProfileNode.h:
(KJS::ProfileNode::parent):
(KJS::ProfileNode::setParent):
(KJS::ProfileNode::nextSibling):
(KJS::ProfileNode::setNextSibling):
(KJS::ProfileNode::totalPercent):
(KJS::ProfileNode::selfPercent):
2008-06-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Removed the recursion limit from JSObject::call, since the VM does
recursion checking now.
This should allow us to remove JSObject::call entirely, netting a small
speedup.
* kjs/object.cpp:
(KJS::JSObject::call):
2008-06-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Adele Peterson.
Added a specific affordance for avoiding stack overflow when converting
recursive arrays to string, in preparation for removing generic stack
overflow checking from JSObject::call.
Tested by fast/js/toString-stack-overflow.html.
2008-06-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Alice Liu.
Refactored some hand-rolled code to call ScopeChain::globalObject instead.
2008-06-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Fixed ASSERT due to execution continuing after an exception is thrown
during array sort.
* kjs/array_instance.cpp:
(KJS::AVLTreeAbstractorForArrayCompare::compare_key_key): Don't call the
custom comparator function if an exception has been thrown. Just return
1 for everything, so the sort completes quickly. (The result will be
thrown away.)
2008-05-30 Timothy Hatcher <timothy@apple.com>
Made the starting line number of scripts be 1-based throughout the engine.
This cleans up script line numbers so they are all consistent now and fixes
some cases where script execution was shown as off by one line in the debugger.
No change in SunSpider.
Reviewed by Oliver Hunt.
* API/minidom.c:
(main): Pass a line number of 1 instead of 0 to parser().parse().
* API/testapi.c:
(main): Ditto. And removes a FIXME and changed an assertEqualsAsNumber
to use 1 instead of 2 for the line number.
* VM/Machine.cpp:
(KJS::callEval): Pass a line number of 1 instead of 0.
(KJS::Machine::debug): Use firstLine for WillExecuteProgram instead of
lastLine. Use lastLine for DidExecuteProgram instead of firstLine.
* kjs/DebuggerCallFrame.cpp:
(KJS::DebuggerCallFrame::evaluate): Pass a line number of 1 instead of
0 to parser().parse().
* kjs/Parser.cpp:
(KJS::Parser::parse): ASSERT startingLineNumber is greatter than 0. Change
the startingLineNumber to be 1 if it was less than or equal to 0. This is needed
for release builds to maintain compatibility with the JavaScriptCore API.
* kjs/function.cpp:
(KJS::globalFuncEval): Pass a line number of 1 instead of 0 to parser().parse().
* kjs/function_object.cpp:
(FunctionObjectImp::construct): Pass a line number of 1 instead of 0 to construct().
* kjs/lexer.cpp:
(Lexer::setCode): Made yylineno = startingLineNumber instead of adding 1.
* kjs/testkjs.cpp:
(functionRun): Pass a line number of 1 instead of 0 to Interpreter::evaluate().
(functionLoad): Ditto.
(prettyPrintScript): Ditto.
(runWithScripts): Ditto.
* profiler/Profiler.cpp:
(WebCore::createCallIdentifier): Removed a plus 1 of startingLineNumber.
2008-05-30 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
https://bugs.webkit.org/show_bug.cgi?id=19180
speed up SunSpider by optimizing immediate number cases
Also fixed a JavaScriptCore regression seen on PowerPC - we didn't clip left shift
parameter to 0...31.
0.5% improvement on SunSpider overall, although a 8.5 regression on bitops-3bit-bits-in-byte.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* kjs/JSImmediate.h:
(KJS::JSImmediate::toTruncatedUInt32): Added. Same as getTruncatedInt32, but casts the result
to unsigned.
2008-05-30 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Oliver Hunt.
https://bugs.webkit.org/show_bug.cgi?id=19180
speed up SunSpider by optimizing immediate number cases
Also fixed two JavaScriptCore regressions seen on PowerPC - we didn't clip right shift
parameter to 0...31.
1.6% improvement on SunSpider, without significant regressions on any tests.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
Added fast paths for >>, ==, ===, !=, !==. Changed order of memory accesses in many
cases, making them less dependent on gcc's ability to properly assign registers. With this,
I could move exception checks back into slow code paths, and saw less randomness in general.
* kjs/JSImmediate.h:
(KJS::JSImmediate::rightShiftImmediateNumbers):
Added.
2008-05-29 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fixed <rdar://problem/5972943> REGRESSION(r33979): Flash clips do not play on cnn.com
Finally blocks could clobber registers that had to remain live
until they returned. This patch takes a conservative approach and
makes sure that finally blocks do not reuse any registers that
were previously allocated for the function. In the future this
could probably be tightened up to be less profligate with the
register allocation.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::highestUsedRegister):
* VM/CodeGenerator.h:
* kjs/nodes.cpp:
(KJS::TryNode::emitCode):
2008-05-29 Steve Falkenburg <sfalken@apple.com>
Build fix.
* kjs/array_instance.cpp:
2008-05-29 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
https://bugs.webkit.org/show_bug.cgi?id=19294
<rdar://problem/5969062> A crash when iterating over a sparse array backwards.
* kjs/array_instance.cpp: Turned sparseArrayCutoff into a macro, so that using max() on it
doesn't cause a PIC branch.
(KJS::ArrayInstance::increaseVectorLength): Added a comment about this function not
preserving class invariants.
(KJS::ArrayInstance::put): Update m_storage after reallocation. Move values that fit to
the vector from the map in all code paths.
2008-05-29 Thiago Macieira <tjmaciei@trolltech.com>
Reviewed by Simon.
Fix compilation in Solaris with Sun CC
Lots of WebKit code uses C99 functions that, strict as it
is, the Solaris system doesn't provide in C++. So we must define them
for both GCC and the Sun CC.
* wtf/MathExtras.h:
2008-05-28 Oliver Hunt <oliver@apple.com>
Reviewed by Anders.
Fix codegen for assignment being used as a function.
FunctionCallValueNode::emitCode failed to account for the
potential of the function expression to allocate arbitrary
registers.
* kjs/nodes.cpp:
(KJS::FunctionCallValueNode::emitCode):
2008-05-27 Geoffrey Garen <ggaren@apple.com>
Reviewed by Tim Hatcher.
Fixed https://bugs.webkit.org/show_bug.cgi?id=19183
REGRESSION (r33979): Crash in DebuggerCallFrame::functionName when
clicking button in returnEvent-crash.html
Added two new debugger hooks, willExecuteProgram and didExecuteProgram,
along with code to generate them, code to invoke them when unwinding
due to an exception, and code to dump them.
SunSpider reports no change.
* VM/CodeBlock.cpp:
(KJS::debugHookName): I had to mark this function NEVER_INLINE to avoid
a .4% performance regression. The mind boggles.
2008-05-28 Adam Roben <aroben@apple.com>
Fix JavaScriptCore tests on OS X
We were quoting the path to testkjs too late, after it had already
been combined with spaces and other options.
* tests/mozilla/jsDriver.pl:
(top level): Move path quoting from here...
(sub get_kjs_engine_command): ...to here.
2008-05-28 Anders Carlsson <andersca@apple.com>
Reviewed by Oliver.
<rdar://problem/5968071> "const f" crashes in JavaScriptCore
Make sure to null check the initializer.
* kjs/nodes.cpp:
(KJS::ConstDeclNode::emitCodeSingle):
2008-05-28 Adam Roben <aroben@apple.com>
Make run-javascriptcore-tests work with a space in the path to testkjs
Reviewed by Alexey Proskuryakov.
* tests/mozilla/jsDriver.pl: Quote the path to the engine so that
spaces will be interpreted correctly.
2008-05-28 Alexey Proskuryakov <ap@webkit.org>
Fixed a misguiding comment - my measurement for negative numbers only included cases
where both operands were negative, which is not very interesting.
* VM/Machine.cpp:
2008-05-28 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Maciej.
Based on a patch by Oliver Hunt.
https://bugs.webkit.org/show_bug.cgi?id=19180
speed up SunSpider by optimizing immediate number cases
1.4% speedup on SunSpider.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* kjs/JSImmediate.h:
(KJS::JSImmediate::incImmediateNumber):
(KJS::JSImmediate::decImmediateNumber):
Added fast paths for ++ and --.
(KJS::JSImmediate::canDoFastAdditiveOperations): Corrected a comment.
2008-05-28 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
https://bugs.webkit.org/show_bug.cgi?id=19180
speed up SunSpider by optimizing immediate number cases
2% speedup overall, maximum 10% on controlflow-recursive and bitops-3bit-bits-in-byte,
but a 4% regression on bitops-bits-in-byte and bitops-bitwise-and.
* kjs/JSImmediate.h:
(KJS::JSImmediate::canDoFastAdditiveOperations):
(KJS::JSImmediate::addImmediateNumbers):
(KJS::JSImmediate::subImmediateNumbers):
Added fast cases that work with positive values less than 2^30.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Use the above operations. Also updated SunSpider frequencies
with my results (looks like tag values have changed, not sure what caused the minor variation
in actual frequencies).
2008-05-27 Adam Roben <aroben@apple.com>
Windows build fix
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
Remove code that appended Cygwin's /bin directory to PATH.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
Prepend Cygwin's /bin directory to PATH. We prepend instead of append
so that Cygwin's utilities will win out over Win32 versions of the
same utilities (particularly perl). We do the prepend here instead of
in the Makefile because nmake doesn't seem to like prepending to PATH
inside the Makefile. This also matches the way WebCoreGenerated works.
2008-05-27 Adam Roben <aroben@apple.com>
Roll out r34163
A better fix is on the way.
* DerivedSources.make:
* JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
2008-05-27 Adam Roben <aroben@apple.com>
Windows build fix
* DerivedSources.make: Don't generate the bytecode docs if
OMIT_BYTECODE_DOCS is set to 1.
* JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Set
OMIT_BYTECODE_DOCS for production builds.
2008-05-27 Anders Carlsson <andersca@apple.com>
Reviewed by Geoff and Maciej.
<rdar://problem/5806428>
https://bugs.webkit.org/show_bug.cgi?id=17925
Crash in KJS::JSObject::put after setting this.__proto__
Set slotIsWriteable to false for __proto__, we want setting __proto__ to go through JSObject::put instead.
* kjs/object.h:
(KJS::JSObject::getOwnPropertySlotForWrite):
2008-05-27 Kevin Ollivier <kevino@theolliviers.com>
wx build fixes to catch up with SquirrelFish, etc.
* JavaScriptCoreSources.bkl:
* jscore.bkl:
* wtf/Platform.h:
2008-05-27 Darin Adler <darin@apple.com>
Reviewed by Tim Hatcher.
- https://bugs.webkit.org/show_bug.cgi?id=19180
speed up SunSpider by optimizing immediate number cases
Add immediate number cases for the &, |, and ^ operators.
Makes standalone SunSpider 1.010x faster.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Add areBothImmediateNumbers special cases
for the &, |, and ^ operators.
* kjs/JSImmediate.h:
(KJS::JSImmediate::xorImmediateNumbers): Added.
(KJS::JSImmediate::orImmediateNumbers): Added.
2008-05-26 Stephanie Lewis <slewis@apple.com>
Windows build fix.
* kjs/testkjs.cpp:
2008-05-26 Maciej Stachowiak <mjs@apple.com>
Reviewed by Anders.
- make addStaticGlobals protected instead of private so subclasses can use it
* JavaScriptCore.exp:
* kjs/JSGlobalObject.h:
2008-05-26 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Fixed <rdar://problem/5960859> After an eval of a non-string or a syntax
error, all profile stack frames are incorrect
SunSpider reports a .3% speedup, possibly because eval of a string is a
little more efficient now.
* VM/Machine.cpp:
(KJS::callEval): Make sure to call didExecute when returning early. I
simplified this function to remove one early return, making the job
of adding special code to early returns easier.
(KJS::Machine::execute): Use the new function ExecState when notifying
the profiler. (This doesn't change behavior now, but it might prevent
subtle errors in the future.)
2008-05-23 Tor Arne Vestbø <tavestbo@trolltech.com>
Reviewed by Simon.
Fixed toLower and toUpper implementations to allow being called
with a null result pointer and resultLength, to determine the
number of characters needed for the case conversion.
* wtf/unicode/qt4/UnicodeQt4.h:
(WTF::Unicode::toLower):
(WTF::Unicode::toUpper):
2008-05-25 Alexey Proskuryakov <ap@webkit.org>
Fixing a typo in the previous commit made as a last minute change.
* kjs/regexp_object.cpp:
2008-05-24 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Changed regular expression matching result array to be lazily filled, because many callers
only care about it being non-null.
2% improvement on Acid3 test 26.
* kjs/array_instance.cpp: Added a void* member to ArrayStorage for ArrayInstance subclasses
to use.
* kjs/array_instance.h:
(KJS::ArrayInstance::lazyCreationData):
(KJS::ArrayInstance::setLazyCreationData):
Added methods to access it from subclasses.
* kjs/regexp_object.cpp:
(KJS::RegExpMatchesArray::RegExpMatchesArray):
(KJS::RegExpMatchesArray::getOwnPropertySlot):
(KJS::RegExpMatchesArray::put):
(KJS::RegExpMatchesArray::deleteProperty):
(KJS::RegExpMatchesArray::getPropertyNames):
(KJS::RegExpMatchesArray::fillArrayInstanceIfNeeded):
(KJS::RegExpMatchesArray::~RegExpMatchesArray):
(KJS::RegExpObjectImp::arrayOfMatches):
RegExpMatchesArray is a subclass of ArrayInstance that isn't filled until
accessed for the first time.
2008-05-24 Alp Toker <alp@nuanti.com>
Win32/gcc build fix. Remove MSVC assumption.
* wtf/TCSpinLock.h:
(TCMalloc_SlowLock):
2008-05-24 Oleg Finkelshteyn <olegfink@gmail.com>
Rubber-stamped, tweaked and landed by Alexey.
Build fix for gcc 4.3.
* JavaScriptCore/kjs/testkjs.cpp:
* JavaScriptCore/VM/CodeBlock.cpp:
Add missing standard includes.
2008-05-23 Anders Carlsson <andersca@apple.com>
Reviewed by Geoff.
<rdar://problem/5959886> REGRESSION: Assertion failure in JSImmediate::toString when loading GMail (19217)
Change List to store a JSValue*** pointer + an offset instead of a JSValue** pointer to protect against the case where
a register file changes while a list object points to its buffer.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* kjs/JSActivation.cpp:
(KJS::JSActivation::createArgumentsObject):
* kjs/list.cpp:
(KJS::List::getSlice):
* kjs/list.h:
(KJS::List::List):
(KJS::List::at):
(KJS::List::append):
(KJS::List::begin):
(KJS::List::end):
(KJS::List::buffer):
2008-05-23 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam.
<rdar://problem/5960012> JSProfiler: Stack overflow if recursion is
too deep.
-Use a simple depth limit to restrict too deep of recursion.
* profiler/Profile.cpp:
(KJS::Profile::willExecute):
(KJS::Profile::didExecute):
* profiler/Profile.h:
2008-05-23 Geoffrey Garen <ggaren@apple.com>
Rolling back in r34085, with performance resolved.
Apparently, passing the eval function to callEval gave GCC a hernia.
Reviewed by Darin Adler, Kevin McCullough, and Oliver Hunt.
Fixed <rdar://problem/5959447> Crashes and incorrect reporting in the
JavaScript profiler
* VM/Machine.cpp:
(KJS::Machine::unwindCallFrame): Fixed incorrect reporting / a crash
when unwinding from inside eval and/or program code: detect the
difference, and do the right thing. Also, be sure to notify the profiler
*before* deref'ing the scope chain, since the profiler uses the scope chain.
(KJS::Machine::execute): Fixed incorrect reporting / crash when calling
a JS function re-entrently: Machine::execute(FunctionBodyNode*...)
should not invoke the didExecute hook, because op_ret already does that.
Also, use the new function's ExecState when calling out to the profiler.
(Not important now, but could have become a subtle bug later.)
(KJS::Machine::privateExecute): Fixed a hard to reproduce crash when
profiling JS functions: notify the profiler *before* deref'ing the scope
chain, since the profiler uses the scope chain.
* kjs/object.cpp:
(KJS::JSObject::call): Removed these hooks, because they are now unnecessary.
* profiler/Profile.cpp: Added a comment to explain a subtlety that only
Kevin and I understood previously. (Now, the whole world can understand!)
* profiler/Profiler.cpp:
(KJS::shouldExcludeFunction): Don't exclude .call and .apply. That was
a hack to fix bugs that no longer exist.
Finally, sped things up a little bit by changing the "Is the profiler
running?" check into an ASSERT, since we only call into the profiler
when it's running:
(KJS::Profiler::willExecute):
(KJS::Profiler::didExecute):
2008-05-23 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
- fixed <rdar://problem/5957662> REGRESSION(r33943-r33980): Can't send email , attach file or save as draft from hotmail.com
SunSpider reports no change.
This is a reworking of r34073, which I rolled out because it caused
lots of crashes.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::CodeGenerator): Use removeDirect to nix old
properties whose names collide with new functions. (Don't use putWithAttributes
because that tries to write to the register file, which hasn't grown to
fit this program yet.)
2008-05-23 Darin Adler <darin@apple.com>
Reviewed by Mark Rowe.
As allocateNumber is used via jsNumberCell outside of JavaScriptCore,
we need to provide a non-inlined version of it to avoid creating a
weak external symbol.
* JavaScriptCore.exp:
* kjs/AllInOneFile.cpp:
* kjs/collector.cpp:
(KJS::Collector::allocate):
(KJS::Collector::allocateNumber):
* kjs/collector.h:
(KJS::Collector::allocate):
(KJS::Collector::inlineAllocateNumber):
* kjs/value.h:
(KJS::NumberImp::operator new):
2008-05-23 Geoffrey Garen <ggaren@apple.com>
Rolled out r34073 because it caused lots of layout test crashes.
2008-05-23 Geoffrey Garen <ggaren@apple.com>
Rolled out r34085 because it measured as a 7.6% performance regression.
2008-05-23 Adam Roben <aroben@apple.com>
Windows build fix
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add the
profiler directory to the include path.
2008-05-23 Oliver Hunt <oliver@apple.com>
Reviewed by Anders.
SQUIRRELFISH: JavaScript error messages are missing informative text
Partial fix.
Tidy up error messages, makes a couple of them provide slightly more info.
Inexplicably leads to a 1% SunSpider Progression.
* VM/ExceptionHelpers.cpp:
(KJS::createError):
(KJS::createInvalidParamError):
(KJS::createNotAConstructorError):
(KJS::createNotAFunctionError):
* VM/ExceptionHelpers.h:
* VM/Machine.cpp:
(KJS::isNotObject):
2008-05-23 Oliver Hunt <oliver@apple.com>
Reviewed by Tim H.
Fix call stack reported by profiler when entering event handlers.
JSObject::call was arbitrarily notifying the profiler when it was
called, even if it was JS code, which notifies the profile on entry
in any case.
* kjs/object.cpp:
(KJS::JSObject::call):
2008-05-16 Alp Toker <alp@nuanti.com>
Build fix for gcc 3. Default constructor required in ExecState,
used by OldInterpreterExecState.
* kjs/ExecState.h:
(KJS::ExecState::ExecState):
2008-05-23 Mark Rowe <mrowe@apple.com>
Reviewed by Oliver Hunt.
Fix <rdar://problem/5954997> global-recursion-on-full-stack.html crashes under guardmalloc.
Growing the register file with uncheckedGrow from within Machine::execute is not safe as the
register file may be too close to its maximum size to grow successfully. By using grow,
checking the result and throwing a stack overflow error we can avoid crashing.
* VM/Machine.cpp:
(KJS::Machine::execute):
* VM/RegisterFile.h: Remove the now-unused uncheckedGrow.
2008-05-23 Oliver Hunt <oliver@apple.com>
RS=Kevin McCullough
Remove JAVASCRIPT_PROFILER define
* VM/Machine.cpp:
(KJS::callEval):
(KJS::Machine::unwindCallFrame):
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
* kjs/config.h:
* kjs/object.cpp:
(KJS::JSObject::call):
2008-05-23 Oliver Hunt <oliver@apple.com>
<rdar://problem/5951561> Turn on JavaScript Profiler
Reviewed by Kevin McCullough.
Flipped the switch on the profiler, rearranged how we
signal the the profiler is active so that calls aren't
needed in the general case.
Also fixed the entry point for Machine::execute(FunctionBodyNode..)
to correctly indicate function exit.
Results in a 0.7-1.0% regression in SunSpider :-(
* VM/Machine.cpp:
(KJS::callEval):
(KJS::Machine::unwindCallFrame):
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
* kjs/config.h:
* profiler/Profiler.cpp:
(KJS::Profiler::profiler):
(KJS::Profiler::startProfiling):
(KJS::Profiler::stopProfiling):
* profiler/Profiler.h:
(KJS::Profiler::enabledProfilerReference):
2008-05-23 Simon Hausmann <hausmann@webkit.org>
Fix the Qt build by adding profiler/ to the include search path.
* JavaScriptCore.pri:
2008-05-22 Kevin McCullough <kmccullough@apple.com>
Reviewed by Adam.
Fix a bug in the profiler where time in the current function is given to
(idle).
* profiler/Profile.cpp:
(KJS::Profile::didExecute): Set the start time and then call didExecute
to calculate the time spent in this function.
* profiler/ProfileNode.cpp: Remove confusing calculations that are no
longer necessary.
(KJS::ProfileNode::insertNode):
* profiler/ProfileNode.h: Expose access to the start time to allow the
simpler time calculations above.
(KJS::ProfileNode::startTime):
(KJS::ProfileNode::setStartTime):
2008-05-22 Adam Roben <aroben@apple.com>
Show "(Function object)" instead of "(JSInpectorCallbackWrapper
object)" in profiles
Reviewed by Kevin McCullough.
* profiler/Profiler.cpp:
(KJS::createCallIdentifier): Use JSObject::className instead of
getting the class name from the ClassInfo directly. JSObject
subclasses can override className to provide a custom class name, and
it seems like we should honor that.
2008-05-22 Timothy Hatcher <timothy@apple.com>
Added Profile::restoreAll and added ProfileNode::restoreAll
to the export file.
Reviewed by Adam Roben.
* JavaScriptCore.exp:
* profiler/Profile.h:
2008-05-22 Alp Toker <alp@nuanti.com>
GTK+ build fix. Add JavaScriptCore/profiler to include path.
* GNUmakefile.am:
2008-05-22 Adam Roben <aroben@apple.com>
Implement sub-millisecond profiling on Windows
Reviewed by Kevin McCullough.
* profiler/ProfileNode.cpp:
(KJS::getCount): Added. On Windows, we use QueryPerformanceCounter. On
other platforms, we use getCurrentUTCTimeWithMicroseconds.
(KJS::ProfileNode::endAndRecordCall): Use getCount instead of
getCurrentUTCTimeWithMicroseconds.
(KJS::ProfileNode::startTimer): Ditto.
2008-05-22 Adam Roben <aroben@apple.com>
Fix a profiler assertion when calling a NodeList as a function
Reviewed by Kevin McCullough.
* profiler/Profiler.cpp:
(KJS::createCallIdentifier): Don't assert when a non-function object
is called as a function. Instead, build up a CallIdentifier using the
object's class name.
2008-05-22 Kevin McCullough <kmccullough@apple.com>
Reviewed by Darin.
<rdar://problem/5951529> JSProfiler: Allow the profiler to "Exclude" a
profile node.
-Implement 'exclude'; where the excluded node attributes its time to its
parent's self time.
* JavaScriptCore.exp: Export the exclude function.
* profiler/Profile.h:
(KJS::Profile::exclude):
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::setTreeVisible): New function that allows a change in
visiblitiy to be propogated to all the children of a node.
(KJS::ProfileNode::exclude): If the node matches the callIdentifier then
set the visiblity of this node and all of its children to false and
attribute it's total time to it's caller's self time.
* profiler/ProfileNode.h:
2008-05-22 Mark Rowe <mrowe@apple.com>
Reviewed by Oliver Hunt.
Fix access to static global variables in Windows release builds.
* kjs/JSGlobalObject.h: Don't store a reference to an Identifier
in GlobalPropertyInfo as the Identifier is likely to be a temporary
and therefore may be destroyed before the GlobalPropertyInfo.
2008-05-22 Kevin McCullough <kmccullough@apple.com>
Build fix.
* VM/Machine.cpp:
(KJS::callEval):
2008-05-22 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam.
<rdar://problem/5951561> Turn on JavaScript Profiler
Get basic JS profiling working.
Even with this patch the profiler will not be compiled in because we do
not know the extend, if any, of the performance regression it would cause
when it is not in use. However with these changes, if the profiler were
on, it would not crash and show good profiling data.
* VM/Machine.cpp: Instrument the calls sites that are needed for profiling.
(KJS::callEval):
(KJS::Machine::unwindCallFrame):
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
* kjs/function.cpp: Ditto.
(KJS::globalFuncEval):
* kjs/interpreter.cpp: Ditto.
(KJS::Interpreter::evaluate):
* profiler/Profile.cpp:
(KJS::Profile::willExecute):
(KJS::Profile::didExecute): Because we do not get a good context when
startProfiling is called it is possible that m_currentNode will be at the
top of the known stack when a didExecute() is called. What we then do is
create a new node that represents the function being exited and insert
it between the head and the currently known children, since they should
be children of this new node.
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::ProfileNode):
(KJS::ProfileNode::willExecute): Rename the add function for consistency.
(KJS::ProfileNode::addChild): Appends the child to this node but also
sets the parent pointer of the children to this node.
(KJS::ProfileNode::insertNode): Insert a node between this node and its
children. Also set the time for the new node since it is now exiting
and we don't really know when it started.
(KJS::ProfileNode::stopProfiling):
(KJS::ProfileNode::startTimer):
* profiler/ProfileNode.h:
(KJS::CallIdentifier::toString): Added for debugging.
(KJS::ProfileNode::setParent):
(KJS::ProfileNode::setSelfTime): Fixed an old bug where we set the
visibleTotalTime not the visibleSelfTime.
(KJS::ProfileNode::children):
(KJS::ProfileNode::toString): Added for debugging.
* profiler/Profiler.cpp: remove unecessary calls.
(KJS::Profiler::startProfiling):
2008-05-22 Sam Weinig <sam@webkit.org>
Reviewed by Oliver Hunt.
Rename register arguments for op_call, op_call_eval, op_end, and op_construct
to document what they are for.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitCall):
(KJS::CodeGenerator::emitCallEval):
(KJS::CodeGenerator::emitEnd):
(KJS::CodeGenerator::emitConstruct):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-05-22 Oliver Hunt <oliver@apple.com>
Reviewed by Darin.
Bug 19116: SquirrelFish shouldn't regress on variable lookups
<https://bugs.webkit.org/show_bug.cgi?id=19116>
Last of the multiscope look up optimisations. This is a wash overall on SunSpider
but is a factor of 5-10 improvement in multiscope read/write/modify (eg. ++, --, +=,
... applied to any non-local var).
* kjs/nodes.cpp:
(KJS::PostIncResolveNode::emitCode):
(KJS::PostDecResolveNode::emitCode):
(KJS::PreIncResolveNode::emitCode):
(KJS::PreDecResolveNode::emitCode):
(KJS::ReadModifyResolveNode::emitCode):
2008-05-22 David Kilzer <ddkilzer@apple.com>
<rdar://problem/5954233> Add method to release free memory from FastMalloc
Patch suggested by Mark Rowe. Rubber-stamped by Maciej.
* JavaScriptCore.exp: Export _releaseFastMallocFreeMemory.
* wtf/FastMalloc.cpp:
(WTF::TCMallocStats::): Added releaseFastMallocFreeMemory() for both
system malloc and FastMalloc code paths.
* wtf/FastMalloc.h: Define releaseFastMallocFreeMemory().
2008-05-22 Oliver Hunt <oliver@apple.com>
RS=Maciej.
Roll out r34020 as it causes recursion tests to fail.
* kjs/object.cpp:
(KJS::JSObject::call):
2008-05-22 Oliver Hunt <oliver@apple.com>
Reviewed by Mark.
Don't leak the SymbolTable when compiling eval code.
* kjs/nodes.cpp:
(KJS::EvalNode::generateCode):
2008-05-22 Simon Hausmann <hausmann@webkit.org>
Reviewed by Oliver.
Qt build fix.
* JavaScriptCore.pri: Added DebuggerCallFrame to the build.
* VM/LabelID.h: Include limits.h for UINT_MAX.
* wtf/VectorTraits.h: Include memory for std::auto_ptr.
2008-05-22 Geoffrey Garen <ggaren@apple.com>
Reviewed by Adam Roben.
Removed the old recursion guard mechanism, since squirrelfish has its
own mechanism. Also removed some old JS call tracing code, since we
have other ways to do that, too.
SunSpider reports no change.
* kjs/object.cpp:
(KJS::JSObject::call):
2008-05-22 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fixed <rdar://problem/5954979> crash on celtic kane JS benchmark
* kjs/nodes.cpp:
(KJS::WithNode::emitCode):
(KJS::TryNode::emitCode):
2008-05-21 Kevin McCullough <kmccullough@apple.com>
Reviewed by Maciej and Geoff.
<rdar://problem/5951561> Turn on JavaScript Profiler
-As part of the effort to turn on the profiler it would be helpful if it
did not need ExecStates to represent the stack location of the currently
executing statement.
-We now create each node as necessary with a reference to the current
node and each node knows its parent so that the tree can be made without
the entire stack.
* profiler/Profile.cpp:
(KJS::Profile::Profile): The current node starts at the head.
(KJS::Profile::stopProfiling): The current node is cleared when profiling
stops.
(KJS::Profile::willExecute): The current node either adds a new child or
starts and returns a reference to an already existing child if the call
ID that is requested already exists.
(KJS::Profile::didExecute): The current node finishes and returns its
parent.
* profiler/Profile.h: Use a single callIdentifier instead of a vector
since we no longer use the whole stack.
* profiler/ProfileNode.cpp: Now profile nodes keep a reference to their
parent.
(KJS::ProfileNode::ProfileNode): Initialize the parent.
(KJS::ProfileNode::didExecute): Record the time and return the parent.
(KJS::ProfileNode::addOrStartChild): If the given callIdentifier is
already a child, start it and return it, otherwise create a new one and
return that.
(KJS::ProfileNode::stopProfiling): Same logic, just use the new function.
* profiler/ProfileNode.h: Utilize the parent.
(KJS::ProfileNode::create):
(KJS::ProfileNode::parent):
* profiler/Profiler.cpp:
(KJS::Profiler::startProfiling): Here is the only place where the
ExecState is used to figure out where in the stack the profiler is
currently profiling.
(KJS::dispatchFunctionToProfiles): Only send one CallIdentifier instead
of a vector of them.
(KJS::Profiler::willExecute): Ditto.
(KJS::Profiler::didExecute): Ditto.
(KJS::createCallIdentifier): Create only one CallIdentifier.
(KJS::createCallIdentifierFromFunctionImp): Ditto.
* profiler/Profiler.h:
2008-05-21 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- https://bugs.webkit.org/show_bug.cgi?id=19180
speed up the < operator for the case when both values are integers
Makes standalone SunSpider 1.022x faster.
* VM/Machine.cpp:
(KJS::jsLess): Add a special case for when both are numbers that fit in a JSImmediate.
2008-05-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver and Sam.
- fixed <rdar://problem/5815631> REGRESSION (r31239): Multiscope optimisation of function calls results in incorrect this value (breaks tvtv.de)
Track global this value in the scope chain so we can retrieve it
efficiently but it follows lexical scope properly.
* kjs/ExecState.h:
(KJS::ExecState::globalThisValue):
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
* kjs/function_object.cpp:
(KJS::FunctionObjectImp::construct):
* kjs/scope_chain.h:
(KJS::ScopeChainNode::ScopeChainNode):
(KJS::ScopeChainNode::globalThisObject):
(KJS::ScopeChainNode::push):
(KJS::ScopeChain::ScopeChain):
2008-05-21 Kevin McCullough <kmccullough@apple.com>
Sadness :(
* kjs/config.h:
2008-05-21 Kevin McCullough <kmccullough@apple.com>
Reviewed by Maciej.
<rdar://problem/5950867> JSProfiler: Allow the profiler to "Focus" a
profile node.
- This patch updatest the times of the visible nodes correctly, but to do
so, some of the design of the ProfileNode changed.
* JavaScriptCore.exp: export focus' symbol.
* profiler/Profile.cpp: ProfileNodes now take a reference to the head of
the profile tree to get up-to-date accurate total profile time.
(KJS::Profile::Profile): Pass 0 for the head node.
(KJS::Profile::stopProfiling): stopProfiling no longer needs the time
passed into it, since it can get it from the head and it does not need to
be told it is the head because it can figure it out on it's own.
(KJS::Profile::willExecute): Set the head node for each created node.
* profiler/Profile.h:
(KJS::Profile::focus): Instead of taking a CallIdentifier that the caller
would have to create, now focus() takes a ProfileNode that they should
already have a reference to and focus() can extract the CallIdentifier
from it.
* profiler/ProfileNode.cpp: Create actual and visible versions fo the
total and self times for focus and exclude. Also add a head node
reference so that nodes can get information from their head.
(KJS::ProfileNode::ProfileNode):
(KJS::ProfileNode::stopProfiling): Rename the total and self time
variables and set the visual ones to the actual ones, so that without any
changes to the visual versions of these variables, their times will match
the actual times.
(KJS::ProfileNode::focus): Now focus() has a bool to force it's children
to be visible if this node is visible. If this node does not match the
CallIdentifier being focused then the visibleTotalTime is only updated if
one or more of it's children is the CallIdentifier being focused.
(KJS::ProfileNode::restoreAll): Restores all variables with respect to
the visible data in the ProfileNode.
(KJS::ProfileNode::endAndRecordCall): Name change.
(KJS::ProfileNode::debugPrintData): Dump the new variables.
(KJS::ProfileNode::debugPrintDataSampleStyle): Name change.
* profiler/ProfileNode.h: Use the new variables and reference to the head
node.
(KJS::ProfileNode::create):
(KJS::ProfileNode::totalTime):
(KJS::ProfileNode::setTotalTime):
(KJS::ProfileNode::selfTime):
(KJS::ProfileNode::setSelfTime):
(KJS::ProfileNode::totalPercent):
(KJS::ProfileNode::selfPercent):
(KJS::ProfileNode::setVisible):
2008-05-21 Alp Toker <alp@nuanti.com>
GTK+/UNIX testkjs build fix. Include signal.h.
* kjs/testkjs.cpp:
2008-05-21 Oliver Hunt <oliver@apple.com>
Yet more windows build fixes
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2008-05-21 Oliver Hunt <oliver@apple.com>
Yet more windows build fixes
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2008-05-21 Alp Toker <alp@nuanti.com>
GTK+ build fix. Add DebuggerCallFrame.cpp and take AllInOneFile.cpp
changes into account.
* GNUmakefile.am:
2008-05-21 Oliver Hunt <oliver@apple.com>
Add DebuggerCallFrame.{h,cpp} to the project file
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2008-05-21 Alp Toker <alp@nuanti.com>
GTK+ port build fixes following squirrelfish merge r33979.
* GNUmakefile.am:
2008-05-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- save a hash lookup wne writing to global properties
0.3% speedup on SunSpider, 7% on bitops-bitwise-and
* VM/Machine.cpp:
(KJS::resolveBase): Check for being a the end of the scope chain
before hash lookup.
2008-05-21 Alp Toker <alp@nuanti.com>
Rubber-stamped by Maciej.
Replace non-standard #pragma marks with comments to avoid compiler
warnings.
* profiler/ProfileNode.cpp:
2008-05-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Mark Rowe.
Fix layout test failure in fast/dom/getter-on-window-object2 introduced in r33961.
* JavaScriptCore.exp:
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::defineGetter):
(KJS::JSGlobalObject::defineSetter):
* kjs/JSGlobalObject.h:
=== End merge of squirrelfish ===
2008-05-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Tim Hatcher.
Merged with trunk WebCore's new debugger.
* kjs/DebuggerCallFrame.cpp:
(KJS::DebuggerCallFrame::evaluate): Changed this function to separate
the exception value from the return value. The WebKit debugger treats
them as one, but the WebCore debugger doesn't.
* kjs/DebuggerCallFrame.h:
(KJS::DebuggerCallFrame::dynamicGlobalObject): Added a new accessor for
the dynamic global object, since the debugger doesn't want the lexical
global object.
2008-05-21 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 19116: SquirrelFish shouldn't regress on variable lookups
<https://bugs.webkit.org/show_bug.cgi?id=19116>
Optimise cross scope assignment, 0.4% progression in sunspider.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitPutScopedVar):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::AssignResolveNode::emitCode):
2008-05-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- check property map before symbol table in JSGlobalObject::getOwnPropertySlot
0.5% speedup on SunSpider
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::getOwnPropertySlot): Check property map before symbol table
because symbol table access is likely to have been optimized.
2008-05-21 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 19116: SquirrelFish shouldn't regress on variable lookups
<https://bugs.webkit.org/show_bug.cgi?id=19116>
Optimise multiscope lookup of statically resolvable function calls.
SunSpider reports a 1.5% improvement, including 37% on
controlflow-recursive for some reason :D
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitResolve):
* VM/CodeGenerator.h:
* kjs/nodes.cpp:
(KJS::FunctionCallResolveNode::emitCode):
2008-05-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- give JSGlobalObject a special version of getOwnPropertySlot that tells you if the slot is directly writable
(WebCore change using this is a 2.6% speedup on in-browser SunSpider).
* JavaScriptCore.exp:
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::getOwnPropertySlot):
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::symbolTableGet):
* kjs/object.h:
(KJS::JSObject::getDirectLocation):
(KJS::JSObject::getOwnPropertySlotForWrite):
* kjs/property_map.cpp:
(KJS::PropertyMap::getLocation):
* kjs/property_map.h:
* kjs/property_slot.h:
(KJS::PropertySlot::putValue):
2008-05-20 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 19116: SquirrelFish shouldn't regress on variable lookups
<https://bugs.webkit.org/show_bug.cgi?id=19116>
This restores multiscope optimisation to simple resolve, producing
a 2.6% progression in SunSpider. Have verified that none of the
sites broken by the multiscope optimisation in trunk were effected
by this change.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeBlock.h:
(KJS::CodeBlock::CodeBlock):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::findScopedProperty):
(KJS::CodeGenerator::emitResolve):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::resolve_n):
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/JSVariableObject.h:
2008-05-20 Oliver Hunt <oliver@apple.com>
Fixerate the windows build.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* VM/CodeGenerator.cpp:
* VM/RegisterFile.h:
* kjs/JSGlobalObject.h:
* kjs/Parser.cpp:
* kjs/interpreter.h:
2008-05-20 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Bug 19110: SquirrelFish: Google Maps - no maps
<https://bugs.webkit.org/show_bug.cgi?id=19110>
Correct a comedy of errors present in my original patch to "fix"
exceptions occurring midway through pre and post increment. This
solution is cleaner than the original, doesn't need the additional
opcodes, and as an added benefit does not break Google Maps.
Sunspider reports a 0.4% progression.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::PreIncResolveNode::emitCode):
(KJS::PreDecResolveNode::emitCode):
(KJS::PreIncBracketNode::emitCode):
(KJS::PreDecBracketNode::emitCode):
(KJS::PreIncDotNode::emitCode):
(KJS::PreDecDotNode::emitCode):
2008-05-20 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- inline JSGlobalObject::getOwnPropertySlot
1% improvement on in-browser SunSpider (a wash command-line)
* kjs/JSGlobalObject.cpp:
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::getOwnPropertySlot):
2008-05-18 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 18752: SQUIRRELFISH: exceptions are not always handled by the vm
<https://bugs.webkit.org/show_bug.cgi?id=18752>
Handle exceptions thrown by toString conversion in subscript operators,
this should basically complete exception handling in SquirrelFish.
Sunspider reports no regression.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-05-17 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
[Reapplying patch with previously missing files from r33553 -- Oliver]
Behold: debugging.
SunSpider reports no change.
* JavaScriptCore.xcodeproj/project.pbxproj: Added DebuggerCallFrame.h/.cpp,
and created a debugger folder.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::generate): If the debugger is attached, always
generate full scope chains for its sake.
* VM/Machine.cpp:
(KJS::Machine::unwindCallFrame): Notify the debugger when unwinding
due to an exception, so it doesn't keep stale call frames around.
(KJS::Machine::execute): Set Callee to 0 in eval frames, so the
debugger can distinguish them from function call frames.
(KJS::Machine::debug): Simplified this function, since the debugger
doesn't actually need all the information we used to provide.
(KJS::Machine::privateExecute): Treat debugging hooks like other function
calls, so the code we hook into (the debugger UI) can be optimized.
* kjs/debugger.cpp: Nixed these default callback implementations and
made the callbacks pure virtual instead, so the compiler could tell me
if I made a mistake in one of the subclasses.
* kjs/debugger.h: Removed a bunch of irrelevent data from the debugger
callbacks. Changed from passing an ExecState* to passing a
DebuggerCallFrame*, since an ExecState* doesn't contain sufficient
information anymore.
* kjs/function.cpp:
(KJS::globalFuncEval): Easiest bug fix evar!
[Previously missing files from r33553]
* kjs/DebuggerCallFrame.cpp: Copied from JavaScriptCore/profiler/FunctionCallProfile.h.
(KJS::DebuggerCallFrame::functionName):
(KJS::DebuggerCallFrame::thisObject):
(KJS::DebuggerCallFrame::evaluateScript):
* kjs/DebuggerCallFrame.h: Copied from JavaScriptCore/VM/Register.h.
(KJS::DebuggerCallFrame::DebuggerCallFrame):
(KJS::DebuggerCallFrame::scopeChain):
(KJS::DebuggerCallFrame::exception):
2008-05-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Bug 18991: SquirrelFish: Major codegen issue in a.b=expr, a[b]=expr
<https://bugs.webkit.org/show_bug.cgi?id=18991>
Fix the last remaining blocking cases of this bug.
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::ReadModifyResolveNode::emitCode):
2008-05-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Partial fix for:
Bug 18991: SquirrelFish: Major codegen issue in a.b=expr, a[b]=expr
<https://bugs.webkit.org/show_bug.cgi?id=18991>
Ensure that the code generated for assignments uses temporaries whenever
necessary. This patch covers the vast majority of situations, but there
are still a few left.
This patch also adds some missing cases to CodeBlock::dump().
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.h:
(KJS::CodeGenerator::destinationForAssignResult):
(KJS::CodeGenerator::leftHandSideNeedsCopy):
(KJS::CodeGenerator::emitNodeForLeftHandSide):
* kjs/NodeInfo.h:
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::AssignDotNode::emitCode):
(KJS::ReadModifyDotNode::emitCode):
(KJS::AssignBracketNode::emitCode):
(KJS::ReadModifyBracketNode::emitCode):
(KJS::ForInNode::ForInNode):
* kjs/nodes.h:
(KJS::ReadModifyResolveNode::):
(KJS::AssignResolveNode::):
(KJS::ReadModifyBracketNode::):
(KJS::AssignBracketNode::):
(KJS::AssignDotNode::):
(KJS::ReadModifyDotNode::):
2008-05-17 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 19106: SquirrelFish: Activation is not marked correctly
<https://bugs.webkit.org/show_bug.cgi?id=19106>
We can't rely on the symbol table for a count of the number of globals
we need to mark as that misses duplicate parameters and 'this'. Now we
use the actual local register count from the codeBlock.
* kjs/JSActivation.cpp:
(KJS::JSActivation::mark):
2008-05-16 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Bug 19076: SquirrelFish: RegisterFile can be corrupted if implictly reenter global scope with no declared vars
<https://bugs.webkit.org/show_bug.cgi?id=19076>
Don't delay allocation of initial global RegisterFile, as we can't guarantee we will be able
to allocate the global 'this' register safely at any point after initialisation of the Global
Object.
Unfortunately this initial allocation caused a regression of 0.2-0.3%, however this patch adds
support for the static slot optimisation for the global Math object which brings it to a 0.3%
progression.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::programCodeThis):
(KJS::CodeGenerator::CodeGenerator):
(KJS::CodeGenerator::addParameter):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::execute):
* kjs/ExecState.h:
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::reset):
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::GlobalPropertyInfo::GlobalPropertyInfo):
(KJS::JSGlobalObject::addStaticGlobals):
* kjs/nodes.cpp:
2008-05-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver Hunt.
Bug 19098: SquirrelFish: Ref'd temporaries can be clobbered
<https://bugs.webkit.org/show_bug.cgi?id=19098>
When doing code generation for a statement list, increase the reference
count on a register that might eventually be returned, so that it doesn't
get clobbered by a request for a new temporary.
* kjs/nodes.cpp:
(KJS::statementListEmitCode):
2008-05-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fixed Bug 19044: SquirrelFish: Bogus values enter evaluation when closing over scope with parameter and var with same name
https://bugs.webkit.org/show_bug.cgi?id=19044
* kjs/JSActivation.cpp:
(KJS::JSActivation::copyRegisters): Use numLocals from the code
block rather than the size of the symbol table for the number of
registers to copy, to account for duplicate parameters and vars
with the same name as parameters (we still have potentially
suboptimal codegen in that we allocate a local register for the
var in the latter case but it is never used).
2008-05-15 Geoffrey Garen <ggaren@apple.com>
Not reviewed.
We regret to inform you that your program is crashing because you were
stupid.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Math is hard.
2008-05-14 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
A little more debugger action: filled in op_debug. All debugger control
flow works now, but variable inspection and backtraces still don't.
SunSpider reports no change.
* VM/CodeGenerator.cpp: Changed op_debug to accept line number parameters.
* VM/Machine.cpp:
(KJS::Machine::getFunctionAndArguments): Moved op_debug into a
NEVER_INLINE function to avoid a stunning 10% performance regression.
Also factored out a common function for retrieving the function and
arguments from a call frame.
* kjs/JSActivation.cpp:
(KJS::JSActivation::createArgumentsObject): Use the new factored out
function mentioned above.
* kjs/Parser.cpp:
(KJS::Parser::parse): Increment m_sourceId before assigning it, so the
sourceId we send to the debugger matches the sourceId recorded in the
node.
* kjs/nodes.cpp: Emit debugging hooks.
2008-05-14 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 19024: SQUIRRELFISH: ASSERTION FAILED: activation->isActivationObject() in Machine::unwindCallFrame
<https://bugs.webkit.org/show_bug.cgi?id=19024>
This fixes a number of issues. The most important is that we now check every register
file for tainting rather than just looking for function register files as that was
insufficient. Additionally guarded against implicit re-entry into Eval code.
Also added a few additional assertions to reduce the amout of time between something
going wrong and us seeing the error.
* VM/Machine.cpp:
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
* VM/RegisterFile.cpp:
(KJS::RegisterFile::growBuffer):
(KJS::RegisterFile::addGlobalSlots):
* VM/RegisterFileStack.cpp:
(KJS::RegisterFileStack::pushGlobalRegisterFile):
(KJS::RegisterFileStack::pushFunctionRegisterFile):
* VM/RegisterFileStack.h:
(KJS::RegisterFileStack::inImplicitCall):
2008-05-14 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
A little more debugger action: emit opcodes for debugger hooks. Right
now, the opcode implementation is just a stub.
SunSpider reports no change.
Some example codegen for "function f() { 1; }":
[ 0] dbg DidEnterCallFrame
[ 2] dbg WillExecuteStatement
[ 4] load tr0, 1(@k0)
[ 7] load tr0, undefined(@k1)
[ 10] dbg WillLeaveCallFrame
[ 12] ret tr0
2008-05-14 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Bug 19025: SQUIRRELFISH: malformed syntax in onload handler causes crash
<https://bugs.webkit.org/show_bug.cgi?id=19025>
Simple fix -- move the use of functionBodyNode to after the null check.
* kjs/function_object.cpp:
(KJS::FunctionObjectImp::construct):
2008-05-13 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fixed a codegen crash with run-time parse errors.
SunSpider reports no change.
emitThrowError needs to return the temporary holding the error, not dst,
since dst may be NULL. In fact, emitThrowError shouldn't take a dst
parameter at all, since exceptions should not modify the destination
register.
2008-05-13 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Bug 19027: SquirrelFish: Incorrect codegen for pre-increment
<https://bugs.webkit.org/show_bug.cgi?id=19027>
This fixes the codegen issues for the pre-inc/decrement operators
to prevent incorrectly clobbering the destination in the event of
an exception.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitPreInc):
(KJS::CodeGenerator::emitPreDec):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::PreIncResolveNode::emitCode):
(KJS::PreDecResolveNode::emitCode):
(KJS::PreIncBracketNode::emitCode):
(KJS::PreDecBracketNode::emitCode):
(KJS::PreIncDotNode::emitCode):
(KJS::PreDecDotNode::emitCode):
2008-05-13 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
A little more debugger action: supply a real line number, sourceId,
and sourceURL in op_new_error.
SunSpider reports a .2% speedup. Not sure what that's about.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Use the new good stuff in op_new_error.
* kjs/nodes.cpp:
(KJS::RegExpNode::emitCode): Use the shared emitThrowError instead of
rolling our own.
2008-05-13 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
A little more debugger action: implemented the exception callback.
SunSpider reports a .2% speedup. Not sure what that's about.
* VM/CodeBlock.h: A little refactoring here. Store a pointer to our
owner ScopeNode so we can retrieve data from it. This allows us to
stop storing copies of the data ourselves. Also, store a "this" register
instead of a code type, since we were only using the code type to
calculate the "this" register.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::generate): Calculate the "this" register mentioned
above. Also, take care of removing "this" from the symbol table after
codegen is done, since relying on the timing of a destructor for correct
behavior is not so good.
* VM/Machine.cpp:
(KJS::Machine::throwException): Invoke the debugger's exception callback.
(KJS::Machine::privateExecute): Use the "this" register mentioned above.
2008-05-13 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Removed some unused exception machinery.
SunSpider reports a .3% speedup.
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
* JavaScriptCore.exp:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* kjs/internal.cpp:
* kjs/object.cpp:
* kjs/object.h:
* kjs/value.h:
2008-05-13 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
A little more debugger action.
* kjs/debugger.cpp:
* kjs/debugger.h: Removed debuggersPresent because it was unused.
Replaced AttachedGlobalObject linked list with a HashSet because HashSet
is faster and simpler. Changed all functions to return void instead of
bool, because no clients ever return false, and we don't want to support
it.
* kjs/nodes.cpp: Did some up-keep to avoid build bustage.
(KJS::Node::handleException):
(KJS::BreakpointCheckStatement::execute):
(KJS::FunctionBodyNodeWithDebuggerHooks::execute):
2008-05-13 Oliver Hunt <oliver@apple.com>
Reviewed by Darin.
Bug 18752: SQUIRRELFISH: exceptions are not always handled by the vm
<https://bugs.webkit.org/show_bug.cgi?id=18752>
Replace old attempt at "branchless" exceptions as the extra information
being passed made gcc an unhappy compiler, replacing these custom toNumber
calls with ordinary toNumber logic (by relying on toNumber now preventing
side effects after an exception has been thrown) provided sufficient leeway
to add the additional checks for the remaining unchecked cases.
This leaves only toString conversions in certain contexts as possibly
misbehaving.
* VM/Machine.cpp:
(KJS::jsAdd):
(KJS::resolve):
(KJS::resolveBaseAndProperty):
(KJS::resolveBaseAndFunc):
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/value.h:
(KJS::JSValue::safeGetNumber):
2008-05-13 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
First steps toward supporting the debugger API: support the sourceParsed
callback; plus some minor fixups.
SunSpider reports no regression.
* VM/CodeGenerator.h: Removed a misleading comment.
* kjs/Parser.h: Changed the parser to take an ExecState*, so it can
implement the sourceParsed callback -- that way, we only have to
implement the callback in one place.
* kjs/debugger.cpp: Nixed DebuggerImp, because its sole purpose in life
was to demonstrate the misapplication of design patterns.
* kjs/debugger.h: Changed sourceParsed to take a SourceProvider, to
reduce copying, and not to return a value, because pausing execution
after parsing is complicated, and no clients needed that ability, anyway.
* kjs/grammar.y: Make sure never to pass a NULL SourceElements* to
didFinishParsing -- that simplifies some code down the road.
* kjs/nodes.cpp: Don't generate special AST nodes just because the
debugger is attached -- that's a relic of the old AST execution model,
and those nodes haven't been maintained.
2008-05-13 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Bug 18752: SQUIRRELFISH: exceptions are not always handled by the vm
<https://bugs.webkit.org/show_bug.cgi?id=18752>
First step: prevent incorrect evaluation of valueOf/toString conversion
in right hand side of expression after earlier conversion throws.
* API/JSCallbackObjectFunctions.h:
(KJS::::toNumber):
* kjs/object.cpp:
(KJS::JSObject::defaultValue):
2008-05-12 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Bug 18934: SQUIRRELFISH: ASSERT @ nytimes.com due to RegisterFile being clobbered
<https://bugs.webkit.org/show_bug.cgi?id=18934>
Unfortunately we cannot create new statically optimised globals if there are any
tainted RegisterFiles on the RegisterFileStack. To handle this we re-introduce
(in a slightly cleaner form) the inImplicitCall concept to the RegisterFileStack.
* VM/Machine.cpp:
(KJS::Machine::execute):
* VM/RegisterFileStack.cpp:
(KJS::RegisterFileStack::pushFunctionRegisterFile):
* VM/RegisterFileStack.h:
2008-05-12 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Introduced support for function.caller.
Improved support for walking interesting scopes for function introspection.
This fixes all remaining layout tests not blocked by rebasing to trunk.
SunSpider reports no change.
* VM/Machine.cpp:
(KJS::Machine::dumpRegisters): Fixed a spacing issue.
2008-05-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Bug 18961: SQUIRRELFISH: Gmail doesn't load
<https://bugs.webkit.org/show_bug.cgi?id=18961>
Fix codegen for logical nodes so that they don't use their destination
as a temporary.
* kjs/nodes.cpp:
(KJS::LogicalAndNode::emitCode):
(KJS::LogicalOrNode::emitCode):
2008-05-10 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- JavaScriptCore part of fix for: "SQUIRRELFISH: function toString broken after calling"
https://bugs.webkit.org/show_bug.cgi?id=18869
Three layout tests are fixed:
fast/js/toString-elision-trailing-comma.html
fast/js/toString-prefix-postfix-preserve-parens.html
fast/js/kde/lval-exceptions.html
Functions now save a shared subrange of the original source used
to make them (so in the common case this adds no storage above the
memory cache).
* kjs/SourceProvider.h: Added.
(KJS::SourceProvider): New abstract base class for classes that provide on-demand access
to the source for a JavaScript program. This allows function objects to have access to their
original source without copying.
(KJS::UStringSourceProvider): SourceProvider subclass backed by a KJS::UString.
(KJS::UStringSourceProvider::create):
(KJS::UStringSourceProvider::getRange):
(KJS::UStringSourceProvider::data):
(KJS::UStringSourceProvider::length):
(KJS::UStringSourceProvider::UStringSourceProvider):
* kjs/SourceRange.h: Added.
(KJS::SourceRange::SourceRange): Class that holds a SourceProvider and a character range into
the source, to encapsulate on-demand access to the source of a function.
(KJS::SourceRange::toString):
* VM/Machine.cpp:
(KJS::eval): Pass a UStringSourceProvider to the parser.
* kjs/Parser.cpp:
(KJS::Parser::parse): Take a SourceProvider and pass it on to the lexer.
* kjs/Parser.h:
(KJS::Parser::parse): Take a SourceProvider.
* kjs/lexer.cpp:
(KJS::Lexer::setCode): Take a SourceProvider; keep it around, and
use it to get the raw buffer and length.
* kjs/lexer.h:
(KJS::Lexer::sourceRange): Convenience function to get a source
range based on the lexer's source provieder, and char offsets
right before and after the desired range.
* kjs/function.cpp:
(KJS::globalFuncEval): Pass a UStringSourceProvider to the parser.
* kjs/function_object.cpp:
(KJS::functionProtoFuncToString): Use toSourceString to get the source.
(KJS::FunctionObjectImp::construct): Give the parser a UStringSourceProvider.
* kjs/grammar.y: When parsing a function declaration, function
expression, or getter or setter, tell the function body about its
SourceRange.
* kjs/interpreter.cpp:
(KJS::Interpreter::checkSyntax): Pass a SourceProvider to the parser.
(KJS::Interpreter::evaluate): Pass a SourceProvider to the parser.
* kjs/interpreter.h:
* kjs/nodes.h:
(KJS::FunctionBodyNode::setSource): Establish a SourceRange for this function.
(KJS::FunctionBodyNode::toSourceString): Get the source string out
of the SourceRange.
(KJS::FuncExprNode::): Take a SourceRange and set it on the body.
(KJS::FuncDeclNode::): ditto
* kjs/testkjs.cpp:
(prettyPrintScript): Use a SourceProvider appropriately.
* JavaScriptCore.exp: Export new symbols.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add new files.
* JavaScriptCore.xcodeproj/project.pbxproj: Add new files.
2008-05-09 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bring back RegisterFile tainting in order to correctly handle
natively implemented getters and setters that re-enter JavaScript
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/RegisterFile.h:
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction):
* kjs/object.cpp:
(KJS::JSObject::put):
(KJS::tryGetAndCallProperty):
* kjs/property_slot.cpp:
(KJS::PropertySlot::functionGetter):
2008-05-09 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- track character offsets of open and close braces, in preparation for saving function source
I verified that there is no performance regression from this change.
* kjs/grammar.y:
* kjs/lexer.cpp:
(KJS::Lexer::lex):
(KJS::Lexer::matchPunctuator):
* kjs/lexer.h:
2008-05-09 Oliver Hunt <oliver@apple.com>
Debug build fix
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::restoreLocalStorage):
2008-05-09 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Build fixes for SquirrelFish on windows.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
* VM/Register.h:
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::restoreLocalStorage):
* kjs/collector.cpp:
(KJS::Collector::allocate):
(KJS::Collector::allocateNumber):
* kjs/collector.h:
(KJS::Collector::allocate):
(KJS::Collector::allocateNumber):
* kjs/property_slot.cpp:
2008-05-08 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- fix activation tearoff in the case where functions are called with too many arguments
Fixes:
fast/canvas/patternfill-repeat.html
fast/dom/SelectorAPI/bug-17313.html
* VM/Machine.cpp:
(KJS::slideRegisterWindowForCall):
(KJS::scopeChainForCall):
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
2008-05-08 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fixed failure in fast/canvas/canvas-pattern-behaviour.html.
SunSpider reports a small speedup. Not sure what that's about.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump): Fixed op_call_eval to dump as "op_call_eval".
This helped me while debugging.
* VM/Machine.cpp:
(KJS::Machine::unwindCallFrame): When looking for an activation to tear
off, don't use the scope chain. Inside eval, the scope chain doesn't
belong to us; it belongs to our calling function.
Also, don't use the needsFullScopeChain flag to decide whether to tear
off the activation. "function.arguments" can create an activation
for a function whose needsFullScopeChain flag is set to false.
2008-05-08 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fix function.call for calls of more than 8 arguments
Fixes svg/carto.net/button.svg
* kjs/list.cpp:
(KJS::List::getSlice): properly set up the m_buffer of the target list.
2008-05-08 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- don't return a null RegisterID from RegExpNode in the exception case, since the caller may need a real register
Fixes:
- fast/regex/early-acid3-86.html
- http/tests/misc/acid3.html
* kjs/nodes.cpp:
(KJS::RegExpNode::emitCode):
2008-05-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Fix a performance regression caused by the introduction of property
attributes to SymbolTable in r32859 by encoding the attributes and the
register index into a single field of SymbolTableEntry.
This leaves Node::optimizeVariableAccess() definitely broken, although
it was probably not entirely correct in SquirrelFish before this change.
* VM/CodeBlock.h:
(KJS::missingThisObjectMarker):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::addVar):
(KJS::CodeGenerator::CodeGenerator):
(KJS::CodeGenerator::registerForLocal):
(KJS::CodeGenerator::registerForLocalConstInit):
(KJS::CodeGenerator::isLocalConstant):
(KJS::CodeGenerator::addConstant):
(KJS::CodeGenerator::emitCall):
* VM/CodeGenerator.h:
(KJS::CodeGenerator::IdentifierMapIndexHashTraits::emptyValue):
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::saveLocalStorage):
* kjs/JSVariableObject.cpp:
(KJS::JSVariableObject::getPropertyNames):
(KJS::JSVariableObject::getPropertyAttributes):
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::symbolTableGet):
(KJS::JSVariableObject::symbolTablePut):
(KJS::JSVariableObject::symbolTablePutWithAttributes):
* kjs/SymbolTable.h:
(KJS::SymbolTableEntry::SymbolTableEntry):
(KJS::SymbolTableEntry::isEmpty):
(KJS::SymbolTableEntry::getIndex):
(KJS::SymbolTableEntry::getAttributes):
(KJS::SymbolTableEntry::setAttributes):
(KJS::SymbolTableEntry::isReadOnly):
* kjs/nodes.cpp:
(KJS::getSymbolTableEntry):
(KJS::PostIncResolveNode::optimizeVariableAccess):
(KJS::PostDecResolveNode::optimizeVariableAccess):
(KJS::DeleteResolveNode::optimizeVariableAccess):
(KJS::TypeOfResolveNode::optimizeVariableAccess):
(KJS::PreIncResolveNode::optimizeVariableAccess):
(KJS::PreDecResolveNode::optimizeVariableAccess):
(KJS::ReadModifyResolveNode::optimizeVariableAccess):
(KJS::AssignResolveNode::optimizeVariableAccess):
(KJS::ProgramNode::initializeSymbolTable):
2008-05-06 Maciej Stachowiak <mjs@apple.com>
Rubber stamped by Oliver.
- add missing ! in an assert that I failed to reverse
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::CodeGenerator):
2008-05-06 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fixed "SQUIRRELFISH: window.this shows up as a property, but it shouldn't"
https://bugs.webkit.org/show_bug.cgi?id=18868
The basic approach is to have "this" only be present in the symbol
table at compile time, not runtime.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::~CodeGenerator): Remove "this" from symbol table.
(KJS::CodeGenerator::CodeGenerator): Add "this" back when re-using
a symbol table.
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::execute): Don't assert that "this" is in the symbol table.
2008-05-06 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Trivial support for function.arguments: Currently, we only support
function.arguments from within the scope of function.
This fixes the remaining Mozilla JS test failures.
SunSpider reports no change.
* JavaScriptCore.exp:
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Separated scope chain deref from
activation register copying: since it is now possible for client code
to create an activation on behalf of a function that otherwise wouldn't
need one, having an activation no longer necessarily means that you need
to deref the scope chain.
(KJS::Machine::getCallFrame): For now, this function only examines the
current scope. Walking parent scopes requires some refactoring in the
way we track execution stacks.
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState): We use a negative call frame offset to
indicate that a given scope is not a function call scope.
2008-05-05 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Fix call frame set up for native -> JS function calls.
* VM/Machine.cpp:
(KJS::Machine::execute):
2008-05-05 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Fixed ecma_3/Object/8.6.2.6-001.js, and similar bugs.
SunSpider reports a .4% speedup. Not sure what that's about.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Check for exception return from equal,
since toPrimitive can throw.
* kjs/operations.cpp:
(KJS::strictEqual): In response to an error I made in an earlier version
of this patch, I changed strictEqual to make clear the fact that it
performs no conversions and can't throw, making it slightly more efficient
in the process.
2008-05-05 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fix some dumb mistakes in my last patch
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitPushScope):
(KJS::CodeGenerator::emitGetPropertyNames):
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-05-05 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- document opcodes relating to jumps, scopes, and property name iteration
Documented jmp, jtrue, false, push_scope, pop_scope, get_pnames,
next_pname and jmp_scopes.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitJump):
(KJS::CodeGenerator::emitJumpIfTrue):
(KJS::CodeGenerator::emitJumpIfFalse):
(KJS::CodeGenerator::emitPushScope):
(KJS::CodeGenerator::emitNextPropertyName):
(KJS::CodeGenerator::emitGetPropertyNames):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* kjs/nodes.cpp:
(KJS::LogicalAndNode::emitCode):
(KJS::LogicalOrNode::emitCode):
(KJS::ConditionalNode::emitCode):
(KJS::IfNode::emitCode):
(KJS::IfElseNode::emitCode):
(KJS::DoWhileNode::emitCode):
(KJS::WhileNode::emitCode):
(KJS::ForNode::emitCode):
(KJS::ForInNode::emitCode):
(KJS::WithNode::emitCode):
2008-05-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Bug 18749: SQUIRRELFISH: const support is broken
<https://bugs.webkit.org/show_bug.cgi?id=18749>
Adds support for const during code generation.
Fixes 2 layout tests.
* ChangeLog:
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::addVar):
(KJS::CodeGenerator::CodeGenerator):
(KJS::CodeGenerator::isLocalConstant):
* VM/CodeGenerator.h:
(KJS::CodeGenerator::addVar):
* kjs/nodes.cpp:
(KJS::PostIncResolveNode::emitCode):
(KJS::PostDecResolveNode::emitCode):
(KJS::PreIncResolveNode::emitCode):
(KJS::PreDecResolveNode::emitCode):
(KJS::ReadModifyResolveNode::emitCode):
(KJS::AssignResolveNode::emitCode):
2008-05-04 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- document some more opcodes (and fix argument names)
Added docs for eq, neq, stricteq, nstriceq, less and lesseq.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitEqual):
(KJS::CodeGenerator::emitNotEqual):
(KJS::CodeGenerator::emitStrictEqual):
(KJS::CodeGenerator::emitNotStrictEqual):
(KJS::CodeGenerator::emitLess):
(KJS::CodeGenerator::emitLessEq):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* kjs/nodes.cpp:
(KJS::LessNode::emitCode):
(KJS::GreaterNode::emitCode):
(KJS::LessEqNode::emitCode):
(KJS::GreaterEqNode::emitCode):
(KJS::EqualNode::emitCode):
(KJS::NotEqualNode::emitCode):
(KJS::StrictEqualNode::emitCode):
(KJS::NotStrictEqualNode::emitCode):
(KJS::CaseBlockNode::emitCodeForBlock):
2008-05-04 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
More scaffolding for f.arguments.
Track the offset of the last call frame in the ExecState, so we can
produce a backtrace at any time.
Also, record numLocals, the sum of numVars + numParameters, in each code
block, to make updates to the ExecState a little cheaper than they
would be otherwise.
We now use numLocals in a bunch of places where we used to calculate
numVars + numParameters or -numVars - numParameters.
Reports are mixed, but all in all, this seems to be a wash on SunSpider.
2008-05-04 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Whoops, correctly handle properties that don't exist in the
symbol table.
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::symbolTablePutWithAttributes):
2008-05-04 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Add attribute information to SymbolTable as ground work for
various DontEnum and ReadOnly issues.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::addVar):
(KJS::CodeGenerator::CodeGenerator):
(KJS::CodeGenerator::registerForLocal):
(KJS::CodeGenerator::registerForLocalConstInit):
(KJS::CodeGenerator::addConstant):
* VM/Machine.cpp:
(KJS::Machine::execute):
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::saveLocalStorage):
* kjs/JSVariableObject.cpp:
(KJS::JSVariableObject::getPropertyNames):
(KJS::JSVariableObject::getPropertyAttributes):
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::symbolTablePut):
(KJS::JSVariableObject::symbolTablePutWithAttributes):
* kjs/SymbolTable.h:
(KJS::SymbolTableEntry::SymbolTableEntry):
(KJS::SymbolTableIndexHashTraits::emptyValue):
* kjs/nodes.cpp:
(KJS::getSymbolTableEntry):
(KJS::ReadModifyResolveNode::optimizeVariableAccess):
(KJS::AssignResolveNode::optimizeVariableAccess):
(KJS::ProgramNode::initializeSymbolTable):
2008-05-04 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
More scaffolding for f.arguments.
Store the register file associated with an ExecState in the ExecState.
SunSpider reports no change.
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Moved
registerFileStack above globalExec, so it gets initialized first.
Removed remnants of old activation scheme.
2008-05-04 Maciej Stachowiak <mjs@apple.com>
Rubber stamped by Oliver.
- renamed a few opcodes and fixed assembly formatting to accomodate the longest opcode
equal --> eq
nequal --> neq
resolve_base_and_property --> resolve_with_base
resolve_base_and_func --> resolve_func
get_prop_id --> get_by_id
put_prop_id --> put_by_id
delete_prop_id --> del_by_id
get_prop_val --> get_by_val
put_prop_val --> put_by_val
delete_prop_val --> del_by_val
put_prop_index --> put_by_index
* VM/CodeBlock.cpp:
(KJS::printUnaryOp):
(KJS::printBinaryOp):
(KJS::printConditionalJump):
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitEqual):
(KJS::CodeGenerator::emitNotEqual):
(KJS::CodeGenerator::emitResolveWithBase):
(KJS::CodeGenerator::emitResolveFunction):
(KJS::CodeGenerator::emitGetById):
(KJS::CodeGenerator::emitPutById):
(KJS::CodeGenerator::emitDeleteById):
(KJS::CodeGenerator::emitGetByVal):
(KJS::CodeGenerator::emitPutByVal):
(KJS::CodeGenerator::emitDeleteByVal):
(KJS::CodeGenerator::emitPutByIndex):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::ArrayNode::emitCode):
(KJS::PropertyListNode::emitCode):
(KJS::BracketAccessorNode::emitCode):
(KJS::DotAccessorNode::emitCode):
(KJS::EvalFunctionCallNode::emitCode):
(KJS::FunctionCallResolveNode::emitCode):
(KJS::FunctionCallBracketNode::emitCode):
(KJS::FunctionCallDotNode::emitCode):
(KJS::PostIncResolveNode::emitCode):
(KJS::PostDecResolveNode::emitCode):
(KJS::PostIncBracketNode::emitCode):
(KJS::PostDecBracketNode::emitCode):
(KJS::PostIncDotNode::emitCode):
(KJS::PostDecDotNode::emitCode):
(KJS::DeleteResolveNode::emitCode):
(KJS::DeleteBracketNode::emitCode):
(KJS::DeleteDotNode::emitCode):
(KJS::TypeOfResolveNode::emitCode):
(KJS::PreIncResolveNode::emitCode):
(KJS::PreDecResolveNode::emitCode):
(KJS::PreIncBracketNode::emitCode):
(KJS::PreDecBracketNode::emitCode):
(KJS::PreIncDotNode::emitCode):
(KJS::PreDecDotNode::emitCode):
(KJS::ReadModifyResolveNode::emitCode):
(KJS::AssignResolveNode::emitCode):
(KJS::AssignDotNode::emitCode):
(KJS::ReadModifyDotNode::emitCode):
(KJS::AssignBracketNode::emitCode):
(KJS::ReadModifyBracketNode::emitCode):
(KJS::ConstDeclNode::emitCodeSingle):
(KJS::ForInNode::emitCode):
(KJS::TryNode::emitCode):
2008-05-04 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Fix assertion when accessing arguments object with too many arguments provided
The arguments constructor was assuming that the register offset given for argv
was an absolute offset into the registerfile, rather than the offset from the
frame. This patches corrects that issue.
* kjs/JSActivation.cpp:
(KJS::JSActivation::createArgumentsObject):
2008-05-04 Geoffrey Garen <ggaren@apple.com>
Rubber stamped by Sam Weinig.
Cleaned up Machine.cpp according to our style guidelines: moved static
data to the top of the file; moved stand-alone functions below that;
moved the Machine constructor above other Machine member functions.
2008-05-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Sam.
- fix accidental breakage from last patch
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-05-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- a bunch more opcode documentation and corresponding parameter name fixes
I renamed a few opcodes:
type_of --> typeof (that's what the JS operator is named)
instance_of --> instanceof (ditto)
create_error --> new_error (for consistency with other new_* opcodes)
I documented the following opcodes:
- load
- new_object
- new_array
- new_regexp
- mov
- pre_inc
- pre_dec
- post_inc
- post_dec
- to_jsnumber
- negate
- bitnot
- not
- instanceof
- typeof
- in
- new_func
- new_funcexp
- new_error
I also fixed formatting on some existing opcode docs.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitMove):
(KJS::CodeGenerator::emitNot):
(KJS::CodeGenerator::emitPreInc):
(KJS::CodeGenerator::emitPreDec):
(KJS::CodeGenerator::emitPostInc):
(KJS::CodeGenerator::emitPostDec):
(KJS::CodeGenerator::emitToJSNumber):
(KJS::CodeGenerator::emitNegate):
(KJS::CodeGenerator::emitBitNot):
(KJS::CodeGenerator::emitInstanceOf):
(KJS::CodeGenerator::emitTypeOf):
(KJS::CodeGenerator::emitIn):
(KJS::CodeGenerator::emitLoad):
(KJS::CodeGenerator::emitNewObject):
(KJS::CodeGenerator::emitNewArray):
(KJS::CodeGenerator::emitNewRegExp):
(KJS::CodeGenerator::emitNewError):
* VM/CodeGenerator.h:
(KJS::CodeGenerator::scopeDepth):
(KJS::CodeGenerator::addVar):
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::Node::emitThrowError):
(KJS::RegExpNode::emitCode):
(KJS::TypeOfValueNode::emitCode):
(KJS::UnaryPlusNode::emitCode):
(KJS::NegateNode::emitCode):
(KJS::BitwiseNotNode::emitCode):
(KJS::LogicalNotNode::emitCode):
(KJS::InstanceOfNode::emitCode):
(KJS::InNode::emitCode):
2008-05-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff and Sam.
- generate HTML bytecode docs at build time
* DerivedSources.make:
* docs: Added.
* docs/make-bytecode-docs.pl: Added.
2008-05-03 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Update ExecState::m_scopeChain when switching scope chains inside the
machine.
This fixes uses of lexicalGlobalObject, such as, in a subframe
alert(top.makeArray() instanceof Array ? "FAIL" : "PASS");
and a bunch of the security failures listed in
https://bugs.webkit.org/show_bug.cgi?id=18870. (Those tests still fail,
seemingly because of regressions in exception messages).
SunSpider reports no change.
* VM/Machine.cpp: Factored out scope chain updating into a common
function that takes care to update ExecState::m_scopeChain, too.
* kjs/ExecState.h: I made Machine a friend of ExecState so that Machine
could update ExecState::m_scopeChain, even though that value is
read-only for everyone else.
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Changed
this client to be a little friendlier to ExecState's internal
storage type for scope chain data.
2008-05-03 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Fixed https://bugs.webkit.org/show_bug.cgi?id=18876
Squirrelfish: ScopeChainNode leak in op_jmp_scopes.
SunSpider reports no change.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Don't construct a ScopeChain object,
since the direct threaded interpreter will goto across its destructor.
2008-05-03 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
A bit more efficient fix than r32832: Don't copy globals into function
register files; instead, have the RegisterFileStack track only the base
of the last *global* register file, so the global object's register
references stay good.
SunSpider reports a .3% speedup. Not sure what that's about.
2008-05-03 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 18864: SquirrelFish: Support getter and setter definition in object literals
<https://bugs.webkit.org/show_bug.cgi?id=18864>
Add new opcodes to allow us to add getters and setters to an object. These are
only used by the codegen for object literals.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitPutGetter):
(KJS::CodeGenerator::emitPutSetter):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::PropertyListNode::emitCode):
2008-05-02 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- properly copy globals into and out of implicit call register
files, otherwise they will fail at global lookup
Fixes fast/js/array-tostring-and-join.html layout test.
* VM/RegisterFileStack.cpp:
(KJS::RegisterFileStack::pushGlobalRegisterFile):
(KJS::RegisterFileStack::popGlobalRegisterFile):
(KJS::RegisterFileStack::pushFunctionRegisterFile):
(KJS::RegisterFileStack::popFunctionRegisterFile):
2008-05-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fixed https://bugs.webkit.org/show_bug.cgi?id=18822
SQUIRRELFISH: incorrect eval used in some cases
Changed all code inside the machine to fetch the lexical global object
directly from the scope chain, instead of from the ExecState.
Clients who fetch the lexical global object through the ExecState
still don't work.
SunSpider reports no change.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Fetch the lexical global object from
the scope chain.
* kjs/ExecState.h:
(KJS::ExecState::ExecState::lexicalGlobalObject): Moved the logic for
this function into ScopeChainNode, but kept this function around to
support existing clients.
2008-05-02 Geoffrey Garen <ggaren@apple.com>
Rubber stamped by Oliver Hunt.
Removed ExecState.cpp from AllInOneFile.cpp, for a .2% speedup.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/AllInOneFile.cpp:
2008-05-01 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff and Maciej.
Bug 18827: SquirrelFish: Prevent getters and setters from destroying the current RegisterFile
<https://bugs.webkit.org/show_bug.cgi?id=18827>
Remove safe/unsafe RegisterFile concept, and instead just add additional
logic to ensure we always push/pop RegisterFiles when executing getters
and setters, similar to the logic for valueOf and toString.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/RegisterFile.h:
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction):
* kjs/object.cpp:
(KJS::JSObject::put):
* kjs/property_slot.cpp:
(KJS::PropertySlot::functionGetter):
2008-05-01 Oliver Hunt <oliver@apple.com>
RS=Geoff
Rename unsafeForReentry to safeForReentry to avoid double negatives.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/RegisterFile.h:
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction):
2008-05-01 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 18827: SquirrelFish: Prevent getters and setters from destroying the current RegisterFile
<https://bugs.webkit.org/show_bug.cgi?id=18827>
This patch makes getters and setters work. It does this by
tracking whether the RegisterFile is "safe", that is whether
the interpreter is in a state that in which it can handle
the RegisterFile being reallocated.
* VM/Machine.cpp:
(KJS::resolve):
(KJS::Machine::privateExecute):
* VM/RegisterFile.h:
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction):
2008-04-30 Geoffrey Garen <ggaren@apple.com>
Release build fix: Always compile in "isGlobalObject", since it's
listed in our .exp file.
* kjs/ExecState.cpp:
(KJS::ExecState::isGlobalObject):
* kjs/ExecState.h:
2008-04-30 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Minor code restructuring to prepare for getters and setters,
also helps exception semantics a bit.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-04-30 Geoffrey Garen <ggaren@apple.com>
Fixed tyop.
* kjs/ExecState.h:
2008-04-30 Geoffrey Garen <ggaren@apple.com>
Debug build fix: export a missing symbol.
* JavaScriptCore.exp:
2008-04-30 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
A little more ExecState refactoring: Now, only the global object creates
an ExecState.
Also inlined ExecState::lexicalGlobalObject().
SunSpider reports no change.
2008-04-30 Geoffrey Garen <ggaren@apple.com>
WebCore build fix: forward-declare ScopeChain.
* kjs/interpreter.h:
2008-04-30 Geoffrey Garen <ggaren@apple.com>
Build fix for JavaScriptGlue: export a missing symbol.
* JavaScriptCore.exp:
2008-04-30 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Removed a lot of unused bits from ExecState, moving them into
OldInterpreterExecState, the fake scaffolding class.
The clutter was making it hard to see the forest from the trees.
.4% SunSpider speedup, probably because ExecState::lexicalGlobalObject()
is faster now.
2008-04-29 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 18643: SQUIRRELFISH: need to support implicit function calls (valueOf, toString, getters/setters)
<https://bugs.webkit.org/show_bug.cgi?id=18643>
Prevent static slot optimisation for new variables and functions in
globally re-entrant code called from an an implicit function call.
This is necessary to prevent us from needing to resize the global
slot portion of the root RegisterFile during an implicit (and hence
unguarded) function call.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::CodeGenerator):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::execute):
* VM/RegisterFile.h:
* VM/RegisterFileStack.cpp:
(KJS::RegisterFileStack::pushGlobalRegisterFile):
(KJS::RegisterFileStack::popGlobalRegisterFile):
(KJS::RegisterFileStack::pushFunctionRegisterFile):
(KJS::RegisterFileStack::popFunctionRegisterFile):
* VM/RegisterFileStack.h:
(KJS::RegisterFileStack::inImplicitFunctionCall):
(KJS::RegisterFileStack::lastGlobal):
* kjs/nodes.cpp:
(KJS::ProgramNode::generateCode):
* kjs/nodes.h:
(KJS::ProgramNode::):
2008-04-29 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
In nested program code, don't propogate "this" back to the parent
register file. ("this" should remain constant in the parent register
file, regardless of the scripts it invokes.)
* VM/RegisterFile.cpp:
(KJS::RegisterFile::copyGlobals):
2008-04-28 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Restore base pointer when popping a global RegisterFile
* VM/RegisterFileStack.cpp:
(KJS::RegisterFileStack::popGlobalRegisterFile):
2008-04-28 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Bug 18643: SQUIRRELFISH: need to support implicit function calls (valueOf, toString, getters/setters)
<https://bugs.webkit.org/show_bug.cgi?id=18643>
Partial fix. This results in all implicit calls to toString or valueOf
executing in a separate RegisterFile, so ensuring that the the pointers
in the triggering interpreter don't get trashed. This still leaves the
task of preventing new global re-entry from toString and valueOf from
clobbering the RegisterFile.
* VM/Machine.cpp:
(KJS::Machine::execute):
* VM/RegisterFileStack.cpp:
(KJS::RegisterFileStack::pushFunctionRegisterFile):
(KJS::RegisterFileStack::popFunctionRegisterFile):
* VM/RegisterFileStack.h:
* kjs/object.cpp:
(KJS::tryGetAndCallProperty):
2008-04-28 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Simplified activation object a bit: No need to store the callee
in the activation object -- we can pull it out of the call frame
when needed, instead.
SunSpider reports no change.
2008-04-28 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
RS by Oliver Hunt on moving JSArguments.cpp out of AllInOneFile.cpp.
Substantially more handling of "arguments": "arguments" works fully
now, but "f.arguments" still doesn't work.
Fixes 10 regression tests.
SunSpider reports no regression.
* kjs/JSActivation.cpp:
(KJS::JSActivation::createArgumentsObject): Reconstruct an arguments
List to pass to the arguments object constructor.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/AllInOneFile.cpp: Removed JSActivation.cpp from AllInOneFile.cpp
because that seems to make GCC happy. (Previously, I had added
JSActivation.cpp to AllInOneFile.cpp because *that* seemed to make GCC
happy. So it goes.)
2008-04-28 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Groundwork for more handling of "arguments". I'm not checking in the
actual handling of "arguments" yet, because it still needs a little
fiddling to avoid a performance regression.
SunSpider reports no change.
* VM/Machine.cpp:
(KJS::initializeCallFrame): Put argc in the register file, so the
arguments object can find it later, to determine arguments.length.
* kjs/nodes.h:
(KJS::FunctionBodyNode::): Added a special code accessor for when you
know the code has already been generated, and you don't have a scopeChain
to supply for potential code generation. (This is the case when the
activation object creates the arguments object.)
2008-04-28 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Replace unsafe use of auto_ptr in Vector with manual memory
management.
* VM/RegisterFileStack.cpp:
(KJS::RegisterFileStack::~RegisterFileStack):
(KJS::RegisterFileStack::popRegisterFile):
* VM/RegisterFileStack.h:
2008-04-27 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Bug 18746: SQUIRRELFISH: indirect eval used when direct eval should be used
<https://bugs.webkit.org/show_bug.cgi?id=18746>
Change the base to the correct value of the 'this' object after the direct
eval test instead of before.
Fixes 5 layout tests.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* kjs/nodes.cpp:
(KJS::EvalFunctionCallNode::emitCode):
2008-04-26 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- document all property getting, setting and deleting opcodes
(And fix function parameter names to match corresponding opcode parameter names.)
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitResolve):
(KJS::CodeGenerator::emitResolveBase):
(KJS::CodeGenerator::emitResolveBaseAndProperty):
(KJS::CodeGenerator::emitResolveBaseAndFunc):
(KJS::CodeGenerator::emitGetPropId):
(KJS::CodeGenerator::emitPutPropId):
(KJS::CodeGenerator::emitDeletePropId):
(KJS::CodeGenerator::emitPutPropVal):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::resolve):
(KJS::resolveBase):
(KJS::resolveBaseAndProperty):
(KJS::resolveBaseAndFunc):
(KJS::Machine::privateExecute):
* kjs/nodes.cpp:
(KJS::ResolveNode::emitCode):
(KJS::ArrayNode::emitCode):
(KJS::PropertyListNode::emitCode):
(KJS::BracketAccessorNode::emitCode):
(KJS::EvalFunctionCallNode::emitCode):
(KJS::FunctionCallResolveNode::emitCode):
(KJS::FunctionCallBracketNode::emitCode):
(KJS::PostIncResolveNode::emitCode):
(KJS::PostDecResolveNode::emitCode):
(KJS::PostIncBracketNode::emitCode):
(KJS::PostDecBracketNode::emitCode):
(KJS::PostIncDotNode::emitCode):
(KJS::PostDecDotNode::emitCode):
(KJS::DeleteResolveNode::emitCode):
(KJS::TypeOfResolveNode::emitCode):
(KJS::PreIncResolveNode::emitCode):
(KJS::PreDecResolveNode::emitCode):
(KJS::PreIncBracketNode::emitCode):
(KJS::PreDecBracketNode::emitCode):
(KJS::AssignResolveNode::emitCode):
(KJS::AssignDotNode::emitCode):
(KJS::ReadModifyDotNode::emitCode):
(KJS::AssignBracketNode::emitCode):
(KJS::ReadModifyBracketNode::emitCode):
(KJS::ConstDeclNode::emitCodeSingle):
2008-04-26 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 18628: SQUIRRELFISH: need to support recursion limit
<https://bugs.webkit.org/show_bug.cgi?id=18628>
Basically completes recursion limiting. There is still some
tuning we may want to do to make things better in the face of
very bad code, but certainly nothing worse than anything already
possible in trunk.
Also fixes a WebKit test by fixing the exception text :D
* JavaScriptCore.exp:
* VM/ExceptionHelpers.cpp:
* VM/Machine.cpp:
(KJS::Machine::execute):
* VM/RegisterFile.cpp:
(KJS::RegisterFile::growBuffer):
(KJS::RegisterFile::addGlobalSlots):
* VM/RegisterFile.h:
(KJS::RegisterFile::grow):
(KJS::RegisterFile::uncheckedGrow):
* VM/RegisterFileStack.cpp:
(KJS::RegisterFileStack::pushRegisterFile):
* VM/RegisterFileStack.h:
2008-04-25 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Bug 18628: SQUIRRELFISH: need to support recursion limit
<https://bugs.webkit.org/show_bug.cgi?id=18628>
Put a limit on the level of reentry recursion. 128 levels of re-entrant recursion
seems reasonable as it is greater than the old eval limit, and a long way short of
the reentry depth needed to overflow the stack.
* VM/Machine.cpp:
(KJS::Machine::execute):
* VM/Machine.h:
2008-04-25 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
A tiny bit of cleanup to the regexp code.
Removed some static_cast.
Removed createRegExpImp because it's no longer used.
2008-04-25 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 18736: SQUIRRELFISH: switch statements with no default have incorrect codegen
<https://bugs.webkit.org/show_bug.cgi?id=18736>
Ensure the "default" target is correct in the absence of an explicit default handler.
* kjs/nodes.cpp:
(KJS::CaseBlockNode::emitCodeForBlock):
2008-04-25 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 18628: SQUIRRELFISH: need to support recursion limit
<https://bugs.webkit.org/show_bug.cgi?id=18628>
More bounds checking.
* VM/Machine.cpp:
(KJS::Machine::execute):
* VM/RegisterFile.cpp:
(KJS::RegisterFile::growBuffer):
* VM/RegisterFile.h:
2008-04-25 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fix signal catching magic
The signal handlers are restored to _exit but are only set when
running under run-javascriptcore-tests. fprintf from a signal
handler is not safe.
* kjs/testkjs.cpp:
(main):
(parseArguments):
* tests/mozilla/jsDriver.pl:
2008-04-25 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Bug 18732: SQUIRRELFISH: exceptions thrown by native constructors are ignored
<https://bugs.webkit.org/show_bug.cgi?id=18732>
Fixes another regression test.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-04-25 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Bug 18728: SQUIRRELFISH: invalid regular expression constants should throw exceptions
<https://bugs.webkit.org/show_bug.cgi?id=18728>
Fixes another regression test.
* kjs/nodes.cpp:
(KJS::RegExpNode::emitCode):
2008-04-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Geoffrey Garen.
Bug 18735: SQUIRRELFISH: closures are sometimes given an incorrect 'this' value when called
<https://bugs.webkit.org/show_bug.cgi?id=18735>
The overloaded toThisObject method was not copied over to JSActivation.
Fixes two regression tests.
* kjs/JSActivation.cpp:
(KJS::JSActivation::toThisObject):
* kjs/JSActivation.h:
2008-04-24 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Added support for arguments.callee.
2008-04-24 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 18628: SQUIRRELFISH: need to support recursion limit
<https://bugs.webkit.org/show_bug.cgi?id=18628>
Partial fix -- this gets us some of the required bounds checking, but not
complete coverage. But it does manage to do them without regressing :D
* VM/ExceptionHelpers.cpp:
(KJS::createError):
(KJS::createStackOverflowError):
* VM/ExceptionHelpers.h:
* VM/Machine.cpp:
(KJS::slideRegisterWindowForCall):
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
* VM/RegisterFile.cpp:
* VM/RegisterFile.h:
(KJS::RegisterFile::):
(KJS::RegisterFile::RegisterFile):
(KJS::RegisterFile::grow):
2008-04-24 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
A tiny bit more handling of "arguments": create a real, but mostly
hollow, arguments object.
Fixes 2 regression tests.
2008-04-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Bug 18717: SQUIRRELFISH: eval returns the wrong value for a variable declaration statement
<https://bugs.webkit.org/show_bug.cgi?id=18717>
Fixes a regression test, but exposes the failure of another due to the
lack of getters and setters.
* kjs/nodes.cpp:
(KJS::ConstDeclNode::emitCodeSingle):
(KJS::ConstDeclNode::emitCode):
(KJS::ConstStatementNode::emitCode):
(KJS::VarStatementNode::emitCode):
* kjs/nodes.h:
2008-04-24 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Print a CRASH statement when crashing, so test failures are not a
mystery.
* kjs/testkjs.cpp:
(handleCrash):
(main):
2008-04-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Geoffrey Garen.
Bug 18716: SQUIRRELFISH: typeof should return undefined for an undefined variable reference
<https://bugs.webkit.org/show_bug.cgi?id=18716>
This fixes 2 more regression tests.
* kjs/nodes.cpp:
(KJS::TypeOfResolveNode::emitCode):
2008-04-24 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Put the callee in the call frame.
Necessary in order to support "arguments" and "arguments.callee".
Also fixes a latent GC bug, where an executing function could be
subject to GC if the register holding it were overwritten. Here's
an example that would have caused problems:
function f()
{
// Flood the machine stack to eliminate any old pointers to f.
g.call({});
// Overwrite f in the register file.
f = 1;
// Force a GC.
for (var i = 0; i < 5000; ++i) {
({});
}
// Welcome to crash-ville.
}
function g()
{
}
f();
* VM/Machine.h: Changed the order of arguments to
execute(FunctionBodyNode*...) to match the other execute functions.
* kjs/function.cpp: Updated to match new argument requirements from
execute(FunctionBodyNode*...). Renamed newObj to thisObj to match the
rest of JavaScriptCore.
SunSpider reports no change.
2008-04-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Bug 18707: SQUIRRELFISH: eval always performs toString() on its argument
<https://bugs.webkit.org/show_bug.cgi?id=18707>
This fixes 4 more regression tests.
* VM/Machine.cpp:
(KJS::eval):
2008-04-23 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fix logic bug in SegmentedVector::grow which would sometimes fail to resize a segment when needed
Fixes 3 JSC tests.
* VM/SegmentedVector.h:
(KJS::SegmentedVector::grow):
2008-04-23 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Degenerate handling of "arguments" as a property of the activation
object. Currently, we just return a vanilla object.
SunSpider reports no change.
Fixes:
ecma_3/Function/regress-94506.js.
Reveals to have been secretly broken:
ecma_3/Function/15.3.4.3-1.js
ecma_3/Function/15.3.4.4-1.js
These tests were passing incorrectly. testkjs creates a global array
named "arguments" to hold command-line arguments. That array was
tricking these tests into thinking that an arguments object with length
0 had been created. Since our new vanilla object shadows the global
property named arguments, that object no longer fools these tests into
passing.
Net change: +1 failing test.
* kjs/AllInOneFile.cpp: Had to put JSActivation.cpp into AllInOneFile.cpp
to solve a surprising 8.6% regression in bitops-3bit-bits-in-byte.
2008-04-23 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- save and restore callFrame
* VM/Machine.cpp:
(KJS::slideRegisterWindowForCall):
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
* kjs/testkjs.cpp:
(main):
2008-04-23 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Fixed scopes for named function expressions.
Fixes one regression test.
Two changes here:
(1) The function's name is supposed to have attributes DontDelete,
ReadOnly, regardless of the type of code executing.
(2) Push the name object on the function's scope chain, rather than
the ExecState's scope chain because, well, that's where it belongs.
2008-04-23 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Inlined JSObject::putDirect, for a .4% SunSpider speedup.
I did this as a first step toward removing nodes.cpp from
AllInOneFile.cpp, but I'm putting that larger project aside for now.
2008-04-23 Maciej Stachowiak <mjs@apple.com>
Rubber stamped by Geoff.
- add OldInterpreterExecState class and use it in dead code
This will allow removing things from the real ExecState class
without having to figure out how to remove all this code without
getting a perf regression.
* kjs/nodes.cpp:
(KJS::ExpressionNode::evaluateToNumber):
(KJS::ExpressionNode::evaluateToBoolean):
(KJS::ExpressionNode::evaluateToInt32):
(KJS::ExpressionNode::evaluateToUInt32):
(KJS::Node::setErrorCompletion):
(KJS::Node::throwError):
(KJS::Node::throwUndefinedVariableError):
(KJS::Node::handleException):
(KJS::Node::rethrowException):
(KJS::BreakpointCheckStatement::execute):
(KJS::BreakpointCheckStatement::optimizeVariableAccess):
(KJS::NullNode::evaluate):
(KJS::FalseNode::evaluate):
(KJS::TrueNode::evaluate):
(KJS::NumberNode::evaluate):
(KJS::NumberNode::evaluateToNumber):
(KJS::NumberNode::evaluateToBoolean):
(KJS::NumberNode::evaluateToInt32):
(KJS::NumberNode::evaluateToUInt32):
(KJS::ImmediateNumberNode::evaluate):
(KJS::ImmediateNumberNode::evaluateToInt32):
(KJS::ImmediateNumberNode::evaluateToUInt32):
(KJS::StringNode::evaluate):
(KJS::StringNode::evaluateToNumber):
(KJS::StringNode::evaluateToBoolean):
(KJS::RegExpNode::evaluate):
(KJS::ThisNode::evaluate):
(KJS::ResolveNode::inlineEvaluate):
(KJS::ResolveNode::evaluate):
(KJS::ResolveNode::evaluateToNumber):
(KJS::ResolveNode::evaluateToBoolean):
(KJS::ResolveNode::evaluateToInt32):
(KJS::ResolveNode::evaluateToUInt32):
(KJS::getSymbolTableEntry):
(KJS::ResolveNode::optimizeVariableAccess):
(KJS::LocalVarAccessNode::inlineEvaluate):
(KJS::LocalVarAccessNode::evaluate):
(KJS::LocalVarAccessNode::evaluateToNumber):
(KJS::LocalVarAccessNode::evaluateToBoolean):
(KJS::LocalVarAccessNode::evaluateToInt32):
(KJS::LocalVarAccessNode::evaluateToUInt32):
(KJS::getNonLocalSymbol):
(KJS::ScopedVarAccessNode::inlineEvaluate):
(KJS::ScopedVarAccessNode::evaluate):
(KJS::ScopedVarAccessNode::evaluateToNumber):
(KJS::ScopedVarAccessNode::evaluateToBoolean):
(KJS::ScopedVarAccessNode::evaluateToInt32):
(KJS::ScopedVarAccessNode::evaluateToUInt32):
(KJS::NonLocalVarAccessNode::inlineEvaluate):
(KJS::NonLocalVarAccessNode::evaluate):
(KJS::NonLocalVarAccessNode::evaluateToNumber):
(KJS::NonLocalVarAccessNode::evaluateToBoolean):
(KJS::NonLocalVarAccessNode::evaluateToInt32):
(KJS::NonLocalVarAccessNode::evaluateToUInt32):
(KJS::ElementNode::optimizeVariableAccess):
(KJS::ElementNode::evaluate):
(KJS::ArrayNode::optimizeVariableAccess):
(KJS::ArrayNode::evaluate):
(KJS::ObjectLiteralNode::optimizeVariableAccess):
(KJS::ObjectLiteralNode::evaluate):
(KJS::PropertyListNode::optimizeVariableAccess):
(KJS::PropertyListNode::evaluate):
(KJS::PropertyNode::optimizeVariableAccess):
(KJS::PropertyNode::evaluate):
(KJS::BracketAccessorNode::optimizeVariableAccess):
(KJS::BracketAccessorNode::inlineEvaluate):
(KJS::BracketAccessorNode::evaluate):
(KJS::BracketAccessorNode::evaluateToNumber):
(KJS::BracketAccessorNode::evaluateToBoolean):
(KJS::BracketAccessorNode::evaluateToInt32):
(KJS::BracketAccessorNode::evaluateToUInt32):
(KJS::DotAccessorNode::optimizeVariableAccess):
(KJS::DotAccessorNode::inlineEvaluate):
(KJS::DotAccessorNode::evaluate):
(KJS::DotAccessorNode::evaluateToNumber):
(KJS::DotAccessorNode::evaluateToBoolean):
(KJS::DotAccessorNode::evaluateToInt32):
(KJS::DotAccessorNode::evaluateToUInt32):
(KJS::ArgumentListNode::optimizeVariableAccess):
(KJS::ArgumentListNode::evaluateList):
(KJS::ArgumentsNode::optimizeVariableAccess):
(KJS::NewExprNode::optimizeVariableAccess):
(KJS::NewExprNode::inlineEvaluate):
(KJS::NewExprNode::evaluate):
(KJS::NewExprNode::evaluateToNumber):
(KJS::NewExprNode::evaluateToBoolean):
(KJS::NewExprNode::evaluateToInt32):
(KJS::NewExprNode::evaluateToUInt32):
(KJS::ExpressionNode::resolveAndCall):
(KJS::EvalFunctionCallNode::optimizeVariableAccess):
(KJS::EvalFunctionCallNode::evaluate):
(KJS::FunctionCallValueNode::optimizeVariableAccess):
(KJS::FunctionCallValueNode::evaluate):
(KJS::FunctionCallResolveNode::optimizeVariableAccess):
(KJS::FunctionCallResolveNode::inlineEvaluate):
(KJS::FunctionCallResolveNode::evaluate):
(KJS::FunctionCallResolveNode::evaluateToNumber):
(KJS::FunctionCallResolveNode::evaluateToBoolean):
(KJS::FunctionCallResolveNode::evaluateToInt32):
(KJS::FunctionCallResolveNode::evaluateToUInt32):
(KJS::LocalVarFunctionCallNode::inlineEvaluate):
(KJS::LocalVarFunctionCallNode::evaluate):
(KJS::LocalVarFunctionCallNode::evaluateToNumber):
(KJS::LocalVarFunctionCallNode::evaluateToBoolean):
(KJS::LocalVarFunctionCallNode::evaluateToInt32):
(KJS::LocalVarFunctionCallNode::evaluateToUInt32):
(KJS::ScopedVarFunctionCallNode::inlineEvaluate):
(KJS::ScopedVarFunctionCallNode::evaluate):
(KJS::ScopedVarFunctionCallNode::evaluateToNumber):
(KJS::ScopedVarFunctionCallNode::evaluateToBoolean):
(KJS::ScopedVarFunctionCallNode::evaluateToInt32):
(KJS::ScopedVarFunctionCallNode::evaluateToUInt32):
(KJS::NonLocalVarFunctionCallNode::inlineEvaluate):
(KJS::NonLocalVarFunctionCallNode::evaluate):
(KJS::NonLocalVarFunctionCallNode::evaluateToNumber):
(KJS::NonLocalVarFunctionCallNode::evaluateToBoolean):
(KJS::NonLocalVarFunctionCallNode::evaluateToInt32):
(KJS::NonLocalVarFunctionCallNode::evaluateToUInt32):
(KJS::FunctionCallBracketNode::optimizeVariableAccess):
(KJS::FunctionCallBracketNode::evaluate):
(KJS::FunctionCallDotNode::optimizeVariableAccess):
(KJS::FunctionCallDotNode::inlineEvaluate):
(KJS::FunctionCallDotNode::evaluate):
(KJS::FunctionCallDotNode::evaluateToNumber):
(KJS::FunctionCallDotNode::evaluateToBoolean):
(KJS::FunctionCallDotNode::evaluateToInt32):
(KJS::FunctionCallDotNode::evaluateToUInt32):
(KJS::PostIncResolveNode::optimizeVariableAccess):
(KJS::PostIncResolveNode::evaluate):
(KJS::PostIncLocalVarNode::evaluate):
(KJS::PostDecResolveNode::optimizeVariableAccess):
(KJS::PostDecResolveNode::evaluate):
(KJS::PostDecLocalVarNode::evaluate):
(KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
(KJS::PostDecLocalVarNode::evaluateToNumber):
(KJS::PostDecLocalVarNode::evaluateToBoolean):
(KJS::PostDecLocalVarNode::evaluateToInt32):
(KJS::PostDecLocalVarNode::evaluateToUInt32):
(KJS::PostfixBracketNode::optimizeVariableAccess):
(KJS::PostIncBracketNode::evaluate):
(KJS::PostDecBracketNode::evaluate):
(KJS::PostfixDotNode::optimizeVariableAccess):
(KJS::PostIncDotNode::evaluate):
(KJS::PostDecDotNode::evaluate):
(KJS::PostfixErrorNode::evaluate):
(KJS::DeleteResolveNode::optimizeVariableAccess):
(KJS::DeleteResolveNode::evaluate):
(KJS::LocalVarDeleteNode::evaluate):
(KJS::DeleteBracketNode::optimizeVariableAccess):
(KJS::DeleteBracketNode::evaluate):
(KJS::DeleteDotNode::optimizeVariableAccess):
(KJS::DeleteDotNode::evaluate):
(KJS::DeleteValueNode::optimizeVariableAccess):
(KJS::DeleteValueNode::evaluate):
(KJS::VoidNode::optimizeVariableAccess):
(KJS::VoidNode::evaluate):
(KJS::TypeOfValueNode::optimizeVariableAccess):
(KJS::TypeOfResolveNode::optimizeVariableAccess):
(KJS::LocalVarTypeOfNode::evaluate):
(KJS::TypeOfResolveNode::evaluate):
(KJS::TypeOfValueNode::evaluate):
(KJS::PreIncResolveNode::optimizeVariableAccess):
(KJS::PreIncLocalVarNode::evaluate):
(KJS::PreIncResolveNode::evaluate):
(KJS::PreDecResolveNode::optimizeVariableAccess):
(KJS::PreDecLocalVarNode::evaluate):
(KJS::PreDecResolveNode::evaluate):
(KJS::PreIncConstNode::evaluate):
(KJS::PreDecConstNode::evaluate):
(KJS::PostIncConstNode::evaluate):
(KJS::PostDecConstNode::evaluate):
(KJS::PrefixBracketNode::optimizeVariableAccess):
(KJS::PreIncBracketNode::evaluate):
(KJS::PreDecBracketNode::evaluate):
(KJS::PrefixDotNode::optimizeVariableAccess):
(KJS::PreIncDotNode::evaluate):
(KJS::PreDecDotNode::evaluate):
(KJS::PrefixErrorNode::evaluate):
(KJS::UnaryPlusNode::optimizeVariableAccess):
(KJS::UnaryPlusNode::evaluate):
(KJS::UnaryPlusNode::evaluateToBoolean):
(KJS::UnaryPlusNode::evaluateToNumber):
(KJS::UnaryPlusNode::evaluateToInt32):
(KJS::UnaryPlusNode::evaluateToUInt32):
(KJS::NegateNode::optimizeVariableAccess):
(KJS::NegateNode::evaluate):
(KJS::NegateNode::evaluateToNumber):
(KJS::BitwiseNotNode::optimizeVariableAccess):
(KJS::BitwiseNotNode::inlineEvaluateToInt32):
(KJS::BitwiseNotNode::evaluate):
(KJS::BitwiseNotNode::evaluateToNumber):
(KJS::BitwiseNotNode::evaluateToBoolean):
(KJS::BitwiseNotNode::evaluateToInt32):
(KJS::BitwiseNotNode::evaluateToUInt32):
(KJS::LogicalNotNode::optimizeVariableAccess):
(KJS::LogicalNotNode::evaluate):
(KJS::LogicalNotNode::evaluateToBoolean):
(KJS::MultNode::optimizeVariableAccess):
(KJS::MultNode::inlineEvaluateToNumber):
(KJS::MultNode::evaluate):
(KJS::MultNode::evaluateToNumber):
(KJS::MultNode::evaluateToBoolean):
(KJS::MultNode::evaluateToInt32):
(KJS::MultNode::evaluateToUInt32):
(KJS::DivNode::optimizeVariableAccess):
(KJS::DivNode::inlineEvaluateToNumber):
(KJS::DivNode::evaluate):
(KJS::DivNode::evaluateToNumber):
(KJS::DivNode::evaluateToInt32):
(KJS::DivNode::evaluateToUInt32):
(KJS::ModNode::optimizeVariableAccess):
(KJS::ModNode::inlineEvaluateToNumber):
(KJS::ModNode::evaluate):
(KJS::ModNode::evaluateToNumber):
(KJS::ModNode::evaluateToBoolean):
(KJS::ModNode::evaluateToInt32):
(KJS::ModNode::evaluateToUInt32):
(KJS::throwOutOfMemoryErrorToNumber):
(KJS::addSlowCase):
(KJS::addSlowCaseToNumber):
(KJS::add):
(KJS::addToNumber):
(KJS::AddNode::optimizeVariableAccess):
(KJS::AddNode::evaluate):
(KJS::AddNode::inlineEvaluateToNumber):
(KJS::AddNode::evaluateToNumber):
(KJS::AddNode::evaluateToInt32):
(KJS::AddNode::evaluateToUInt32):
(KJS::AddNumbersNode::inlineEvaluateToNumber):
(KJS::AddNumbersNode::evaluate):
(KJS::AddNumbersNode::evaluateToNumber):
(KJS::AddNumbersNode::evaluateToInt32):
(KJS::AddNumbersNode::evaluateToUInt32):
(KJS::AddStringsNode::evaluate):
(KJS::AddStringLeftNode::evaluate):
(KJS::AddStringRightNode::evaluate):
(KJS::SubNode::optimizeVariableAccess):
(KJS::SubNode::inlineEvaluateToNumber):
(KJS::SubNode::evaluate):
(KJS::SubNode::evaluateToNumber):
(KJS::SubNode::evaluateToInt32):
(KJS::SubNode::evaluateToUInt32):
(KJS::LeftShiftNode::optimizeVariableAccess):
(KJS::LeftShiftNode::inlineEvaluateToInt32):
(KJS::LeftShiftNode::evaluate):
(KJS::LeftShiftNode::evaluateToNumber):
(KJS::LeftShiftNode::evaluateToInt32):
(KJS::LeftShiftNode::evaluateToUInt32):
(KJS::RightShiftNode::optimizeVariableAccess):
(KJS::RightShiftNode::inlineEvaluateToInt32):
(KJS::RightShiftNode::evaluate):
(KJS::RightShiftNode::evaluateToNumber):
(KJS::RightShiftNode::evaluateToInt32):
(KJS::RightShiftNode::evaluateToUInt32):
(KJS::UnsignedRightShiftNode::optimizeVariableAccess):
(KJS::UnsignedRightShiftNode::inlineEvaluateToUInt32):
(KJS::UnsignedRightShiftNode::evaluate):
(KJS::UnsignedRightShiftNode::evaluateToNumber):
(KJS::UnsignedRightShiftNode::evaluateToInt32):
(KJS::UnsignedRightShiftNode::evaluateToUInt32):
(KJS::lessThan):
(KJS::lessThanEq):
(KJS::LessNode::optimizeVariableAccess):
(KJS::LessNode::inlineEvaluateToBoolean):
(KJS::LessNode::evaluate):
(KJS::LessNode::evaluateToBoolean):
(KJS::LessNumbersNode::inlineEvaluateToBoolean):
(KJS::LessNumbersNode::evaluate):
(KJS::LessNumbersNode::evaluateToBoolean):
(KJS::LessStringsNode::inlineEvaluateToBoolean):
(KJS::LessStringsNode::evaluate):
(KJS::LessStringsNode::evaluateToBoolean):
(KJS::GreaterNode::optimizeVariableAccess):
(KJS::GreaterNode::inlineEvaluateToBoolean):
(KJS::GreaterNode::evaluate):
(KJS::GreaterNode::evaluateToBoolean):
(KJS::LessEqNode::optimizeVariableAccess):
(KJS::LessEqNode::inlineEvaluateToBoolean):
(KJS::LessEqNode::evaluate):
(KJS::LessEqNode::evaluateToBoolean):
(KJS::GreaterEqNode::optimizeVariableAccess):
(KJS::GreaterEqNode::inlineEvaluateToBoolean):
(KJS::GreaterEqNode::evaluate):
(KJS::GreaterEqNode::evaluateToBoolean):
(KJS::InstanceOfNode::optimizeVariableAccess):
(KJS::InstanceOfNode::evaluate):
(KJS::InstanceOfNode::evaluateToBoolean):
(KJS::InNode::optimizeVariableAccess):
(KJS::InNode::evaluate):
(KJS::InNode::evaluateToBoolean):
(KJS::EqualNode::optimizeVariableAccess):
(KJS::EqualNode::inlineEvaluateToBoolean):
(KJS::EqualNode::evaluate):
(KJS::EqualNode::evaluateToBoolean):
(KJS::NotEqualNode::optimizeVariableAccess):
(KJS::NotEqualNode::inlineEvaluateToBoolean):
(KJS::NotEqualNode::evaluate):
(KJS::NotEqualNode::evaluateToBoolean):
(KJS::StrictEqualNode::optimizeVariableAccess):
(KJS::StrictEqualNode::inlineEvaluateToBoolean):
(KJS::StrictEqualNode::evaluate):
(KJS::StrictEqualNode::evaluateToBoolean):
(KJS::NotStrictEqualNode::optimizeVariableAccess):
(KJS::NotStrictEqualNode::inlineEvaluateToBoolean):
(KJS::NotStrictEqualNode::evaluate):
(KJS::NotStrictEqualNode::evaluateToBoolean):
(KJS::BitAndNode::optimizeVariableAccess):
(KJS::BitAndNode::evaluate):
(KJS::BitAndNode::inlineEvaluateToInt32):
(KJS::BitAndNode::evaluateToNumber):
(KJS::BitAndNode::evaluateToBoolean):
(KJS::BitAndNode::evaluateToInt32):
(KJS::BitAndNode::evaluateToUInt32):
(KJS::BitXOrNode::optimizeVariableAccess):
(KJS::BitXOrNode::inlineEvaluateToInt32):
(KJS::BitXOrNode::evaluate):
(KJS::BitXOrNode::evaluateToNumber):
(KJS::BitXOrNode::evaluateToBoolean):
(KJS::BitXOrNode::evaluateToInt32):
(KJS::BitXOrNode::evaluateToUInt32):
(KJS::BitOrNode::optimizeVariableAccess):
(KJS::BitOrNode::inlineEvaluateToInt32):
(KJS::BitOrNode::evaluate):
(KJS::BitOrNode::evaluateToNumber):
(KJS::BitOrNode::evaluateToBoolean):
(KJS::BitOrNode::evaluateToInt32):
(KJS::BitOrNode::evaluateToUInt32):
(KJS::LogicalAndNode::optimizeVariableAccess):
(KJS::LogicalAndNode::evaluate):
(KJS::LogicalAndNode::evaluateToBoolean):
(KJS::LogicalOrNode::optimizeVariableAccess):
(KJS::LogicalOrNode::evaluate):
(KJS::LogicalOrNode::evaluateToBoolean):
(KJS::ConditionalNode::optimizeVariableAccess):
(KJS::ConditionalNode::evaluate):
(KJS::ConditionalNode::evaluateToBoolean):
(KJS::ConditionalNode::evaluateToNumber):
(KJS::ConditionalNode::evaluateToInt32):
(KJS::ConditionalNode::evaluateToUInt32):
(KJS::valueForReadModifyAssignment):
(KJS::ReadModifyResolveNode::optimizeVariableAccess):
(KJS::AssignResolveNode::optimizeVariableAccess):
(KJS::ReadModifyLocalVarNode::evaluate):
(KJS::AssignLocalVarNode::evaluate):
(KJS::ReadModifyConstNode::evaluate):
(KJS::AssignConstNode::evaluate):
(KJS::ReadModifyResolveNode::evaluate):
(KJS::AssignResolveNode::evaluate):
(KJS::AssignDotNode::optimizeVariableAccess):
(KJS::AssignDotNode::evaluate):
(KJS::ReadModifyDotNode::optimizeVariableAccess):
(KJS::ReadModifyDotNode::evaluate):
(KJS::AssignErrorNode::evaluate):
(KJS::AssignBracketNode::optimizeVariableAccess):
(KJS::AssignBracketNode::evaluate):
(KJS::ReadModifyBracketNode::optimizeVariableAccess):
(KJS::ReadModifyBracketNode::evaluate):
(KJS::CommaNode::optimizeVariableAccess):
(KJS::CommaNode::evaluate):
(KJS::ConstDeclNode::optimizeVariableAccess):
(KJS::ConstDeclNode::handleSlowCase):
(KJS::ConstDeclNode::evaluateSingle):
(KJS::ConstDeclNode::evaluate):
(KJS::ConstStatementNode::optimizeVariableAccess):
(KJS::ConstStatementNode::execute):
(KJS::statementListExecute):
(KJS::BlockNode::optimizeVariableAccess):
(KJS::BlockNode::execute):
(KJS::EmptyStatementNode::execute):
(KJS::ExprStatementNode::optimizeVariableAccess):
(KJS::ExprStatementNode::execute):
(KJS::VarStatementNode::optimizeVariableAccess):
(KJS::VarStatementNode::execute):
(KJS::IfNode::optimizeVariableAccess):
(KJS::IfNode::execute):
(KJS::IfElseNode::optimizeVariableAccess):
(KJS::IfElseNode::execute):
(KJS::DoWhileNode::optimizeVariableAccess):
(KJS::DoWhileNode::execute):
(KJS::WhileNode::optimizeVariableAccess):
(KJS::WhileNode::execute):
(KJS::ForNode::optimizeVariableAccess):
(KJS::ForNode::execute):
(KJS::ForInNode::optimizeVariableAccess):
(KJS::ForInNode::execute):
(KJS::ContinueNode::execute):
(KJS::BreakNode::execute):
(KJS::ReturnNode::optimizeVariableAccess):
(KJS::ReturnNode::execute):
(KJS::WithNode::optimizeVariableAccess):
(KJS::WithNode::execute):
(KJS::CaseClauseNode::optimizeVariableAccess):
(KJS::CaseClauseNode::evaluate):
(KJS::CaseClauseNode::executeStatements):
(KJS::ClauseListNode::optimizeVariableAccess):
(KJS::CaseBlockNode::optimizeVariableAccess):
(KJS::CaseBlockNode::executeBlock):
(KJS::SwitchNode::optimizeVariableAccess):
(KJS::SwitchNode::execute):
(KJS::LabelNode::optimizeVariableAccess):
(KJS::LabelNode::execute):
(KJS::ThrowNode::optimizeVariableAccess):
(KJS::ThrowNode::execute):
(KJS::TryNode::optimizeVariableAccess):
(KJS::TryNode::execute):
(KJS::ProgramNode::initializeSymbolTable):
(KJS::ScopeNode::optimizeVariableAccess):
(KJS::ProgramNode::processDeclarations):
(KJS::EvalNode::processDeclarations):
(KJS::ProgramNode::execute):
(KJS::EvalNode::execute):
(KJS::FunctionBodyNodeWithDebuggerHooks::execute):
(KJS::FuncDeclNode::execute):
(KJS::FuncExprNode::evaluate):
* kjs/nodes.h:
(KJS::Node::):
(KJS::FalseNode::):
(KJS::TrueNode::):
(KJS::ArgumentsNode::):
2008-04-23 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Bug 18672: SQUIRRELFISH: codegen fails with a large number of temporaries
<https://bugs.webkit.org/show_bug.cgi?id=18672>
Add a SegmentedVector type, which provides a Vector<T> which maintains
existing memory locations during resize. This allows dynamically sizing
local, temporary and label "vectors" in CodeGenerator.
* JavaScriptCore.xcodeproj/project.pbxproj:
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::addVar):
(KJS::CodeGenerator::CodeGenerator):
(KJS::CodeGenerator::newTemporary):
(KJS::CodeGenerator::newLabel):
* VM/CodeGenerator.h:
* VM/SegmentedVector.h: Added.
(KJS::SegmentedVector::SegmentedVector):
(KJS::SegmentedVector::~SegmentedVector):
(KJS::SegmentedVector::last):
(KJS::SegmentedVector::append):
(KJS::SegmentedVector::removeLast):
(KJS::SegmentedVector::size):
(KJS::SegmentedVector::operator[]):
(KJS::SegmentedVector::resize):
(KJS::SegmentedVector::shrink):
(KJS::SegmentedVector::grow):
2008-04-23 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
A little refactoring in preparation for supporting 'arguments'.
Fixes 2 regression tests.
SunSpider reports no change.
We now check the activation register, instead of the codeBlock, to
determine whether we need to tear off the activation. This is to support
"f.arguments", which will create an activation/arguments pair for f,
even though the needsFullScopeChain flag is false for f's codeBlock.
The test fixes resulted from calling initializeCallFrame for re-entrant
function code, instead of initializing (not enough) parts of the call
frame by hand.
2008-04-22 Maciej Stachowiak <mjs@apple.com>
Reviewed by Sam.
- propagate the "this" value properly to local eval
(fixes a measly one regression test)
* VM/CodeBlock.h:
(KJS::CodeBlock::CodeBlock):
(KJS::ProgramCodeBlock::ProgramCodeBlock):
(KJS::EvalCodeBlock::EvalCodeBlock):
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-04-22 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Add support for function declarations in eval code.
(this fixes 12 more regression tests)
* VM/CodeBlock.h:
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::CodeGenerator):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::execute):
* kjs/nodes.cpp:
(KJS::EvalNode::generateCode):
2008-04-22 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Implement LabelNode.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::pushJumpContext):
(KJS::CodeGenerator::jumpContextForContinue):
(KJS::CodeGenerator::jumpContextForBreak):
* VM/CodeGenerator.h:
* kjs/nodes.cpp:
(KJS::DoWhileNode::emitCode):
(KJS::WhileNode::emitCode):
(KJS::ForNode::emitCode):
(KJS::ForInNode::emitCode):
(KJS::ContinueNode::emitCode):
(KJS::BreakNode::emitCode):
(KJS::SwitchNode::emitCode):
(KJS::LabelNode::emitCode):
2008-04-22 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fixed crash when unwinding from exceptions inside eval.
* VM/Machine.cpp:
(KJS::Machine::unwindCallFrame): Don't assume that the top of the
current call frame's scope chain is an activation: it can be the global
object, instead.
2008-04-22 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
* kjs/testkjs.cpp:
(main): Convert signals to exit codes, so that crashing tests are
detected as regression test failures.
2008-04-22 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt and Maciej Stachowiak.
Renamed "needsActivation" to "needsFullScopeChain" because lying will
make hair grow on the backs of your hands.
2008-04-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Fixed ScopeChainNode lifetime problems:
(1) In "with" and "catch" scopes, we would construct a ScopeChain
object and then jump across its destructor, leaking the ScopeChainNode
we had pushed.
(2) In global and eval scopes, we would fail to initially ref
"scopeChain", causing us to overrelease it later. Now that we ref
"scopeChain" properly, we also need to deref it when the script
terminates.
SunSpider reports a .2% regression, but an earlier round of ScopeChain
refactoring was a .4% speedup, so there.
2008-04-22 Maciej Stachowiak <mjs@apple.com>
Reviewed by Alexey.
- use global object instead of null for "this" on unqualified calls
This fixes 10 more JSC test regressions.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-04-22 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- throw proper exceptions for objects that don't implement call or construct
This fixes 21 more JSC test regressions. It is also seemingly an
0.5% progression.
* VM/ExceptionHelpers.cpp:
(KJS::createNotAnObjectError):
(KJS::createNotAConstructorError):
(KJS::createNotAFunctionError):
* VM/ExceptionHelpers.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-04-21 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Implement emitCode for ConstDeclNode.
This fixes the crash (assertion) in js1_5/Scope/scope-001.js
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::registerForLocalConstInit):
* VM/CodeGenerator.h:
* kjs/nodes.cpp:
(KJS::AssignResolveNode::emitCode):
(KJS::ConstDeclNode::emitCodeSingle):
(KJS::ConstDeclNode::emitCode):
(KJS::ConstStatementNode::emitCode):
* kjs/nodes.h:
2008-04-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Sam.
- add some support for the split window object
This fixes many layout tests.
* VM/Machine.cpp:
(KJS::resolveBaseAndFunc): Use toThisObject() to ensure we get the
wrapper global, if one exists, as the "this" object.
* kjs/function.cpp:
(KJS::globalFuncEval): Use toGlobalObject() to handle the wrapper
case properly.
2008-04-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- restore ScopeChain::operator= to avoid crash on many layout tests
Otherwise, FunctionImp::setScope would cause a reference
underflow. I implemented using the copy construct and swap idiom.
* kjs/scope_chain.h:
(KJS::ScopeChain::swap):
(KJS::ScopeChain::operator=):
2008-04-21 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Bug 18649: SQUIRRELFISH: correctly handle exceptions in eval code
<https://bugs.webkit.org/show_bug.cgi?id=18649>
Allocate a callframe for eval() and initialise with a null codeBlock to
indicate native code. This prevents the unwinder from clobbering the
register stack.
* VM/Machine.cpp:
(KJS::Machine::execute):
2008-04-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Removed ScopeChain::push(ScopeChain&) because it was unused. Moved
ScopeChain::print to ScopeChainNode.
ScopeChain is now nothing more than a resource-handling wrapper around
ScopeChainNode.
2008-04-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Bug 18671: SquirrelFish: continue inside switch fails
<https://bugs.webkit.org/show_bug.cgi?id=18671>
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::jumpContextForLabel):
* VM/CodeGenerator.h:
* kjs/nodes.cpp:
(KJS::ContinueNode::emitCode):
2008-04-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Moved push(JSObject*) and pop() from ScopeChain to ScopeChainNode,
rearranging scope_chain.h a bit.
SunSpider reports no change.
2008-04-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Moved bottom() from ScopeChain to ScopeChainNode, simplifying it based
on the knowledge that the ScopeChain is never empty.
SunSpider reports no change.
2008-04-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Moved begin() and end() from ScopeChain to ScopeChainNode.
Also marked a few methods "const".
SunSpider reports no change.
2008-04-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Turned ScopeChain::depth into a stand-alone function, and simplified it
a bit.
I also moved ScopeChain::depth to Machine.cpp because it doesn't report
the true depth of the ScopeChain -- just the Machine's perspective of
its depth within a given call frame.
SunSpider reports no change.
2008-04-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Removed indirection in ScopeChain::ref / ScopeChain::deref.
SunSpider reports no change.
* kjs/scope_chain.h:
(KJS::ScopeChain::ScopeChain):
(KJS::ScopeChain::~ScopeChain):
(KJS::ScopeChain::clear):
2008-04-21 Oliver Hunt <oliver@apple.com>
Fix debug build
* kjs/nodes.cpp:
(KJS::ConstDeclNode::evaluateSingle):
2008-04-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Bug 18664: SQUIRRELFISH: correctly throw a SyntaxError when parsing of eval code fails
<https://bugs.webkit.org/show_bug.cgi?id=18664>
Correctly throw a SyntaxError when parsing of eval code fails.
* VM/Machine.cpp:
(KJS::eval):
2008-04-21 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Partial fix for Bug 18649: SQUIRRELFISH: correctly handle exceptions in eval code
Make sure we correct the register state before jumping to vm_throw.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-04-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Simplified ScopeChain ref/deref.
SunSpider reports a .4% speedup.
* kjs/scope_chain.h:
(KJS::ScopeChainNode::ref): Removed this function because it was nonsense.
ScopeChainNodes are initialized with a refCount of 1, so the loop was
guaranteed to iterate exactly once.
2008-04-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Removed support for empty ScopeChains.
SunSpider reports no change.
2008-04-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Removed some completely unused ScopeChain member functions.
SunSpider reports no change.
2008-04-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Avoid creating unnecessary ScopeChain objects, to reduce refcount churn.
SunSpider reports no change.
2008-04-21 Maciej Stachowiak <mjs@apple.com>
Rubber stamped by Alexey.
Add some braces.x
* kjs/testkjs.cpp:
(runWithScripts):
2008-04-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- only print "End:" output when -d flag is passed.
This fixes half of our failing JSC regression tests.
* kjs/testkjs.cpp:
(runWithScripts):
2008-04-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Add support for variable declarations in eval code.
* VM/CodeBlock.h:
(KJS::EvalCodeBlock::EvalCodeBlock):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::CodeGenerator):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::execute):
* VM/Machine.h:
* kjs/function.cpp:
(KJS::globalFuncEval):
* kjs/nodes.cpp:
(KJS::EvalNode::generateCode):
* kjs/nodes.h:
(KJS::EvalNode::):
2008-04-20 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Throw exceptions for invalid continue, break, and return statements.
Simple refactoring and extension of Cameron's AssignErrorNode, etc patch
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::CodeGenerator):
(KJS::CodeGenerator::pushJumpContext):
(KJS::CodeGenerator::popJumpContext):
(KJS::CodeGenerator::jumpContextForLabel):
* VM/CodeGenerator.h:
* kjs/nodes.cpp:
(KJS::Node::emitThrowError):
(KJS::ContinueNode::emitCode):
(KJS::BreakNode::emitCode):
(KJS::ReturnNode::emitCode):
* kjs/nodes.h:
2008-04-20 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Removed Machine.cpp from AllInOneFile.cpp, and manually inlined a few
things that used to be inlined automatically.
1.9% speedup on SunSpider.
My hope is that we'll face fewer surprises in Machine.cpp codegen, now
that GCC is making fewer decisions. The speedup seems to confirm that.
2008-04-20 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 18642: Iterator context may get placed into the return register, leading to much badness
<https://bugs.webkit.org/show_bug.cgi?id=18642>
To prevent incorrectly reusing what will become the result register for
eval and global code execution, we need to request and ref the destination
in advance of codegen. Unfortunately this may lead to unnecessary copying,
although in future we can probably limit this. Curiously SunSpider shows
a progression in a number of tests, although it comes out as a wash overall.
* kjs/nodes.cpp:
(KJS::EvalNode::emitCode):
(KJS::ProgramNode::emitCode):
2008-04-20 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Add support for AssignErrorNode, PrefixErrorNode, and PostfixErrorNode.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitCreateError):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::PostfixErrorNode::emitCode):
(KJS::PrefixErrorNode::emitCode):
(KJS::AssignErrorNode::emitCode):
* kjs/nodes.h:
2008-04-20 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff and Mark.
Provide line number information in exceptions
Simple patch, adds line number information metadata to CodeBlock
and a simple method to get the line number responsible for a given
Instruction*.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::lineNumberForVPC):
* VM/CodeBlock.h:
* VM/CodeGenerator.h:
(KJS::CodeGenerator::emitNode):
* VM/Machine.cpp:
(KJS::Machine::throwException):
2008-04-20 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Provide "sourceURL" in exceptions
* VM/CodeBlock.h:
* VM/Machine.cpp:
(KJS::Machine::throwException):
* kjs/nodes.cpp:
(KJS::EvalNode::generateCode):
(KJS::ProgramNode::generateCode):
2008-04-19 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Don't call emitCode directly on subnodes, instead use CodeGenerator::emitNode
This patch just a preparation for tracking line numbers.
* kjs/nodes.cpp:
(KJS::ObjectLiteralNode::emitCode):
(KJS::PropertyListNode::emitCode):
(KJS::ArgumentListNode::emitCode):
(KJS::TryNode::emitCode):
2008-04-19 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 18619: Support continue, break, and return in try .. finally blocks
<https://bugs.webkit.org/show_bug.cgi?id=18619>
This patch replaces the current partial finally support (which uses code
duplication to achieve what it does) with a subroutine based approach.
This has a number of advantages over code duplication:
* Reduced code size
* Simplified exception handling as the finaliser code only exists in
one place, so no "magic" is needed to get the correct handler for a
finaliser.
* When we support instruction to line number mapping we won't need to
worry about the dramatic code movement caused by duplication
On the downside it is necessary to add two new opcodes, op_jsr and op_sret
to enter and exit the finaliser subroutines, happily SunSpider reports
a performance progression (gcc amazes me) and ubench reports a wash.
While jsr and sret provide a mechanism that allows us to enter and exit
any arbitrary finaliser we need to, it was still necessary to increase
the amount of information tracked when entering and exiting both finaliser
scopes and dynamic scopes ("with"). This means "scopeDepth" is now
the combination of "finaliserDepth" and "dynamicScopeDepth". We also
now use a scopeContextStack to ensure that we pop scopes and execute
finalisers in the correct order. This increases the cost of "with" nodes
during codegen, but it should not be significant enough to effect real
world performance and greatly simplifies codegen for return, break and
continue when interacting with finalisers.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
Pretty printing of jsr/sret opcodes
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::CodeGenerator):
(KJS::CodeGenerator::emitPushScope):
(KJS::CodeGenerator::emitPopScope):
Dynamic scopes need to be tracked on the scopeContextStack now
(KJS::CodeGenerator::pushFinallyContext):
(KJS::CodeGenerator::popFinallyContext):
Handle entry and exit from code regions with finalisers. This is
needed solely to support return, continue and break inside finaliser
regions.
(KJS::CodeGenerator::emitComplexJumpScopes):
Helper function for emitJumpScopes to handle the complex codegen
needed to handle return, continue and break inside a finaliser region
(KJS::CodeGenerator::emitJumpScopes):
Updated to be aware of finalisers, if a cross-scope jump occurs inside
a finaliser we hand off codegen to emitComplexJumpScopes, otherwise
we can handle the normal (trivial) case with a single instruction.
(KJS::CodeGenerator::emitJumpSubroutine):
(KJS::CodeGenerator::emitSubroutineReturn):
Trivial opcode emitter functions.
* VM/CodeGenerator.h:
(KJS::CodeGenerator::scopeDepth):
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
Implement op_jsr and op_sret.
* VM/Opcode.h:
Ad op_jsr and op_sret
* kjs/nodes.cpp:
(KJS::TryNode::emitCode):
Fix codegen for new finaliser model.
2008-04-17 Mark Rowe <mrowe@apple.com>
Rubber-stamped by Oliver Hunt.
Remove unnecessary files from testkjs, testapi and minidom targets.
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-04-17 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fixed ASSERT seen during run-sunspider of a debug build.
* VM/CodeGenerator.h: Made the default codegen buffers bigger. SunSpider
runs all tests in one global environment, so you end up with more than
128 locals. This is just a stop-gap until we code up a real
solution to arbitrary symbol and label limits.
2008-04-17 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fixed a bug in exception unwinding, where we wouldn't deref the scope
chain in global scope, so we would leak ScopeChainNodes when exceptions
were thrown inside "with" and "catch" scopes.
Also did some cleanup of the unwinding code along the way.
Scope chain reference counting is still wrong in a few ways. I thought
I would fix this portion of it first.
run-sunspider shows no change.
* VM/Machine.cpp:
(KJS::Machine::unwindCallFrame):
(KJS::Machine::throwException):
(KJS::Machine::privateExecute):
* VM/Machine.h:
2008-04-17 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Add more exception checking to toNumber conversions
This corrects op_pre_dec, op_negate, op_mod and op_sub.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-04-17 Geoffrey Garen <ggaren@apple.com> and Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver Hunt.
Behold: eval.
Introduced a new opcode: op_call_eval. In the normal case, it performs
an eval. In the case where eval has been overridden in some way, it
performs a function call.
* VM/CodeGenerator.h: Added a feature so the code generator knows not
to optimized locals in eval code.
2008-04-17 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Added some ASSERTs to document codegen failures in
run-javascriptcore-tests.
For all tests, program-level codegen now either succeeds, or fails with
an ASSERT.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::addVar):
(KJS::CodeGenerator::CodeGenerator):
(KJS::CodeGenerator::newTemporary):
(KJS::CodeGenerator::newLabel):
2008-04-17 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Fixed another case of a dst register being an unreferenced temporary
(caused an ASSERT when running the full sunspider suite).
* kjs/nodes.cpp:
(KJS::CaseBlockNode::emitCodeForBlock):
2008-04-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- add documentation (and meaningful parameter names) for arithmetic and bitwise binary ops
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitMul):
(KJS::CodeGenerator::emitDiv):
(KJS::CodeGenerator::emitMod):
(KJS::CodeGenerator::emitSub):
(KJS::CodeGenerator::emitLeftShift):
(KJS::CodeGenerator::emitRightShift):
(KJS::CodeGenerator::emitUnsignedRightShift):
(KJS::CodeGenerator::emitBitAnd):
(KJS::CodeGenerator::emitBitXOr):
(KJS::CodeGenerator::emitBitOr):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::MultNode::emitCode):
(KJS::DivNode::emitCode):
(KJS::ModNode::emitCode):
(KJS::SubNode::emitCode):
(KJS::LeftShiftNode::emitCode):
(KJS::RightShiftNode::emitCode):
(KJS::UnsignedRightShiftNode::emitCode):
(KJS::BitAndNode::emitCode):
(KJS::BitXOrNode::emitCode):
(KJS::BitOrNode::emitCode):
(KJS::emitReadModifyAssignment):
(KJS::ReadModifyResolveNode::emitCode):
2008-04-16 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Exception checks for toNumber in op_pre_inc
This is somewhat more convoluted than the simple hadException checks
we currently use. Instead we use special toNumber conversions that
select between the exception and ordinary vPC. This allows us to
remove any branches in the common case (incrementing a number).
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(KJS::::toNumber):
* ChangeLog:
* JavaScriptCore.exp:
* JavaScriptCore.xcodeproj/project.pbxproj:
* VM/JSPropertyNameIterator.cpp:
(KJS::JSPropertyNameIterator::toNumber):
* VM/JSPropertyNameIterator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState):
* kjs/ExecState.h:
* kjs/JSNotAnObject.cpp:
(KJS::JSNotAnObject::toNumber):
* kjs/JSNotAnObject.h:
* kjs/internal.cpp:
(KJS::StringImp::toNumber):
(KJS::NumberImp::toNumber):
(KJS::GetterSetterImp::toNumber):
* kjs/internal.h:
* kjs/object.cpp:
(KJS::JSObject::toNumber):
* kjs/object.h:
* kjs/value.h:
(KJS::JSValue::toNumber):
2008-04-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- ensure that activations are kept in a register to protect them from GC
Also renamed OptionalCalleeScopeChain constant to OptionalCalleeActivation, since
that is what is now kept there, and there is no more need to keep the scope chain in
the register file.
* VM/Machine.cpp:
(KJS::initializeCallFrame):
(KJS::scopeChainForCall):
* VM/Machine.h:
(KJS::Machine::):
2008-04-16 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Made "this" work in program code / global scope.
The machine can initialize "this" prior to execution because it knows
that, for program code, "this" is always stored in lr1.
* VM/Machine.cpp:
(KJS::Machine::execute):
* VM/Machine.h:
(KJS::Machine::):
* kjs/interpreter.cpp:
(KJS::Interpreter::evaluate):
2008-04-16 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fixed a codegen bug when returning from inside a dynamic scope (a with
or catch block): we need to pop any dynamic scope(s) that have been
added so op_ret can find the activation object at the top of the scope
chain.
* kjs/nodes.cpp:
(KJS::ReturnNode::emitCode): If we're returning from inside a dynamic
scope, emit a jmp_scopes to take care of popping any dynamic scope(s)
and then branching to the return instruction.
2008-04-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- document the add and get_prop_id opcodes
In addition to adding documentation in comments, I changed
references to register IDs or indices relating to these opcodes to
have meaningful names instead of r0 r1 r2.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitAdd):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* kjs/nodes.cpp:
(KJS::DotAccessorNode::emitCode):
(KJS::FunctionCallDotNode::emitCode):
(KJS::PostIncDotNode::emitCode):
(KJS::PostDecDotNode::emitCode):
(KJS::PreIncDotNode::emitCode):
(KJS::PreDecDotNode::emitCode):
(KJS::AddNode::emitCode):
(KJS::ReadModifyDotNode::emitCode):
2008-04-15 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt and Maciej Stachowiak.
Fixed a codegen bug in with and switch, and added an ASSERT to
make sure it doesn't happen again.
emitCode() assumes that dst, if non-zero, is either referenced or
non-temporary (i.e., it assumes that newTemporary() will return a
register not equal to dst). Certain callers to emitCode() weren't
guaranteeing that to be so, so temporary register values were being
overwritten.
* VM/CodeGenerator.h:
(KJS::CodeGenerator::emitNode): ASSERT that dst is referenced or non-temporary.
* kjs/nodes.cpp:
(KJS::CommaNode::emitCode): Reference the dst we pass.
(KJS::WithNode::emitCode): No need to pass an explicit dst register.
(KJS::CaseBlockNode::emitCodeForBlock): No need to pass an explicit dst register.
(KJS::SwitchNode::emitCode): No need to pass an explicit dst register.
* kjs/nodes.h: Made dst the last parameter to emitCodeForBlock, to match
emitCode.
2008-04-15 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 18526: Throw exceptions when resolve fails for op_resolve_base_and_func.
<https://bugs.webkit.org/show_bug.cgi?id=18526>
Very simple fix, sunspider shows a 0.7% progression, ubench shows a 0.4% regression.
* VM/Machine.cpp:
(KJS::resolveBaseAndFunc):
(KJS::Machine::privateExecute):
2008-04-15 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fix incorrect result on 3d-raytrace test
Oliver found and tracked down this bug, I just typed in the fix.
* VM/Machine.cpp:
(KJS::slideRegisterWindowForCall): When setting omitted parameters to undefined,
account for the space for local variables.
2008-04-15 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fix codegen handling of dst registers
1.006x speedup (not sure why).
Most emitCode functions take an optional "dst" parameter that says
where the output of the instruction should be written. I made some
functions for convenient handling of the dst register:
* VM/CodeGenerator.h:
(KJS::CodeGenerator::tempDestination): Takes the dst register. Returns it if
it is not null and is a temporary, otherwise allocates a new temporary. This is
intended for cases where an intermediate value might be written into the dst
(KJS::CodeGenerator::finalDestination): Takes the dst register and an optional
register that was used as a temp destination. Picks the right thing for the final
output. Intended to be used as the output register for the instruction that generates
the final value of a particular node.
(KJS::CodeGenerator::moveToDestinationIfNeeded): Takes dst and a
RegisterID; moves from the register to dst if dst is defined and
different from the register. This is intended for cases where the
result of a node is already in a specific register (likely a
local), and so no code needs to be generated unless a specific
destination has been requested, in which case a move is needed.
I also applied these methods throughout emitCode functions. In
some cases this was just cleanup, in other cases I fixed actual
codegen bugs. Below I have given specific comments for the cases
where I believe I fixed a codegen bug, or improved quality of codegen.
* kjs/nodes.cpp:
(KJS::NullNode::emitCode):
(KJS::FalseNode::emitCode):
(KJS::TrueNode::emitCode):
(KJS::NumberNode::emitCode):
(KJS::StringNode::emitCode):
(KJS::RegExpNode::emitCode):
(KJS::ThisNode::emitCode): Now avoids emitting a mov when dst is
the same as the this register (the unlikely case of "this = this");
(KJS::ResolveNode::emitCode): Now avoids emitting a mov when dst
is the same as the local regiester, in the local var case (the
unlikely case of "x = x");
(KJS::ArrayNode::emitCode): Fixed a codegen bug where array
literal element expressions may have observed an intermediate
value of constructing the array.
(KJS::ObjectLiteralNode::emitCode):
(KJS::PropertyListNode::emitCode): Fixed a codegen bug where object literal
property definition expressions may have obesrved an intermediate value of
constructing the object.
(KJS::BracketAccessorNode::emitCode):
(KJS::DotAccessorNode::emitCode):
(KJS::NewExprNode::emitCode):
(KJS::FunctionCallValueNode::emitCode):
(KJS::FunctionCallBracketNode::emitCode):
(KJS::FunctionCallDotNode::emitCode):
(KJS::PostIncResolveNode::emitCode):
(KJS::PostDecResolveNode::emitCode):
(KJS::PostIncBracketNode::emitCode):
(KJS::PostDecBracketNode::emitCode):
(KJS::PostIncDotNode::emitCode):
(KJS::PostDecDotNode::emitCode):
(KJS::DeleteResolveNode::emitCode):
(KJS::DeleteBracketNode::emitCode):
(KJS::DeleteDotNode::emitCode):
(KJS::DeleteValueNode::emitCode):
(KJS::VoidNode::emitCode):
(KJS::TypeOfResolveNode::emitCode):
(KJS::TypeOfValueNode::emitCode):
(KJS::PreIncResolveNode::emitCode): Fixed a codegen bug where the final
value would not be output to the dst register in the local var case.
(KJS::PreDecResolveNode::emitCode): Fixed a codegen bug where the final
value would not be output to the dst register in the local var case.
(KJS::PreIncBracketNode::emitCode):
(KJS::PreDecBracketNode::emitCode):
(KJS::PreIncDotNode::emitCode):
(KJS::PreDecDotNode::emitCode):
(KJS::UnaryPlusNode::emitCode):
(KJS::NegateNode::emitCode):
(KJS::BitwiseNotNode::emitCode):
(KJS::LogicalNotNode::emitCode):
(KJS::MultNode::emitCode):
(KJS::DivNode::emitCode):
(KJS::ModNode::emitCode):
(KJS::AddNode::emitCode):
(KJS::SubNode::emitCode):
(KJS::LeftShiftNode::emitCode):
(KJS::RightShiftNode::emitCode):
(KJS::UnsignedRightShiftNode::emitCode):
(KJS::LessNode::emitCode):
(KJS::GreaterNode::emitCode):
(KJS::LessEqNode::emitCode):
(KJS::GreaterEqNode::emitCode):
(KJS::InstanceOfNode::emitCode):
(KJS::InNode::emitCode):
(KJS::EqualNode::emitCode):
(KJS::NotEqualNode::emitCode):
(KJS::StrictEqualNode::emitCode):
(KJS::NotStrictEqualNode::emitCode):
(KJS::BitAndNode::emitCode):
(KJS::BitXOrNode::emitCode):
(KJS::BitOrNode::emitCode):
(KJS::LogicalAndNode::emitCode):
(KJS::LogicalOrNode::emitCode):
(KJS::ConditionalNode::emitCode):
(KJS::emitReadModifyAssignment): Allow an out argument separate from the operands,
needed for fixes below.
(KJS::ReadModifyResolveNode::emitCode): Fixed a codegen bug where the right side of
the expression may observe an intermediate value.
(KJS::AssignResolveNode::emitCode): Fixed a codegen bug where the right side of the
expression may observe an intermediate value.
(KJS::ReadModifyDotNode::emitCode): Fixed a codegen bug where the right side of the
expression may observe an intermediate value.
(KJS::ReadModifyBracketNode::emitCode): Fixed a codegen bug where the right side of the
expression may observe an intermediate value.
(KJS::CommaNode::emitCode): Avoid writing temporary value to dst register.
(KJS::ReturnNode::emitCode): Void return should return undefined, not null.
(KJS::FuncExprNode::emitCode):
2008-04-15 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- fix huge performance regression (from trunk) in string-unpack-code
This restores string-unpack-code performance to parity with
trunk (2.27x speedup relative to previous SquirrelFish)
* VM/Machine.cpp:
(KJS::Machine::execute): Shrink register file after call to avoid
growing repeatedly.
2008-04-15 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Fixed dumpCallFrame to match our new convention of passing around a
ScopeChainNode* instead of a ScopeChain*.
* JavaScriptCore.exp:
* VM/Machine.cpp:
(KJS::Machine::dumpCallFrame):
* VM/Machine.h:
2008-04-15 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 18436: Need to throw exception on read/modify/write or similar resolve for nonexistent property
<https://bugs.webkit.org/show_bug.cgi?id=18436>
Add op_resolve_base_and_property for read/modify/write operations,
this adds a "superinstruction" to resolve the base and value of a
property simultaneously. Just using resolveBase and resolve results
in an 5% regression in ubench, 30% in loop-empty-resolve (which is
expected). 1.3% progression in sunspider, 2.1% in ubench, with a
21% gain in loop-empty-resolve. The only outlier is function-missing-args
which gets a 3% regression that I could never resolve.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitResolveBaseAndProperty):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::resolveBaseAndProperty):
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::PostIncResolveNode::emitCode):
(KJS::PostDecResolveNode::emitCode):
(KJS::PreIncResolveNode::emitCode):
(KJS::PreDecResolveNode::emitCode):
(KJS::ReadModifyResolveNode::emitCode):
2008-04-15 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fixed "SquirrelFish crashes due to bad scope chain on some SunSpider tests"
https://bugs.webkit.org/show_bug.cgi?id=18508
3d-raytrace and string-unpack-code now run.
The basic approach is to pass around ScopeChainNode* instead of
ScopeChain*, which in addition to not becoming suddenly an invalid
pointer also saves an indirection.
This is an 0.4% speedup on SunSpider --squirrelfish (1.8% on --ubench)
* VM/Machine.cpp:
(KJS::resolve):
(KJS::resolveBase):
(KJS::resolveBaseAndFunc):
(KJS::initializeCallFrame):
(KJS::scopeChainForCall):
(KJS::Machine::unwindCallFrame):
(KJS::Machine::throwException):
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
* VM/Machine.h:
* VM/Register.h:
(KJS::Register::):
* kjs/nodes.cpp:
(KJS::EvalNode::generateCode):
(KJS::FunctionBodyNode::generateCode):
(KJS::ProgramNode::generateCode):
(KJS::ProgramNode::processDeclarations):
(KJS::EvalNode::processDeclarations):
(KJS::FuncDeclNode::makeFunction):
(KJS::FuncExprNode::makeFunction):
* kjs/nodes.h:
(KJS::ProgramNode::):
(KJS::EvalNode::):
(KJS::FunctionBodyNode::):
* kjs/object.h:
* kjs/scope_chain.h:
(KJS::ScopeChainNode::ScopeChainNode):
(KJS::ScopeChainNode::deref):
(KJS::ScopeChainIterator::ScopeChainIterator):
(KJS::ScopeChainIterator::operator*):
(KJS::ScopeChainIterator::operator->):
(KJS::ScopeChain::ScopeChain):
(KJS::ScopeChain::node):
(KJS::ScopeChain::deref):
(KJS::ScopeChain::ref):
(KJS::ScopeChainNode::ref):
(KJS::ScopeChainNode::release):
(KJS::ScopeChainNode::begin):
(KJS::ScopeChainNode::end):
2008-04-14 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fixed crash when accessing registers in a torn-off activation object.
* kjs/JSActivation.cpp:
(KJS::JSActivation::copyRegisters): Update our registerOffset after
copying our registers, since our offset should now be relative to
our private register array, not the shared register file.
2008-04-14 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fix a codegen flaw that makes some tests run way too fast or way too slow
The basic problem was that FunctionCallResolveNode results in
codegen which can incorrectly write an intermediate value into the
dst register even when that is a local. I added convenience
functions to CodeGenerator for getting this right, but for now I
only fixed FunctionCallResolve.
* VM/CodeGenerator.h:
(KJS::CodeGenerator::tempDestination):
(KJS::CodeGenerator::):
* kjs/nodes.cpp:
(KJS::FunctionCallResolveNode::emitCode):
2008-04-14 Gabor Loki <loki@inf.u-szeged.hu>
Reviewed and slightly tweaked by Geoffrey Garen.
Bug 18489: Squirrelfish doesn't build on linux
<https://bugs.webkit.org/show_bug.cgi?id=18489>
* JavaScriptCore.pri: Add VM into include path and its files into
source set
* VM/JSPropertyNameIterator.cpp: Fix include name
* VM/Machine.cpp: Add UNLIKELY macro for GCC
* VM/Machine.h: Add missing includes
* VM/RegisterFile.cpp: Add missing include
* kjs/testkjs.pro: Add VM into include path
2008-04-14 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Restored OwnPtr in some places where I had removed it previously. We
can have an OwnPtr to an undefined class in a header as long as the
class's destructor isn't in the header.
2008-04-14 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Fixed access to "this" inside dynamic scopes.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::registerForLocal): Always return a register for
"this", even if we're not optimizing access to other locals. Because
"this" is a keyword, it's always in a register and always accessible.
* VM/CodeGenerator.h:
(KJS::CodeGenerator::shouldOptimizeLocals): Factored out a function
for determining whether we should optimize access to locals, since
eval will need to make this test a little more complicated.
2008-04-14 Maciej Stachowiak <mjs@apple.com>
Reviewed by Adam.
- fix crash when running SunSpider full harness
When growing the register file's buffer to make space for new globals,
make sure to copy accounting for the fact that the new space is logically
at the beginning of the buffer in this case, instead of at the end as when
growing for a new call frame.
* VM/RegisterFile.cpp:
(KJS::RegisterFile::newBuffer):
(KJS::RegisterFile::growBuffer):
(KJS::RegisterFile::addGlobalSlots):
* VM/RegisterFile.h:
2008-04-11 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Mark constant pools for global and eval code (collectively known as
"program code"). (Constant pools for function code are already marked by
their functions.)
The global object is responsible for marking program code constant
pools. Code blocks add themselves to the mark set at creation time, and
remove themselves from the mark set at destruction time.
sunspider --squirrelfish reports a 1% speedup, perhaps because
generateCode() is now non-virtual.
* kjs/nodes.cpp: I had to use manual init and delete in this file
because putting an OwnPtr into the header would have created a circular
header dependency.
2008-04-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Bug 18231: Improve support for function call nodes in SquirrelFish
<https://bugs.webkit.org/show_bug.cgi?id=18231>
Use correct value of 'this' for function calls.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitResolveBaseAndFunc):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::resolveBaseAndFunc):
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::FunctionCallResolveNode::emitCode):
2008-04-10 Geoffrey Garen <ggaren@apple.com>
This time for sure.
* kjs/interpreter.cpp:
(KJS::Interpreter::evaluate):
2008-04-10 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Fixed Interpreter::execute to honor the new model for returning non-NULL
values when an exception is thrown.
* kjs/interpreter.cpp:
(KJS::Interpreter::evaluate):
2008-04-10 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Fix SquirrelFish interpreter to pass internal exceptions back to
native code correctly.
* JavaScriptCore.xcodeproj/project.pbxproj:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-04-10 Sam Weinig <sam@webkit.org>
Reviewed by Geoffrey Garen.
Replace the use of getCallData in op_construct with the new
getConstructData function that replaces implementsConstruct.
* API/JSCallbackConstructor.cpp:
(KJS::JSCallbackConstructor::getConstructData):
* API/JSCallbackConstructor.h:
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(KJS::::getConstructData):
(KJS::::construct):
* API/JSObjectRef.cpp:
(JSObjectIsConstructor):
* JavaScriptCore.exp:
* JavaScriptCore.xcodeproj/project.pbxproj:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* kjs/CallData.h:
* kjs/ConstructData.h: Copied from JavaScriptCore/kjs/CallData.h.
* kjs/array_object.cpp:
(KJS::ArrayObjectImp::getConstructData):
* kjs/array_object.h:
* kjs/bool_object.cpp:
(KJS::BooleanObjectImp::getConstructData):
* kjs/bool_object.h:
* kjs/date_object.cpp:
(KJS::DateObjectImp::getConstructData):
* kjs/date_object.h:
* kjs/error_object.cpp:
(KJS::ErrorObjectImp::getConstructData):
(KJS::NativeErrorImp::getConstructData):
* kjs/error_object.h:
* kjs/function.cpp:
(KJS::FunctionImp::getCallData):
(KJS::FunctionImp::getConstructData):
(KJS::FunctionImp::construct):
* kjs/function.h:
* kjs/function_object.cpp:
(KJS::FunctionObjectImp::getConstructData):
* kjs/function_object.h:
* kjs/nodes.cpp:
(KJS::NewExprNode::inlineEvaluate):
* kjs/number_object.cpp:
(KJS::NumberObjectImp::getConstructData):
* kjs/number_object.h:
* kjs/object.cpp:
* kjs/object.h:
* kjs/object_object.cpp:
(KJS::ObjectObjectImp::getConstructData):
* kjs/object_object.h:
* kjs/regexp_object.cpp:
(KJS::RegExpObjectImp::getConstructData):
* kjs/regexp_object.h:
* kjs/string_object.cpp:
(KJS::StringObjectImp::getConstructData):
* kjs/string_object.h:
* kjs/value.cpp:
(KJS::JSCell::getConstructData):
* kjs/value.h:
(KJS::JSValue::getConstructData):
2008-04-10 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Bug 18420: SquirrelFish: need to throw Reference and Type errors
when attempting invalid operations on JSValues
Add validation and exception checks to SquirrelFish so that the
correct exceptions are thrown for undefined variables, type errors
and toObject failure. Also handle exceptions thrown by native
function calls.
* JavaScriptCore.xcodeproj/project.pbxproj:
* VM/ExceptionHelpers.cpp: Added.
(KJS::substitute):
(KJS::createError):
(KJS::createUndefinedVariableError):
* VM/ExceptionHelpers.h: Added.
Helper functions
* VM/Machine.cpp:
(KJS::resolve):
Modified to signal failure
(KJS::isNotObject):
Wrapper for JSValue::isObject and exception creation (these need
to be merged, lest GCC go off the deep end)
(KJS::Machine::privateExecute):
Adding the many exception and validity checks.
* kjs/JSNotAnObject.cpp: Added.
Stub object used to reduce the need for multiple exception checks
when toObject fails.
(KJS::JSNotAnObject::toPrimitive):
(KJS::JSNotAnObject::getPrimitiveNumber):
(KJS::JSNotAnObject::toBoolean):
(KJS::JSNotAnObject::toNumber):
(KJS::JSNotAnObject::toString):
(KJS::JSNotAnObject::toObject):
(KJS::JSNotAnObject::mark):
(KJS::JSNotAnObject::getOwnPropertySlot):
(KJS::JSNotAnObject::put):
(KJS::JSNotAnObject::deleteProperty):
(KJS::JSNotAnObject::defaultValue):
(KJS::JSNotAnObject::construct):
(KJS::JSNotAnObject::callAsFunction):
(KJS::JSNotAnObject::getPropertyNames):
* kjs/JSNotAnObject.h: Added.
(KJS::JSNotAnObject::JSNotAnObject):
* kjs/JSImmediate.cpp:
(KJS::JSImmediate::toObject):
modified to create an JSNotAnObject rather than throwing an exception
directly.
2008-04-10 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Pass a function body node its function's scope chain, rather than the
current execution context's scope chain, when compiling it.
This doesn't matter yet, but it will once we start using the scope
chain during compilation.
sunspider --squirrelfish notes a tiny speedup.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-04-10 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fix two bugs when throwing exceptions from re-entrant JS calls:
(1) Don't shrink the register file to 0, since our caller may still
be using it.
(2) In case of exception, return jsNull() instead of 0 because,
surprisingly, some JavaScriptCore clients rely on a function's return
value being safe to operate on even if the function threw an exception.
Also:
- Changed FunctionImp::callAsFunction to honor the new semantics of
exceptions not returning 0.
- Renamed "handlerPC" to "handlerVPC" to match other uses of "VPC".
- Renamed "exceptionData" to "exceptionValue", because "data" seemed to
imply something more than just a JSValue.
- Merged prepareException into throwException, since throwException was
its only caller, and it seemed weird that throwException didn't take
an exception as an argument.
sunspider --squirrelfish does not seem to complain on my machine, but it
complains a little (.6%) on Oliver's.
2008-04-10 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Fixed op_construct for CallTypeNative to reacquire "r" before setting
its return value, since registerBase can theoretically change during the
execution of arbitrary code. (Not sure if any native constructors
actually make this possible.)
sunspider --squirrelfish does not seem to complain.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-04-10 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt and Sam Weinig.
Re-entrant execution of function code (global code -> built-in function
-> JS function):
Miraculously, sunspider --squirrelfish does not seem to complain.
A re-entrant function call is the same as a normal function call with
one exception: the re-entrant call leaves everything except for
CallerCodeBlock in the call frame header uninitialized, since the call
doesn't need to return to JS code. (It sets CallerCodeBlock to 0, to
indicate that the call shouldn't return to JS code.)
Also fixed a few issues along the way:
- Fixed two bugs in the read-write List implementation that caused
m_size and m_buffer to go stale.
- Changed native call code to update "r" *before* setting the return
value, since the call may in turn call JS code, which changes the value
of "r".
- Migrated initialization of "r" outside of Machine::privateExecute,
because global code and function code initialize "r" differently.
- Migrated a codegen warning from Machine::privateExecute to the wiki.
- Removed unnecessary "r" parameter from slideRegisterWindowForCall
* VM/Machine.cpp:
(KJS::slideRegisterWindowForCall):
(KJS::scopeChainForCall):
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
* VM/Machine.h:
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction):
* kjs/list.cpp:
(KJS::List::getSlice):
* kjs/list.h:
(KJS::List::clear):
2008-04-10 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fix problem with code generation for return with no argument
3d-cube now runs
* kjs/nodes.cpp:
(KJS::ReturnNode::emitCode):
2008-04-10 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- Implement support for JS constructors
access-binary-trees and access-nbody now run.
Inexplicably a 1% speedup.
* VM/Machine.cpp:
(KJS::initializeCallFrame):
(KJS::Machine::privateExecute):
* VM/Machine.h:
(KJS::Machine::):
2008-04-10 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- More code cleanup in preparation for JS constructors
Factor the remaining interesting parts of JS function calls into
slideRegisterWindowForCall and scopeChainForCall.
* VM/Machine.cpp:
(KJS::slideRegisterWindowForCall):
(KJS::scopeChainForCall):
(KJS::Machine::privateExecute):
2008-04-10 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- Code cleanup in preparation for JS constructors
- Renamed returnInfo to callFrame.
- Made an enum which defines what goes where in the call frame.
- Factored out initializeCallFrame function from op_call
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitCall):
(KJS::CodeGenerator::emitConstruct):
* VM/Machine.cpp:
(KJS::Machine::dumpRegisters):
(KJS::initializeCallFrame):
(KJS::Machine::unwindCallFrame):
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
* VM/Machine.h:
(KJS::Machine::):
2008-04-10 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fixed two bugs in register allocation for function calls:
(1) op_call used to allocate codeBlock->numVars too many registers for
each call frame, due to duplicated math. Fixing this revealed...
(2) By unconditionally calling resize(), op_call used to truncate the
register file when calling a function whose registers fit wholly within
the register file already allocated by its caller.
sunspider --squirrelfish reports no regression.
I also threw in a little extra formatting to dumpCallFrame, because it
helped me debug these issues.
* VM/Machine.cpp:
(KJS::Machine::dumpRegisters):
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
* VM/RegisterFile.h:
(KJS::RegisterFile::shrink):
(KJS::RegisterFile::grow):
* VM/RegisterFileStack.cpp:
(KJS::RegisterFileStack::popRegisterFile):
2008-04-09 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Next step toward re-entrant execution of function code (global code ->
built-in function -> JS function):
Made op_ret return from Machine::privateExecute if its calling codeBlock
is NULL.
I'm checking this in by itself to demonstrate that a more clever
mechanism is not necessary for performance.
sunspider --squirrelfish reports no regression.
* ChangeLog:
* VM/Machine.cpp:
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
2008-04-09 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Next step toward re-entrant execution of function code (global code ->
built-in function -> JS function):
Made Machine::execute return a value.
Sketched out some code for Machine::execute for functions -- still
doesn't work yet, though.
sunspider --squirrelfish reports no regression.
* VM/Machine.cpp:
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
* VM/Machine.h:
* kjs/interpreter.cpp:
(KJS::Interpreter::evaluate):
* kjs/testkjs.cpp:
(runWithScripts):
2008-04-09 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
First step toward re-entrant execution of function code (global code ->
built-in function -> JS function):
Tiny bit of refactoring in the Machine class.
sunspider --squirrelfish reports no regression.
* VM/Machine.cpp:
(KJS::Machine::dumpRegisters):
(KJS::Machine::unwindCallFrame):
(KJS::Machine::execute):
(KJS::Machine::privateExecute):
* VM/Machine.h:
(KJS::Machine::isGlobalCallFrame):
* kjs/interpreter.cpp:
(KJS::Interpreter::evaluate):
2008-04-08 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Support for re-entrant execution of global code (global code -> built-in
function -> global code).
Keep a stack of register files instead of just one. Globals propogate
between register files as the register files enter and exit the stack.
An activation still uses its own register file's base as its
registerBase, but the global object uses the register file *stack*'s
registerBase, which updates dynamically to match the register file at
the top of the stack.
sunspider --squirrelfish reports no regression.
2008-04-08 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- initial preparatory work for JS constructors
1) Allocate registers for the returnInfo block and "this" value when generating code for
op_construct. These are not used yet, but the JS branch of op_construct will use them.
2) Adjust argc and argv appropriately for native constructor calls.
3) Assign return value in a more straightforward way in op_ret since this is actually
a bit faster (and makes up for the allocation of extra registers above).
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitConstruct):
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-04-07 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Fixed crashing SunSpider tests.
Let's just pretend this never happened, bokay?
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::CodeGenerator):
* VM/CodeGenerator.h:
* VM/RegisterFile.cpp:
(KJS::RegisterFile::addGlobals):
2008-04-07 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Restored dumping of generated code as a command-line switch:
run-testkjs -d will do it.
2008-04-07 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Next step toward supporting re-entrant evaluation: Moved register file
maintenance code into a proper "RegisterFile" class.
There's a subtle change to the register file's internal layout: for
global code / the global object, registerOffset is always 0 now. In
other words, all register counting starts at 0, not 0 + (number of
global variables). The helps simplify accounting when the number of
global variables changes.
2008-04-07 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Bug 18338: Support exceptions in SquirrelFish <http://bugs.webkit.org/show_bug.cgi?id=18338>
Initial support for exceptions in SquirrelFish, only supports finalisers in the
simple cases (eg. exceptions and non-goto/return across finaliser boundaries).
This doesn't add the required exception checks to existing code, it merely adds
support for throw, catch, and the required stack unwinding.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
(KJS::CodeBlock::getHandlerForVPC):
* VM/CodeBlock.h:
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitCatch):
(KJS::CodeGenerator::emitThrow):
* VM/CodeGenerator.h:
* VM/JSPropertyNameIterator.cpp:
(KJS::JSPropertyNameIterator::create):
* VM/Machine.cpp:
(KJS::prepareException):
(KJS::Machine::unwindCallFrame):
(KJS::Machine::throwException):
(KJS::Machine::privateExecute):
* VM/Machine.h:
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::ThrowNode::emitCode):
(KJS::TryNode::emitCode):
* kjs/nodes.h:
* kjs/scope_chain.cpp:
(KJS::ScopeChain::depth):
* kjs/scope_chain.h:
2008-04-06 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
First step toward supporting re-entrant evaluation: Switch register
clients from using "registers", a pointer to a register vector, to
"registerBase", an indirect pointer to the logical first entry in the
register file. (The logical first entry is the first entry that is not
a global variable).
With a vector, offsets into the register file remain good when the
underlying buffer reallocates, but they go bad when the logical
first entry moves. (The logical first entry moves when new global
variables get added to the beginning of the register file.) With an
indirect pointer to the logical first entry, offsets will remain good
regardless.
1.4% speedup on sunspider --squirrelfish. I suspect this is due to
reduced allocation when creating closures, and reduced indirection
through the register vector.
* wtf/Vector.h: Added an accessor for an indirect pointer to the vector's
buffer, which we currently use (incorrectly) for registerBase. This is
temporary scaffolding to allow us to change client code without
changing behavior.
2008-04-06 Sam Weinig <sam@webkit.org>
Reviewed by Oliver Hunt.
Implement codegen for ReadModifyDotNode.
* kjs/nodes.cpp:
(KJS::ReadModifyDotNode::emitCode):
* kjs/nodes.h:
2008-04-06 Sam Weinig <sam@webkit.org>
Reviewed by Oliver Hunt.
Fix codegen for PostIncDotNode and implement codegen for PostIncBracketNode,
PostDecBracketNode and PostDecDotNode.
* kjs/nodes.cpp:
(KJS::PostIncBracketNode::emitCode):
(KJS::PostDecBracketNode::emitCode):
(KJS::PostIncDotNode::emitCode):
(KJS::PostDecDotNode::emitCode):
* kjs/nodes.h:
2008-04-06 Sam Weinig <sam@webkit.org>
Reviewed by Geoffrey Garen.
Implement codegen for PreDecResolveNode, PreIncBracketNode, PreDecBracketNode,
PreIncDotNode and PreDecDotNode. This required adding one new op code, op_pre_dec.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitPreDec):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::PreDecResolveNode::emitCode):
(KJS::PreIncBracketNode::emitCode):
(KJS::PreDecBracketNode::emitCode):
(KJS::PreIncDotNode::emitCode):
(KJS::PreDecDotNode::emitCode):
* kjs/nodes.h:
2008-04-06 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Improved register dumping, plus a liberal smattering of "const". Here's
what the new format looks like:
(gdb) call (void)dumpCallFrame(codeBlock, scopeChain, registers->begin(), r)
4 instructions; 48 bytes at 0x509210; 3 locals (2 parameters); 1 temporaries
[ 0] load lr1, undefined(@k0)
[ 3] load lr1, 2(@k1)
[ 6] add tr0, lr2, lr1
[ 10] ret tr0
Constants:
k0 = undefined
k1 = 2
Register frame:
----------------------------------------
use | address | value
----------------------------------------
[return info] | 0x80ac08 | 0x5081c0
[return info] | 0x80ac0c | 0x508e90
[return info] | 0x80ac10 | 0x504acc
[return info] | 0x80ac14 | 0x2
[return info] | 0x80ac18 | 0x0
[return info] | 0x80ac1c | 0x7
[return info] | 0x80ac20 | 0x0
----------------------------------------
[param] | 0x80ac24 | 0x1
[param] | 0x80ac28 | 0x7
[var] | 0x80ac2c | 0xb
[temp] | 0x80ac30 | 0xf
2008-04-06 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Support for evaluating multiple scripts in the same global environment.
(Still don't support re-entrant evaluation yet.)
The main changes here are:
(1) Obey the ECMA 10.1.3 rules regarding how to resolve collisions when
a given symbol is declared more than once. (This patch fixes the same
issue for function code, too.)
(2) In the case of var and/or function collisions, reuse the existing
storage slot. For global code, this is required for previously
generated instructions to continue to work. For function code, it's
more of a "nice to have": it makes register layout in the case of
collisions easier to understand, and has the added benefit of saving
memory.
(3) Allocate slots in the CodeGenerator's m_locals vector in parallel
to register indexes in the symbol table. This ensures that, given an
index in the symbol table, we can find the corresponding RegisterID
without hashing, which speeds up codegen.
I moved responsibility for emitting var and function initialization
instructions into the CodeGenerator, because bookkeeping in cases where
var, function, and/or parameter names collide requires a lot of
internal knowledge about the CodeGenerator.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::addVar): Removed responsibility for checking whether
a var declaration overwrites "arguments", because the check is
inappropriate for global code, which may not have a pre-existing
"arguments" symbol in scope. Also changed this function to return a
boolean indicating whether addVar actually created a new RegisterID,
or just reused an old one.
(KJS::CodeGenerator::CodeGenerator): Split out the constructors for
function code and global code, since they're quite different now.
(KJS::CodeGenerator::registerForLocal): This function does its job
without any hashing now.
* VM/Machine.cpp: Move old globals and update "r" before executing a
new script. That way, old globals stay at a constant offset from "r",
and previously optimized code still works.
* VM/RegisterID.h: Added the ability to allocate a RegisterID before
initializing its index field. We use this for parameters now.
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::symbolTableGet): Changed the ungettable getter
ASSERT to account for the fact that symbol indexes are all negative.
2008-04-05 Sam Weinig <sam@webkit.org>
Reviewed by Geoffrey Garen.
Implement codegen for InNode.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitIn):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::InNode::emitCode):
* kjs/nodes.h:
2008-04-05 Sam Weinig <sam@webkit.org>
Reviewed by Oliver Hunt.
- Implement codegen for DeleteResolveNode, DeleteBracketNode, DeleteDotNode and DeleteValueNode.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitGetPropId):
(KJS::CodeGenerator::emitPutPropId):
(KJS::CodeGenerator::emitDeletePropId):
(KJS::CodeGenerator::emitDeletePropVal):
(KJS::CodeGenerator::emitPutPropIndex):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::DeleteResolveNode::emitCode):
(KJS::DeleteBracketNode::emitCode):
(KJS::DeleteDotNode::emitCode):
(KJS::DeleteValueNode::emitCode):
* kjs/nodes.h:
2008-04-04 Sam Weinig <sam@webkit.org>
Reviewed by Oliver Hunt.
- Implement codegen for Switch statements.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::pushJumpContext):
(KJS::CodeGenerator::popJumpContext):
(KJS::CodeGenerator::jumpContextForLabel):
* VM/CodeGenerator.h:
Rename LoopContext to JumpContext now that it used of Switch statements in addition
to loops.
* kjs/nodes.cpp:
(KJS::DoWhileNode::emitCode):
(KJS::WhileNode::emitCode):
(KJS::ForNode::emitCode):
(KJS::ForInNode::emitCode):
(KJS::ContinueNode::emitCode):
(KJS::BreakNode::emitCode):
(KJS::CaseBlockNode::emitCodeForBlock):
(KJS::SwitchNode::emitCode):
* kjs/nodes.h:
(KJS::CaseClauseNode::expr):
(KJS::CaseClauseNode::children):
(KJS::CaseBlockNode::):
2008-04-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Sam.
- fix crash in codegen from new nodes
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitConstruct):
* kjs/nodes.h:
2008-04-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
* kjs/nodes.cpp:
(KJS::ReadModifyResolveNode::emitCode):
(KJS::ReadModifyBracketNode::emitCode):
* kjs/nodes.h:
2008-04-02 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- take a shot at marking constant pools for global and eval code
Geoff says this won't really work in all cases but is an ok stopgap.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::mark):
2008-04-02 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- fix 2x perf regression in 3d-morph
* VM/Machine.cpp:
(KJS::Machine::privateExecute): If we subbed in null for the global object,
don't toObject it, since that will throw an exception (very slowly).
2008-04-02 Maciej Stachowiak <mjs@apple.com>
Rubber stamped by Geoff
- fix Release build
* kjs/nodes.cpp:
(KJS::getNonLocalSymbol):
2008-04-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Removed the last vestiges of LocalStorage from JSVariableObject and
JSGlobalObject.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::saveLocalStorage): Save and restore from/to
registers. Use stub isReadOnly and isDontEnum methods for now, until
we really implement attributes in the symbol table.
(KJS::JSGlobalObject::restoreLocalStorage):
(KJS::JSGlobalObject::reset):
* kjs/JSVariableObject.cpp:
(KJS::JSVariableObject::getPropertyNames): Use stub isDontEnum method
for now, as above.
(KJS::JSVariableObject::getPropertyAttributes): ditto
* kjs/JSVariableObject.h: Removed LocalStorage from JSVariableObjectData.
Removed mark method, because subclasses implement different strategies for
marking registers.
(KJS::JSVariableObject::isReadOnly): Stub method
(KJS::JSVariableObject::isDontEnum): ditto
Changed the code below to ASSERT_NOT_REACHED() and return 0, since it
can no longer retrieve LocalStorage from the ExecState. (Eventually,
we'll just remove this code and all its friends, but that's a task for
later.)
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState):
* kjs/function.cpp:
(KJS::ActivationImp::markChildren):
* kjs/function.h:
* kjs/nodes.cpp:
(KJS::getNonLocalSymbol):
(KJS::ScopeNode::optimizeVariableAccess):
(KJS::ProgramNode::processDeclarations):
2008-04-01 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Got globals?
To get things working, I had to roll out
http://trac.webkit.org/projects/webkit/changeset/31226 for the time
being.
* VM/CodeBlock.h: Removed obsolete function.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): For the sake of re-entrancy, we track
and restore the global object's old rOffset value. (No way to test this
yet, but I think it will work.)
2008-04-01 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- mark the constant pool (at least for function code blocks)
* VM/CodeBlock.cpp:
(KJS::CodeBlock::mark):
* VM/CodeBlock.h:
* kjs/function.cpp:
(KJS::FunctionImp::mark):
* kjs/nodes.cpp:
(KJS::ScopeNode::mark):
* kjs/nodes.h:
(KJS::FuncExprNode::body):
(KJS::FuncDeclNode::body):
2008-04-01 Geoffrey Garen <ggaren@apple.com>
Reviewed by Beth Dakin.
Cleaned up a few loose ends.
* JavaScriptCore.exp: Export dumpRegisters, so it's visible to gdb even
if we don't explicitly call it in the source text.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): No need to call dumpRegisters anymore,
since that was just a hack for gdb's sake.
* kjs/JSActivation.h: Removed obsolete comment.
* VM/CodeGenerator.cpp: Added ASSERTs to verify that the localCount
we're given matches the number of locals actually allocated.
* VM/CodeGenerator.h:
(KJS::CodeGenerator::CodeGenerator): Changed "localCount" to include
the parameter count, since we're using the word "local" to mean
parameter, var, function, or "this". Renamed "m_nextLocal" to
"m_nextVar", since "m_nextLocal" doesn't contrast well with
"m_nextParameter".
Also moved tracking of implicit "this" parameter from here...
* kjs/nodes.cpp:
(KJS::FunctionBodyNode::generateCode): ... to here
(KJS::ProgramNode::generateCode): ... and here
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump): Added missing "\n".
2008-04-01 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Bug 18274: ResolveNode::emitCode() doesn't make a new temporary when dst
is 0, leading to incorrect codegen
<http://bugs.webkit.org/show_bug.cgi?id=18274>
* kjs/nodes.cpp:
(KJS::FunctionCallBracketNode::emitCode):
(KJS::FunctionCallDotNode::emitCode):
2008-04-01 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fix bug in for..in codegen (gotta use ident, not m_ident)
* kjs/nodes.cpp:
(KJS::ForInNode::emitCode):
2008-04-01 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- Add suport for regexp literals
* VM/CodeBlock.cpp:
(KJS::regexpToSourceString):
(KJS::regexpName):
(KJS::CodeBlock::dump):
* VM/CodeBlock.h:
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::addRegExp):
(KJS::CodeGenerator::emitNewRegExp):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::RegExpNode::emitCode):
* kjs/nodes.h:
2008-04-01 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff
Add support for for..in nodes
Added two new opcodes to get_pnames and next_pname to handle iterating
over the set of properties on an object. This iterator is explicitly
invalidated and the property name array is released on standard exit
from the loop, otherwise we rely on GC to do the clean up for us.
* JavaScriptCore.xcodeproj/project.pbxproj:
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitNextPropertyName):
(KJS::CodeGenerator::emitGetPropertyNames):
* VM/CodeGenerator.h:
* VM/JSPropertyNameIterator.cpp: Added.
(KJS::JSPropertyNameIterator::JSPropertyNameIterator):
(KJS::JSPropertyNameIterator::type):
(KJS::JSPropertyNameIterator::toPrimitive):
(KJS::JSPropertyNameIterator::getPrimitiveNumber):
(KJS::JSPropertyNameIterator::toBoolean):
(KJS::JSPropertyNameIterator::toNumber):
(KJS::JSPropertyNameIterator::toString):
(KJS::JSPropertyNameIterator::toObject):
(KJS::JSPropertyNameIterator::mark):
(KJS::JSPropertyNameIterator::next):
(KJS::JSPropertyNameIterator::invalidate):
(KJS::JSPropertyNameIterator::~JSPropertyNameIterator):
(KJS::JSPropertyNameIterator::create):
* VM/JSPropertyNameIterator.h: Added.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* VM/Register.h:
(KJS::Register::):
* kjs/PropertyNameArray.h:
* kjs/nodes.cpp:
(KJS::ForInNode::emitCode):
* kjs/nodes.h:
* kjs/value.h:
2008-04-01 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Change CodeGenerator::emitCall() so it increments the reference count of
registers passed to it, and change its callers so they don't needlessly
increment the reference count of the registers they are passing.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitCall):
* kjs/nodes.cpp:
(KJS::FunctionCallResolveNode::emitCode):
(KJS::FunctionCallDotNode::emitCode):
2008-04-01 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- generate call for PostIncDotNode
* kjs/nodes.cpp:
(KJS::PostIncDotNode::emitCode):
* kjs/nodes.h:
2008-04-01 Maciej Stachowiak <mjs@apple.com>
Build fix.
- fix build (not sure how this ever worked?)
* kjs/nodes.cpp:
(KJS::FunctionCallBracketNode::emitCode):
2008-04-01 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- generate code for FunctionCallBracketNode
* kjs/nodes.cpp:
(KJS::FunctionCallBracketNode::emitCode):
* kjs/nodes.h:
2008-04-01 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- Fix two crashing SunSpider tests
* VM/Machine.cpp:
(KJS::Machine::privateExecute): set up 'this' properly for native calls.
* kjs/list.h:
(KJS::List::List): Fix intialization of buffer and size from
vector, the initialization order was wrong.
2008-04-01 Geoffrey Garen <ggaren@apple.com>
Build fix: marked ASSERT-only variables as UNUSED_PARAMs.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::symbolTableInitializeVariable):
2008-04-01 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Next step toward global code: Moved get, put, and initializeVariable
functionality up into JSVariableObject, and changed JSActivation to
rely on it.
* kjs/JSActivation.cpp:
(KJS::JSActivation::JSActivation):
(KJS::JSActivation::getOwnPropertySlot):
(KJS::JSActivation::put):
(KJS::JSActivation::initializeVariable):
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::valueAt):
(KJS::JSVariableObject::isReadOnly):
(KJS::JSVariableObject::symbolTableGet):
(KJS::JSVariableObject::symbolTablePut):
(KJS::JSVariableObject::symbolTableInitializeVariable):
2008-04-01 Maciej Stachowiak <mjs@apple.com>
Reviewed by Sam.
- fix HashTable assertion on some SunSpider tests
Don't use -1 as the deleted value for JSValue*-keyed hashtables,
since it is a valid value (it's the immediate for -1).
* VM/CodeGenerator.h:
(KJS::CodeGenerator::JSValueHashTraits::emptyValue):
(KJS::CodeGenerator::JSValueHashTraits::deletedValue):
* kjs/JSImmediate.h:
(KJS::JSImmediate::impossibleValue):
2008-04-01 Sam Weinig <sam@webkit.org>
Reviewed by Maciej Stachowiak.
Add support for calling Native constructors like new Array().
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitConstruct):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::NewExprNode::emitCode):
* kjs/nodes.h:
2008-04-01 Maciej Stachowiak <mjs@apple.com>
Reviewed by Sam.
- add some missing toOpbject calls to avoid crashing when calling methods on primitives
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-04-01 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Changed Machine::dumpRegisters to take a pointer instead of a reference,
so gdb understands how to call it.
* VM/Machine.cpp:
(KJS::Machine::dumpRegisters):
(KJS::Machine::privateExecute):
* VM/Machine.h:
2008-03-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Fix CodeGenerator::addConstant() so it uses the functionExpressions
counter for function expressions, not the functions counter.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::addConstant):
2008-03-31 Sam Weinig <sam@webkit.org>
Reviewed by Geoffrey Garen.
Add emitCode support for TypeOfResolveNode and TypeOfValueNode.
Added new opcode op_type_of to handle them.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitNot):
(KJS::CodeGenerator::emitInstanceOf):
(KJS::CodeGenerator::emitTypeOf):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::jsTypeStringForValue):
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::TypeOfResolveNode::emitCode):
(KJS::TypeOfValueNode::emitCode):
* kjs/nodes.h:
2008-03-31 Sam Weinig <sam@webkit.org>
Reviewed by Oliver Hunt.
Fix non-computed goto version of isOpcode. op_end is a valid opcode.
* VM/Machine.cpp:
(KJS::Machine::isOpcode):
2008-03-31 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Added op_post_dec.
2008-03-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Geoffrey Garen.
Add support for FunctionCallDotNode.
* kjs/nodes.cpp:
(KJS::FunctionCallDotNode::emitCode):
* kjs/nodes.h:
2008-03-31 Geoffrey Garen <ggaren@apple.com>
Reviewed by Beth Dakin.
Next step toward global code: Removed more obsolete API, moved
saveLocalStorage and restoreLocalStorage to JSGlobalObject subclass,
since it's only intended for use there.
* ChangeLog:
* JavaScriptCore.exp:
* kjs/Activation.h:
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::saveLocalStorage):
(KJS::JSGlobalObject::restoreLocalStorage):
* kjs/JSGlobalObject.h:
* kjs/JSVariableObject.cpp:
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::JSVariableObjectData::JSVariableObjectData):
* kjs/function.cpp:
(KJS::ActivationImp::ActivationImp):
2008-03-31 Geoffrey Garen <ggaren@apple.com>
Reviewed by Beth Dakin.
Next step toward global code: subclass JSActivation + JSActivationData
from JSVariableObject + JSVariableObjectData.
JSActivation now relies on JSVariableObject for access to registers and
symbol table, and for some delete functionality, but not for anything
else yet.
(KJS::JSActivation::mark): Cleaned up the style here a little bit.
2008-03-31 Geoffrey Garen <ggaren@apple.com>
Reviewed by Beth Dakin.
Next step toward global code: store "rOffset" in JSVariableObjectData.
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::JSVariableObjectData::JSVariableObjectData):
2008-03-31 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Next steps toward global code:
* Moved access to the register file into JSVariableObject.
* Added more ASSERTs to indicate obsolete APIs there are just hanging
around to stave off build failures.
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::registers):
(KJS::JSVariableObject::JSVariableObjectData::JSVariableObjectData):
(KJS::JSVariableObject::JSVariableObject):
2008-03-31 Sam Weinig <sam@webkit.org>
Reviewed by Oliver. Tweaked somewhat by Maciej.
- implement codegen for ReadModifyResolveNode
* kjs/nodes.cpp:
(KJS::emitReadModifyAssignment):
(KJS::ReadModifyResolveNode::emitCode):
* kjs/nodes.h:
2008-03-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Geoff.
Fix the build -- r31492 removed activation tear-off, but r31493 used it.
* kjs/nodes.cpp:
(KJS::FuncExprNode::makeFunction):
2008-03-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Add support for FuncExprNode to SquirrelFish.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeBlock.h:
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::addConstant):
(KJS::CodeGenerator::emitNewFunctionExpression):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::FuncExprNode::emitCode):
(KJS::FuncExprNode::makeFunction):
* kjs/nodes.h:
2008-03-31 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
First step toward global code: removed some obsolete JSGlobalObject
APIs, changing clients to ASSERT_NOT_REACHED.
Activation tear-off and scope chain pushing is obsolete because we
statically detect whether an activation + scope node is required.
The variableObject() and activationObject() accessors are obsolete
because they haven't been maintained, and they're mostly used by
node evaluation code, anyway.
The localStorage() accessor is obsolete because everything is in
registers now, and it's mostly used by node evaluation code, anyway.
2008-03-31 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- implement codegen for bracket accessor and bracket assign
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitGetPropVal):
(KJS::CodeGenerator::emitPutPropVal):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::BracketAccessorNode::emitCode):
(KJS::AssignBracketNode::emitCode):
* kjs/nodes.h:
2008-03-31 Geoffrey Garen <ggaren@apple.com>
Not reviewed.
Removed FIXME that I just fixed.
Added ASSERT to cover an error previously only covered by a FIXME.
* kjs/JSActivation.cpp:
(KJS::JSActivation::getOwnPropertySlot):
2008-03-31 Geoffrey Garen <ggaren@apple.com>
Not reviewed.
Fixed indentation inside op_call. (I had left this code badly indented
to make the behavior-changing diff clearer.)
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-03-31 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Fixed up logging of jump instructions to follow the following style:
jump offset(->absoluteTarget)
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
2008-03-31 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Changed the SymbolTable API to use int instead of size_t. It has been
using int internally for a while now (since squirrelfish symbols can
have negative indices).
2008-03-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Add support for FunctionCallValueNode.
* kjs/nodes.cpp:
(KJS::FunctionCallValueNode::emitCode):
* kjs/nodes.h:
2008-03-31 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
1) Implemented array literals
2) Renamed op_object_get and op_object_put to op_get_prop_id and
op_put_prop_id in preparation for new variants.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitNewArray):
(KJS::CodeGenerator::emitGetPropId):
(KJS::CodeGenerator::emitPutPropId):
(KJS::CodeGenerator::emitPutPropIndex):
* VM/CodeGenerator.h:
(KJS::CodeGenerator::CodeGenerator):
(KJS::CodeGenerator::propertyNames):
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::ArrayNode::emitCode):
(KJS::PropertyListNode::emitCode):
(KJS::DotAccessorNode::emitCode):
(KJS::PostIncResolveNode::emitCode):
(KJS::PreIncResolveNode::emitCode):
(KJS::AssignResolveNode::emitCode):
(KJS::AssignDotNode::emitCode):
* kjs/nodes.h:
2008-03-30 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Implemented native function calls. (Re-entering from native code back
to JS doesn't work yet, though.)
0.2% speedup overall, due to some inlining tweaks. 3.6% regression on
function-empty.js, since we're making a new virtual call and taking a
new branch inside every op_call.
I adjusted the JavaScriptCore calling convention to minimize overhead,
like so:
The machine calls a single virtual function, "getCallData", to get all
the data it needs for a function call. Native code still uses the old
"isObject()" check followed by an "implementsCall()" check, which
aliases to "getCallData". (We can optimize native code to use getCallData
at our leisure.)
To supply a list of arguments, the machine calls a new List constructor
that just takes a pointer and a length, without copying. Native code
still appends to the list one argument at a time. (We can optimize
native code to use the new List constructor at our leisure.)
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Changed resize() call to grow() call,
to encourage the compiler to inline the Vector code.
* kjs/CallData.h: Added.
(KJS::): CallData is a union because eventually native calls will stuff
a function pointer into it, to eliminate the callAsFunction virtual call.
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction): Changed this to an ASSERT since
it's not implemented yet.
* kjs/list.h: Made the List class two-faced, to support the old way and
the new way during this transition phase: lists can be made read-only
with just a pointer and a legnth, or you can append to them one item
at a time.
* kjs/value.h:
(KJS::jsUndefined): Marked this function ALWAYS_INLINE for the benefit
of a certain compiler that doesn't know what's best for it.
2008-03-30 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
Dump code that codegen can't handle yet, so it's easier to prioritize missing nodes.
* kjs/nodes.h:
(KJS::Node::emitCode):
2008-03-30 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
Improve dumping of bytecode and fix coding style accordingly.
Registers are printed as lr1 for locals, tr1 for temp registers. Identifiers print as
foobar(@id0) and constants print as "foo"(@k1) or 312.4(@k2) or the like. Constant and
identifier tables are dumped for reference.
* VM/CodeBlock.cpp:
(KJS::escapeQuotes):
(KJS::valueToSourceString):
(KJS::registerName):
(KJS::constantName):
(KJS::idName):
(KJS::printUnaryOp):
(KJS::printBinaryOp):
(KJS::CodeBlock::dump):
* VM/Machine.cpp:
(KJS::resolve):
(KJS::resolveBase):
(KJS::Machine::privateExecute):
2008-03-30 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
Implement StringNode and VoidNode (both pretty trivial).
* kjs/nodes.cpp:
(KJS::StringNode::emitCode):
(KJS::VoidNode::emitCode):
* kjs/nodes.h:
2008-03-30 Maciej Stachowiak <mjs@apple.com>
Reviewed by Sam.
Implement CommaNode.
* kjs/nodes.cpp:
(KJS::CommaNode::emitCode):
* kjs/nodes.h:
2008-03-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Adds support for dot notation and object literals.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitNewObject):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::ObjectLiteralNode::emitCode):
(KJS::PropertyListNode::emitCode):
(KJS::DotAccessorNode::emitCode):
(KJS::AssignDotNode::emitCode):
* kjs/nodes.h:
2008-03-29 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Mark the register file.
It's a conservative mark for now, but once registers are typed, we can
do an exact mark.
1.4% regression regardless of whether we actually do the marking.
GCC is is worth every penny.
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Most of the changes here are just for
the fact that "registers" is a pointer now.
* kjs/JSGlobalObject.cpp: The global object owns the register file now.
2008-03-28 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 18204: SquirrelFish: continue/break do not correctly handle scope popping
<http://bugs.webkit.org/show_bug.cgi?id=18204>
We now track the scope depth as part of a loop context, and add an
extra instruction op_jump_scopes that is used to perform a jump across
dynamic scope boundaries.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitJumpScopes):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::ContinueNode::emitCode):
(KJS::BreakNode::emitCode):
2008-03-28 Sam Weinig <sam@webkit.org>
Reviewed by Geoffrey Garen.
Add emitCode support for ConditionalNode.
* kjs/nodes.cpp:
(KJS::ConditionalNode::emitCode):
* kjs/nodes.h:
2008-03-28 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Responding to feedback, added some comments, fixed up a few names, and
clarified that "locals" always means all local variables, functions,
and parameters.
2008-03-28 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Added support for "this".
Supply an implicit "this" value as the first argument to every function.
Alias the "this" keyword to that argument.
1% regression overall, 2.5% regression on empty function calls. Seems
like a reasonable cost for now, since we're doing more work.
(Eventually, we might decide to create a version of op_call specialized
for a known null "this" value.)
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitCall):
* VM/CodeGenerator.h:
(KJS::CodeGenerator::CodeGenerator):
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* kjs/CommonIdentifiers.cpp:
(KJS::CommonIdentifiers::CommonIdentifiers):
* kjs/CommonIdentifiers.h:
* kjs/nodes.cpp:
(KJS::ThisNode::emitCode):
(KJS::FunctionCallResolveNode::emitCode):
* kjs/nodes.h:
2008-03-28 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Bug 18192: Squirrelfish needs support for break and continue
<http://bugs.webkit.org/show_bug.cgi?id=18192>
Added a loop context stack to the code generator to provide the
correct jump labels for continue and goto. Added logic to the
currently implemented loop constructs to manage entry and exit
from the loop contexts. Finally, implemented codegen for break
and continue (and a pass through for LabelNode)
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::pushLoopContext):
(KJS::CodeGenerator::popLoopContext):
(KJS::CodeGenerator::loopContextForIdentifier):
(KJS::CodeGenerator::labelForContinue):
(KJS::CodeGenerator::labelForBreak):
* VM/CodeGenerator.h:
* kjs/nodes.cpp:
(KJS::DoWhileNode::emitCode):
(KJS::WhileNode::emitCode):
(KJS::ForNode::emitCode):
(KJS::ContinueNode::emitCode):
(KJS::BreakNode::emitCode):
(KJS::LabelNode::emitCode):
* kjs/nodes.h:
2008-03-27 Sam Weinig <sam@webkit.org>
Reviewed by Geoffrey Garen.
Add emitCode support for UnaryPlusNode, NegateNode, BitwiseNotNode and LogicalNotNode.
* VM/CodeBlock.cpp:
(KJS::printUnaryOp):
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitToJSNumber):
(KJS::CodeGenerator::emitNegate):
(KJS::CodeGenerator::emitBitNot):
(KJS::CodeGenerator::emitNot):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::UnaryPlusNode::emitCode):
(KJS::NegateNode::emitCode):
(KJS::BitwiseNotNode::emitCode):
(KJS::LogicalNotNode::emitCode):
* kjs/nodes.h:
2008-03-27 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej Stachowiak.
Add support for LogicalAndNode and LogicalOrNode.
* kjs/nodes.cpp:
(KJS::LogicalAndNode::emitCode):
(KJS::LogicalOrNode::emitCode):
* kjs/nodes.h:
2008-03-27 Sam Weinig <sam@webkit.org>
Clean up code and debug output.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-03-27 Geoffrey Garen <ggaren@apple.com>
Moved an ASSERT to a more logical place.
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-03-27 Sam Weinig <sam@webkit.org>
Reviewed by Oliver Hunt.
Add emitCode support for InstanceOfNode.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitInstanceOf):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::InstanceOfNode::emitCode):
* kjs/nodes.h:
2008-03-27 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Bug 18142: squirrelfish needs to support dynamic scoping/with
<http://bugs.webkit.org/show_bug.cgi?id=18142>
Add support for dynamic scoping and add code to handle 'with'
statements.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeBlock.h:
(KJS::CodeBlock::CodeBlock):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::getRegister):
(KJS::CodeGenerator::emitPushScope):
(KJS::CodeGenerator::emitPopScope):
* VM/CodeGenerator.h:
(KJS::CodeGenerator::CodeGenerator):
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::WithNode::emitCode):
* kjs/nodes.h:
2008-03-27 Sam Weinig <sam@webkit.org>
Reviewed by Geoffrey Garen.
Add emitCode support for NullNode, FalseNode, TrueNode, IfNode, IfElseNode, DoWhileNode and WhileNode
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump): Dump op_jfalse opcode.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitJumpIfFalse): Identical to emitJumpIfTrue except it emits the op_jfalse opcode.
(KJS::CodeGenerator::emitLoad): Add and emitLoad override for booleans.
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::Machine::privateExecute): Adds execution of op_jfalse. It is identical to op_jtrue, except the
the condition is reversed.
* VM/Opcode.h: Add op_jfalse.
* kjs/nodes.cpp:
(KJS::NullNode::emitCode): Added.
(KJS::FalseNode::emitCode): Added.
(KJS::TrueNode::emitCode): Added.
(KJS::IfNode::emitCode): Added.
(KJS::IfElseNode::emitCode): Added.
(KJS::DoWhileNode::emitCode): Added.
(KJS::WhileNode::emitCode): Added.
* kjs/nodes.h:
2008-03-26 Geoffrey Garen <ggaren@apple.com>
Nixed an unused List.
The calm before my stormy war against the List class.
* kjs/function_object.cpp:
(KJS::FunctionObjectImp::construct):
2008-03-26 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Geoffrey Garen.
Adds support for EqualNode, NotEqualNode, StrictEqualNode, NotStrictEqualNode,
LessEqNode, GreaterNode, GreaterEqNode, MultNode, DivNode, ModNode, SubNode,
LeftShiftNode, RightShiftNode, UnsignedRightShiftNode, BitAndNode, BitXOrNode,
and BitOrNode.
* VM/CodeBlock.cpp:
(KJS::CodeBlock::dump):
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitEqual):
(KJS::CodeGenerator::emitNotEqual):
(KJS::CodeGenerator::emitStrictEqual):
(KJS::CodeGenerator::emitNotStrictEqual):
(KJS::CodeGenerator::emitLessEq):
(KJS::CodeGenerator::emitMult):
(KJS::CodeGenerator::emitDiv):
(KJS::CodeGenerator::emitMod):
(KJS::CodeGenerator::emitSub):
(KJS::CodeGenerator::emitLeftShift):
(KJS::CodeGenerator::emitRightShift):
(KJS::CodeGenerator::emitUnsignedRightShift):
(KJS::CodeGenerator::emitBitAnd):
(KJS::CodeGenerator::emitBitXOr):
(KJS::CodeGenerator::emitBitOr):
* VM/CodeGenerator.h:
* VM/Machine.cpp:
(KJS::jsLessEq):
(KJS::Machine::privateExecute):
* VM/Opcode.h:
* kjs/nodes.cpp:
(KJS::MultNode::emitCode):
(KJS::DivNode::emitCode):
(KJS::ModNode::emitCode):
(KJS::SubNode::emitCode):
(KJS::LeftShiftNode::emitCode):
(KJS::RightShiftNode::emitCode):
(KJS::UnsignedRightShiftNode::emitCode):
(KJS::GreaterNode::emitCode):
(KJS::LessEqNode::emitCode):
(KJS::GreaterEqNode::emitCode):
(KJS::EqualNode::emitCode):
(KJS::NotEqualNode::emitCode):
(KJS::StrictEqualNode::emitCode):
(KJS::NotStrictEqualNode::emitCode):
(KJS::BitAndNode::emitCode):
(KJS::BitXOrNode::emitCode):
(KJS::BitOrNode::emitCode):
* kjs/nodes.h:
2008-03-26 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Only print debug dumps in debug builds.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::generate):
* VM/Machine.cpp:
(KJS::Machine::privateExecute):
2008-03-26 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Moved a few files around in the XCode project.
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-03-26 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Made closures work.
An activation object aliases to the register file until its associated
function returns, at which point it copies the registers for locals and
parameters into an independent storage buffer.
2008-03-24 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fixed recent 25% regression on simple for loop test. GCC seems to be
very finicky about the code that gets inlined into
Machine::privateExecute.
Everything in this patch is simply the result of experiment.
The resolve and resolve_base opcodes do not seem to have gotten slower
from this change.
* VM/Machine.cpp:
(KJS::resolve):
(KJS::resolveBase):
(KJS::Machine::privateExecute):
* kjs/nodes.h:
2008-03-24 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff Garen.
Bug 18059: squirrelfish needs to compile on platforms without computed goto
<http://bugs.webkit.org/show_bug.cgi?id=18059>
"Standard" macro style support for conditionalising the use of computed goto.
* JavaScriptCore.xcodeproj/project.pbxproj:
* VM/Machine.cpp:
(KJS::Machine::isOpcode):
(KJS::Machine::privateExecute):
* VM/Machine.h:
(KJS::Machine::getOpcode):
(KJS::Machine::getOpcodeID):
* VM/Opcode.h:
* wtf/Platform.h:
2008-03-24 Geoffrey Garen <ggaren@apple.com>
Moved my notes from nodes.h to the wiki.
* kjs/nodes.h:
2008-03-24 Geoffrey Garen <ggaren@apple.com>
SquirrelFish lives.
Initial check-in of the code I've been carrying around. Lots of stuff
doesn't work. Plus a bunch of empty files.
=== Start merge of squirrelfish ===
2008-05-21 Darin Adler <darin@apple.com>
- try to fix the Windows build
* profiler/Profiler.cpp:
(KJS::Profiler::stopProfiling): Use ptrdiff_t instead of the less-common but incredibly
similar ssize_t type.
* wtf/AVLTree.h:
(KJS::AVLTree::search): Added a typename for a dependent name that's a type.
2008-05-21 Darin Adler <darin@apple.com>
Reviewed by Anders.
- fix <rdar://problem/5952721> bug in JavaScript arguments object property lookup
Test: fast/js/arguments-bad-index.html
* kjs/function.cpp:
(KJS::IndexToNameMap::IndexToNameMap): Use unsigned instead of int.
(KJS::IndexToNameMap::isMapped): Use unsigned instead of int, and also use the
strict version of the numeric conversion function, since we don't want to allow
trailing junk.
(KJS::IndexToNameMap::unMap): Ditto.
(KJS::IndexToNameMap::operator[]): Ditto.
* kjs/function.h: Changed IndexToNameMap::size type from int to unsigned.
2008-05-21 Timothy Hatcher <timothy@apple.com>
Change the Profiler to allow multiple profiles to be running at
the same time. This can happen when you have nested console.profile()
calls. This required two changes. First, the Profiler needed to keep a
Vector of current profiles, instead of one. Second, a Profile needs
to keep track of the global ExecState it started in and the page group
identifier it is tracking.
The stopProfiling call now takes the same arguments as startProfiling.
This makes sure the correct profile is stopped. Passing a null UString
as the title will stop the last profile for the matching ExecState.
<rdar://problem/5951559> Multiple pages profiling can interfere with each other
Reviewed by Kevin McCullough.
* JavaScriptCore.exp: Added new exports. Removed old symbols.
* profiler/Profile.cpp:
(KJS::Profile::Profile): New constructor arguments for the
originatingGlobalExec and pageGroupIdentifier.
(KJS::Profile::stopProfiling): Set the m_originatingGlobalExec to null.
* profiler/Profile.h:
(KJS::Profile::create): Additional arguments.
(KJS::Profile::originatingGlobalExec): Return m_originatingGlobalExec.
(KJS::Profile::pageGroupIdentifier): Return m_pageGroupIdentifier.
* profiler/Profiler.cpp:
(KJS::Profiler::findProfile): Added. Finds a Profile that matches
the ExecState and title.
(KJS::Profiler::startProfiling): Return early if there is already
a Profile with the ExecState and title. If not, create a new profile
and append it to m_currentProfiles.
(KJS::Profiler::stopProfiling): Loops through m_currentProfiles
and find the one matching the ExecState and title. If one is found
call stopProfiling and return the Profile after removing it
from m_currentProfiles.
(KJS::dispatchFunctionToProfiles): Helper inline function to loop through
m_currentProfiles and call a Profile function.
(KJS::Profiler::willExecute): Call dispatchFunctionToProfiles.
(KJS::Profiler::didExecute): Ditto.
* profiler/Profiler.h:
2008-05-21 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
<rdar://problem/5908520> REGRESSION (3.1.1-r33033): Crash in WebKit when opening or
refreshing page on people.com
The problem was that STL algorithms do not work with non-conformant comparators, and the
site used sort(function() { return 0.5 - Math.random(); } to randomly shuffle an array.
https://bugs.webkit.org/show_bug.cgi?id=18687
REGRESSION(r32220): ecma/Array/15.4.4.5-3.js test now fails in GMT(BST)
Besides relying on sort stability, this test was just broken, and kept failing with the
new stable sort.
Tests: fast/js/sort-randomly.html
fast/js/sort-stability.html
fast/js/comparefn-sort-stability.html
* kjs/avl_tree.h: Added an AVL tree implementation.
* JavaScriptCore.xcodeproj/project.pbxproj:
* wtf/AVLTree.h: Added.
Added an AVL tree implementation.
* kjs/array_instance.cpp:
(KJS::ArrayInstance::increaseVectorLength):
(KJS::ArrayInstance::sort):
(KJS::AVLTreeAbstractorForArrayCompare::get_less):
(KJS::AVLTreeAbstractorForArrayCompare::set_less):
(KJS::AVLTreeAbstractorForArrayCompare::get_greater):
(KJS::AVLTreeAbstractorForArrayCompare::set_greater):
(KJS::AVLTreeAbstractorForArrayCompare::get_balance_factor):
(KJS::AVLTreeAbstractorForArrayCompare::set_balance_factor):
(KJS::AVLTreeAbstractorForArrayCompare::compare_key_key):
(KJS::AVLTreeAbstractorForArrayCompare::compare_key_node):
(KJS::AVLTreeAbstractorForArrayCompare::compare_node_node):
(KJS::AVLTreeAbstractorForArrayCompare::null):
(KJS::ArrayInstance::compactForSorting):
* kjs/array_instance.h: increaseVectorLength() now returns a bool to indicate whether it was
successful.
* wtf/Vector.h:
(WTF::Vector::Vector):
(WTF::::operator=):
(WTF::::fill):
Make these methods fail instead of crash when allocation fails, matching resize() and
reserveCapacity(), which already had this behavior. Callers need to check for null buffer
after making any Vector call that can try to allocate.
* tests/mozilla/ecma/Array/15.4.4.5-3.js: Fixed the test to use a consistent sort function,
as suggested in comments to a Mozilla bug filed about it (I'll keep tracking the bug to see
what the final resolution is).
2008-05-20 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim.
<rdar://problem/5950867> JSProfiler: Allow the profiler to "Focus" a
profile node.
- Implements focus by adding the idea of a profileNode being visible and
adding the ability to reset all of the visible flags.
* profiler/Profile.h:
(KJS::Profile::focus):
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::ProfileNode): Initialize the visible flag.
(KJS::ProfileNode::setTreeVisible): Set the visibility of this node and
all of its descendents.
(KJS::ProfileNode::focus): Determine if this node should be visible when
focusing, if the functionName matches this node's function name or if any
of this node's children are visible.
(KJS::ProfileNode::restoreAll): Restore all nodes' visible flag.
(KJS::ProfileNode::debugPrintData):
* profiler/ProfileNode.h:
(KJS::ProfileNode::visible):
(KJS::ProfileNode::setVisible):
2008-05-20 Timothy Hatcher <timothy@apple.com>
Fixes a couple performance issues with the profiler. Also fixes
a regression where some nodes wouldn't be added to the tree.
Reviewed by Kevin McCullough.
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::addChild): Compare callIdentifier instead
of functionName.
* profiler/ProfileNode.h:
(CallIdentifier.operator==): Compare the CallIdentifiers in
an order that fails sooner for non-matches.
(CallIdentifier.callIdentifier): Return the CallIdentifier by
reference to prevent making a new copy each time.
2008-05-20 Kevin McCullough <kmccullough@apple.com>
Reviewed by Darin.
<rdar://problem/5950796> JSProfiler: dump functions are in the code
Removed dump and logging functions from the Release version of the code
and renamed them to be obviously for debugging only.
* JavaScriptCore.exp:
* profiler/Profile.cpp:
(KJS::Profile::debugPrintData):
(KJS::Profile::debugPrintDataSampleStyle):
* profiler/Profile.h:
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::debugPrintData):
(KJS::ProfileNode::debugPrintDataSampleStyle):
* profiler/ProfileNode.h:
* profiler/Profiler.cpp:
* profiler/Profiler.h:
2008-05-20 Kevin McCullough <kmccullough@apple.com>
Reviewed by Adam.
<rdar://problem/5950538> JSProfiler: Keep track of non-JS execution time
We now have an extra node that represents the excess non-JS time.
- Also changed "SCRIPT" and "anonymous function" to be more consistent
with the debugger.
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::stopProfiling): If this ProfileNode is the head node
create a new child that has the excess execution time.
(KJS::ProfileNode::calculatePercentages): Moved calculation of the
percentages into a function since it's called from multiple places.
* profiler/ProfileNode.h: Add the newly needed functions used above.
(KJS::ProfileNode::setTotalTime):
(KJS::ProfileNode::setSelfTime):
(KJS::ProfileNode::setNumberOfCalls):
* profiler/Profiler.cpp: renamed "SCRIPT" and "anonymous function" to be
consistent with the debugger and use constants that can be localized
more easily.
(KJS::getCallIdentifiers):
(KJS::getCallIdentifierFromFunctionImp):
2008-05-20 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim.
<rdar://problem/5770054> JavaScript profiler (10928)
Removed only profiler-internal use of currentProfile since that concept
is changing.
* profiler/Profile.h: Now stopProfiling takes a time and bool as
arguments. The time is used to calculate %s from and the bool tells
if this node is the head node and should be the one calculating the time.
(KJS::Profile::stopProfiling):
* profiler/ProfileNode.cpp: Ditto.
(KJS::ProfileNode::stopProfiling):
* profiler/ProfileNode.h: Ditto.
2008-05-20 Kevin McCullough <kmccullough@apple.com>
Accidentally turned on the profiler.
* kjs/config.h:
2008-05-20 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim.
<rdar://problem/5770054> JavaScript profiler (10928)
Split function name into 3 parts so that the Web Inspector can link it to
the resource location from whence it came.
* kjs/ustring.cpp: Implemented operator> for UStrings
(KJS::operator>):
* kjs/ustring.h:
* profiler/Profile.cpp:
(KJS::Profile::Profile): Initialize all 3 values.
(KJS::Profile::willExecute): Use CallIdentifier struct.
(KJS::Profile::didExecute): Ditto.
* profiler/Profile.h: Ditto and remove unused function.
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::ProfileNode): Use CallIdentifier struct.
(KJS::ProfileNode::willExecute): Ditto and fix an issue where we
restarted the m_startTime even though it was already started.
(KJS::ProfileNode::didExecute): Ditto.
(KJS::ProfileNode::findChild): Ditto.
(KJS::functionNameDescendingComparator): Ditto and use new comparator.
(KJS::functionNameAscendingComparator): Ditto.
(KJS::ProfileNode::printDataInspectorStyle): Use CallIdentifier struct.
(KJS::ProfileNode::printDataSampleStyle): Ditto.
* profiler/ProfileNode.h:
(KJS::CallIdentifier::CallIdentifier): Describe the CallIdentifier struct
(KJS::CallIdentifier::operator== ):
(KJS::ProfileNode::create): Use the CallIdentifier struct.
(KJS::ProfileNode::callIdentifier):
(KJS::ProfileNode::functionName): Now only return the function name, not
the url and line number too.
(KJS::ProfileNode::url):
(KJS::ProfileNode::lineNumber):
* profiler/Profiler.cpp: Use the CallIdentifier struct.
(KJS::Profiler::startProfiling):
(KJS::Profiler::willExecute):
(KJS::Profiler::didExecute):
(KJS::getCallIdentifiers):
(KJS::getCallIdentifierFromFunctionImp):
2008-05-20 Timothy Hatcher <timothy@apple.com>
Rename sortFileName{Ascending,Descending} to
sortFunctionName{Ascending,Descending}.
Reviewed by Kevin McCullough.
* JavaScriptCore.exp:
* kjs/config.h:
* profiler/Profile.h:
* profiler/ProfileNode.cpp:
(KJS::functionNameDescendingComparator):
(KJS::ProfileNode::sortFunctionNameDescending):
(KJS::functionNameAscendingComparator):
(KJS::ProfileNode::sortFunctionNameAscending):
* profiler/ProfileNode.h:
2008-05-19 Timothy Hatcher <timothy@apple.com>
Make the profiler use higher than millisecond resolution time-stamps.
Reviewed by Kevin McCullough.
* kjs/DateMath.cpp:
(KJS::getCurrentUTCTime): Call getCurrentUTCTimeWithMicroseconds and
floor the result.
(KJS::getCurrentUTCTimeWithMicroseconds): Copied from the previous
implementation of getCurrentUTCTime without the floor call.
* kjs/DateMath.h: Addded getCurrentUTCTimeWithMicroseconds.
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::ProfileNode): Use getCurrentUTCTimeWithMicroseconds.
2008-05-19 Timothy Hatcher <timothy@apple.com>
Fixes a bug in the profiler where call and apply would show up
and double the time spent in a function. We don't want to show call
and apply at all in the profiles. This change excludes them.
Reviewed by Kevin McCullough.
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::stopProfiling): Remove a second for loop and
calculate self time in the existing loop.
* profiler/Profiler.cpp:
(KJS::shouldExcludeFunction): Helper inline function that returns
true in the current function in an InternalFunctionImp and it is
has the functionName call or apply.
(KJS::Profiler::willExecute): Call shouldExcludeFunction and return
early if if returns true.
(KJS::Profiler::didExecute): Ditto.
2008-05-19 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim.
<rdar://problem/5770054> JavaScript profiler (10928)
- Implement sorting by function name.
* JavaScriptCore.exp:
* profiler/Profile.h:
(KJS::Profile::sortFileNameDescending):
(KJS::Profile::sortFileNameAscending):
* profiler/ProfileNode.cpp:
(KJS::fileNameDescendingComparator):
(KJS::ProfileNode::sortFileNameDescending):
(KJS::fileNameAscendingComparator):
(KJS::ProfileNode::sortFileNameAscending):
* profiler/ProfileNode.h:
2008-05-19 Kevin McCullough <kmccullough@apple.com>
Reviewed by Adam.
<rdar://problem/5770054> JavaScript profiler (10928)
- Pass the exec state to profiler when calling startProfiling so that if
profiling is started within an execution context that location is
recorded correctly.
* JavaScriptCore.exp:
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::printDataInspectorStyle): Dump more info for debugging
purposes.
* profiler/Profiler.cpp:
(KJS::Profiler::startProfiling):
* profiler/Profiler.h:
2008-05-19 Kevin McCullough <kmccullough@apple.com>
Rubberstamped by Geoff.
Turn off the profiler because it is a performance regression.
* kjs/config.h:
2008-05-19 Alp Toker <alp@nuanti.com>
Reviewed by Anders and Beth.
http://bugs.webkit.org/show_bug.cgi?id=16495
[GTK] Accessibility support with ATK/AT-SPI
Initial ATK/AT-SPI accessibility support for the GTK+ port.
* wtf/Platform.h:
2008-05-19 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim.
<rdar://problem/5770054> JavaScript profiler (10928)
-In an effort to make the profiler as efficient as possible instead of
prepending to a vector we keep the vector in reverse order and operate
over it backwards.
* profiler/Profile.cpp:
(KJS::Profile::willExecute):
(KJS::Profile::didExecute):
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::didExecute):
(KJS::ProfileNode::endAndRecordCall):
* profiler/ProfileNode.h:
* profiler/Profiler.cpp:
(KJS::getStackNames):
2008-05-16 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim.
<rdar://problem/5770054> JavaScript profiler (10928)
Implement sorting for the profiler.
I chose to sort the profileNodes in place since there is no reason they
need to retain their original order.
* JavaScriptCore.exp: Export the symbols.
* profiler/Profile.h: Add the different ways a profile can be sorted.
(KJS::Profile::sortTotalTimeDescending):
(KJS::Profile::sortTotalTimeAscending):
(KJS::Profile::sortSelfTimeDescending):
(KJS::Profile::sortSelfTimeAscending):
(KJS::Profile::sortCallsDescending):
(KJS::Profile::sortCallsAscending):
* profiler/ProfileNode.cpp: Implement those ways.
(KJS::totalTimeDescendingComparator):
(KJS::ProfileNode::sortTotalTimeDescending):
(KJS::totalTimeAscendingComparator):
(KJS::ProfileNode::sortTotalTimeAscending):
(KJS::selfTimeDescendingComparator):
(KJS::ProfileNode::sortSelfTimeDescending):
(KJS::selfTimeAscendingComparator):
(KJS::ProfileNode::sortSelfTimeAscending):
(KJS::callsDescendingComparator):
(KJS::ProfileNode::sortCallsDescending):
(KJS::callsAscendingComparator):
(KJS::ProfileNode::sortCallsAscending):
* profiler/ProfileNode.h: No longer use a Deque since it cannot be
sorted by std::sort and there was no reason not to use a Vector. I
previously had though I would do prepending but am not.
(KJS::ProfileNode::selfTime):
(KJS::ProfileNode::totalPercent):
(KJS::ProfileNode::selfPercent):
(KJS::ProfileNode::children):
* profiler/Profiler.cpp: Removed these functions as they can be called
directoy on the Profile object after getting the Vector of them.
(KJS::getStackNames):
* profiler/Profiler.h:
2008-05-15 Ariya Hidayat <ariya.hidayat@trolltech.com>
Reviewed by Simon.
Since WebKitGtk is fully using autotools now, clean-up the .pro/.pri files
from gtk-port.
* JavaScriptCore.pro:
* kjs/testkjs.pro:
2008-05-15 Kevin McCullough <kmccullough@apple.com>
- Build fix.
* JavaScriptCore.exp:
2008-05-15 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim.
<rdar://problem/5770054> JavaScript profiler (10928)
- Cache some values to save on computing them repetitively. This will be
a big savings when we sort since we won't have to walk the tree for
every comparison!
- We cache these values when we end profiling because otherwise we won't
know which profile to get the totalTime for the whole profile from without
retaining a reference to the head profile or looking up the profile from
the list of all profiles.
- Also it's safe to assume we won't be asked for these values while we
are still profiling since the WebInspector only get's profileNodes from
profiles that are in the allProfiles() list and a profile is only added
to that list after it has finished and these values will no longer
change.
* JavaScriptCore.exp:
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::ProfileNode):
(KJS::ProfileNode::stopProfiling):
(KJS::ProfileNode::printDataInspectorStyle):
(KJS::ProfileNode::printDataSampleStyle):
(KJS::ProfileNode::endAndRecordCall):
* profiler/ProfileNode.h:
(KJS::ProfileNode::totalTime):
(KJS::ProfileNode::selfTime):
(KJS::ProfileNode::totalPercent):
(KJS::ProfileNode::selfPercent):
* profiler/Profiler.cpp:
(KJS::Profiler::stopProfiling):
2008-05-15 Simon Hausmann <shausman@trolltech.com>
Reviewed by Holger.
Fix compilation when compiling with MSVC and wchar_t support.
* wtf/unicode/qt4/UnicodeQt4.h:
(WTF::Unicode::foldCase):
(WTF::Unicode::umemcasecmp):
2008-05-14 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim.
<rdar://problem/5770054> JavaScript profiler (10928)
- Turn on the profiler.
* kjs/config.h:
2008-05-14 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim.
<rdar://problem/5770054> JavaScript profiler (10928)
- Expose the new profiler functions to the WebInspector.
* JavaScriptCore.exp:
2008-05-14 Kevin McCullough <kmccullough@apple.com>
Giving credit where credit is due.
* ChangeLog:
2008-05-14 Kevin McCullough <kmccullough@apple.com>
Reviewed by Geoff and Sam.
<rdar://problem/5770054> JavaScript profiler (10928)
Add the ability to get percentages of total and self time for displaying
in the WebInspector.
* profiler/Profile.h:
(KJS::Profile::totalProfileTime):
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::totalPercent):
(KJS::ProfileNode::selfPercent):
* profiler/ProfileNode.h:
* profiler/Profiler.h:
(KJS::Profiler::currentProfile):
2008-05-14 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam.
<rdar://problem/5770054> JavaScript profiler (10928)
- Rename FunctionCallProfile to ProfileNode.
* GNUmakefile.am:
* JavaScriptCore.exp:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* profiler/FunctionCallProfile.cpp: Removed.
* profiler/FunctionCallProfile.h: Removed.
* profiler/Profile.cpp:
(KJS::Profile::Profile):
(KJS::Profile::willExecute):
* profiler/Profile.h:
(KJS::Profile::callTree):
* profiler/ProfileNode.cpp: Copied from profiler/FunctionCallProfile.cpp.
(KJS::ProfileNode::ProfileNode):
(KJS::ProfileNode::willExecute):
(KJS::ProfileNode::didExecute):
(KJS::ProfileNode::addChild):
(KJS::ProfileNode::findChild):
(KJS::ProfileNode::stopProfiling):
(KJS::ProfileNode::selfTime):
(KJS::ProfileNode::printDataInspectorStyle):
(KJS::ProfileNode::printDataSampleStyle):
(KJS::ProfileNode::endAndRecordCall):
* profiler/ProfileNode.h: Copied from profiler/FunctionCallProfile.h.
(KJS::ProfileNode::create):
(KJS::ProfileNode::children):
* profiler/Profiler.cpp:
2008-05-14 Kevin McCullough <kmccullough@apple.com>
Reviewed by John.
<rdar://problem/5770054> JavaScript profiler (10928)
- Have each FunctionCallProfile be able to return it's total and self time.
* JavaScriptCore.exp:
* profiler/FunctionCallProfile.cpp:
(KJS::FunctionCallProfile::selfTime):
* profiler/FunctionCallProfile.h:
(KJS::FunctionCallProfile::totalTime):
2008-05-14 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
<rdar://problem/5934376> REGRESSION: A script fails because of a straw BOM character in it.
<https://bugs.webkit.org/show_bug.cgi?id=4931>
Unicode format characters (Cf) should be removed from JavaScript source
Of all Cf characters, we are only removing BOM, because this is what Firefox trunk has
settled upon, after extensive discussion and investigation.
Based on Darin's work on this bug.
Test: fast/js/removing-Cf-characters.html
* kjs/lexer.cpp:
(KJS::Lexer::setCode): Tweak formatting. Use a call to shift(4) to read in the
first characters, instead of having special case code here.
(KJS::Lexer::shift): Add a loop when reading a character to skip BOM characters.
2008-05-13 Matt Lilek <webkit@mattlilek.com>
Not reviewed, build fix.
* kjs/date_object.cpp:
(KJS::DateObjectFuncImp::callAsFunction):
2008-05-13 Anders Carlsson <andersca@apple.com>
Reviewed by Sam.
<rdar://problem/5933644> Implement Date.now
Implement Date.now which returns the number of milliseconds since the epoch.
* kjs/CommonIdentifiers.h:
* kjs/date_object.cpp:
(KJS::DateObjectFuncImp::):
(KJS::DateObjectImp::DateObjectImp):
(KJS::DateObjectFuncImp::callAsFunction):
2008-05-13 Kevin McCullough <kmccullough@apple.com>
Giving credit where credit is due.
* ChangeLog:
2008-05-13 Kevin McCullough <kmccullough@apple.com>
Reviewed by Adam and Geoff.
<rdar://problem/5770054> JavaScript profiler (10928)
Use PassRefPtrs instead of RefPtrs when appropriate.
* profiler/FunctionCallProfile.cpp:
(KJS::FunctionCallProfile::addChild):
* profiler/FunctionCallProfile.h:
* profiler/Profile.h:
(KJS::Profile::callTree):
2008-05-13 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam.
<rdar://problem/5770054> JavaScript profiler (10928)
- Made some functions static (as per Adam) and changed from using raw
pointers to RefPtr for making these JavaScript Objects.
* profiler/FunctionCallProfile.cpp:
(KJS::FunctionCallProfile::addChild):
(KJS::FunctionCallProfile::findChild):
* profiler/FunctionCallProfile.h:
(KJS::FunctionCallProfile::create):
* profiler/Profile.cpp:
(KJS::Profile::Profile):
(KJS::Profile::willExecute):
(KJS::Profile::didExecute):
(KJS::functionNameCountPairComparator):
* profiler/Profile.h:
(KJS::Profile::create):
(KJS::Profile::title):
(KJS::Profile::callTree):
* profiler/Profiler.cpp:
(KJS::Profiler::startProfiling):
* profiler/Profiler.h:
(KJS::Profiler::allProfiles):
(KJS::Profiler::clearProfiles):
2008-05-13 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoffrey Garen.
<rdar://problem/4949018> JavaScriptCore API claims to work with UTF8 strings, but only works
with ASCII strings
* kjs/ustring.h:
* kjs/ustring.cpp:
(KJS::UString::Rep::createFromUTF8):
Added. Implementation adapted from JSStringCreateWithUTF8CString().
* API/JSStringRef.cpp:
(JSStringCreateWithUTF8CString):
* API/JSClassRef.cpp:
(OpaqueJSClass::OpaqueJSClass):
Use UString::Rep::createFromUTF8().
2008-05-12 Mark Rowe <mrowe@apple.com>
Reviewed by Tim Hatcher.
<rdar://problem/4859666> WebKit needs availability macros in order to deprecate APIs
Create WebKit availability macros that key off the Mac OS X version being targeted to
determine the WebKit version being targeted. Applications can define
WEBKIT_VERSION_MIN_REQUIRED before including WebKit headers in order to target a specific
version of WebKit.
The availability header is being added to JavaScriptCore rather than WebKit as JavaScriptCore
is the lowest-level portion of the public WebKit API.
* API/WebKitAvailability.h: Added.
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-05-12 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Maciej.
https://bugs.webkit.org/show_bug.cgi?id=18828
Reproducible crash with PAC file
Naively moving JavaScriptCore into thread-specific data was inappropriate in the face of
exiting JavaScriptCore API clients, which expect a different therading model. Temporarily
disabling ThreadSpecific implementation until this can be sorted out.
* wtf/ThreadSpecific.h:
(WTF::::ThreadSpecific):
(WTF::::~ThreadSpecific):
(WTF::::get):
(WTF::::set):
2008-05-12 Alexey Proskuryakov <ap@webkit.org>
Roll out recent threading changes (r32807, r32810, r32819, r32822) to simplify
SquirrelFish merging.
* API/JSBase.cpp:
(JSGarbageCollect):
* API/JSCallbackObjectFunctions.h:
(KJS::::staticFunctionGetter):
* API/JSClassRef.cpp:
(OpaqueJSClass::prototype):
* API/JSObjectRef.cpp:
(JSObjectMake):
(JSObjectMakeFunctionWithCallback):
(JSObjectMakeConstructor):
(JSObjectMakeFunction):
* API/JSValueRef.cpp:
(JSValueMakeNumber):
(JSValueMakeString):
* JavaScriptCore.exp:
* kjs/ExecState.h:
* kjs/InitializeThreading.cpp:
(KJS::initializeThreadingOnce):
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::~JSGlobalObject):
(KJS::JSGlobalObject::init):
(KJS::JSGlobalObject::put):
(KJS::JSGlobalObject::reset):
(KJS::JSGlobalObject::tearOffActivation):
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::head):
(KJS::JSGlobalObject::perThreadData):
* kjs/JSLock.cpp:
(KJS::JSLock::registerThread):
* kjs/JSLock.h:
(KJS::JSLock::JSLock):
* kjs/array_instance.cpp:
(KJS::ArrayInstance::ArrayInstance):
(KJS::ArrayInstance::lengthGetter):
* kjs/array_object.cpp:
(KJS::arrayProtoFuncToString):
(KJS::arrayProtoFuncToLocaleString):
(KJS::arrayProtoFuncJoin):
(KJS::arrayProtoFuncConcat):
(KJS::arrayProtoFuncPop):
(KJS::arrayProtoFuncPush):
(KJS::arrayProtoFuncShift):
(KJS::arrayProtoFuncSlice):
(KJS::arrayProtoFuncSplice):
(KJS::arrayProtoFuncUnShift):
(KJS::arrayProtoFuncFilter):
(KJS::arrayProtoFuncMap):
(KJS::arrayProtoFuncEvery):
(KJS::arrayProtoFuncForEach):
(KJS::arrayProtoFuncSome):
(KJS::arrayProtoFuncIndexOf):
(KJS::arrayProtoFuncLastIndexOf):
(KJS::ArrayObjectImp::ArrayObjectImp):
(KJS::ArrayObjectImp::construct):
* kjs/bool_object.cpp:
(KJS::BooleanPrototype::BooleanPrototype):
(KJS::booleanProtoFuncToString):
(KJS::BooleanObjectImp::BooleanObjectImp):
(KJS::BooleanObjectImp::construct):
* kjs/collector.cpp:
(KJS::allocateBlock):
(KJS::Collector::recordExtraCost):
(KJS::Collector::heapAllocate):
(KJS::Collector::allocate):
(KJS::Collector::allocateNumber):
(KJS::Collector::registerAsMainThread):
(KJS::onMainThread):
(KJS::PlatformThread::PlatformThread):
(KJS::getCurrentPlatformThread):
(KJS::Collector::Thread::Thread):
(KJS::destroyRegisteredThread):
(KJS::initializeRegisteredThreadKey):
(KJS::Collector::registerThread):
(KJS::Collector::markStackObjectsConservatively):
(KJS::Collector::markCurrentThreadConservativelyInternal):
(KJS::Collector::markCurrentThreadConservatively):
(KJS::suspendThread):
(KJS::resumeThread):
(KJS::getPlatformThreadRegisters):
(KJS::otherThreadStackPointer):
(KJS::Collector::markOtherThreadConservatively):
(KJS::protectedValues):
(KJS::Collector::protect):
(KJS::Collector::unprotect):
(KJS::Collector::collectOnMainThreadOnly):
(KJS::Collector::markProtectedObjects):
(KJS::Collector::markMainThreadOnlyObjects):
(KJS::Collector::sweep):
(KJS::Collector::collect):
(KJS::Collector::size):
(KJS::Collector::globalObjectCount):
(KJS::Collector::protectedGlobalObjectCount):
(KJS::Collector::protectedObjectCount):
(KJS::Collector::protectedObjectTypeCounts):
(KJS::Collector::isBusy):
(KJS::Collector::reportOutOfMemoryToAllExecStates):
* kjs/collector.h:
(KJS::Collector::cellBlock):
(KJS::Collector::cellOffset):
(KJS::Collector::isCellMarked):
(KJS::Collector::markCell):
(KJS::Collector::reportExtraMemoryCost):
* kjs/date_object.cpp:
(KJS::formatLocaleDate):
(KJS::DatePrototype::DatePrototype):
(KJS::DateObjectImp::DateObjectImp):
(KJS::DateObjectImp::construct):
(KJS::DateObjectImp::callAsFunction):
(KJS::DateObjectFuncImp::DateObjectFuncImp):
(KJS::DateObjectFuncImp::callAsFunction):
(KJS::dateProtoFuncToString):
(KJS::dateProtoFuncToUTCString):
(KJS::dateProtoFuncToDateString):
(KJS::dateProtoFuncToTimeString):
(KJS::dateProtoFuncToLocaleString):
(KJS::dateProtoFuncToLocaleDateString):
(KJS::dateProtoFuncToLocaleTimeString):
(KJS::dateProtoFuncValueOf):
(KJS::dateProtoFuncGetTime):
(KJS::dateProtoFuncGetFullYear):
(KJS::dateProtoFuncGetUTCFullYear):
(KJS::dateProtoFuncToGMTString):
(KJS::dateProtoFuncGetMonth):
(KJS::dateProtoFuncGetUTCMonth):
(KJS::dateProtoFuncGetDate):
(KJS::dateProtoFuncGetUTCDate):
(KJS::dateProtoFuncGetDay):
(KJS::dateProtoFuncGetUTCDay):
(KJS::dateProtoFuncGetHours):
(KJS::dateProtoFuncGetUTCHours):
(KJS::dateProtoFuncGetMinutes):
(KJS::dateProtoFuncGetUTCMinutes):
(KJS::dateProtoFuncGetSeconds):
(KJS::dateProtoFuncGetUTCSeconds):
(KJS::dateProtoFuncGetMilliSeconds):
(KJS::dateProtoFuncGetUTCMilliseconds):
(KJS::dateProtoFuncGetTimezoneOffset):
(KJS::dateProtoFuncSetTime):
(KJS::setNewValueFromTimeArgs):
(KJS::setNewValueFromDateArgs):
(KJS::dateProtoFuncSetYear):
(KJS::dateProtoFuncGetYear):
* kjs/error_object.cpp:
(KJS::ErrorPrototype::ErrorPrototype):
(KJS::errorProtoFuncToString):
(KJS::ErrorObjectImp::ErrorObjectImp):
(KJS::ErrorObjectImp::construct):
(KJS::NativeErrorPrototype::NativeErrorPrototype):
(KJS::NativeErrorImp::NativeErrorImp):
(KJS::NativeErrorImp::construct):
* kjs/function.cpp:
(KJS::FunctionImp::lengthGetter):
(KJS::FunctionImp::construct):
(KJS::Arguments::Arguments):
(KJS::ActivationImp::createArgumentsObject):
(KJS::encode):
(KJS::decode):
(KJS::globalFuncParseInt):
(KJS::globalFuncParseFloat):
(KJS::globalFuncEscape):
(KJS::globalFuncUnescape):
(KJS::PrototypeFunction::PrototypeFunction):
(KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
* kjs/function_object.cpp:
(KJS::FunctionPrototype::FunctionPrototype):
(KJS::functionProtoFuncToString):
(KJS::FunctionObjectImp::FunctionObjectImp):
(KJS::FunctionObjectImp::construct):
* kjs/internal.cpp:
(KJS::StringImp::toObject):
* kjs/internal.h:
(KJS::StringImp::StringImp):
(KJS::NumberImp::operator new):
* kjs/list.cpp:
(KJS::List::markSet):
(KJS::List::markProtectedListsSlowCase):
(KJS::List::expandAndAppend):
* kjs/list.h:
(KJS::List::List):
(KJS::List::~List):
(KJS::List::markProtectedLists):
* kjs/lookup.h:
(KJS::staticFunctionGetter):
(KJS::cacheGlobalObject):
* kjs/math_object.cpp:
(KJS::MathObjectImp::getValueProperty):
(KJS::mathProtoFuncAbs):
(KJS::mathProtoFuncACos):
(KJS::mathProtoFuncASin):
(KJS::mathProtoFuncATan):
(KJS::mathProtoFuncATan2):
(KJS::mathProtoFuncCeil):
(KJS::mathProtoFuncCos):
(KJS::mathProtoFuncExp):
(KJS::mathProtoFuncFloor):
(KJS::mathProtoFuncLog):
(KJS::mathProtoFuncMax):
(KJS::mathProtoFuncMin):
(KJS::mathProtoFuncPow):
(KJS::mathProtoFuncRandom):
(KJS::mathProtoFuncRound):
(KJS::mathProtoFuncSin):
(KJS::mathProtoFuncSqrt):
(KJS::mathProtoFuncTan):
* kjs/nodes.cpp:
(KJS::ParserRefCounted::ParserRefCounted):
(KJS::ParserRefCounted::ref):
(KJS::ParserRefCounted::deref):
(KJS::ParserRefCounted::refcount):
(KJS::ParserRefCounted::deleteNewObjects):
(KJS::Node::handleException):
(KJS::NumberNode::evaluate):
(KJS::StringNode::evaluate):
(KJS::ArrayNode::evaluate):
(KJS::PostIncResolveNode::evaluate):
(KJS::PostIncLocalVarNode::evaluate):
(KJS::PostDecResolveNode::evaluate):
(KJS::PostDecLocalVarNode::evaluate):
(KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
(KJS::PostIncBracketNode::evaluate):
(KJS::PostDecBracketNode::evaluate):
(KJS::PostIncDotNode::evaluate):
(KJS::PostDecDotNode::evaluate):
(KJS::typeStringForValue):
(KJS::LocalVarTypeOfNode::evaluate):
(KJS::TypeOfResolveNode::evaluate):
(KJS::TypeOfValueNode::evaluate):
(KJS::PreIncLocalVarNode::evaluate):
(KJS::PreIncResolveNode::evaluate):
(KJS::PreDecLocalVarNode::evaluate):
(KJS::PreDecResolveNode::evaluate):
(KJS::PreIncConstNode::evaluate):
(KJS::PreDecConstNode::evaluate):
(KJS::PostIncConstNode::evaluate):
(KJS::PostDecConstNode::evaluate):
(KJS::PreIncBracketNode::evaluate):
(KJS::PreDecBracketNode::evaluate):
(KJS::PreIncDotNode::evaluate):
(KJS::PreDecDotNode::evaluate):
(KJS::NegateNode::evaluate):
(KJS::BitwiseNotNode::evaluate):
(KJS::MultNode::evaluate):
(KJS::DivNode::evaluate):
(KJS::ModNode::evaluate):
(KJS::addSlowCase):
(KJS::add):
(KJS::AddNumbersNode::evaluate):
(KJS::AddStringsNode::evaluate):
(KJS::AddStringLeftNode::evaluate):
(KJS::AddStringRightNode::evaluate):
(KJS::SubNode::evaluate):
(KJS::LeftShiftNode::evaluate):
(KJS::RightShiftNode::evaluate):
(KJS::UnsignedRightShiftNode::evaluate):
(KJS::BitXOrNode::evaluate):
(KJS::BitOrNode::evaluate):
(KJS::valueForReadModifyAssignment):
(KJS::ForInNode::execute):
(KJS::TryNode::execute):
(KJS::FuncDeclNode::makeFunction):
(KJS::FuncExprNode::evaluate):
* kjs/nodes.h:
* kjs/number_object.cpp:
(KJS::NumberPrototype::NumberPrototype):
(KJS::numberProtoFuncToString):
(KJS::numberProtoFuncToLocaleString):
(KJS::numberProtoFuncToFixed):
(KJS::numberProtoFuncToExponential):
(KJS::numberProtoFuncToPrecision):
(KJS::NumberObjectImp::NumberObjectImp):
(KJS::NumberObjectImp::getValueProperty):
(KJS::NumberObjectImp::construct):
(KJS::NumberObjectImp::callAsFunction):
* kjs/object.cpp:
(KJS::JSObject::call):
(KJS::JSObject::get):
(KJS::JSObject::put):
(KJS::JSObject::defineGetter):
(KJS::JSObject::defineSetter):
(KJS::JSObject::putDirect):
(KJS::Error::create):
* kjs/object.h:
* kjs/object_object.cpp:
(KJS::ObjectPrototype::ObjectPrototype):
(KJS::objectProtoFuncToLocaleString):
(KJS::objectProtoFuncToString):
(KJS::ObjectObjectImp::ObjectObjectImp):
(KJS::ObjectObjectImp::construct):
* kjs/property_map.h:
(KJS::SavedProperty::SavedProperty):
(KJS::SavedProperty::init):
(KJS::SavedProperty::~SavedProperty):
(KJS::SavedProperty::name):
(KJS::SavedProperty::value):
(KJS::SavedProperty::attributes):
* kjs/protect.h:
(KJS::gcProtect):
(KJS::gcUnprotect):
* kjs/regexp_object.cpp:
(KJS::RegExpPrototype::RegExpPrototype):
(KJS::regExpProtoFuncToString):
(KJS::RegExpImp::getValueProperty):
(KJS::RegExpObjectImp::RegExpObjectImp):
(KJS::RegExpObjectImp::arrayOfMatches):
(KJS::RegExpObjectImp::getBackref):
(KJS::RegExpObjectImp::getLastParen):
(KJS::RegExpObjectImp::getLeftContext):
(KJS::RegExpObjectImp::getRightContext):
(KJS::RegExpObjectImp::getValueProperty):
(KJS::RegExpObjectImp::createRegExpImp):
* kjs/regexp_object.h:
* kjs/string_object.cpp:
(KJS::StringInstance::StringInstance):
(KJS::StringInstance::lengthGetter):
(KJS::StringInstance::indexGetter):
(KJS::stringInstanceNumericPropertyGetter):
(KJS::StringPrototype::StringPrototype):
(KJS::replace):
(KJS::stringProtoFuncCharAt):
(KJS::stringProtoFuncCharCodeAt):
(KJS::stringProtoFuncConcat):
(KJS::stringProtoFuncIndexOf):
(KJS::stringProtoFuncLastIndexOf):
(KJS::stringProtoFuncMatch):
(KJS::stringProtoFuncSearch):
(KJS::stringProtoFuncReplace):
(KJS::stringProtoFuncSlice):
(KJS::stringProtoFuncSplit):
(KJS::stringProtoFuncSubstr):
(KJS::stringProtoFuncSubstring):
(KJS::stringProtoFuncToLowerCase):
(KJS::stringProtoFuncToUpperCase):
(KJS::stringProtoFuncToLocaleLowerCase):
(KJS::stringProtoFuncToLocaleUpperCase):
(KJS::stringProtoFuncLocaleCompare):
(KJS::stringProtoFuncBig):
(KJS::stringProtoFuncSmall):
(KJS::stringProtoFuncBlink):
(KJS::stringProtoFuncBold):
(KJS::stringProtoFuncFixed):
(KJS::stringProtoFuncItalics):
(KJS::stringProtoFuncStrike):
(KJS::stringProtoFuncSub):
(KJS::stringProtoFuncSup):
(KJS::stringProtoFuncFontcolor):
(KJS::stringProtoFuncFontsize):
(KJS::stringProtoFuncAnchor):
(KJS::stringProtoFuncLink):
(KJS::StringObjectImp::StringObjectImp):
(KJS::StringObjectImp::construct):
(KJS::StringObjectImp::callAsFunction):
(KJS::StringObjectFuncImp::StringObjectFuncImp):
(KJS::StringObjectFuncImp::callAsFunction):
* kjs/string_object.h:
(KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
* kjs/testkjs.cpp:
(GlobalObject::GlobalObject):
(functionGC):
(functionRun):
(functionReadline):
(kjsmain):
* kjs/ustring.h:
* kjs/value.cpp:
(KJS::JSCell::operator new):
(KJS::jsString):
(KJS::jsOwnedString):
(KJS::jsNumberCell):
* kjs/value.h:
(KJS::jsNaN):
(KJS::jsNumber):
(KJS::jsNumberFromAnd):
(KJS::JSCell::marked):
(KJS::JSCell::mark):
(KJS::JSValue::toJSNumber):
* wtf/ThreadSpecific.h:
(WTF::T):
2008-05-10 Julien Chaffraix <jchaffraix@webkit.org>
Qt & wx build fix.
* JavaScriptCore.pri: Add profiler/Profile.cpp.
* JavaScriptCoreSources.bkl: Ditto.
2008-05-10 Jan Michael Alonzo <jmalonzo@unpluggable.com>
Reviewed by Maciej.
Gtk+ build fix
* GNUmakefile.am: Add Profile.cpp in _sources
2008-05-09 Brady Eidson <beidson@apple.com>
Build Fix. Kevin is an idiot.
("My name is Kevin McCullough and I approve this message.")
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2008-05-09 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim.
-<rdar://problem/5770054> JavaScript profiler (10928)
-Add Profile class so that all profiles can be stored and retrieved by
the WebInspector when that time comes.
* JavaScriptCore.exp: Export the new function signatures.
* JavaScriptCore.xcodeproj/project.pbxproj: Add the new files to the
project
* profiler/Profile.cpp: Added. This class represents a single run of the
profiler.
(KJS::Profile::Profile):
(KJS::Profile::willExecute):
(KJS::Profile::didExecute):
(KJS::Profile::printDataInspectorStyle):
(KJS::functionNameCountPairComparator):
(KJS::Profile::printDataSampleStyle):
* profiler/Profile.h: Added. Ditto
(KJS::Profile::stopProfiling):
* profiler/Profiler.cpp: Now the profiler keeps track of many profiles
but only runs one at a time.
(KJS::Profiler::startProfiling):
(KJS::Profiler::stopProfiling):
(KJS::Profiler::willExecute):
(KJS::Profiler::didExecute):
(KJS::Profiler::printDataInspectorStyle):
(KJS::Profiler::printDataSampleStyle):
* profiler/Profiler.h: Ditto.
(KJS::Profiler::~Profiler):
(KJS::Profiler::allProfiles):
(KJS::Profiler::clearProfiles):
2008-05-08 Anders Carlsson <andersca@apple.com>
Reviewed by Mark.
Enable NPAPI plug-ins on 64-bit.
* wtf/Platform.h:
2008-05-07 Julien Chaffraix <jchaffraix@webkit.org>
Reviewed by Adam Roben.
wx & Gtk build fix.
Add SIZE_MAX definition for the wx port.
* os-win32/stdint.h:
2008-05-07 Ariya Hidayat <ariya.hidayat@trolltech.com>
Reviewed by Simon.
Support for isMainThread in the Qt port.
* wtf/ThreadingQt.cpp:
(WTF::initializeThreading): Adjusted.
(WTF::isMainThread): Added.
2008-05-05 Darin Adler <darin@apple.com>
Reviewed by John Sullivan.
- fix debug-only leak seen on buildbot
* wtf/HashTable.h:
(WTF::HashTable::checkKey): After writing an empty value in, but before constructing a
deleted value on top of it, call the destructor so the empty value doesn't leak.
2008-05-02 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoffrey Garen.
Get rid of static data in nodes.cpp (well, at least of non-debug one).
No measurable change on SunSpider.
* kjs/InitializeThreading.cpp:
(KJS::initializeThreadingOnce):
* kjs/nodes.cpp:
(KJS::newTrackedObjects):
(KJS::trackedObjectExtraRefCounts):
(KJS::initializeNodesThreading):
(KJS::ParserRefCounted::ParserRefCounted):
(KJS::ParserRefCounted::ref):
(KJS::ParserRefCounted::deref):
(KJS::ParserRefCounted::refcount):
(KJS::ParserRefCounted::deleteNewObjects):
* kjs/nodes.h:
Made newTrackedObjects and trackedObjectExtraRefCounts per-thread.
2008-05-02 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Move call stack depth counter to global object.
* kjs/ExecState.h: (KJS::ExecState::functionCallDepth): Added a recursion depth counter to
per-thread data.
* kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::init): Initialize PerThreadData.functionCallDepth.
* kjs/JSGlobalObject.h: (KJS::JSGlobalObject::perThreadData): Made the result non-const.
* kjs/object.cpp:
(KJS::throwStackSizeExceededError): Moved throwError to a separate function, since it is now
the only thing in JSObject::call that needs a PIC branch.
(KJS::JSObject::call): Use a per-thread variable instead of local static for recursion depth
tracking.
2008-05-02 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Make JavaScriptGlue and JavaScriptCore API functions implicitly call initializeThreading
for the sake of non-WebKit clients.
* API/JSBase.cpp:
(JSGarbageCollect):
* API/JSContextRef.cpp:
(JSGlobalContextCreate):
These are the JavaScriptCore API bottlenecks. There are a few other JSStringRef
and JSClassRef functions that can be called earlier, but they do not do anything that
requires initializeThreading.
* kjs/InitializeThreading.cpp:
(KJS::doInitializeThreading):
(KJS::initializeThreading):
On Darwin, make the initialization happen under pthread_once, since there is no guarantee
that non-WebKit clients won't try to call this function re-entrantly.
* kjs/InitializeThreading.h:
* wtf/Threading.h:
Spell out initializeThreading contract.
* wtf/ThreadingPthreads.cpp: (WTF::isMainThread): Make sure that results are correct on
Darwin, even if threading was initialized from a secondary thread.
2008-05-02 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoffrey Garen.
https://bugs.webkit.org/show_bug.cgi?id=18826
Make JavaScript heap per-thread
* wtf/ThreadSpecific.h: Make sure to initialize POD thread-specific varaibles, too
(replaced "new T" with "new T()").
* kjs/collector.h: Renamed Collector to Heap, made the heap per-thread. Removed support for
multithreaded access to a heap.
(KJS::CollectorBlock): Removed collectOnMainThreadOnly bitmap, added a reference to owner heap.
(KJS::SmallCellCollectorBlock): Ditto.
(KJS::Heap::markListSet): Moved from a static variable in List.cpp to a per-thread one here.
(KJS::Heap::heap): Added a method to find which heap a JSValue is allocated in.
* kjs/collector.cpp: Changed "const size_t" constants to #defines, to avoid a PIC branch
(gcc was using one to access a constant used in std::max(), because it takes a reference,
even though std::max() itself was inlined).
(KJS::Heap::threadHeap): JS heap is now per-thread.
(KJS::Heap::Heap): Zero-initialize the heap.
(KJS::allocateBlock): Added NEVER_INLINE, because this function uses a PIC branch, so
inlining it in Heap::heapAllocate() is bad for performance, now that the latter doesn't
use any global data.
(KJS::Heap::heapAllocate): Initialize Block::heap.
(KJS::Heap::markCurrentThreadConservatively): Moved into markStackObjectsConservatively(),
as GC only works with a current thread's heap now.
(KJS::Heap::sweep): Removed collectOnMainThreadOnly checks.
(KJS::Heap::collect): Ditto.
* kjs/JSLock.cpp:
* kjs/JSLock.h:
(KJS::JSLock::JSLock):
Removed registerThread(), as the heap no longer cares.
* kjs/InitializeThreading.cpp: (KJS::initializeThreading): Initialize new per-thread
variables in Heap and JSGlobalObject.
* kjs/ExecState.h: (KJS::ExecState::heap): Added a heap pointer for faster access to
per-thread heap, and an accessor for it.
* kjs/JSGlobalObject.h: Made JSGlobalObject linked list per-thread.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::~JSGlobalObject): Fixed a bug in linked list handling. It only worked
right if the removed object was the head one!
(KJS::JSGlobalObject::head): Return a per-thread list head.
(KJS::JSGlobalObject::init): Store a reference to per-thread heap.
(KJS::JSGlobalObject::reset): Pass ExecState to functions that need it.
(KJS::JSGlobalObject::tearOffActivation): Ditto.
(KJS::JSGlobalObject::operator new): JSGlobalObject allocation cannot use an ExecState,
so it needs a custom operator new that directly accesses per-thread heap.
* kjs/list.h:
(KJS::List::List): Replaced m_isInMarkSet boolean with an actual pointer to the set, since it
is no longer a single static object.
(KJS::List::~List): Ditto.
* kjs/list.cpp:
(KJS::List::markSet): Removed, this is now stored in Heap.
(KJS::List::markProtectedLists): Take a reference to the list.
(KJS::List::expandAndAppend): Ask the current thread heap for a mark set reference.
* kjs/protect.h:
(KJS::gcProtect):
(KJS::gcUnprotect):
Use the newly added Heap::heap() method to find out which heap the value to be (un)protected
belongs to.
* kjs/property_map.h: Removed unused SavedProperty class.
* JavaScriptCore.exp:
* API/JSBase.cpp:
(JSGarbageCollect):
* API/JSCallbackObjectFunctions.h:
(KJS::::staticFunctionGetter):
* API/JSClassRef.cpp:
(OpaqueJSClass::prototype):
* API/JSObjectRef.cpp:
(JSObjectMake):
(JSObjectMakeFunctionWithCallback):
(JSObjectMakeConstructor):
(JSObjectMakeFunction):
* API/JSValueRef.cpp:
(JSValueMakeNumber):
(JSValueMakeString):
* kjs/array_instance.cpp:
(KJS::ArrayInstance::ArrayInstance):
(KJS::ArrayInstance::lengthGetter):
* kjs/array_object.cpp:
(KJS::arrayProtoFuncToString):
(KJS::arrayProtoFuncToLocaleString):
(KJS::arrayProtoFuncJoin):
(KJS::arrayProtoFuncConcat):
(KJS::arrayProtoFuncPop):
(KJS::arrayProtoFuncPush):
(KJS::arrayProtoFuncShift):
(KJS::arrayProtoFuncSlice):
(KJS::arrayProtoFuncSplice):
(KJS::arrayProtoFuncUnShift):
(KJS::arrayProtoFuncFilter):
(KJS::arrayProtoFuncMap):
(KJS::arrayProtoFuncEvery):
(KJS::arrayProtoFuncForEach):
(KJS::arrayProtoFuncSome):
(KJS::arrayProtoFuncIndexOf):
(KJS::arrayProtoFuncLastIndexOf):
(KJS::ArrayObjectImp::ArrayObjectImp):
(KJS::ArrayObjectImp::construct):
* kjs/bool_object.cpp:
(KJS::BooleanPrototype::BooleanPrototype):
(KJS::booleanProtoFuncToString):
(KJS::BooleanObjectImp::BooleanObjectImp):
(KJS::BooleanObjectImp::construct):
* kjs/date_object.cpp:
(KJS::formatLocaleDate):
(KJS::DatePrototype::DatePrototype):
(KJS::DateObjectImp::DateObjectImp):
(KJS::DateObjectImp::construct):
(KJS::DateObjectImp::callAsFunction):
(KJS::DateObjectFuncImp::DateObjectFuncImp):
(KJS::DateObjectFuncImp::callAsFunction):
(KJS::dateProtoFuncToString):
(KJS::dateProtoFuncToUTCString):
(KJS::dateProtoFuncToDateString):
(KJS::dateProtoFuncToTimeString):
(KJS::dateProtoFuncToLocaleString):
(KJS::dateProtoFuncToLocaleDateString):
(KJS::dateProtoFuncToLocaleTimeString):
(KJS::dateProtoFuncValueOf):
(KJS::dateProtoFuncGetTime):
(KJS::dateProtoFuncGetFullYear):
(KJS::dateProtoFuncGetUTCFullYear):
(KJS::dateProtoFuncToGMTString):
(KJS::dateProtoFuncGetMonth):
(KJS::dateProtoFuncGetUTCMonth):
(KJS::dateProtoFuncGetDate):
(KJS::dateProtoFuncGetUTCDate):
(KJS::dateProtoFuncGetDay):
(KJS::dateProtoFuncGetUTCDay):
(KJS::dateProtoFuncGetHours):
(KJS::dateProtoFuncGetUTCHours):
(KJS::dateProtoFuncGetMinutes):
(KJS::dateProtoFuncGetUTCMinutes):
(KJS::dateProtoFuncGetSeconds):
(KJS::dateProtoFuncGetUTCSeconds):
(KJS::dateProtoFuncGetMilliSeconds):
(KJS::dateProtoFuncGetUTCMilliseconds):
(KJS::dateProtoFuncGetTimezoneOffset):
(KJS::dateProtoFuncSetTime):
(KJS::setNewValueFromTimeArgs):
(KJS::setNewValueFromDateArgs):
(KJS::dateProtoFuncSetYear):
(KJS::dateProtoFuncGetYear):
* kjs/error_object.cpp:
(KJS::ErrorPrototype::ErrorPrototype):
(KJS::errorProtoFuncToString):
(KJS::ErrorObjectImp::ErrorObjectImp):
(KJS::ErrorObjectImp::construct):
(KJS::NativeErrorPrototype::NativeErrorPrototype):
(KJS::NativeErrorImp::NativeErrorImp):
(KJS::NativeErrorImp::construct):
* kjs/function.cpp:
(KJS::FunctionImp::lengthGetter):
(KJS::FunctionImp::construct):
(KJS::Arguments::Arguments):
(KJS::ActivationImp::createArgumentsObject):
(KJS::encode):
(KJS::decode):
(KJS::globalFuncParseInt):
(KJS::globalFuncParseFloat):
(KJS::globalFuncEscape):
(KJS::globalFuncUnescape):
(KJS::PrototypeFunction::PrototypeFunction):
(KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
* kjs/function_object.cpp:
(KJS::FunctionPrototype::FunctionPrototype):
(KJS::functionProtoFuncToString):
(KJS::FunctionObjectImp::FunctionObjectImp):
(KJS::FunctionObjectImp::construct):
* kjs/internal.cpp:
(KJS::StringImp::toObject):
* kjs/internal.h:
(KJS::StringImp::StringImp):
(KJS::NumberImp::operator new):
* kjs/lookup.h:
(KJS::staticFunctionGetter):
(KJS::cacheGlobalObject):
* kjs/math_object.cpp:
(KJS::MathObjectImp::getValueProperty):
(KJS::mathProtoFuncAbs):
(KJS::mathProtoFuncACos):
(KJS::mathProtoFuncASin):
(KJS::mathProtoFuncATan):
(KJS::mathProtoFuncATan2):
(KJS::mathProtoFuncCeil):
(KJS::mathProtoFuncCos):
(KJS::mathProtoFuncExp):
(KJS::mathProtoFuncFloor):
(KJS::mathProtoFuncLog):
(KJS::mathProtoFuncMax):
(KJS::mathProtoFuncMin):
(KJS::mathProtoFuncPow):
(KJS::mathProtoFuncRandom):
(KJS::mathProtoFuncRound):
(KJS::mathProtoFuncSin):
(KJS::mathProtoFuncSqrt):
(KJS::mathProtoFuncTan):
* kjs/nodes.cpp:
(KJS::Node::handleException):
(KJS::NumberNode::evaluate):
(KJS::StringNode::evaluate):
(KJS::ArrayNode::evaluate):
(KJS::PostIncResolveNode::evaluate):
(KJS::PostIncLocalVarNode::evaluate):
(KJS::PostDecResolveNode::evaluate):
(KJS::PostDecLocalVarNode::evaluate):
(KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
(KJS::PostIncBracketNode::evaluate):
(KJS::PostDecBracketNode::evaluate):
(KJS::PostIncDotNode::evaluate):
(KJS::PostDecDotNode::evaluate):
(KJS::typeStringForValue):
(KJS::LocalVarTypeOfNode::evaluate):
(KJS::TypeOfResolveNode::evaluate):
(KJS::TypeOfValueNode::evaluate):
(KJS::PreIncLocalVarNode::evaluate):
(KJS::PreIncResolveNode::evaluate):
(KJS::PreDecLocalVarNode::evaluate):
(KJS::PreDecResolveNode::evaluate):
(KJS::PreIncConstNode::evaluate):
(KJS::PreDecConstNode::evaluate):
(KJS::PostIncConstNode::evaluate):
(KJS::PostDecConstNode::evaluate):
(KJS::PreIncBracketNode::evaluate):
(KJS::PreDecBracketNode::evaluate):
(KJS::PreIncDotNode::evaluate):
(KJS::PreDecDotNode::evaluate):
(KJS::NegateNode::evaluate):
(KJS::BitwiseNotNode::evaluate):
(KJS::MultNode::evaluate):
(KJS::DivNode::evaluate):
(KJS::ModNode::evaluate):
(KJS::addSlowCase):
(KJS::add):
(KJS::AddNumbersNode::evaluate):
(KJS::AddStringsNode::evaluate):
(KJS::AddStringLeftNode::evaluate):
(KJS::AddStringRightNode::evaluate):
(KJS::SubNode::evaluate):
(KJS::LeftShiftNode::evaluate):
(KJS::RightShiftNode::evaluate):
(KJS::UnsignedRightShiftNode::evaluate):
(KJS::BitXOrNode::evaluate):
(KJS::BitOrNode::evaluate):
(KJS::valueForReadModifyAssignment):
(KJS::ForInNode::execute):
(KJS::TryNode::execute):
(KJS::FuncDeclNode::makeFunction):
(KJS::FuncExprNode::evaluate):
* kjs/number_object.cpp:
(KJS::NumberPrototype::NumberPrototype):
(KJS::numberProtoFuncToString):
(KJS::numberProtoFuncToLocaleString):
(KJS::numberProtoFuncToFixed):
(KJS::numberProtoFuncToExponential):
(KJS::numberProtoFuncToPrecision):
(KJS::NumberObjectImp::NumberObjectImp):
(KJS::NumberObjectImp::getValueProperty):
(KJS::NumberObjectImp::construct):
(KJS::NumberObjectImp::callAsFunction):
* kjs/object.cpp:
(KJS::JSObject::defineGetter):
(KJS::JSObject::defineSetter):
(KJS::JSObject::putDirect):
(KJS::Error::create):
* kjs/object.h:
* kjs/object_object.cpp:
(KJS::ObjectPrototype::ObjectPrototype):
(KJS::objectProtoFuncToLocaleString):
(KJS::objectProtoFuncToString):
(KJS::ObjectObjectImp::ObjectObjectImp):
(KJS::ObjectObjectImp::construct):
* kjs/regexp_object.cpp:
(KJS::RegExpPrototype::RegExpPrototype):
(KJS::regExpProtoFuncToString):
(KJS::RegExpImp::getValueProperty):
(KJS::RegExpObjectImp::RegExpObjectImp):
(KJS::RegExpObjectImp::arrayOfMatches):
(KJS::RegExpObjectImp::getBackref):
(KJS::RegExpObjectImp::getLastParen):
(KJS::RegExpObjectImp::getLeftContext):
(KJS::RegExpObjectImp::getRightContext):
(KJS::RegExpObjectImp::getValueProperty):
(KJS::RegExpObjectImp::createRegExpImp):
* kjs/regexp_object.h:
* kjs/string_object.cpp:
(KJS::StringInstance::StringInstance):
(KJS::StringInstance::lengthGetter):
(KJS::StringInstance::indexGetter):
(KJS::stringInstanceNumericPropertyGetter):
(KJS::StringPrototype::StringPrototype):
(KJS::replace):
(KJS::stringProtoFuncCharAt):
(KJS::stringProtoFuncCharCodeAt):
(KJS::stringProtoFuncConcat):
(KJS::stringProtoFuncIndexOf):
(KJS::stringProtoFuncLastIndexOf):
(KJS::stringProtoFuncMatch):
(KJS::stringProtoFuncSearch):
(KJS::stringProtoFuncReplace):
(KJS::stringProtoFuncSlice):
(KJS::stringProtoFuncSplit):
(KJS::stringProtoFuncSubstr):
(KJS::stringProtoFuncSubstring):
(KJS::stringProtoFuncToLowerCase):
(KJS::stringProtoFuncToUpperCase):
(KJS::stringProtoFuncToLocaleLowerCase):
(KJS::stringProtoFuncToLocaleUpperCase):
(KJS::stringProtoFuncLocaleCompare):
(KJS::stringProtoFuncBig):
(KJS::stringProtoFuncSmall):
(KJS::stringProtoFuncBlink):
(KJS::stringProtoFuncBold):
(KJS::stringProtoFuncFixed):
(KJS::stringProtoFuncItalics):
(KJS::stringProtoFuncStrike):
(KJS::stringProtoFuncSub):
(KJS::stringProtoFuncSup):
(KJS::stringProtoFuncFontcolor):
(KJS::stringProtoFuncFontsize):
(KJS::stringProtoFuncAnchor):
(KJS::stringProtoFuncLink):
(KJS::StringObjectImp::StringObjectImp):
(KJS::StringObjectImp::construct):
(KJS::StringObjectImp::callAsFunction):
(KJS::StringObjectFuncImp::StringObjectFuncImp):
(KJS::StringObjectFuncImp::callAsFunction):
* kjs/string_object.h:
(KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
* kjs/testkjs.cpp:
(GlobalObject::GlobalObject):
(functionGC):
(functionRun):
(functionReadline):
(kjsmain):
* kjs/ustring.h:
* kjs/value.cpp:
(KJS::JSCell::operator new):
(KJS::jsString):
(KJS::jsOwnedString):
(KJS::jsNumberCell):
* kjs/value.h:
(KJS::jsNaN):
(KJS::jsNumber):
(KJS::jsNumberFromAnd):
(KJS::JSCell::marked):
(KJS::JSCell::mark):
(KJS::JSValue::toJSNumber):
Removed collectOnMainThreadOnly, as this is the only way to collect now. Replaced calls to
static Collector methods with calls to per-thread Heap ones.
2008-05-02 Dan Bernstein <mitz@apple.com>
Reviewed by Maciej Stachowiak.
- Mac build fix
* wtf/StrHash.h: Added header guards and removed #include "config.h".
2008-05-01 Ada Chan <adachan@apple.com>
#include <wtf/StrHash.h> in identifier.cpp.
Reviewed by Maciej.
* kjs/identifier.cpp:
2008-05-01 Steve Falkenburg <sfalken@apple.com>
Build fix.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2008-05-01 Sam Weinig <sam@webkit.org>
Fix build.
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-05-01 Kevin McCullough <kmccullough@apple.com>
Reviewed by Darin.
<rdar://problem/5770054> JavaScript profiler (10928)
- Fix "sample" output so that it can be imported into Instruments
- Also keep track of number of times a function is profiled.
* JavaScriptCore.xcodeproj/project.pbxproj: Add StrHash.h which needed
to be pulled out of identifier.cpp so that it could be used by the
profiler and identifiers.
* kjs/identifier.cpp: Ditto.
* profiler/FunctionCallProfile.cpp:
(KJS::FunctionCallProfile::printDataInspectorStyle): Inspector style
printing should show microseconds.
(KJS::FunctionCallProfile::printDataSampleStyle): Sample style printing
now counts the number of times a function is in the stack tree and does
not print microseconds since that does not make sense for a sampler.
* profiler/FunctionCallProfile.h: Keep track of number of times a
function is profiled.
(KJS::FunctionCallProfile::numberOfCalls):
* profiler/Profiler.cpp:
(KJS::functionNameCountPairComparator): Comparator for sort function in
printDataSampleStyle.
(KJS::Profiler::printDataSampleStyle): Print the number of times that a
function is listed in the stack tree in order of most times listed.
* wtf/HashCountedSet.h: Added copyToVector since it didn't exist and is
a more standard way to copy a HashSet to a Vector. I added on variant
that takes a pair as the Vector's type and so the HashCountedSet simply
fills in that pair with its internal pair, and another variant that
takes a Vector of the type of the HashCountedSet and only fills in the
Vector with the first element of the pair.
(WTF::copyToVector):
* wtf/StrHash.h: Added.
(WTF::):
2008-04-29 David Kilzer <ddkilzer@apple.com>
BUILD FIX for ENABLE(DASHBOARD_SUPPORT)
* wtf/Platform.h: Defined ENABLE(DASHBOARD_SUPPORT) to 1 only for
PLATFORM(MAC) and PLATFORM(WIN). Changed default to 0 for other
ports.
2008-04-29 Greg Bolsinga <bolsinga@apple.com>
Reviewed by Darin.
Wrapped Dashboard code with ENABLE(DASHBOARD_SUPPORT)
* wtf/Platform.h:
2008-04-29 Kevin McCullough <kmccullough@apple.com>
Reviewed by Geoff.
-<rdar://problem/5770054> JavaScript profiler (10928)
-Keep call count.
* profiler/FunctionCallProfile.cpp:
(KJS::FunctionCallProfile::FunctionCallProfile):
(KJS::FunctionCallProfile::didExecute): Implements call count and fixed a bug where a stackIndex
of 0 was causing the assert to be hit.
(KJS::FunctionCallProfile::stopProfiling):
(KJS::FunctionCallProfile::endAndRecordCall):
* profiler/FunctionCallProfile.h:
2008-04-29 Simon Hausmann <hausmann@webkit.org>
Qt/Windows build fix. The externally declared hash tables are actually
declared const and the const is mangled in the symbol name, so when
importing they also need to be marked const.
When compiling without MULTIPLE_THREADS use a const HashTable&
instead of a HashTable& in ThreadClassInfoHashTables to avoid
initializing the latter with a const reference.
* kjs/JSGlobalObject.cpp:
2008-04-28 Alexey Proskuryakov <ap@webkit.org>
Windows build fix.
* kjs/ExecState.h: For whatever reason, MSVC couldn't generate a default constructor for
a struct that had a "const List" member. Removing the const qulifier makes the problem go away.
2008-04-28 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Fix run-webkit-tests --threading
and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661>
Proxy server issue in Sunday's Nightly
Changed ClassInfo objects for built-in objects to hold a getter function returning
a per-thread instance. This makes it safe to share these ClassInfo objects between threads -
and these are the only ones that need to be shared.
* kjs/lexer.cpp:
(KJS::Lexer::Lexer):
(KJS::Lexer::~Lexer):
* kjs/lexer.h:
Made mainTable a member of Lexer, so that it no longer needs to be shared between threads.
* kjs/object.cpp:
(KJS::JSObject::deleteProperty):
(KJS::JSObject::findPropertyHashEntry):
(KJS::JSObject::propertyIsEnumerable):
(KJS::JSObject::getPropertyAttributes):
(KJS::JSObject::getPropertyNames):
* kjs/object.h:
(KJS::ClassInfo::propHashTable):
Added a new classPropHashTableGetterFunction field to ClassInfo. If it is non-zero, the
static table is not used.
* kjs/JSGlobalObject.cpp:
(KJS::ThreadClassInfoHashTables::ThreadClassInfoHashTables): This new class holds per-thread
HashTables for built-in classes. The old static structs are copied to create per-thread
instances.
(KJS::JSGlobalObject::threadClassInfoHashTables): An accessor/initializer for the above.
(KJS::JSGlobalObject::init): Copy per-thread data into a single structure for faster access.
Also, construct globalExec.
(KJS::JSGlobalObject::reset): Adapted for globalExec now being an OwnPtr.
(KJS::JSGlobalObject::mark): Ditto.
(KJS::JSGlobalObject::globalExec): Ditto.
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Made JSGlobalObject::JSGlobalObjectData::globalExec an OwnPtr, so that it can
be initialized from JSGlobalObject::init() after them. Otherwise, ExecState constructor was
trying to access half-initialized JSGlobalObject to make its own copy of these table
references, and failed.
(KJS::JSGlobalObject::JSGlobalObject): Pass "this" value to init() to create globalExec.
(KJS::JSGlobalObject::perThreadData): An accessor for per-thread data.
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState):
* kjs/ExecState.h:
(KJS::ExecState::propertyNames):
(KJS::ExecState::emptyList):
(KJS::ExecState::arrayTable):
(KJS::ExecState::dateTable):
(KJS::ExecState::mathTable):
(KJS::ExecState::numberTable):
(KJS::ExecState::RegExpImpTable):
(KJS::ExecState::RegExpObjectImpTable):
(KJS::ExecState::stringTable):
* kjs/ExecStateInlines.h:
(KJS::ExecState::ExecState):
Each ExecState holds its own reference to per-thread data, for even faster access. Moved
m_emptyList and m_propertyNames to the same structure, making ExecState faster to construct
and take less space on the stack.
* kjs/InitializeThreading.cpp: (KJS::initializeThreading): Initialize thread-static data
added to JSGlobalObject.
* API/JSCallbackConstructor.cpp:
* API/JSCallbackFunction.cpp:
* API/JSCallbackObject.cpp:
* JavaScriptCore.exp:
* kjs/JSVariableObject.cpp:
(KJS::JSVariableObject::getPropertyAttributes):
* kjs/JSVariableObject.h:
* kjs/array_instance.cpp:
* kjs/array_object.cpp:
(KJS::ArrayPrototype::getOwnPropertySlot):
* kjs/bool_object.cpp:
* kjs/create_hash_table:
* kjs/date_object.cpp:
(KJS::DatePrototype::getOwnPropertySlot):
(KJS::DateObjectImp::DateObjectImp):
* kjs/error_object.cpp:
* kjs/function.cpp:
* kjs/function_object.cpp:
(KJS::FunctionPrototype::FunctionPrototype):
* kjs/internal.cpp:
* kjs/lookup.h:
* kjs/math_object.cpp:
(KJS::MathObjectImp::getOwnPropertySlot):
* kjs/number_object.cpp:
(KJS::NumberObjectImp::getOwnPropertySlot):
* kjs/object_object.cpp:
(KJS::ObjectPrototype::ObjectPrototype):
* kjs/regexp_object.cpp:
(KJS::RegExpPrototype::RegExpPrototype):
(KJS::RegExpImp::getOwnPropertySlot):
(KJS::RegExpImp::put):
(KJS::RegExpObjectImp::getOwnPropertySlot):
(KJS::RegExpObjectImp::put):
* kjs/string_object.cpp:
(KJS::StringPrototype::getOwnPropertySlot):
Adjust for the above changes.
2008-04-28 Darin Adler <darin@apple.com>
Reviewed by Adam.
- make sure RefPtr's default hash doesn't ref/deref when computing the hash
- remove remnants of the hash table storage type optimization
* wtf/HashFunctions.h: Used "using" to get the hash and equal functions
from PtrHash<P*> into PtrHash<RefPtr<P>>.
* wtf/HashMap.h: Replaced uses of PairBaseHashTraits with PairHashTraits.
Eliminated storage-related typedefs. Removed constructor, destructor,
copy constructor, and destructor since the compiler-generated ones are
fine. Removed refAll and derefAll. Took out unnnecessary typecasts.
Removed use of RefCounter.
* wtf/HashSet.h: Eliminated storage-related typedefs. Removed constructor,
destructor, copy constructor, and destructor since the compiler-generated
ones are fine. Removed refAll and derefAll. Removed unneeded template
arguents from HashSetTranslatorAdapter. Eliminated unneeded HashSetTranslator
template.
* wtf/HashTable.h: Tweaked formatting. Removed NeedsRef, RefCounterBase,
RefCounter, HashTableRefCounterBase, HashTableRefCounter, and Assigner
class templates.
* wtf/HashTraits.h: Removed StorageTraits, needsRef, PairBaseHashTraits,
and HashKeyStorageTraits.
* wtf/RefPtrHashMap.h: Made all the same fixes as in HashMap. Also made
the corresponding changes to RefPtrHashMapRawKeyTranslator.
2008-04-28 Darin Adler <darin@apple.com>
Reviewed by Mitz.
- fix assertion hit every time you view www.apple.com
* kjs/PropertyNameArray.cpp:
(KJS::PropertyNameArray::add): Changed assertion to allow null and empty strings.
Now to find out why we have a property named "" and if that's a bug!
2008-04-27 Mark Rowe <mrowe@apple.com>
Reviewed by Maciej Stachowiak.
Fix crash inside PtrHash::hash when loading a page.
* wtf/HashFunctions.h: Explicitly use the superclass implementation of hash to avoid infinite recursion.
2008-04-27 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fix <rdar://problem/5657459> REGRESSION: JavaScriptCore no longer builds with
GCC 4.2 due to pointer aliasing warnings
Fix this by removing the HashTable optimizations that allowed us to share a back end
implementation between hash tables with integers, pointers, RefPtr, and String objects
as keys. The way it worked was incompatible with strict aliasing.
This increases code size. On Mac OS X we'll have to regenerate .order files to avoid
slowing down Safari startup times.
This creates a slight slowdown in SunSpider, mitigated by the following four speedups:
- speed up array put slightly by moving a branch (was already done for get)
- speed up symbol table access by adding a function named inlineGet to HashMap
and using that in symbolTableGet/Put
- speed up PropertyNameArray creation by reducing the amount of reference count
churn and uniqueness checking when adding names and not doing any allocation at
all when building small arrays
- speed up conversion of strings to floating point numbers by eliminating the
malloc/free of the buffer for the ASCII copy of the string; a way to make
things even faster would be to change strtod to take a UTF-16 string
Note that there is considerable unused complexity now in HashSet/Map/Table to support
"storage types", which is no longer used. Will do in a separate patch.
* API/JSCallbackObjectFunctions.h:
(KJS::JSCallbackObject<Base>::getPropertyNames): Removed explicit cast to Identifier to
take advantage of the new PropertyNameArray::add overload and avoid reference count churn.
* API/JSObjectRef.cpp:
(JSPropertyNameAccumulatorAddName): Ditto.
* JavaScriptCore.exp: Updated PropertyNameArray::add entry point name.
* kjs/JSVariableObject.cpp: Removed now-unneeded IdentifierRepHashTraits::nullRepPtr
definition (see below).
(KJS::JSVariableObject::getPropertyNames): Removed explicit cast to Identifier.
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::symbolTableGet): Use inlineGet for speed. Also changed to do
early exit instead of nesting the body inside an if.
(KJS::JSVariableObject::symbolTablePut): Ditto.
* kjs/PropertyNameArray.cpp:
(KJS::PropertyNameArray::add): Changed implementation to take a raw pointer instead of
a reference to an identifier. Do uniqueness checking by searching the vector when the
vector is short, only building the set once the vector is large enough.
* kjs/PropertyNameArray.h: Added an overload of add for a raw pointer, and made the old
add function call that one. Added an addKnownUnique function for use when the new
name is known to be different from any other in the array. Changed the vector to have
an inline capacity of 20.
* kjs/SymbolTable.h: Changed IdentifierRepHash to inherit from the default hash for
a RefPtr so we don't have to define so much. Added an overload of the hash function for
a raw pointer as required by the new RefPtrHashMap. Got rid of the now-unneeded
IdentifierRepHashTraits -- the default traits now work fine. Added a definition of
empthValueIsZero to SymbolTableIndexHashTraits; not having it was incorrect, but harmless.
* kjs/array_instance.cpp:
(KJS::ArrayInstance::put): Move the maxArrayIndex check inside the branch that checks
the index against the length, as done in the get function.
* kjs/function.cpp:
(KJS::globalFuncKJSPrint): Changed to use the new getCString instead of cstring.
* kjs/internal.cpp: Removed printInfo debugging function, a client of cstring.
If we need a debugging function we can easily make a better one and we haven't
used this one in a long time.
* kjs/internal.h: Ditto.
* kjs/object.cpp:
(KJS::JSObject::getPropertyNames): Removed explicit cast to Identifier.
* kjs/property_map.cpp:
(KJS::PropertyMap::getEnumerablePropertyNames): Ditto. Also added a special case for
the case where the propertyNames array is empty -- in that case we know we're adding
a set of names that are non-overlapping so we can use addKnownUnique.
* kjs/ustring.cpp:
(KJS::UString::getCString): Replaces cstring. Puts the C string into a CStringBuffer,
which is a char Vector with an inline capacity. Also returns a boolean to indicate if
the converion was lossy, which eliminates the need for a separate is8Bit call.
(KJS::UString::toDouble): Changed to call getCString instead of cstring.
* kjs/ustring.h: Ditto.
* wtf/HashFunctions.h: Overload the hash and equal functions for RefPtr's default
hash to take raw pointers. This works with the changes to RefPtrHashMap to avoid
introducing refcount churn.
* wtf/HashMap.h: Removed special code to convert the deleted value to the empty value
when writing a new value into the map. This is now handled elsewhere.
(WTF::HashMap::get): Removed code that checks for an empty hash table before calling
HashTable::lookup; it's slightly more efficient to do this check inside lookup.
* wtf/HashTable.h:
(WTF::HashTable::isDeletedBucket): Changed to use isDeletedValue instead of using
deletedValue and the equality operator.
(WTF::HashTable::deleteBucket): Changed to use constructDeletedValue instead of
using deletedValue and the assignment operator.
(WTF::HashTable::checkKey): Added. Factors out the check for values that are empty
or deleted keys that's used in various functions below.
(WTF::HashTable::lookup): Changed to use checkKey, check for a 0 table, and also
made public for use by RefPtrHashMap.
(WTF::HashTable::lookupForWriting): Changed to use checkKey.
(WTF::HashTable::fullLookupForWriting): Changed to use checkKey.
(WTF::HashTable::add): Changed to use checkKey, and call initializeBucket on a
deleted bucket before putting a new entry into it.
(WTF::HashTable::addPassingHashCode): Ditto.
(WTF::HashTable::deallocateTable): Check isDeletedBucket before calling ~ValueType.
* wtf/HashTraits.h: Got ridd of all the HashTraits specialization for the integer
types, since GeneicHashTraitsBase already deals with integers separately. Put the
deleted value support into GenericHashTraitsBase. Changed FloatHashTraits to
inherit from GenericHashTraits, and define construct/isDeletedValue rather than
deletedValue. Removed the ref and deref functions from RefPtr's HashTraits, and
defined construct/isDeletedValue. Eliminated DeletedValueAssigner. Changed
PairHashTraits to define construct/isDeletedValue, and also merged
PairBaseHashTraits in with PairHashTraits. Got rid of all specialization of
HashKeyStorageTraits. We'll remove that, and the needsRef data member, later.
* wtf/RefPtr.h: Added HashTableDeletedValueType, an enum type with a single value,
HashTableDeletedValue. Used that type to make a new constructor to construct
deleted values and also added an isHashTableDeletedValue function.
* wtf/RefPtrHashMap.h: Added RefPtrHashMapRawKeyTranslator and used it to implement
the raw pointer functions. This is a way to continue to avoid refcount thrash. We
can't use the old way because it depended on the underlying map using a non-RefPtr
type.
(WTF::HashMap::find): Use find with RefPtrHashMapRawKeyTranslator.
(WTF::HashMap::contains): Use contains with RefPtrHashMapRawKeyTranslator.
(WTF::HashMap::inlineAdd): Use add with RefPtrHashMapRawKeyTranslator.
(WTF::HashMap::get): Removed code that checks for an empty hash table before calling
HashTable::lookup; it's slightly more efficient to do this check inside lookup.
(WTF::HashMap::inlineGet): Added. Just like get, but marked inline for use in the
symbol table code.
2008-04-25 Sam Weinig <sam@webkit.org>
Rubber-stamped by Mark Rowe.
Remove SavedBuiltins and SavedProperties classes and the methods used to
save data to them. The CachedPage now stores a the JSGlobalObject in full.
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/JSGlobalObject.cpp:
* kjs/JSGlobalObject.h:
* kjs/JSVariableObject.cpp:
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::localStorage):
* kjs/SavedBuiltins.h: Removed.
* kjs/object.h:
* kjs/property_map.cpp:
* kjs/property_map.h:
2008-04-25 Mark Rowe <mrowe@apple.com>
Rubber-stamped by Sam Weinig.
Add some content to an empty ICU header file to prevent verification errors.
* icu/unicode/utf_old.h:
2008-04-25 David Kilzer <ddkilzer@apple.com>
<rdar://problem/5819422> REGRESSION: Wrong line number passed to -willLeaveCallFrame
Patch by George Dicker and Michael Kahl. Reviewed by Darin.
When -[NSObject(WebScriptDebugDelegate) webView:willLeaveCallFrame:sourceId:line:forWebFrame:]
is invoked, the first line number of the function is returned instead of the last
line number. This regressed in r28458.
* kjs/nodes.cpp:
(KJS::FunctionBodyNodeWithDebuggerHooks::execute): Pass lastLine() instead of lineNo()
when calling Debugger::returnEvent().
2008-04-25 Darin Adler <darin@apple.com>
Done with Stephanie Lewis.
* JavaScriptCore.xcodeproj/project.pbxproj: Prepare for compilation with gcc 4.2 by
adding -fno-strict-aliasing to CollatorICU.cpp.
2008-04-24 Sam Weinig <sam@webkit.org>
Reviewed by Geoffrey Garen.
Add a #define to easily enable collecting on every allocation to aid
debugging GC bugs.
* kjs/collector.cpp:
(KJS::Collector::heapAllocate):
2008-04-24 Kevin McCullough <kmccullough@apple.com>
Reviewed by Adam and Sam.
-<rdar://problem/5770054> JavaScript profiler (10928)
-Only profile the page group that starts profiling to avoid profiling
tools that shouldn't be profiled unless explicitly requested to.
* JavaScriptCore.exp: Export new signature.
* kjs/JSGlobalObject.cpp: Add unique identifiers to the JSGlobalObject.
(KJS::JSGlobalObject::init):
* kjs/JSGlobalObject.h: Ditto.
(KJS::JSGlobalObject::setPageGroupIdentifier):
(KJS::JSGlobalObject::pageGroupIdentifier):
* profiler/Profiler.cpp: Check the identifier of the page group of the
lexical global exec state and only profile if it matches the given page
group identifier.
(KJS::Profiler::startProfiling):
(KJS::Profiler::willExecute):
(KJS::Profiler::didExecute):
* profiler/Profiler.h: Ditto.
(KJS::Profiler::Profiler):
2008-04-24 Julien Chaffraix <jchaffraix@webkit.org>
Reviewed by Simon.
Bug 15940: Implement threading API for Qt
https://bugs.webkit.org/show_bug.cgi?id=15940
Original patch by Justin Haygood, tweaked by me.
* JavaScriptCore.pri:
* wtf/ThreadingQt.cpp: Added.
(WTF::threadMapMutex):
(WTF::threadMap):
(WTF::establishIdentifierForThread):
(WTF::clearThreadForIdentifier):
(WTF::threadForIdentifier):
(WTF::initializeThreading):
(WTF::ThreadPrivate::getReturnValue):
(WTF::ThreadPrivate::ThreadPrivate):
(WTF::ThreadPrivate::run):
(WTF::createThread):
(WTF::waitForThreadCompletion): return !res to return
0 on success (to match the pthreads implementation).
(WTF::detachThread):
(WTF::identifierByQthreadHandle):
(WTF::currentThread):
(WTF::Mutex::Mutex):
(WTF::Mutex::~Mutex):
(WTF::Mutex::lock):
(WTF::Mutex::tryLock):
(WTF::Mutex::unlock):
(WTF::ThreadCondition::ThreadCondition):
(WTF::ThreadCondition::~ThreadCondition):
(WTF::ThreadCondition::wait):
(WTF::ThreadCondition::timedWait):
(WTF::ThreadCondition::signal):
2008-04-22 Darin Adler <darin@apple.com>
Reviewed by Anders.
- simplify use of HashTraits to prepare for some upcoming hash table changes
* kjs/SymbolTable.h: Made SymbolTableIndexHashTraits derive from HashTraits<size_t>
and specialize only the empty value.
2008-04-23 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Simon.
Removed the #define for USE_SYSTEM_MALLOC that we set in WebKit.pri
already.
* wtf/Platform.h:
2008-04-21 Kevin McCullough <kmccullough@apple.com>
Reviewed by Adam.
<rdar://problem/5770054> JavaScript profiler (10928)
- When stop profiling is called we need to stop the timers on all the
functions that are still running.
* profiler/FunctionCallProfile.cpp:
(KJS::FunctionCallProfile::didExecute):
(KJS::FunctionCallProfile::stopProfiling):
* profiler/FunctionCallProfile.h:
* profiler/Profiler.cpp:
(KJS::Profiler::stopProfiling):
2008-04-21 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Move collector main thread initialization from WebKit/win to KJS::initializeThreading.
* kjs/InitializeThreading.cpp:
(KJS::initializeThreading):
2008-04-21 Adam Roben <aroben@apple.com>
MSVC build fix
Reviewed by Alexey Proskuryakov.
* kjs/ustring.h:
(KJS::UString::cost): Disable a warning about assigning a 32-bit
size_t into a 31-bit size_t.
2008-04-21 Simon Hausmann <hausmann@webkit.org>
Reviewed by Lars.
Made convertValueToQVariant accessible from within WebKit/qt/Api
* bindings/qt/qt_runtime.h:
2008-04-21 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
Reviewed by Simon.
Build fix for Qt 4.3
* When building WebCore/internal make sure the QT_[BEGIN,END]_NAMESPACE is
always defined. Do this by adding defines to the compiler line
* For users of our API this is not feasible. Every public header file should
include qwebkitglobal.h. Define the QT_BEGIN_NAMESPACE and QT_END_NAMESPACE
when we are building everything < 4.4.0 and don't have them defined.
* kjs/testkjs.pro:
2008-04-19 Matt Lilek <webkit@mattlilek.com>
Not reviewed, Windows build fix - copy the profiler headers in all
configurations, not just Debug_Internal.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2008-04-19 Mike Hommey <glandium@debian.org>
Reviewed by Alp Toker.
Don't build testkjs with rpath.
* GNUmakefile.am:
2008-04-18 Kevin Ollivier <kevino@theolliviers.com>
wx build fixes. Rename LocalStorage.h to LocalStorageEntry.h
to avoid header detection issues between WebCore/storage/LocalStorage.h
and it, and add $(PROFILER_SOURCES) to the wx JSCore build.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* jscore.bkl:
* kjs/ExecState.h:
* kjs/JSVariableObject.h:
* kjs/LocalStorage.h: Removed.
* kjs/LocalStorageEntry.h: Copied from JavaScriptCore/kjs/LocalStorage.h.
* kjs/function.h:
2008-04-18 Jan Michael Alonzo <jmalonzo@unpluggable.com>
Reviewed by Alp Toker.
http://bugs.webkit.org/show_bug.cgi?id=16620
[GTK] Autotools make dist and make check support
Cleanups.
* GNUmakefile.am:
2008-04-18 Jon Honeycutt <jhoneycutt@apple.com>
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Windows
build fix.
2008-04-11 Mark Rowe <mrowe@apple.com>
Rubber-stamped by Antti Koivisto.
Silence GCC 4.3 warnings by removing extraneous consts.
* kjs/ustring.cpp:
* kjs/ustring.h:
2008-04-18 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam.
-<rdar://problem/5770054> JavaScript profiler (10928)
- Use Deque instead of Vector since the profiler uses prepend a lot
and deque is faster at that.
* profiler/FunctionCallProfile.h:
(KJS::FunctionCallProfile::milliSecs): Corrected the name to match
its output.
* wtf/Deque.h:
(WTF::deleteAllValues):
2008-04-18 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam and Adam.
-<rdar://problem/5770054> JavaScript profiler (10928)
- Cleaned up the header file and made some functions static, added
a new, sane, printing function, and fixed a few minor bugs.
* JavaScriptCore.exp:
* JavaScriptCore.xcodeproj/project.pbxproj:
* profiler/FunctionCallProfile.cpp:
(KJS::FunctionCallProfile::didExecute): Removed assertion that time is
> 0 because at ms resolution that may not be true and only cross-
platform way to get time differences is in ms.
(KJS::FunctionCallProfile::printDataInspectorStyle): Added a new
printing function for dumping data in a sane style.
(KJS::FunctionCallProfile::printDataSampleStyle): Fixed a bug where we
displayed too much precision when printing our floats. Also added logic
to make sure we don't display 0 because that doesn't make sense for a
sampling profile.
* profiler/FunctionCallProfile.h:
* profiler/Profiler.cpp: Moved functions that could be static into the
implementation, and chaned the ASSERTs to early returns. I did this
because console.profile() is a JS function and so was being profiled
but asserting because the profiler had not been started! In the future
I would like to put the ASSERTs back and not profile the calls to
console.profile() and console.profileEnd().
(KJS::Profiler::willExecute):
(KJS::Profiler::didExecute):
(KJS::getStackNames): Fixed a bug where the wrong ExecState was being
used.
(KJS::getFunctionName):
(KJS::Profiler::printDataInspectorStyle):
* profiler/Profiler.h:
2008-04-18 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Fix leaks during plugin tests (which actually excercise background JS), and potential
PAC brokenness that was not reported, but very likely.
The leaks shadowed a bigger problem with Identifier destruction. Identifier::remove involves
an IdentifierTable lookup, which is now a per-thread instance. Since garbage collection can
currently happen on a different thread than allocation, a wrong table was used.
No measurable change on SunSpider total, ~1% variation on individual tests.
* kjs/ustring.cpp:
(KJS::UString::Rep::create):
(KJS::UString::Rep::destroy):
* kjs/ustring.h:
Replaced isIdentifier with a pointer to IdentifierTable, so that destruction can be done
correctly. Took one bit from reportedCost, to avoid making UString::Rep larger (performance
effect was measurable on SunSpider).
* kjs/identifier.cpp:
(KJS::IdentifierTable::IdentifierTable):
(KJS::IdentifierTable::~IdentifierTable):
(KJS::IdentifierTable::add):
(KJS::IdentifierTable::remove):
Make IdentifierTable a real class. Its destructor needs to zero out outstanding references,
because some identifiers may briefly outlive it during thread destruction, and we don't want
them to use their stale pointers.
(KJS::LiteralIdentifierTable):
(KJS::Identifier::add):
Now that LiteralIdentifierTable is per-thread and can be destroyed not just during application
shutdown, it is not appropriate to simply bump refcount for strings that get there; changed
the table to hold RefPtrs.
(KJS::CStringTranslator::translate):
(KJS::UCharBufferTranslator::translate):
(KJS::Identifier::addSlowCase):
(KJS::Identifier::remove):
* kjs/identifier.h:
(KJS::Identifier::add):
Use and update UString::Rep::identifierTable as appropriate. Updating it is now done in
IdentifierTable::add, not in translators.
2008-04-18 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Get rid of static compareWithCompareFunctionArguments in array_instance.cpp.
No change on SunSpider, CelticKane or iBench JavaScript. It is probable that in some cases,
merge sort is still faster, but more investigation is needed to determine a new cutoff.
Or possibly, it would be better to do what FIXME says (change to tree sort).
Also, made arguments a local variable - not sure why it was a member of
CompareWithCompareFunctionArguments.
* kjs/array_instance.cpp:
(KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
(KJS::CompareWithCompareFunctionArguments::operator()):
(KJS::ArrayInstance::sort):
2008-04-18 Simon Hausmann <hausmann@webkit.org>
Build fix for gcc 4.3. Include stdio.h for printf.
* profiler/FunctionCallProfile.cpp:
* profiler/Profiler.cpp:
2008-04-17 Jon Honeycutt <jhoneycutt@apple.com>
Reviewed by mrowe.
* wtf/Platform.h: Add HAVE_ACCESSIBILITY to Platform.h.
2008-04-17 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Maciej.
Thread static data destructors are not guaranteed to be called in any particular order;
turn ThreadSpecific into a phoenix-style singleton to avoid accessing freed memory when
deleted objects are interdependent (e.g. CommonIdentifiers and internal identifier tables).
No change on SunSpider.
* wtf/ThreadSpecific.h:
(WTF::ThreadSpecific::Data::Data):
(WTF::::get):
(WTF::::set):
(WTF::::destroy):
2008-04-15 Srinivas Rao. M Hamse <msrinirao@gmail.com>
Reviewed by Maciej Stachowiak.
- gcc 3.x build fix
* kjs/nodes.h: CallerType definition made public for gcc 3.x compilation
2008-04-16 Brady Eidson <beidson@apple.com>
Reviewed by Sam Weinig
Change ThreadSafeShared to act like RefCounted by starting out with a single ref by default
* wtf/Threading.h:
(WTF::ThreadSafeShared::ThreadSafeShared):
2008-04-16 Sam Weinig <sam@webkit.org>
Reviewed by Geoffrey Garen.
- To keep the behavior of the WebKit and JavaScriptCore API's the same,
we need to hide the fact that the global object and the window object
are no longer the same thing, and the the global object now changes on
navigations. To do this, only the wrapper should ever be exposed. This
fixes the two remaining spots where the internal global object is exposed,
the windowScriptObject returned from [WebFrame windowObject] and the object
return by calling JSContextGetGlobalObject on [WebFrame globalContext].
* API/JSContextRef.cpp:
(JSContextGetGlobalObject):
This is a bit of a hack, this returns the "this" representation of the globalObject
which will be the WrapperWindow for WebCore and the globalObject for non-WebCore.
* API/JSObjectRef.cpp:
(JSObjectSetProperty):
Call the new putWithAttributes method instead of relying on lower-level calls.
This is needed so that the window wrapper can forward the calls.
* JavaScriptCore.exp:
* kjs/Activation.h:
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::putWithAttributes):
* kjs/JSGlobalObject.h:
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::symbolTablePutWithAttributes):
* kjs/function.cpp:
(KJS::ActivationImp::putWithAttributes):
* kjs/nodes.cpp:
(KJS::ConstDeclNode::handleSlowCase):
(KJS::ConstDeclNode::evaluateSingle):
(KJS::EvalNode::processDeclarations):
* kjs/object.cpp:
(KJS::JSObject::putWithAttributes):
* kjs/object.h:
Rename initializeVariable to putWithAttributes and move it down to JSObject so it
can be used for JSObjectSetProperty.
2008-04-16 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam and Geoff.
-<rdar://problem/5770054> JavaScript profiler (10928)
Inital profiler prototype
* GNUmakefile.am: Added new files to project
* JavaScriptCore.pri: Ditto
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto
* JavaScriptCore.xcodeproj/project.pbxproj: Ditto
* JavaScriptCoreSources.bkl: Ditto
* kjs/config.h: Put compiling flag in here.
* kjs/function.cpp: Instrument calling the function eval().
(KJS::eval):
* kjs/interpreter.cpp: Instrument evaluating global scopes.
(KJS::Interpreter::evaluate):
* kjs/object.cpp: Instrument JS function calls.
(KJS::JSObject::call):
* profiler: Added.
* profiler/FunctionCallProfile.cpp: Added.
(KJS::FunctionCallProfile::FunctionCallProfile):
(KJS::FunctionCallProfile::~FunctionCallProfile):
(KJS::FunctionCallProfile::willExecute): Call right before the JS function or executing context is executed to start the profiler's timer.
(KJS::FunctionCallProfile::didExecute): Call right after the JS function or executing context is executed to stop the profiler's timer.
(KJS::FunctionCallProfile::addChild): Add a child to the current FunctionCallProfile if it isn't already a child of the current FunctionalCallProfile.
(KJS::FunctionCallProfile::findChild): Return the child that matches the given name if there is one.
(KJS::FunctionCallProfile::printDataSampleStyle): Print the current profiled information in a format that matches sample's output.
* profiler/FunctionCallProfile.h: Added.
(KJS::FunctionCallProfile::FunctionCallProfile):
(KJS::FunctionCallProfile::~FunctionCallProfile):
(KJS::FunctionCallProfile::functionName):
(KJS::FunctionCallProfile::microSecs):
* profiler/Profiler.cpp: Added.
(KJS::Profiler::profiler):
(KJS::Profiler::sharedProfiler): Return global singleton (may change due to multi-threading concerns)
(KJS::Profiler::startProfiling): Don't start collecting profiling information until the user starts the profiler. Also don't clear old prfiled data until the profiler is restarted.
(KJS::Profiler::stopProfiling): Stop collecting profile information.
(KJS::Profiler::willExecute): Same as above.
(KJS::Profiler::didExecute): Same as above.
(KJS::Profiler::insertStackNamesInTree): Follow the stack of the given names and if a sub-stack is not in the current tree, add it.
(KJS::Profiler::getStackNames): Get the names from the different passed in parameters and order them as a stack.
(KJS::Profiler::getFunctionName): Get the function name from the given parameter.
(KJS::Profiler::printDataSampleStyle): Print the current profiled information in a format that matches sample's output.
(KJS::Profiler::debugLog):
* profiler/Profiler.h: Added.
(KJS::Profiler::Profiler):
2008-04-16 Sam Weinig <sam@webkit.org>
Reviewed by Darin Adler.
- Remove kjs_ prefix from strtod, dtoa, and freedtoa and put it
in the KJS namespace.
- Make strtod, dtoa, and freedtoa c++ functions instead of extern "C".
- Remove mode switching from dtoa. ~2% improvement on test 26.
- Removes all unnecessary #defines from dtoa code.
* JavaScriptCore.exp:
* kjs/dtoa.cpp:
(KJS::ulp):
(KJS::b2d):
(KJS::d2b):
(KJS::ratio):
(KJS::strtod):
(KJS::freedtoa):
(KJS::dtoa):
* kjs/dtoa.h:
* kjs/function.cpp:
(KJS::parseInt):
* kjs/lexer.cpp:
(KJS::Lexer::lex):
* kjs/number_object.cpp:
(KJS::integer_part_noexp):
(KJS::numberProtoFuncToExponential):
* kjs/ustring.cpp:
(KJS::UString::from):
(KJS::UString::toDouble):
2008-04-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Get rid of static execForCompareByStringForQSort in array_instance.cpp.
No change on SunSpider, CelticKane or iBench JavaScript.
* kjs/array_instance.cpp:
(KJS::ArraySortComparator::ArraySortComparator):
(KJS::ArraySortComparator::operator()):
(KJS::ArrayInstance::sort):
Switch slow case to std::sort, so that ExecState can be passed in a comparator.
2008-04-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Adam Roben.
MSVC build fix.
* kjs/CommonIdentifiers.cpp:
* kjs/CommonIdentifiers.h:
* kjs/Parser.cpp:
* kjs/Parser.h:
* kjs/identifier.cpp:
* kjs/lexer.h:
* wtf/ThreadSpecific.h:
2008-04-16 Alexey Proskuryakov <ap@webkit.org>
Build fix.
* kjs/date_object.cpp:
* kjs/date_object.h:
Don't include DateMath.h from date_object.h, as the latter is used from WebCore, while
where the former is not available.
2008-04-16 Holger Hans Peter Freyther <zecke@selfish.org>
Unreviewed build fix for MSVC. It does not want to have
WTF in the KJS namespace.
* kjs/CommonIdentifiers.h:
2008-04-16 Holger Hans Peter Freyther <zecke@selfish.org>
Unreviewed build fix for gcc.
::msToGregorianDateTime is not known to it.
* kjs/date_object.cpp:
(KJS::DateInstance::msToGregorianDateTime):
2008-04-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Oliver Hunt.
Initialize threadMapMutex safely (as already done in ThreadingWin).
* wtf/ThreadingGtk.cpp:
(WTF::threadMapMutex):
(WTF::initializeThreading):
* wtf/ThreadingPthreads.cpp:
(WTF::threadMapMutex):
(WTF::initializeThreading):
2008-04-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Adam Roben.
Cache Gregorian date/time structure on DateInstance objects for 1.027x SunSpider speedup
(1.65x on date-format-xparb, 1.13x on date-format-tofte).
* kjs/DateMath.h:
(KJS::GregorianDateTime::copyFrom): Added. It presumably makes sense to keep GregorianDateTime
Noncopyable, so it's not just operator=.
* kjs/date_object.h: Added a per-object cache.
* kjs/date_object.cpp:
(KJS::DateInstance::DateInstance):
(KJS::DateInstance::msToGregorianDateTime):
(KJS::dateProtoFuncToString):
(KJS::dateProtoFuncToUTCString):
(KJS::dateProtoFuncToDateString):
(KJS::dateProtoFuncToTimeString):
(KJS::dateProtoFuncToLocaleString):
(KJS::dateProtoFuncToLocaleDateString):
(KJS::dateProtoFuncToLocaleTimeString):
(KJS::dateProtoFuncGetFullYear):
(KJS::dateProtoFuncGetUTCFullYear):
(KJS::dateProtoFuncToGMTString):
(KJS::dateProtoFuncGetMonth):
(KJS::dateProtoFuncGetUTCMonth):
(KJS::dateProtoFuncGetDate):
(KJS::dateProtoFuncGetUTCDate):
(KJS::dateProtoFuncGetDay):
(KJS::dateProtoFuncGetUTCDay):
(KJS::dateProtoFuncGetHours):
(KJS::dateProtoFuncGetUTCHours):
(KJS::dateProtoFuncGetMinutes):
(KJS::dateProtoFuncGetUTCMinutes):
(KJS::dateProtoFuncGetSeconds):
(KJS::dateProtoFuncGetUTCSeconds):
(KJS::dateProtoFuncGetTimezoneOffset):
(KJS::setNewValueFromTimeArgs):
(KJS::setNewValueFromDateArgs):
(KJS::dateProtoFuncSetYear):
(KJS::dateProtoFuncGetYear):
Use the cache when converting.
2008-04-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Implement an abstraction for thread-specific storage, use it to get rid of some static objects.
SunSpider results were not conclusive, possibly up to 0.2% slowdown.
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
Added ThreadSpecific.h
* wtf/ThreadSpecific.h: Added.
(WTF::::ThreadSpecific):
(WTF::::~ThreadSpecific):
(WTF::::get):
(WTF::::set):
(WTF::::destroy):
(WTF::T):
(WTF::::operator):
Only implemented for platforms that use pthreads.
* kjs/CommonIdentifiers.cpp:
(KJS::CommonIdentifiers::shared):
* kjs/CommonIdentifiers.h:
* kjs/InitializeThreading.cpp:
(KJS::initializeThreading):
* kjs/Parser.cpp:
(KJS::parser):
* kjs/Parser.h:
* kjs/identifier.cpp:
(KJS::identifierTable):
(KJS::literalIdentifierTable):
(KJS::Identifier::initializeIdentifierThreading):
* kjs/identifier.h:
* kjs/lexer.cpp:
(KJS::lexer):
* kjs/lexer.h:
Make static instances per-thread.
2008-04-15 Anders Carlsson <andersca@apple.com>
Reviewed by Adam.
Add ENABLE_OFFLINE_WEB_APPLICATIONS to FEATURE_DEFINES.
* Configurations/JavaScriptCore.xcconfig:
2008-04-15 Andre Poenitz <andre.poenitz@trolltech.com>
Reviewed by Simon.
Fix compilation with Qt namespaces
Qt can be configured to have all of its classes inside a specified namespaces.
This is for example used in plugin/component environments like Eclipse.
This change makes it possible to let the Qt port compile against a namespaced
Qt by the use of macros Qt provides to properly forward declare Qt classes in
the namespace.
* wtf/unicode/qt4/UnicodeQt4.h:
2008-04-14 Anders Carlsson <andersca@apple.com>
Reviewed by Adam.
Don't leak the prototype class.
* API/JSClassRef.cpp:
(OpaqueJSClass::create):
2008-04-14 Steve Falkenburg <sfalken@apple.com>
Fix build.
* wtf/ThreadingWin.cpp:
2008-04-14 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Adam Roben.
https://bugs.webkit.org/show_bug.cgi?id=18488
FastMalloc doesn't release thread-specific data on Windows
* wtf/ThreadingWin.cpp:
(WTF::threadMapMutex): (WTF::initializeThreading): Call threadMapMutex once to initialize the static safely.
(WTF::ThreadFunctionInvocation::ThreadFunctionInvocation): Added a structure to wrap thread entry point and arguments.
(WTF::wtfThreadEntryPoint): Make sure to end all WTF threads with pthread_exit(), to give pthreads-win32 a chance to call
destructors of thread-specific data.
(WTF::createThread): Use _beginthreadex instead of CreateThread, because MSDN says so. Also removed a call to CreateEvent,
for which I could see no reason at all.
2008-04-14 Alexey Proskuryakov <ap@webkit.org>
Touched a file to make JavaScriptCore.vcproj rebuild.
* wtf/MathExtras.h:
2008-04-14 Adam Roben <aroben@apple.com>
Windows build fix
Rubberstamped by Alexey Proskuryakov.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
the "potentially uninitialized variable" warning for grammar.cpp, as
it seems to be incorrect. yylval gets initialized by the lexer, but
MSVC doesn't seem to understand this.
2008-04-11 Antti Koivisto <antti@apple.com>
Reviewed by Maciej.
Add default hash for pairs of hashable types.
* wtf/HashFunctions.h:
(WTF::PairHash::hash):
(WTF::PairHash::equal):
(WTF::):
2008-04-11 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff.
Make DateMath.cpp thread safe.
No measurable change on SunSpider (should be a very small speedup).
* kjs/DateMath.cpp:
(KJS::mimimumYearForDST): (KJS::equivalentYearForDST): Got rid of double caching of the
same precomputed value.
(KJS::calculateUTCOffset): (KJS::getUTCOffset): Factored actual UTC offset calculation code
out of getUTCOffset(), and notification setup into initDateMath().
(KJS::initDateMath): Added.
* kjs/DateMath.h:
* kjs/InitializeThreading.cpp:
(KJS::initializeThreading):
Added initDateMath().
2008-04-11 Alexey Proskuryakov <ap@webkit.org>
Windows build fix.
* kjs/grammar.y:
2008-04-11 Alexey Proskuryakov <ap@webkit.org>
Tiger build fix. Forward declaring a union didn't work for whatever reason, make the
parameters void*.
* kjs/grammar.y:
* kjs/lexer.cpp:
(kjsyylex):
(KJS::Lexer::lex):
* kjs/lexer.h:
2008-04-11 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff.
Generate a pure (re-entrant) parser with Bison.
No change on SunSpider.
* kjs/Parser.cpp:
(KJS::Parser::parse):
* kjs/grammar.y:
* kjs/lexer.cpp:
(kjsyylex):
(KJS::Lexer::lex):
* kjs/lexer.h:
Pass state as function arguments, instead of global data. Don't call lexer() as often as
before, as this function is about to become slower due to thread-specific storage.
* kjs/function.cpp:
(KJS::isStrWhiteSpace): Don't call isSeparatorSpace() for 8-bit characters, as these are
already taken care of. This is a small speedup, compensating for a small slowdown caused
by switching Bison mode.
2008-04-10 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Geoff.
https://bugs.webkit.org/show_bug.cgi?id=18402
REGRESSION: visited element handling is incorrect in nested join/toString calls
No change on SunSpider total, possibly a tiny improvement (about 0.1%).
Test: fast/js/array-tostring-and-join.html
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::visitedElements): Store visited elements HashSet here, making it
common to toString/toLocalizedString/join again.
* kjs/array_object.cpp:
(KJS::arrayProtoFuncToString):
(KJS::arrayProtoFuncToLocaleString):
(KJS::arrayProtoFuncJoin):
Got rid of static variables. Replaced UString with Vector to avoid O(n^2) behavior and
regain performance.
* wtf/Vector.h:
(WTF::::resize):
(WTF::::grow):
(WTF::::reserveCapacity):
(WTF::::append):
(WTF::::insert):
Added null checks, so that Vector methods don't crash when out of memory. The caller should
check that data pointer is not null before proceeding.
2008-04-10 Mark Rowe <mrowe@apple.com>
Reviewed by Maciej Stachowiak.
Fix https://bugs.webkit.org/show_bug.cgi?id=18367 and the many dupes.
Bug 18367: Crash during celtic kane js speed 2007 test
GCC 4.2 on x86_64 Linux decided to reorder the local variables in markCurrentThreadConservatively's
stack frame. This lead to the range of addresses the collector treated as stack to exclude the
contents of volatile registers that markCurrentThreadConservatively forces onto the stack. This was
leading to objects being prematurely collected if the only reference to them was via a register at
the time a collection occurred.
The fix for this is to move the calculation of the top of the stack into a NEVER_INLINE function
that is called from markCurrentThreadConservatively. This forces the dummy variable we use for
determining the top of stack to be in a different stack frame which prevents the compiler from
reordering it relative to the registers that markCurrentThreadConservatively forces onto the stack.
* kjs/collector.cpp:
(KJS::Collector::markCurrentThreadConservativelyInternal):
(KJS::Collector::markCurrentThreadConservatively):
* kjs/collector.h:
2008-04-10 Adam Roben <aroben@apple.com>
VC++ Express build fix
* JavaScriptCore.vcproj/WTF/WTF.vcproj: Link against user32.lib so
that anyone who links against WTF.lib will get user32.lib
automatically.
2008-04-09 Adam Roben <aroben@apple.com>
VC++ Express build fix
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Link against
user32.lib.
2008-04-09 Adam Roben <aroben@apple.com>
Build fix
* JavaScriptCore.exp: Export isMainThread.
2008-04-09 Adam Roben <aroben@apple.com>
Build fix
* wtf/AlwaysInline.h: Make sure to #include Platform.h before using
the macros it defines.
2008-04-08 Mark Rowe <mrowe@apple.com>
Export WTF::initializeThreading() from JavaScriptCore.
* JavaScriptCore.exp:
2008-04-04 Sam Weinig <sam@webkit.org>
Reviewed by Geoffrey Garen.
First step in implementing the "split window"
- Add a GlobalThisValue to ExecState which should be used
in places that used to implement the "use the global object
as this if null" rule.
- Factor out lookupGetter/lookupSetter into virtual methods
on JSObject so that they can be forwarded.
- Make defineGetter/defineSetter virtual methods for the same
reason.
- Have PrototypeReflexiveFunction store the globalObject used
to create it so that it can be used to get the correct thisObject
for eval.
* API/JSObjectRef.cpp:
(JSObjectCallAsFunction):
* JavaScriptCore.exp:
* kjs/Activation.h:
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState):
(KJS::GlobalExecState::GlobalExecState):
* kjs/ExecState.h:
(KJS::ExecState::globalThisValue):
* kjs/ExecStateInlines.h:
(KJS::ExecState::ExecState):
(KJS::FunctionExecState::FunctionExecState):
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::reset):
(KJS::JSGlobalObject::toGlobalObject):
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
(KJS::JSGlobalObject::JSGlobalObject):
* kjs/array_instance.cpp:
(KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
(KJS::compareWithCompareFunctionForQSort):
* kjs/array_object.cpp:
(KJS::arrayProtoFuncSort):
(KJS::arrayProtoFuncFilter):
(KJS::arrayProtoFuncMap):
(KJS::arrayProtoFuncEvery):
(KJS::arrayProtoFuncForEach):
(KJS::arrayProtoFuncSome):
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction):
(KJS::ActivationImp::toThisObject):
(KJS::globalFuncEval):
(KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
(KJS::PrototypeReflexiveFunction::mark):
* kjs/function.h:
(KJS::PrototypeReflexiveFunction::cachedGlobalObject):
* kjs/function_object.cpp:
(KJS::functionProtoFuncApply):
(KJS::functionProtoFuncCall):
* kjs/nodes.cpp:
(KJS::ExpressionNode::resolveAndCall):
(KJS::FunctionCallValueNode::evaluate):
(KJS::LocalVarFunctionCallNode::inlineEvaluate):
(KJS::ScopedVarFunctionCallNode::inlineEvaluate):
(KJS::FunctionCallBracketNode::evaluate):
(KJS::FunctionCallDotNode::inlineEvaluate):
* kjs/object.cpp:
(KJS::JSObject::call):
(KJS::JSObject::put):
(KJS::tryGetAndCallProperty):
(KJS::JSObject::lookupGetter):
(KJS::JSObject::lookupSetter):
(KJS::JSObject::toThisObject):
(KJS::JSObject::toGlobalObject):
(KJS::JSObject::fillGetterPropertySlot):
* kjs/object.h:
* kjs/object_object.cpp:
(KJS::objectProtoFuncLookupGetter):
(KJS::objectProtoFuncLookupSetter):
* kjs/string_object.cpp:
(KJS::replace):
2008-04-08 Brady Eidson <beidson@apple.com>
Encourage Windows to rebuild - AGAIN...
* kjs/DateMath.cpp:
2008-04-08 Adam Roben <aroben@apple.com>
Mac build fix
* JavaScriptCore.exp: Add callOnMainThread, and sorted the list.
2008-04-08 Brady Eidson <beidson@apple.com>
Rubberstamped by Adam Roben
Touch some files to *strongly* encourage Windows to rebuilt with DOM_STORAGE enabled
* kjs/DateMath.cpp:
2008-04-08 Adam Roben <aroben@apple.com>
Move callOnMainThread to WTF
Reviewed by Alexey Proskuryakov.
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
Added new files.
* wtf/MainThread.cpp:
* wtf/MainThread.h:
* wtf/gtk/MainThreadGtk.cpp:
* wtf/mac/MainThreadMac.mm:
* wtf/qt/MainThreadQt.cpp:
* wtf/win/MainThreadWin.cpp:
* wtf/wx/MainThreadWx.cpp:
Moved here from WebCore/platform. Replaced all instances of "WebCore"
with "WTF".
* kjs/bool_object.cpp: Touched to force JavaScriptCore.vcproj to
build.
to the WTF namespace.
* wtf/ThreadingWin.cpp:
(WTF::initializeThreading): Call initializeMainThread.
2008-04-07 Brady Eidson <beidson@apple.com>
Add "ENABLE_DOM_STORAGE" to keep in sync with the rest of the project
* Configurations/JavaScriptCore.xcconfig:
2008-04-07 Adam Roben <aroben@apple.com>
Windows build fix
* wtf/ThreadingWin.cpp: Back out some changes I didn't mean to land.
2008-04-07 Adam Roben <aroben@apple.com>
Add WTF::isMainThread
Reviewed by Alexey Proskuryakov.
* wtf/Threading.h: Declare the new function.
* wtf/ThreadingGtk.cpp:
(WTF::initializeThreading): Initialize the main thread identifier.
(WTF::isMainThread): Added.
* wtf/ThreadingNone.cpp: Ditto ThreadingGtk.cpp.
(WTF::initializeThreading):
(WTF::isMainThread):
* wtf/ThreadingPthreads.cpp: Ditto.
(WTF::initializeThreading):
(WTF::isMainThread):
* wtf/ThreadingWin.cpp: Ditto.
(WTF::initializeThreading):
(WTF::isMainThread):
2008-04-06 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Make UString thread-safe.
No change on SunSpider total, although individual tests have changed a lot, up to 3%.
* kjs/InitializeThreading.cpp: (KJS::initializeThreading): Call UString::null() to initialize
a static.
* kjs/identifier.cpp:
(KJS::CStringTranslator::translate):
(KJS::UCharBufferTranslator::translate):
Use "true" for a boolean value instead of 1, because it's C++.
* kjs/ustring.h:
(KJS::CString::adopt): Added a method to create from a char* buffer without copying.
(KJS::UString::Rep::ref): Removed an assertion for JSLock::lockCount, as it's no longer
necessary to hold JSLock when working with strings.
(KJS::UString::Rep::deref): Ditto.
(KJS::UString::Rep::isStatic): Added a field to quickly determine that this is an empty
or null static string.
* kjs/ustring.cpp:
(KJS::): Removed normalStatBufferSize and statBufferSize, as there is no reason to have such
an advanced implementation of a debug-only ascii() method. Removed a long-obsolete comment
about UChar.
(KJS::UString::Rep::createCopying): Removed an assertion for JSLock::lockCount.
(KJS::UString::Rep::create): Ditto.
(KJS::UString::Rep::destroy): Ditto. Do not do anything for static null and empty strings,
as refcounting is not reliable for those. Reordered branches for a noticeable speed gain -
apparently this functiton is hot enough for SunSpider to see an effect from this!
(KJS::UString::null): Moved a star, added a comment.
(KJS::UString::cstring): Reimplemented to not call ascii(), which is not thread-safe.
(KJS::UString::ascii): Simplified statBuffer handling logic.
(KJS::UString::toDouble): Use cstring() instead of ascii().
2008-04-02 Mark Rowe <mrowe@apple.com>
Reviewed by Oliver Hunt.
Ensure that debug symbols are generated for x86_64 and ppc64 builds.
* Configurations/Base.xcconfig:
2008-04-01 Christian Dywan <christian@imendio.com>
Build fix for GCC 4.3.
* wtf/unicode/icu/CollatorICU.cpp: include string.h
2008-04-01 Alexey Proskuryakov <ap@webkit.org>
Rubber-stamped by Darin.
Turn off using 64-bit arithmetic on 32-bit hardware, as dtoa own code is faster than
compiler-provided emulation.
1% speedup on Acid3 test 26.
* kjs/dtoa.cpp:
2008-04-01 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Make MathExtras.h thread safe.
* kjs/math_object.cpp:
(KJS::mathProtoFuncRandom): If threading is enabled, rely on initializeThreading to call
wtf_random_init().
* wtf/Threading.h:
* wtf/ThreadingGtk.cpp:
(WTF::initializeThreading):
* wtf/ThreadingNone.cpp:
(WTF::initializeThreading):
* wtf/ThreadingPthreads.cpp:
(WTF::initializeThreading):
* wtf/ThreadingWin.cpp:
(WTF::initializeThreading):
Call wtf_random_init(); made the function non-inline to avoid having to include too many
headers in Threading.h.
2008-03-31 Eric Seidel <eric@webkit.org>
Reviewed by darin.
Make matching of regexps using ^ much faster
http://bugs.webkit.org/show_bug.cgi?id=18086
* pcre/pcre_compile.cpp:
(compileBranch):
(branchNeedsLineStart):
* pcre/pcre_exec.cpp:
(match):
(jsRegExpExecute):
* pcre/pcre_internal.h:
2008-03-29 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Oliver Hunt.
<rdar://problem/5829556> REGRESSION: Leak in KJS::initializeThreading()
* kjs/InitializeThreading.cpp: (KJS::initializeThreading): There is no guarantee that
initializeThreading() is called only once; check that the mutex hasn't been already allocated.
2008-03-29 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Bug 17924: Crash in KJS::ConstDeclNode::evaluate with |with| and |const|
<http://bugs.webkit.org/show_bug.cgi?id=17924>
<rdar://problem/5806933>
It turns out this is trivially avoidable if we just match firefox's
semantics and ensure that an assignment in a const declaration always
writes to the variable object.
* kjs/nodes.cpp:
(KJS::ConstDeclNode::handleSlowCase):
2008-03-28 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Sam Weinig.
Fix a dtoa thread safety issue.
WebCore can call kjs_strtod without holding JS lock, but we didn't have thread safety
compiled in for dtoa.
This is a 0.5% regression on SunSpider, which Sam Weinig has volunteered to cover with
his recent improvement.
* kjs/dtoa.cpp:
(Bigint::Balloc):
(Bigint::Bfree):
Changed to use fastMalloc/fastDelete - they are much faster than the dtoa custom version was
in the presence of locking (but somewhat slower in single-threaded case).
(Bigint::pow5mult): Got rid of the dreaded double-checked locking anti-pattern (had to
restructure the code to avoid significant performance implications).
(Bigint::lshift): Rewrote to avoid an allocation, if possible.
(Bigint::rv_alloc):
(Bigint::kjs_freedtoa):
(Bigint::kjs_dtoa):
Check for USE(MULTIPLE_THREADS), not dtoa legacy MULTIPLE_THREADS.
* kjs/InitializeThreading.cpp: Added.
(KJS::initializeThreading):
* kjs/InitializeThreading.h: Added.
Initialize threading at KJS level, if enabled.
* kjs/dtoa.h: Expose dtoa mutex for KJS::initializeThreading.
* kjs/testkjs.cpp: (kjsmain): Call initializeThreading.
* JavaScriptCore.exp: Export KJS::initializeThreading.
* GNUmakefile.am:
* JavaScriptCore.exp:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCoreSources.bkl:
* JavaScriptCore.xcodeproj/project.pbxproj:
Added InitializeThreading.{h,cpp}.
* wtf/Threading.h: Removed a using directive for WTF::initializeThreading - it is only
to be called from KJS::initializeThreading, and having it in the global namespace is useless.
2008-03-28 Brady Eidson <beidson@apple.com>
Reviewed by Darin
Export Unicode/UTF8.h and convertUTF16ToUTF8() for more flexible conversion in WebCore
* JavaScriptCore.exp:
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-03-27 Darin Adler <darin@apple.com>
Reviewed by Mark Rowe.
<rdar://problem/5826236> Regular expressions with large nested repetition counts can have their
compiled length calculated incorrectly.
* pcre/pcre_compile.cpp:
(multiplyWithOverflowCheck):
(calculateCompiledPatternLength): Check for overflow when dealing with nested repetition counts
and bail with an error rather than returning incorrect results.
2008-03-26 Mark Rowe <mrowe@apple.com>
Rubber-stamped by Brady Eidson.
Update FEATURE_DEFINES to be consistent with the other locations in which it is defined.
* Configurations/JavaScriptCore.xcconfig:
2008-03-26 Adam Roben <aroben@apple.com>
Fix Bug 18060: Assertion failure (JSLock not held) beneath
JSCallbackObject<Base>::toString
<http://bugs.webkit.org/show_bug.cgi?id=18060>
Reviewed by Geoff Garen.
Bug fix:
* API/JSCallbackObjectFunctions.h:
(KJS::JSCallbackObject<Base>::toString): Make the DropAllLocks
instance only be in scope while calling convertToType.
Test:
* API/testapi.c:
(MyObject_convertToType): Implement type conversion to string.
* API/testapi.js: Add a test for type conversion to string.
2008-03-26 Adam Roben <aroben@apple.com>
Windows build fix
* kjs/array_instance.cpp: Touched this.
* wtf/HashFunctions.h:
(WTF::intHash): Added 8- and 16-bit versions of intHash.
2008-03-26 Adam Roben <aroben@apple.com>
Force JSC headers to be copied by touching a file
* kjs/array_instance.cpp:
(KJS::ArrayInstance::getPropertyNames):
2008-03-26 Adam Roben <aroben@apple.com>
Windows build fix after r31324
Written with Darin.
Added HashTable plumbing to support using wchar_t as a key type.
* wtf/HashFunctions.h:
* wtf/HashTraits.h:
(WTF::):
2008-03-26 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- JSC part of fix for "SVG multichar glyph matching matches longest instead of first (affects Acid3 test 79)"
http://bugs.webkit.org/show_bug.cgi?id=18118
* wtf/HashFunctions.h:
(WTF::):
* wtf/HashTraits.h:
(WTF::):
2008-03-26 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Cache C string identifiers by address, not value, assuming that C strings can only
be literals.
1% speedup on Acid3 test 26.
* kjs/identifier.cpp:
(KJS::literalIdentifierTable):
(KJS::Identifier::add):
Added a new table to cache UString::Reps created from C strings by address. Elements are
never removed from this cache, as only predefined identifiers can get there.
* kjs/identifier.h:
(KJS::Identifier::Identifier): Added a warning.
2008-03-26 Alexey Proskuryakov <ap@webkit.org>
Rubber-stamped by Maciej.
An assertion was failing in function-toString-object-literals.html when parsing 1e-500.
The condition existed before, and got uncovered by turning compiled-out dtoa checks into
ASSERTs.
The assertion was verifying that the caller wasn't constructing a Bigint from 0.
This might have had some reason behind it originally, but I couldn't find any,
and this doesn't look like a reasonable requirement.
* kjs/dtoa.cpp: (d2b): Removed the assertion (two copies in different code paths).
2008-03-25 Adam Roben <aroben@apple.com>
Fix Bug 18077: Integrate testapi.c into the Windows build
<http://bugs.webkit.org/show_bug.cgi?id=18077>
Reviewed by Steve Falkenburg.
* JavaScriptCore.vcproj/testapi/testapi.vcproj: Added.
2008-03-25 Adam Roben <aroben@apple.com>
Make testapi.c compile under MSVC
Currently you must compile testapi.c as C++ code since MSVC does not
support many C features that GCC does.
Reviewed by Steve Falkenburg.
* API/testapi.c:
(nan): Added an implementation of this for MSVC.
(assertEqualsAsUTF8String): Use malloc instead of dynamically-sized
stack arrays.
(assertEqualsAsCharactersPtr): Ditto.
(print_callAsFunction): Ditto.
(main): Ditto, and explicitly cast from UniChar* to JSChar*.
2008-03-25 Adam Roben <aroben@apple.com>
Stop using JavaScriptCore's custom stdbool.h and stdint.h on Windows
We can't remove the os-win32 directory yet because other ports (at
least wx) are still relying on it.
Reviewed by Steve Falkenburg.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
- Made all the include paths match the one for the Debug
configuration (these got out of sync in r30797)
- Removed os-win32 from the include path
- Removed os-win32 from the directories we copy to $WebKitOutputDir.
- Removed stdint.h from the project
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
Delete the files that we may have previously copied from the os-win32
directory.
2008-03-25 Alexey Proskuryakov <ap@webkit.org>
Windows build fix.
* kjs/dtoa.cpp: Include stdint.h.
2008-03-25 Alexey Proskuryakov <ap@webkit.org>
Rubber-stamped by Darin.
Cleanup dtoa.cpp style.
* kjs/dtoa.cpp:
(Bigint::Balloc):
(Bigint::Bfree):
(Bigint::multadd):
(Bigint::s2b):
(Bigint::hi0bits):
(Bigint::lo0bits):
(Bigint::i2b):
(Bigint::mult):
(Bigint::pow5mult):
(Bigint::lshift):
(Bigint::cmp):
(Bigint::diff):
(Bigint::ulp):
(Bigint::b2d):
(Bigint::d2b):
(Bigint::ratio):
(Bigint::):
(Bigint::match):
(Bigint::hexnan):
(Bigint::kjs_strtod):
(Bigint::quorem):
(Bigint::rv_alloc):
(Bigint::nrv_alloc):
(Bigint::kjs_freedtoa):
(Bigint::kjs_dtoa):
* kjs/dtoa.h:
2008-03-24 Darin Adler <darin@apple.com>
Reviewed by Sam.
- convert a JavaScript immediate number to a string more efficiently
2% speedup of Acid3 test 26
* kjs/JSImmediate.cpp:
(KJS::JSImmediate::toString): Take advantage of the fact that all immediate
numbers are integers, and use the faster UString function for formatting integers
instead of the slower one that works for floating point. I think this is a leftover
from when immediate numbers were floating point.
2008-03-23 Sam Weinig <sam@webkit.org>
Reviewed by Darin Adler.
Fix http://bugs.webkit.org/show_bug.cgi?id=18048
The "thisObject" parameter to JSEvaluateScript is not used properly
Making passing a thisObject to JSEvaluateScript actually set the thisObject of the created
ExecState.
* API/testapi.c:
(main): Add tests for setting the thisObject when calling JSEvaluateScript.
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState): Assign the thisObject to m_thisValue and remove the comment.
2008-03-22 Jesse Ruderman <jruderman@gmail.com>
Reviewed by Sam Weinig. Landed by eseidel.
Make testkjs flush stdout after printing.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/testkjs.cpp:
(functionPrint):
2008-03-21 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Optimise lookup of Math, undefined, NaN and Infinity
Added a method to JSVariableObject to allow us to inject DontDelete properties
into the symbol table and localStorage. This results in a 0.4% progression in
SunSpider, with a 8% gain in math-partial-sums.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::reset):
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::symbolTableInsert):
2008-03-21 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff Garen.
Global properties that use LocalStorage are not correctly listed as enumerable.
The problem was caused by JSObject::getPropertyAttributes not being aware
of the JSVariableObject SymbolTable. The fix is to make getPropertyAttributes
virtual and override in JSVariableObject. This does not produce any performance
regression.
* JavaScriptCore.exp:
* kjs/JSVariableObject.cpp:
(KJS::JSVariableObject::getPropertyNames):
(KJS::JSVariableObject::getPropertyAttributes):
* kjs/JSVariableObject.h:
* kjs/object.h:
2008-03-21 Arkadiusz Miskiewicz <arekm@maven.pl>
Webkit does not build on linux powerpc
<http://bugs.webkit.org/show_bug.cgi?id=17019>
Reviewed by David Kilzer.
* wtf/TCSpinLock.h:
(TCMalloc_SpinLock::Unlock):
2008-03-21 Rodney Dawes <dobey@wayofthemonkey.com>
Reviewed by Holger.
http://bugs.webkit.org/show_bug.cgi?id=17981
Add javascriptcore_cppflags to Programs_minidom_CPPFLAGS.
* GNUmakefile.am:
2008-03-21 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Oliver Hunt.
Consolidate static identifier initializers within CommonIdentifiers.
No reliably measurable change on SunSpider; maybe a tiny improvement (within 0.2%).
* kjs/CommonIdentifiers.h: Added static identifiers that were lazily initialized
throughout the code.
* kjs/date_object.cpp:
(KJS::DateObjectImp::DateObjectImp):
* kjs/function_object.cpp:
(KJS::FunctionPrototype::FunctionPrototype):
* kjs/object_object.cpp:
(KJS::ObjectPrototype::ObjectPrototype):
* kjs/regexp_object.cpp:
(KJS::RegExpPrototype::RegExpPrototype):
Use the values from CommonIdentifiers.
* kjs/lookup.h: Caching the identifier in a static wasn't a win on SunSpider, removed it.
* kjs/value.h:
(KJS::jsNaN): We already have a shared NaN value, no need for a duplicate here.
* wtf/MathExtras.h:
(wtf_atan2): Having local variables for numeric_limits constants is good for readability,
but there is no reason to keep them static.
* JavaScriptCore.exp: Don't needlessly export JSGlobalObject::s_head.
2008-03-20 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Fix for leak introduced by inline ScopeChainNode use
To avoid any extra branches when managing an inline ScopeChainNode
in the ScopeChain the inline node gets inserted with a refcount of
2. This meant than when the ScopeChain was destroyed the ScopeChainNodes
above the inline node would be leaked.
We resolve this by manually popping the inline node in the
FunctionExecState destructor.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/ExecStateInlines.h:
(KJS::FunctionExecState::~FunctionExecState):
* kjs/scope_chain.h:
(KJS::ScopeChain::popInlineScopeNode):
2008-03-20 Mark Rowe <mrowe@apple.com>
Reviewed by Sam Weinig.
Ensure that the defines in FEATURE_DEFINES are sorted so that they will match the default settings of build-webkit.
This will prevent the world from being rebuilt if you happen to switch between building in Xcode and with build-webkit on the
command-line.
* Configurations/JavaScriptCore.xcconfig:
2008-03-20 David Krause <david.krause@gmail.com>
Reviewed by David Kilzer.
Fix http://bugs.webkit.org/show_bug.cgi?id=17923
Bug 17923: ARM platform endian defines inaccurate
* wtf/Platform.h:
Replaced !defined(__ARMEL__) check with !defined(__VFP_FP__)
for PLATFORM(MIDDLE_ENDIAN)
2008-03-20 Maciej Stachowiak <mjs@apple.com>
- fix build
* JavaScriptCore.xcodeproj/project.pbxproj: install Activation.h as private
2008-03-20 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- reduce function call overhead for 1.014x speedup on SunSpider
I moved some functions from ExecState.cpp to ExecStateInline.h and
from JSGlobalObject.cpp to JSGlobalObject.h, and declared them
inline; machine function call overhead for these was hurting JS
funcion call overhead.
* kjs/ExecState.cpp:
* kjs/ExecStateInlines.h: Added.
(KJS::ExecState::ExecState):
(KJS::ExecState::~ExecState):
(KJS::FunctionExecState::FunctionExecState):
(KJS::FunctionExecState::~FunctionExecState):
* kjs/JSGlobalObject.cpp:
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::pushActivation):
(KJS::JSGlobalObject::checkActivationCount):
(KJS::JSGlobalObject::popActivation):
* kjs/function.cpp:
2008-03-19 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Avoid heap allocating the root scope chain node for eval and closure free functions
Maciej suggested using an inline ScopeChainNode for functions that don't use eval
or closures as they are unable to ever capture the scope chain. This gives us a 2.4%
win in sunspider, a 15% win in controlflow-recursive, and big (>5%) wins in a number
of other tests.
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState):
* kjs/ExecState.h:
* kjs/scope_chain.h:
(KJS::ScopeChain::push):
2008-03-19 Mark Rowe <mrowe@apple.com>
Reviewed by Sam Weinig.
Fix release build.
* kjs/JSGlobalObject.cpp: Add missing #include.
2008-03-19 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
Fix for <rdar://problem/5785694>
Crash occurs at KJS::Collector::collect() when loading web clip widgets with a PAC file
Make the activeExecStates stack per JSGlobalObject instead of static to ensure
thread safety.
* JavaScriptCore.exp:
* kjs/ExecState.cpp:
(KJS::InterpreterExecState::InterpreterExecState):
(KJS::InterpreterExecState::~InterpreterExecState):
(KJS::EvalExecState::EvalExecState):
(KJS::EvalExecState::~EvalExecState):
(KJS::FunctionExecState::FunctionExecState):
(KJS::FunctionExecState::~FunctionExecState):
* kjs/ExecState.h:
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::mark):
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::activeExecStates):
* kjs/collector.cpp:
(KJS::Collector::collect):
(KJS::Collector::reportOutOfMemoryToAllExecStates): Iterate all JSGlobalObjects and report
the OutOfMemory condition to all the ExecStates in each.
2008-03-19 Jasper Bryant-Greene <jasper@unix.geek.nz>
Reviewed by Maciej Stachowiak.
Fix http://bugs.webkit.org/show_bug.cgi?id=17941
Bug 17941: C++-style comments in JavaScriptCore API
* API/JSBase.h:
Remove C++-style comments from public JavaScriptCore API, replacing
with standard C90 block comments.
2008-03-19 Mark Rowe <mrowe@apple.com>
Reviewed by Oliver Hunt.
Fix http://bugs.webkit.org/show_bug.cgi?id=17939
Bug 17939: Crash decompiling "const a = 1, b;"
* kjs/nodes2string.cpp:
(KJS::ConstDeclNode::streamTo): Null-check the correct variable.
2008-03-18 Oliver Hunt <oliver@apple.com>
Reviewed by Mark Rowe.
Bug 17929: Incorrect decompilation with |const|, comma
http://bugs.webkit.org/show_bug.cgi?id=17929
There were actually two bugs here. First we weren't correctly handling const
nodes with multiple declarations. The second issue was caused by us not
giving the correct precedence to the initialisers.
* kjs/nodes2string.cpp:
(KJS::ConstDeclNode::streamTo):
2008-03-18 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- Speed up JavaScript built-in properties by changing the
hash table to take advantage of the identifier objects
5% speedup for Acid3 test 26
* JavaScriptCore.exp: Updated.
* kjs/create_hash_table: Compute size of hash table large enough so that there
are no collisions, but don't generate the hash table.
* kjs/identifier.h: Made the add function that returns a PassRefPtr public.
* kjs/lexer.cpp:
(KJS::Lexer::lex): Updated for change to HashTable interface.
* kjs/lookup.cpp:
(KJS::HashTable::changeKeysToIdentifiers): Added. Finds the identifier for
each property so the equality comparision can be done with pointer comparision.
* kjs/lookup.h: Made the key be a union of char* with UString::Rep* so it can
hold identifiers. Added a keysAreIdentifiers flag to the HashTable. Changed
the Lookup functions to be member functions of HashTable instead.
* kjs/object.cpp:
(KJS::JSObject::deleteProperty): Update for change to HashTable.
(KJS::JSObject::findPropertyHashEntry): Ditto.
(KJS::JSObject::getPropertyAttributes): Ditto.
(KJS::JSObject::getPropertyNames): Ditto.
2008-03-18 Mark Rowe <mrowe@apple.com>
Reviewed by Oliver Hunt.
Fix http://bugs.webkit.org/show_bug.cgi?id=17925 and http://bugs.webkit.org/show_bug.cgi?id=17927.
- Bug 17925: Crash in KJS::JSObject::put after setting this.__proto__
- Bug 17927: Hang after attempting to create circular __proto__
* kjs/object.cpp:
(KJS::JSObject::put): Silently ignore attempts to set __proto__ to a non-object, non-null value.
Return after setting the exception when an attempt to set a cyclic __proto__ is detected so that
the cyclic value is not set.
2008-03-18 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- inline ActivationImp::init for 0.8% SunSpider speedup
* kjs/Activation.h:
(KJS::ActivationImp::init): Moved here from function.cpp
* kjs/function.cpp:
2008-03-18 Simon Hausmann <hausmann@webkit.org>
Fix the Qt build.
Including config.h like in the other .cpp files gets the #ifdeffery
correct for rand_s.
* kjs/JSWrapperObject.cpp:
2008-03-17 Darin Adler <darin@apple.com>
Reviewed by Maciej.
JavaScriptCore changes to support a WebCore speedup.
* JavaScriptCore.exp: Export the UString::Rep::computeHash function.
* wtf/HashSet.h: Added a find and contains function that take a translator,
like the add function.
2008-03-18 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- a few micro-optimizations for 1.2% SunSpider speedup
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction): check for Return completion before Throw,
it is more likely.
* kjs/object.cpp:
(KJS::JSObject::put): When walking prototype chain, instead of
checking isObject (a virtual call), compare to jsNull (compare to
a constant) since null is the only non-object that can be in a
prototype chain.
2008-03-17 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Optimise multi-scope function call resolution
Refactor multiscope variable resolution and use to add
optimised FunctionCallResolveNode subclasses.
2.6% gain in sunspider performance, *25%* gain in controlflow-recursive
* kjs/nodes.cpp:
(KJS::getSymbolTableEntry):
(KJS::ResolveNode::optimizeVariableAccess):
(KJS::getNonLocalSymbol):
(KJS::ExpressionNode::resolveAndCall):
(KJS::FunctionCallResolveNode::optimizeVariableAccess):
(KJS::FunctionCallResolveNode::inlineEvaluate):
(KJS::ScopedVarFunctionCallNode::inlineEvaluate):
(KJS::ScopedVarFunctionCallNode::evaluate):
(KJS::ScopedVarFunctionCallNode::evaluateToNumber):
(KJS::ScopedVarFunctionCallNode::evaluateToBoolean):
(KJS::ScopedVarFunctionCallNode::evaluateToInt32):
(KJS::ScopedVarFunctionCallNode::evaluateToUInt32):
(KJS::NonLocalVarFunctionCallNode::inlineEvaluate):
(KJS::NonLocalVarFunctionCallNode::evaluate):
(KJS::NonLocalVarFunctionCallNode::evaluateToNumber):
(KJS::NonLocalVarFunctionCallNode::evaluateToBoolean):
(KJS::NonLocalVarFunctionCallNode::evaluateToInt32):
(KJS::NonLocalVarFunctionCallNode::evaluateToUInt32):
* kjs/nodes.h:
(KJS::ScopedVarFunctionCallNode::):
(KJS::NonLocalVarFunctionCallNode::):
2008-03-17 David Kilzer <ddkilzer@apple.com>
Don't define PLATFORM(MIDDLE_ENDIAN) on little endian ARM.
Reviewed by Darin.
See <http://bugs.webkit.org/show_bug.cgi?id=15416#c13>.
* wtf/Platform.h: Added check for !defined(__ARMEL__) when defining
PLATFORM(MIDDLE_ENDIAN).
2008-03-17 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff, Darin and Weinig.
Add fast multi-level scope lookup
Add logic and AST nodes to provide rapid variable resolution across
static scope boundaries. This also adds logic that allows us to skip
any static scopes that do not contain the variable to be resolved.
This results in a ~2.5% speedup in SunSpider, and gives a 25-30% speedup
in some simple and ad hoc closure and global variable access tests.
* JavaScriptCore.exp:
* kjs/Activation.h:
* kjs/JSGlobalObject.cpp:
* kjs/JSGlobalObject.h:
* kjs/JSVariableObject.cpp:
* kjs/JSVariableObject.h:
* kjs/function.cpp:
(KJS::ActivationImp::isDynamicScope):
* kjs/nodes.cpp:
(KJS::ResolveNode::optimizeVariableAccess):
(KJS::ScopedVarAccessNode::inlineEvaluate):
(KJS::ScopedVarAccessNode::evaluate):
(KJS::ScopedVarAccessNode::evaluateToNumber):
(KJS::ScopedVarAccessNode::evaluateToBoolean):
(KJS::ScopedVarAccessNode::evaluateToInt32):
(KJS::ScopedVarAccessNode::evaluateToUInt32):
(KJS::NonLocalVarAccessNode::inlineEvaluate):
(KJS::NonLocalVarAccessNode::evaluate):
(KJS::NonLocalVarAccessNode::evaluateToNumber):
(KJS::NonLocalVarAccessNode::evaluateToBoolean):
(KJS::NonLocalVarAccessNode::evaluateToInt32):
(KJS::NonLocalVarAccessNode::evaluateToUInt32):
(KJS::IfElseNode::optimizeVariableAccess):
(KJS::ScopeNode::optimizeVariableAccess):
* kjs/nodes.h:
(KJS::ScopedVarAccessNode::):
(KJS::NonLocalVarAccessNode::):
* kjs/object.h:
2008-03-16 weihongzeng <weihong.zeng@hotmail.com>
Reviewed by Darin Adler.
http://bugs.webkit.org/show_bug.cgi?id=15416
Add support for mixed-endian processors
* kjs/dtoa.cpp: Add IEEE_ARM, triggered by PLATFORM(MIDDLE_ENDIAN).
2008-03-16 Kevin Ollivier <kevino@theolliviers.com>
Rubber stamped by Darin.
Add set-webkit-configuration support for wx port, and centralize
build dir location setting.
http://bugs.webkit.org/show_bug.cgi?id=17790
* jscore.bkl:
2008-03-14 Steve Falkenburg <sfalken@apple.com>
PGO build fixes.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2008-03-14 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Add logic to track whether a function uses a locally scoped eval or requires a closure
Now that we limit eval we can track those uses of eval that operate
in the local scope and functions that require a closure. We track
this information during initial parsing to avoid yet another tree
walk.
* JavaScriptCore.exp:
* kjs/NodeInfo.h:
* kjs/Parser.cpp:
(KJS::Parser::didFinishParsing):
* kjs/Parser.h:
(KJS::Parser::parse):
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::ScopeNode::ScopeNode):
(KJS::ProgramNode::ProgramNode):
(KJS::ProgramNode::create):
(KJS::EvalNode::EvalNode):
(KJS::EvalNode::create):
(KJS::FunctionBodyNode::FunctionBodyNode):
(KJS::FunctionBodyNode::create):
* kjs/nodes.h:
(KJS::ScopeNode::):
(KJS::ScopeNode::usesEval):
(KJS::ScopeNode::needsClosure):
2008-03-14 Geoffrey Garen <ggaren@apple.com>
Reviewed by Beth Dakin.
Fixed another problem with Vector::shrinkCapacity.
moveOverlapping isn't good enough for the case where the buffer hasn't
changed, because it still destroys the contents of the buffer.
* wtf/Vector.h:
(WTF::::shrinkCapacity): Changed to explicitly check whether the call
to allocateBuffer produced a new buffer. If it didn't, there's no need
to move.
2008-03-14 Geoffrey Garen <ggaren@apple.com>
Reviewed by Beth Dakin.
Fixed a few problems with Vector::shrinkCapacity that I noticed in testing.
* wtf/Vector.h:
(WTF::VectorBufferBase::deallocateBuffer): Clear our m_buffer pointer
when we deallocate m_buffer, in case we're not asked to reallocate a new
buffer. (Otherwise, we would use a stale m_buffer if we were asked to
perform any operations after shrinkCapacity was called.)
(WTF::VectorBuffer::allocateBuffer): Made VectorBuffer with inline
capacity aware that calls to allocateBuffer might be shrinks, rather
than grows, so we shouldn't allocate a new buffer on the heap unless
our inline buffer is too small.
(WTF::::shrinkCapacity): Call resize() instead of just setting m_size,
so destructors run. Call resize before reallocating the buffer to make
sure that we still have access to the objects we need to destroy. Call
moveOverlapping instead of move, since a call to allocateBuffer on an
inline buffer may produce identical storage.
2008-03-14 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Get rid of a localime() call on platforms that have better alternatives.
* kjs/DateMath.h: Added getLocalTime();
* kjs/DateMath.cpp:
(KJS::getLocalTime):
(KJS::getDSTOffsetSimple):
Implementation moved from getDSTOffsetSimple().
* kjs/date_object.cpp:
(KJS::DateObjectImp::callAsFunction): Switched to getLocalTime().
2008-03-14 David D. Kilzer <ddkilzer@apple.com>
Unify concept of enabling the Mac Java bridge.
Reviewed by Darin and Anders.
* wtf/Platform.h: Define ENABLE_MAC_JAVA_BRIDGE here.
2008-03-13 Mark Mentovai <mark@moxienet.com>
Reviewed by eseidel. Landed by eseidel.
* wtf/FastMalloc.cpp: #include <wtf/HashSet.h> outside of any
namespaces.
2008-03-13 Mark Mentovai <mark@moxienet.com>
Reviewed by eseidel. Landed by eseidel.
* pcre/pcre_exec.cpp: Fix misnamed variable, allowing -DDEBUG build
to succeed.
* wtf/ThreadingPthreads.cpp: #include <sys/time.h> for gettimeofday
in non-pch build.
2008-03-13 Steve Falkenburg <sfalken@apple.com>
PGO build fixes.
Disable PGO for normal release builds.
Added work-in-progress Release_PGOInstrument/Release_PGOOptimize targets.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2008-03-13 Beth Dakin <bdakin@apple.com>
Reviewed by Geoff.
Adding new functionality to Vector. Currently all of the shrink and
resize functions on Vector only shrink the size of the Vector, not
the capacity. For the Vector to take up as little memory as
possible, though, it is necessary to be able to shrink the capacity
as well. So this patch adds that functionality.
I need this for a speed up I am working on, and Geoff wants to use
it in a speed up he is working on also, so he asked me to commit it
now.
* wtf/Vector.h:
(WTF::VectorBufferBase::allocateBuffer):
(WTF::::shrinkCapacity):
2008-03-13 Simon Hausmann <hausmann@webkit.org>
Reviewed by Adam Roben.
Attempt at fixing the Qt/Windows build bot. Quote using double-quotes
instead of single quotes.
* pcre/dftables:
2008-03-12 Steve Falkenburg <sfalken@apple.com>
Build fix.
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
2008-03-12 Alp Toker <alp@atoker.com>
Another autotools testkjs build fix attempt.
* GNUmakefile.am:
2008-03-12 Alp Toker <alp@atoker.com>
Attempt to fix the autotools testkjs build on systems with
non-standard include paths.
* GNUmakefile.am:
2008-03-11 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
<rdar://problem/5787743> REGRESSION: Crash at WTF::Collator::CreateCollator() running fast/js/kde/StringObject.html on Windows
* wtf/unicode/icu/CollatorICU.cpp:
(WTF::Collator::createCollator): Check for null (== user default) m_locale before calling strcmp.
2008-03-11 Steve Falkenburg <sfalken@apple.com>
Disable LTCG/PGO for grammar.cpp and nodes.cpp.
PGO on these files causes us to hang.
Copy newer vsprops files from relative WebKitLibraries path to environment variable based path.
Reviewed by Oliver.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
2008-03-10 Darin Adler <darin@apple.com>
- Windows build fix
* kjs/function.cpp: (KJS::decode): Initialize variable.
2008-03-10 Brent Fulgham <bfulgham@gmail.com>
Windows build fix
Reviewed by Adam.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
Set the PATH to include Cygwin before running touch.
2008-03-10 Eric Seidel <eric@webkit.org>
Build fix for JSC on windows.
* API/JSStringRefCF.cpp:
(JSStringCreateWithCFString):
* kjs/function.cpp:
(KJS::decode):
* kjs/nodes2string.cpp:
(KJS::escapeStringForPrettyPrinting):
2008-03-10 Eric Seidel <eric@webkit.org>
No review, build fix only.
Attempt to fix the windows build?
* kjs/ustring.h: change unsigned short to UChar
2008-03-10 Eric Seidel <eric@webkit.org>
Reviewed by Darin.
Remove KJS::UChar, use ::UChar instead
http://bugs.webkit.org/show_bug.cgi?id=17017
* API/JSStringRef.cpp:
(JSStringCreateWithCharacters):
(JSStringCreateWithUTF8CString):
* API/JSStringRefCF.cpp:
(JSStringCreateWithCFString):
* JavaScriptCore.exp:
* kjs/Parser.h:
* kjs/function.cpp:
(KJS::decode):
(KJS::parseInt):
(KJS::parseFloat):
(KJS::globalFuncEscape):
(KJS::globalFuncUnescape):
* kjs/function_object.cpp:
(KJS::FunctionObjectImp::construct):
* kjs/identifier.cpp:
(KJS::Identifier::equal):
(KJS::CStringTranslator::translate):
* kjs/interpreter.h:
* kjs/lexer.cpp:
(KJS::Lexer::setCode):
(KJS::Lexer::shift):
(KJS::Lexer::lex):
(KJS::Lexer::convertUnicode):
(KJS::Lexer::makeIdentifier):
* kjs/lookup.cpp:
(KJS::keysMatch):
* kjs/nodes2string.cpp:
(KJS::escapeStringForPrettyPrinting):
(KJS::SourceStream::operator<<):
* kjs/regexp.cpp:
(KJS::RegExp::RegExp):
(KJS::RegExp::match):
* kjs/string_object.cpp:
(KJS::substituteBackreferences):
(KJS::stringProtoFuncCharCodeAt):
(KJS::stringProtoFuncToLowerCase):
(KJS::stringProtoFuncToUpperCase):
(KJS::stringProtoFuncToLocaleLowerCase):
(KJS::stringProtoFuncToLocaleUpperCase):
* kjs/ustring.cpp:
(KJS::UString::Rep::computeHash):
(KJS::UString::UString):
(KJS::UString::append):
(KJS::UString::ascii):
(KJS::UString::operator=):
(KJS::UString::is8Bit):
(KJS::UString::toStrictUInt32):
(KJS::UString::find):
(KJS::operator==):
(KJS::operator<):
(KJS::compare):
(KJS::UString::UTF8String):
* kjs/ustring.h:
* pcre/pcre.h:
2008-03-09 Steve Falkenburg <sfalken@apple.com>
Stop Windows build if an error occurs in a prior project.
Rubber stamped by Darin.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2008-03-09 J¸rg Billeter <j@bitron.ch>
Reviewed by Alp Toker.
Conditionalise ICU for Unicode in the GTK+ port.
* wtf/Platform.h:
2008-03-07 David D. Kilzer <ddkilzer@apple.com>
Unify concept of enabling Netscape Plug-in API (NPAPI).
Reviewed by Darin.
* wtf/Platform.h: Define ENABLE_NETSCAPE_PLUGIN_API here.
2008-03-07 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Fixed <rdar://problem/5689093> Stricter (ES4) eval semantics
The basic rule is:
- "eval(s)" is treated as an operator that gives the ES3 eval behavior.
... but only if there is no overriding declaration of "eval" in scope.
- All other invocations treat eval as a function that evaluates a
script in the context of its "this" object.
... but if its "this" object is not the global object it was
originally associated with, eval throws an exception.
Because only expressions of the form "eval(s)" have access to local
scope, the compiler can now statically determine whether a function
needs local scope to be dynamic.
* kjs/nodes.h: Added FunctionCallEvalNode. It works just like
FuncationCallResolveNode, except it statically indicates that the node
may execute eval in the ES3 way.
* kjs/nodes.cpp:
* kjs/nodes2string.cpp:
* tests/mozilla/expected.html: This patch happens to fix a Mozilla JS
test, but it's a bit of a pyrrhic victory. The test intends to test
Mozilla's generic API for calling eval on any object, but, in reality,
we only support calling eval on the global object.
2008-03-06 Steve Falkenburg <sfalken@apple.com>
Build fix.
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2008-03-06 Steve Falkenburg <sfalken@apple.com>
Build fix.
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
2008-03-06 Alp Toker <alp@atoker.com>
Fix the build fix in r30845 to support out-of-tree builds.
* GNUmakefile.am:
2008-03-06 Steve Falkenburg <sfalken@apple.com>
Build fix.
* wtf/ThreadingWin.cpp:
(WTF::ThreadCondition::timedWait):
2008-03-06 Darin Adler <darin@apple.com>
- another small step towards fixing the Qt build
* JavaScriptCore.pri: Remove more references to the now-obsolete bindings directory.
2008-03-06 Darin Adler <darin@apple.com>
- a small step towards fixing the Qt build
* JavaScriptCore.pri: Remove references to files no longer present in JavaScriptCore/bindings.
2008-03-06 Brady Eidson <beidson@apple.com>
Gtk Build fix
* wtf/ThreadingGtk.cpp:
(WTF::ThreadCondition::timedWait):
2008-03-06 Alexey Proskuryakov <ap@webkit.org>
Wx build fix.
* wtf/unicode/icu/CollatorICU.cpp:
(WTF::Collator::userDefault): Put ICU workaround under both PLATFORM(DARWIN) and
PLATFORM(CF) checks, so that each port can decide if it wants to use CF on Mac for it.
2008-03-06 Brady Eidson <beidson@apple.com>
Reviewed by Darin
Add a timedWait() method to ThreadCondition
* JavaScriptCore.exp:
* wtf/Threading.h:
* wtf/ThreadingGtk.cpp:
(WTF::ThreadCondition::timedWait):
* wtf/ThreadingNone.cpp:
(WTF::ThreadCondition::timedWait):
* wtf/ThreadingPthreads.cpp:
(WTF::ThreadCondition::timedWait):
* wtf/ThreadingWin.cpp:
(WTF::ThreadCondition::timedWait): Needs implementation
2008-03-06 Alexey Proskuryakov <ap@webkit.org>
More build fixes.
* jscore.bkl: Add the wtf/unicode directory.
* wtf/unicode/CollatorDefault.cpp:
(WTF::Collator::userDefault): Use a constructor that does exist.
* wtf/unicode/icu/CollatorICU.cpp: Mac build fix for case-sensitive file systems.
2008-03-06 Darin Adler <darin@apple.com>
- try to fix the Qt build
* JavaScriptCore.pri: Add the wtf/unicode directory.
2008-03-06 Darin Adler <darin@apple.com>
- try to fix the GTK build
* GNUmakefile.am: Add a -I for the wtf/unicode directory.
2008-03-06 Darin Adler <darin@apple.com>
- try to fix the Mac build
* icu/unicode/parseerr.h: Copied from ../WebCore/icu/unicode/parseerr.h.
* icu/unicode/ucol.h: Copied from ../WebCore/icu/unicode/ucol.h.
* icu/unicode/uloc.h: Copied from ../WebCore/icu/unicode/uloc.h.
* icu/unicode/unorm.h: Copied from ../WebCore/icu/unicode/unorm.h.
* icu/unicode/uset.h: Copied from ../WebCore/icu/unicode/uset.h.
2008-03-06 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
<rdar://problem/5687269> Need to create a Collator abstraction for WebCore and JavaScriptCore
* wtf/Threading.h:
(WTF::initializeThreading):
* wtf/ThreadingGtk.cpp:
(WTF::initializeThreading):
* wtf/ThreadingNone.cpp:
* wtf/ThreadingPthreads.cpp:
* wtf/ThreadingWin.cpp:
Added AtomicallyInitializedStatic.
* kjs/string_object.cpp: (KJS::localeCompare): Changed to use Collator.
* GNUmakefile.am:
* JavaScriptCore.exp:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
Added new fiiles to projects.
* wtf/unicode/Collator.h: Added.
(WTF::Collator::):
* wtf/unicode/CollatorDefault.cpp: Added.
(WTF::Collator::Collator):
(WTF::Collator::~Collator):
(WTF::Collator::setOrderLowerFirst):
(WTF::Collator::collate):
* wtf/unicode/icu/CollatorICU.cpp: Added.
(WTF::cachedCollatorMutex):
(WTF::Collator::Collator):
(WTF::Collator::~Collator):
(WTF::Collator::setOrderLowerFirst):
(WTF::Collator::collate):
(WTF::Collator::createCollator):
(WTF::Collator::releaseCollator):
2008-03-05 Kevin Ollivier <kevino@theolliviers.com>
Fix the wx build after the bindings move.
* JavaScriptCoreSources.bkl:
* jscore.bkl:
2008-03-05 Alp Toker <alp@atoker.com>
GTK+ build fix for breakage introduced in r30800.
Track moved bridge sources from JavaScriptCore to WebCore.
* GNUmakefile.am:
2008-03-05 Brent Fulgham <bfulgham@gmail.com>
Reviewed by Adam Roben.
Remove definition of WTF_USE_SAFARI_THEME from wtf/Platform.h
because the PLATFORM(CG) flag is not set until config.h has
already included this file.
* wtf/Platform.h: Remove useless definition of WTF_USE_SAFARI_THEME
2008-03-05 Brady Eidson <beidson@apple.com>
Reviewed by Alexey and Mark Rowe
Fix for <rdar://problem/5778247> - Reproducible crash on storage/execute-sql-args.html
DatabaseThread::unscheduleDatabaseTasks() manually filters through a MessageQueue,
removing particular items for Databases that were shutting down.
This filtering operation is not atomic, and therefore causes a race condition with the
MessageQueue waking up and reading from the message queue.
The end result was an attempt to dereference a null DatabaseTask. Timing-wise, this never
seemed to happen in a debug build, otherwise an assertion would've caught it. Replacing that
assertion with a crash in a release build is what revealed this bug.
* wtf/MessageQueue.h:
(WTF::::waitForMessage): Tweak the waiting logic to check the queue's empty state then go back
to sleep if the queue was empty - checking m_killed each time it wakes up.
2008-03-05 David D. Kilzer <ddkilzer@apple.com>
Remove unused header includes from interpreter.cpp.
Reviewed by Darin.
* kjs/interpreter.cpp: Remove unused header includes.
2008-03-05 Anders Carlsson <andersca@apple.com>
Reviewed by Sam.
Remove bindings/.
* bindings: Removed.
2008-03-05 Anders Carlsson <andersca@apple.com>
Don't build bindings/ anymore.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2008-03-05 Anders Carlsson <andersca@apple.com>
Reviewed by Geoff.
Don't build JavaScriptCore/bindings.
* JavaScriptCore.exp:
Export a couple of new functions.
* JavaScriptCore.xcodeproj/project.pbxproj:
Remove bindings/
* kjs/config.h:
No need to define HAVE_JNI anymore.
* kjs/interpreter.cpp:
Remove unnecessary include.
2008-03-05 David D. Kilzer <ddkilzer@apple.com>
Allow override of default script file name using command-line argument.
Reviewed by Adele.
* API/minidom.c:
(main): Allow first command-line argument to override the default script
file name of "minidom.js".
* API/testapi.c:
(main): Allow first command-line argument to override the default script
file name of "testapi.js".
2008-03-04 Mark Rowe <mrowe@apple.com>
Mac build fix.
* JavaScriptCore.exp: Add new symbol to exports file.
2008-03-03 Oliver Hunt <oliver@apple.com>
Reviewed by Anders.
Make ForInNode check for the timeout interrupt
* kjs/nodes.cpp:
(KJS::ForInNode::execute):
2008-03-02 Brent Fulgham <bfulgham@gmail.com>
Reviewed by Alp Toker.
http://bugs.webkit.org/show_bug.cgi?id=17415
GTK Build (using autotools) on Mac OS (DarwinPorts) Fails
Add -lstdc++ to link flags for minidom program. This corrects
a build error for the GTK+ on Mac OS.
* GNUmakefile.am:
2008-03-01 Mark Rowe <mrowe@apple.com>
Reviewed by Tim Hatcher.
Update Xcode configuration to support building debug and release from the mysterious future.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
2008-02-29 Brent Fulgham <bfulgham@gmail.com>
http://bugs.webkit.org/show_bug.cgi?id=17483
Implement scrollbars on Windows (Cairo)
Reviewed by Adam Roben.
* wtf/Platform.h:
2008-02-29 Adam Roben <aroben@apple.com>
Remove unused DebuggerImp::abort and DebuggerImp::aborted
Reviewed by Tim and Sam.
* kjs/function_object.cpp:
(KJS::FunctionObjectImp::construct):
* kjs/internal.h:
(KJS::DebuggerImp::DebuggerImp):
* kjs/nodes.cpp:
(KJS::Node::handleException):
(KJS::FunctionBodyNodeWithDebuggerHooks::execute):
2008-02-28 Eric Christopher <echristo@apple.com>
Reviewed by Geoffrey Garen.
** TOTAL **: 1.005x as fast 2867.6ms +/- 0.4% 2853.2ms +/- 0.3% significant
* kjs/nodes.cpp: Tell the compiler that exceptions are unexpected (for
the sake of branch prediction and code organization).
2008-02-27 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Sam Weinig.
http://bugs.webkit.org/show_bug.cgi?id=17030
Small buffer overflow within initialization
* kjs/date_object.cpp:
(KJS::DateObjectFuncImp::callAsFunction):
(KJS::parseDate):
Remove unnecessary and incorrect memset() calls - GregorianDateTime can initialize itself.
2008-02-25 Sam Weinig <sam@webkit.org>
Reviewed by Dan Bernstein.
- Add a variant of remove that takes a position and a length.
* wtf/Vector.h:
(WTF::Vector::remove):
2008-02-25 Mark Mentovai <mark@moxienet.com>
Reviewed by Mark Rowe.
Enable CollectorHeapIntrospector to build by itself, as well as in an AllInOneFile build.
http://bugs.webkit.org/show_bug.cgi?id=17538
* kjs/CollectorHeapIntrospector.cpp: Provide "using" declaration for
WTF::RemoteMemoryReader.
* kjs/collector.h: Move CollectorHeap declaration here...
* kjs/collector.cpp: ... from here.
2008-02-25 Darin Adler <darin@apple.com>
Reviewed by Adam.
* JavaScriptCore.exp: Sort the contents of this file.
2008-02-25 Adam Roben <aroben@apple.com>
MSVC build fix
* kjs/testkjs.cpp:
(functionQuit): Don't add a return statement after exit(0) for MSVC.
2008-02-24 Sam Weinig <sam@webkit.org>
Reviewed by Mark Rowe.
http://bugs.webkit.org/show_bug.cgi?id=17529
Add support for reading from stdin from testkjs
* kjs/testkjs.cpp:
(GlobalObject::GlobalObject): Add readline function to global object.
(functionReadline): Added. Reads characters from stdin until a '\n' or
EOF is encountered. The input is returned as a String to the caller.
2008-02-24 Sam Weinig <sam@webkit.org>
Reviewed by Mark Rowe.
http://bugs.webkit.org/show_bug.cgi?id=17528
Give testkjs a bath
* JavaScriptCore.exp:
* JavaScriptCore.xcodeproj/project.pbxproj: Make the testkjs.cpp use 4 space indentation.
* kjs/testkjs.cpp:
(StopWatch::getElapsedMS):
(GlobalObject::className):
(GlobalObject::GlobalObject):
Rename GlobalImp to GlobalObject and setup the global functions
in the GlobalObject's constructor. Also, use static functions for
the implementation so we can use the standard PrototypeFunction
class and remove TestFunctionImp.
(functionPrint): Move print() functionality here.
(functionDebug): Move debug() functionality here.
(functionGC): Move gc() functionality here.
(functionVersion): Move version() functionality here.
(functionRun): Move run() functionality here.
(functionLoad): Move load() functionality here.
(functionQuit): Move quit() functionality here.
(prettyPrintScript): Fix indentation.
(runWithScripts): Since all the functionality of createGlobalObject is
now in the GlobalObject constructor, just call new here.
(parseArguments): Fix indentation.
(kjsmain): Ditto
(fillBufferWithContentsOfFile): Ditto.
2008-02-24 Sam Weinig <sam@webkit.org>
Reviewed by Oliver Hunt and Mark Rowe.
http://bugs.webkit.org/show_bug.cgi?id=17505
Add support for getting command line arguments in testkjs
- This slightly changes the behavior of parsing arguments by requiring
a '-f' before all files.
* kjs/testkjs.cpp:
(createGlobalObject): Add a global property called 'arguments' which
contains an array with the parsed arguments as strings.
(runWithScripts): Pass in the arguments vector so that it can be passed
to the global object.
(parseArguments): Change parsing rules to require a '-f' before any script
file. After all '-f' and '-p' arguments have been parsed, the remaining
are added to the arguments vector and exposed to the script. If there is a
chance of ambiguity (the user wants to pass the string '-f' to the script),
the string '--' can be used separate the options from the pass through
arguments.
(kjsmain):
2008-02-24 Dan Bernstein <mitz@apple.com>
Reviewed by Darin Adler.
- fix http://bugs.webkit.org/show_bug.cgi?id=17511
REGRESSION: Reproducible crash in SegmentedSubstring::SegmentedSubstring(SegmentedSubstring const&)
* wtf/Deque.h:
(WTF::::expandCapacityIfNeeded): Fixed the case where m_start and m_end
are both zero but the buffer capacity is non-zero.
(WTF::::prepend): Added validity checks.
2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com>
Rubber stamped by Darin.
Add separator '\' after libJavaScriptCore_la_LIBADD and cleanup
whitespaces introduced in the previous commit.
* GNUmakefile.am:
2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com>
* GNUmakefile.am: Add GLOBALDEPS for testkjs and minidom.
2008-02-23 Darin Adler <darin@apple.com>
Reviewed by Anders.
- http://bugs.webkit.org/show_bug.cgi?id=17496
make Deque use a circular array; add iterators
* wtf/Deque.h: Wrote an all-new version of this class that uses a circular
buffer. Growth policy is identical to vector. Added iterators.
* wtf/Vector.h: Made two small refinements while using this to implement
Deque: Made VectorBufferBase derive from Noncopyable, which would have
saved me some debugging time if it had been there. Renamed Impl and
m_impl to Buffer and m_buffer.
2008-02-23 Darin Adler <darin@apple.com>
Reviewed by Anders.
- http://bugs.webkit.org/show_bug.cgi?id=17067
eliminate attributes parameter from JSObject::put for speed/clarity
* API/JSCallbackObject.h: Removed attribute arguments.
* API/JSCallbackObjectFunctions.h:
(KJS::JSCallbackObject<Base>::put): Ditto.
* API/JSObjectRef.cpp:
(JSObjectSetProperty): Use initializeVariable or putDirect when necessary
to set attribute values.
* JavaScriptCore.exp: Updated.
* bindings/objc/objc_runtime.h: Removed attribute arguments.
* bindings/objc/objc_runtime.mm:
(ObjcFallbackObjectImp::put): Ditto.
* bindings/runtime_array.cpp:
(RuntimeArray::put): Ditto.
* bindings/runtime_array.h: Ditto.
* bindings/runtime_object.cpp:
(RuntimeObjectImp::put): Ditto.
* bindings/runtime_object.h: Ditto. Also removed canPut which was only
called from one place in WebCore that can use hasProperty instead.
* kjs/Activation.h: Removed attribute argument from put and added the new
initializeVariable function that's used to put variables in variable objects.
Also made isActivationObject a const member.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::put): Removed attribute argument.
(KJS::JSGlobalObject::initializeVariable): Added. Used to give variables
their initial values, which can include the read-only property.
(KJS::JSGlobalObject::reset): Removed obsolete comments about flags.
Removed Internal flag, which is no longer needed.
* kjs/JSGlobalObject.h: More of the same.
* kjs/JSVariableObject.h: Added pure virtual initializeVariable function.
(KJS::JSVariableObject::symbolTablePut): Removed checkReadOnly flag; we always
check read-only.
(KJS::JSVariableObject::symbolTableInitializeVariable): Added.
* kjs/array_instance.cpp:
(KJS::ArrayInstance::put): Removed attribute argument.
* kjs/array_instance.h: Ditto.
* kjs/function.cpp:
(KJS::FunctionImp::put): Ditto.
(KJS::Arguments::put): Ditto.
(KJS::ActivationImp::put): Ditto.
(KJS::ActivationImp::initializeVariable): Added.
* kjs/function.h: Removed attribute arguments.
* kjs/function_object.cpp:
(KJS::FunctionObjectImp::construct): Removed Internal flag.
* kjs/lookup.h:
(KJS::lookupPut): Removed attributes argument. Also changed to use putDirect
instead of calling JSObject::put.
(KJS::cacheGlobalObject): Ditto.
* kjs/nodes.cpp:
(KJS::ConstDeclNode::handleSlowCase): Call initializeVariable to initialize
the constant.
(KJS::ConstDeclNode::evaluateSingle): Ditto.
(KJS::TryNode::execute): Use putDirect to set up the new object.
(KJS::FunctionBodyNode::processDeclarations): Removed Internal.
(KJS::ProgramNode::processDeclarations): Ditto.
(KJS::EvalNode::processDeclarations): Call initializeVariable to initialize
the variables and functions.
(KJS::FuncDeclNode::makeFunction): Removed Internal.
(KJS::FuncExprNode::evaluate): Ditto.
* kjs/object.cpp: Removed canPut, which was only being used in one code path,
not the normal high speed one.
(KJS::JSObject::put): Removed attribute argument. Moved the logic from
canPut here, in the one code ath that was still using it.
* kjs/object.h: Removed Internal attribute, ad canPut function. Removed the
attributes argument to the put function. Made isActivationObject const.
* kjs/regexp_object.cpp:
(KJS::RegExpImp::put): Removed attributes argument.
(KJS::RegExpImp::putValueProperty): Ditto.
(KJS::RegExpObjectImp::put): Ditto.
(KJS::RegExpObjectImp::putValueProperty): Ditto.
* kjs/regexp_object.h: Ditto.
* kjs/string_object.cpp:
(KJS::StringInstance::put): Removed attributes argument.
* kjs/string_object.h: Ditto.
2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com>
Not reviewed, Gtk build fix.
* kjs/testkjs.pro:
2008-02-23 Alexey Proskuryakov <ap@webkit.org>
Windows build fix - move ThreadCondition implementation from WebCore to WTF.
* wtf/ThreadingWin.cpp:
(WTF::ThreadCondition::ThreadCondition):
(WTF::ThreadCondition::~ThreadCondition):
(WTF::ThreadCondition::wait):
(WTF::ThreadCondition::signal):
(WTF::ThreadCondition::broadcast):
2008-02-23 Alexey Proskuryakov <ap@webkit.org>
Touch some files, hoping that Windows build bot will create JSC headers.
* kjs/AllInOneFile.cpp:
* kjs/array_instance.cpp:
* wtf/HashTable.cpp:
2008-02-23 Alexey Proskuryakov <ap@webkit.org>
Qt/Wx build fix - this file was still in a wrong namespace, too.
* wtf/ThreadingNone.cpp:
2008-02-23 Alexey Proskuryakov <ap@webkit.org>
More build fixing - fix mismatched braces.
* JavaScriptCore.pri:
2008-02-23 Alexey Proskuryakov <ap@webkit.org>
Wx and Gtk build fixes.
* JavaScriptCore.pri: Don't try to compile ThreadingPthreads.
* wtf/ThreadingGtk.cpp: Use a correct namespace.
2008-02-23 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
Move basic threading support from WebCore to WTF.
Added mutex protection to MessageQueue::killed() for paranoia sake.
* GNUmakefile.am:
* JavaScriptCore.exp:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* wtf/Locker.h: Copied from WebCore/platform/Locker.h.
* wtf/MessageQueue.h: Copied from WebCore/platform/MessageQueue.h.
(WTF::::killed):
* wtf/Threading.h: Copied from WebCore/platform/Threading.h.
* wtf/ThreadingGtk.cpp: Copied from WebCore/platform/gtk/ThreadingGtk.cpp.
(WebCore::createThread):
* wtf/ThreadingNone.cpp: Copied from WebCore/platform/ThreadingNone.cpp.
* wtf/ThreadingPthreads.cpp: Copied from WebCore/platform/pthreads/ThreadingPthreads.cpp.
(WTF::createThread):
* wtf/ThreadingWin.cpp: Copied from WebCore/platform/win/ThreadingWin.cpp.
(WTF::createThread):
(WTF::Mutex::Mutex):
(WTF::Mutex::~Mutex):
(WTF::Mutex::lock):
(WTF::Mutex::tryLock):
(WTF::Mutex::unlock):
2008-02-22 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Partial fix for <rdar://problem/5744037> Gmail out of memory (17455)
I'm removing KJS_MEM_LIMIT for the following reasons:
- We have a few reports of KJS_MEM_LIMIT breaking important web
applications, like GMail and Google Reader. (For example, if you
simply open 12 GMail tabs, tab #12 will hit the limit.)
- Firefox has no discernable JS object count limit, so any limit, even
a large one, is a potential compatibility problem.
- KJS_MEM_LIMIT does not protect against malicious memory allocation,
since there are many ways to maliciously allocate memory without
increasing the JS object count.
- KJS_MEM_LIMIT is already mostly broken, since it only aborts the
script that breaches the limit, not any subsequent scripts.
- We've never gotten bug reports about websites that would have
benefited from an unbroken KJS_MEM_LIMIT. The initial check-in of
KJS_MEM_LIMIT (KJS revision 80061) doesn't mention a website that
needed it.
- Any website that brings you anywhere close to crashing due to the
number of live JS objects will almost certainly put up the "slow
script" dialog at least 20 times beforehand.
* kjs/collector.cpp:
(KJS::Collector::collect):
* kjs/collector.h:
* kjs/nodes.cpp:
(KJS::TryNode::execute):
2008-02-22 Oliver Hunt <oliver@apple.com>
Reviewed by Alexey P.
<rdar://problem/5759327> REGRESSION: while(NaN) acts like while(true)
Fix yet another case where we incorrectly relied on implicit double
to bool coercion.
* kjs/nodes.cpp:
(KJS::PostDecLocalVarNode::evaluateToBoolean):
2008-02-20 Michael Knaup <michael.knaup@mac.com>
Reviewed by Darin.
Fix for Bug 16753: date set methods with no args should result in NaN (Acid3 bug)
The set values result in NaN now when called with no args, NaN or +/- inf values.
The setYear, setFullYear and setUTCFullYear methods used on NaN dates work as
descripted in the standard.
* kjs/date_object.cpp:
(KJS::fillStructuresUsingTimeArgs):
(KJS::fillStructuresUsingDateArgs):
(KJS::setNewValueFromTimeArgs):
(KJS::setNewValueFromDateArgs):
(KJS::dateProtoFuncSetYear):
2008-02-19 Anders Carlsson <andersca@apple.com>
Reviewed by Darin.
Change OpaqueJSClass and RootObject to start with a ref count of 1.
* API/JSClassRef.cpp:
(OpaqueJSClass::OpaqueJSClass):
(OpaqueJSClass::createNoAutomaticPrototype):
(OpaqueJSClass::create):
* API/JSClassRef.h:
* API/JSObjectRef.cpp:
(JSClassCreate):
* bindings/runtime_root.cpp:
(KJS::Bindings::RootObject::create):
(KJS::Bindings::RootObject::RootObject):
2008-02-19 Darin Adler <darin@apple.com>
Rubber stamped by Anders.
- removed explicit initialization to 1 for RefCounted; that's now the default
* kjs/regexp.cpp:
(KJS::RegExp::RegExp): Removed RefCounted initializer.
2008-02-19 Darin Adler <darin@apple.com>
Reviewed by Anders.
- next step for http://bugs.webkit.org/show_bug.cgi?id=17257
start ref counts at 1 instead of 0 for speed
* wtf/RefCounted.h:
(WTF::RefCounted::RefCounted): Have refcounts default to 1. This allows us to start
removing the explicit initialization of RefCounted from classes and eventually we
can remove the ability to have the initial count of 0 entirely.
2008-02-18 Samuel Weinig <sam@webkit.org>
Reviewed by Geoff Garen.
Fix for http://bugs.webkit.org/show_bug.cgi?id=17419
Remove CompatMode from JavaScriptCore as it is never set to anything other than NativeMode
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::init):
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::setDebugger):
* kjs/date_object.cpp:
(KJS::dateProtoFuncGetYear):
2008-02-18 Darin Adler <darin@apple.com>
Reviewed by Sam.
* wtf/ASCIICType.h:
(WTF::toASCIIHexValue): Added.
2008-02-17 Darin Adler <darin@apple.com>
* wtf/ListHashSet.h: (WTF::swap): Removed stray return statement.
2008-02-15 Adam Roben <aroben@apple.com>
Make JavaScriptCore's FEATURE_DEFINES match WebCore's
Reviewed by Mark.
* Configurations/JavaScriptCore.xcconfig:
2008-02-14 Stephanie Lewis <slewis@apple.com>
Reviewed by Geoff.
Update order files.
* JavaScriptCore.order:
2008-02-14 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Fixed <rdar://problem/5737835> nee http://bugs.webkit.org/show_bug.cgi?id=17329
Crash in JSGlobalObject::popActivation when inserting hyperlink in Wordpress (17329)
Don't reset the "activations" stack in JSGlobalObject::reset, since we
might be executing a script during the call to reset, and the script
needs to safely run to completion.
Instead, initialize the "activations" stack when the global object is
created, and subsequently rely on pushing and popping during normal
execution to maintain the stack's state.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::init):
(KJS::JSGlobalObject::reset):
2008-02-13 Bernhard Rosenkraenzer <bero@arklinux.org>
Reviewed by Darin.
- http://bugs.webkit.org/show_bug.cgi?id=17339
JavaScriptCore does not build with gcc 4.3
* kjs/interpreter.cpp: Add include of <unistd.h>, since that's where
getpid() comes from.
2008-02-13 Oliver Hunt <oliver@apple.com>
Reviewed by Alexey P.
<rdar://problem/5737003> REGRESSION (r27747): can't browse pictures on fastcupid.com
When converting numeric values to booleans we need to account for NaN
* kjs/nodes.cpp:
(KJS::MultNode::evaluateToBoolean):
(KJS::ModNode::evaluateToBoolean):
2008-02-08 Samuel Weinig <sam@webkit.org>
Reviewed by Brady Eidson.
<rdar://problem/5659216> REGRESSION: PLT 0.3% slower due to r28868 (caching ClassNodeList and NamedNodeList)
- Tweak the statements in isASCIISpace to account for the statistical distribution of
usage in the PLT.
.4% speedup on my machine. Stephanie's machine shows this as .3% speedup.
* wtf/ASCIICType.h:
(WTF::isASCIISpace):
2008-02-11 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
Fixes for:
<rdar://problem/5735497> Match Firefox's cross-domain model more accurately by return the built-in version of functions even if they have been overridden
<rdar://problem/5735443> Crash when setting the Window objects prototype to a custom Object and then calling a method on it
- Expose the native Object.prototype.toString implementation so that it can be used for cross-domain
toString calling.
* JavaScriptCore.exp:
* kjs/object_object.cpp:
* kjs/object_object.h:
2008-02-10 Darin Adler <darin@apple.com>
Rubber stamped by Eric.
* kjs/ExecState.h:
(KJS::ExecState::takeException): Added.
2008-02-10 Darin Adler <darin@apple.com>
Reviewed by Eric.
- http://bugs.webkit.org/show_bug.cgi?id=17256
eliminate default ref. count of 0 in RefCounted class
* wtf/RefCounted.h:
(WTF::RefCounted::RefCounted): Remove default of 0.
2008-02-10 Darin Adler <darin@apple.com>
Reviewed by Eric.
- http://bugs.webkit.org/show_bug.cgi?id=17256
Make clients of RefCounted explicitly set the count to 0.
* API/JSClassRef.cpp:
(OpaqueJSClass::OpaqueJSClass):
* bindings/runtime_root.cpp:
(KJS::Bindings::RootObject::RootObject):
2008-02-09 Darin Adler <darin@apple.com>
Reviewed by Mitz.
- http://bugs.webkit.org/show_bug.cgi?id=17256
Change RegExp to start its ref count at 1, not 0
We'll want to do this to every RefCounted class, one at a time.
* kjs/nodes.h:
(KJS::RegExpNode::RegExpNode): Use RegExp::create instead of new RegExp.
* kjs/regexp.cpp:
(KJS::RegExp::RegExp): Marked inline, set initial ref count to 1.
(KJS::RegExp::create): Added. Calls new RegExp then adopts the initial ref.
* kjs/regexp.h: Reformatted. Made the constructors private. Added static
create functions that return objects already wrapped in PassRefPtr.
* kjs/regexp_object.cpp:
(KJS::regExpProtoFuncCompile): Use RegExp::create instead of new RegExp.
(KJS::RegExpObjectImp::construct): Ditto.
* kjs/string_object.cpp:
(KJS::stringProtoFuncMatch): Ditto.
(KJS::stringProtoFuncSearch): Ditto.
2008-02-08 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
<rdar://problem/5731773> REGRESSION (r28973): Extraneous parentheses in function.toString()
https://bugs.webkit.org/show_bug.cgi?id=17214
Make a subclass of CommaNode to provide the correct precedence for each expression in
a variable declaration list.
* kjs/grammar.y:
* kjs/nodes.h:
(KJS::VarDeclCommaNode::):
2008-02-08 Darin Adler <darin@apple.com>
Reviewed by Oliver.
- fix http://bugs.webkit.org/show_bug.cgi?id=17247
Labelled continue/break can fail in some cases
Test: fast/js/continue-break-multiple-labels.html
* kjs/nodes.h:
(KJS::StatementNode::pushLabel): Made this virtual.
(KJS::LabelNode::pushLabel): Forward pushLabel calls to the statement inside.
2008-02-08 Darin Adler <darin@apple.com>
Reviewed by Eric.
- fix http://bugs.webkit.org/show_bug.cgi?id=15003
Function.prototype.constructor should not be DontDelete/ReadOnly (Acid3 bug)
Test: fast/js/constructor-attributes.html
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::reset): Remove unwanted attributes from "constructor".
* kjs/function_object.cpp:
(KJS::FunctionObjectImp::construct): Ditto.
* kjs/nodes.cpp:
(KJS::FuncDeclNode::makeFunction): Ditto.
(KJS::FuncExprNode::evaluate): Ditto.
2008-02-06 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Added an ASSERT to catch refCount underflow, since it caused a leak in
my last check-in.
* wtf/RefCounted.h:
(WTF::RefCounted::deref):
2008-02-06 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
PLT speedup related to <rdar://problem/5659272> REGRESSION: PLT .4%
slower due to r28884 (global variable symbol table optimization)
Tweaked RefCounted::deref() to be a little more efficient.
1% - 1.5% speedup on my machine. .7% speedup on Stephanie's machine.
* wtf/RefCounted.h:
(WTF::RefCounted::deref): Don't modify m_refCount if we're just going
to delete the object anyway. Also, use a simple == test, which might be
faster than <= on some hardware.
2008-02-06 Darin Adler <darin@apple.com>
Reviewed by Sam.
- fix http://bugs.webkit.org/show_bug.cgi?id=17094
Array.prototype functions create length properties with DontEnum/DontDelete
Test results match Gecko with very few obscure exceptions that seem to be
bugs in Gecko.
Test: fast/js/array-functions-non-arrays.html
* kjs/array_object.cpp:
(KJS::arrayProtoFuncConcat): Removed DontEnum and DontDelete from the call
to set length.
(KJS::arrayProtoFuncPop): Ditto. Also added missing call to deleteProperty,
which is not needed for real arrays, but is needed for non-arrays.
(KJS::arrayProtoFuncPush): Ditto.
(KJS::arrayProtoFuncShift): Ditto.
(KJS::arrayProtoFuncSlice): Ditto.
(KJS::arrayProtoFuncSort): Removed incorrect call to set length when
the array has no elements.
(KJS::arrayProtoFuncSplice): Removed DontEnum and DontDelete from the call
to set length.
(KJS::arrayProtoFuncUnShift): Ditto. Also added a check for 0 arguments to
make behavior match the specification in that case.
* kjs/nodes.cpp:
(KJS::ArrayNode::evaluate): Removed DontEnum and DontDelete from the call
to set length.
2008-02-06 Darin Adler <darin@apple.com>
Reviewed by Sam.
- replace calls to put to set up properties with calls to putDirect, to
prepare for a future change where put won't take attributes any more,
and for a slight performance boost
* API/JSObjectRef.cpp:
(JSObjectMakeConstructor): Use putDirect instead of put.
* kjs/CommonIdentifiers.h: Removed lastIndex.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::reset): Use putDirect instead of put.
* kjs/array_object.cpp:
(KJS::arrayProtoFuncConcat): Took out extra call to get length (unused).
(KJS::ArrayObjectImp::ArrayObjectImp): Use putDirect instead of put.
* kjs/error_object.cpp:
(KJS::ErrorPrototype::ErrorPrototype): Use putDirect instead of put.
* kjs/function.cpp:
(KJS::Arguments::Arguments): Use putDirect instead of put.
(KJS::PrototypeFunction::PrototypeFunction): Use putDirect instead of put.
* kjs/function_object.cpp:
(KJS::FunctionObjectImp::construct): Use putDirect instead of put.
* kjs/nodes.cpp:
(KJS::FuncDeclNode::makeFunction): Use putDirect instead of put.
(KJS::FuncExprNode::evaluate): Use putDirect instead of put.
* kjs/regexp_object.cpp:
(KJS::regExpProtoFuncCompile): Use setLastIndex instead of put(lastIndex).
(KJS::RegExpImp::match): Get and set lastIndex by using m_lastIndex instead of
calling get and put.
* kjs/regexp_object.h:
(KJS::RegExpImp::setLastIndex): Added.
* kjs/string_object.cpp:
(KJS::stringProtoFuncMatch): Use setLastIndex instead of put(lastIndex).
2008-02-05 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
Fix for http://bugs.webkit.org/show_bug.cgi?id=8080
NodeList (and other DOM lists) items are not enumeratable using for..in
* JavaScriptCore.exp:
2008-02-05 Mark Rowe <mrowe@apple.com>
Reviewed by Oliver Hunt.
Update versioning to support the mysterious future.
* Configurations/Version.xcconfig: Add SYSTEM_VERSION_PREFIX_1060.
2008-02-04 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver Hunt.
Fixes Bug 16889: REGRESSION (r29425): Canvas-based graphing calculator fails to run
Bug 17015: REGRESSION (r29414-29428): www.fox.com "shows" menu fails to render
Bug 17164: REGRESSION: JavaScript pop-up menu appears at wrong location when hovering image at http://news.chinatimes.com/
<http://bugs.webkit.org/show_bug.cgi?id=16889>
<rdar://problem/5696255>
<http://bugs.webkit.org/show_bug.cgi?id=17015>
<http://bugs.webkit.org/show_bug.cgi?id=17164>
<rdar://problem/5720947>
The ActivationImp tear-off (r29425) introduced a problem with ReadModify
nodes that first resolve a slot, call valueForReadModifyNode(), and then
store a value in the previously resolved slot. Since valueForReadModifyNode()
may cause a tear-off, the slot needs to be resolved again, but this was
not happening with the existing code.
* kjs/nodes.cpp:
(KJS::ReadModifyLocalVarNode::evaluate):
(KJS::ReadModifyResolveNode::evaluate):
2008-02-04 Cameron McCormack <cam@mcc.id.au>
Reviewed by Geoff Garen.
Remove some unneccesary UNUSED_PARAMs. Clarify ownership rule of return value of JSObjectCopyPropertyNames.
* API/JSNode.c:
(JSNode_appendChild):
(JSNode_removeChild):
(JSNode_replaceChild):
(JSNode_getNodeType):
(JSNode_getFirstChild):
* API/JSNodeList.c:
(JSNodeList_length):
* API/JSObjectRef.h:
2008-02-04 Rodney Dawes <dobey@wayofthemonkey.com>
Reviewed by Alp Toker and Mark Rowe.
Fix http://bugs.webkit.org/show_bug.cgi?id=17175.
Bug 17175: Use of C++ compiler flags in CFLAGS
* GNUmakefile.am: Use global_cxxflags as well as global_cflags in CXXFLAGS.
2008-02-04 Alp Toker <alp@atoker.com>
Rubber-stamped by Mark Rowe.
Remove all trailing whitespace in the GTK+ port and related
components.
* GNUmakefile.am:
2008-02-02 Darin Adler <darin@apple.com>
Reviewed by Geoff Garen.
PLT speedup related to <rdar://problem/5659272> REGRESSION: PLT .4%
slower due to r28884 (global variable symbol table optimization)
Geoff's theory is that the slowdown was due to copying hash tables when
putting things into the back/forward cache. If that's true, then this
should fix the problem.
(According to Geoff's measurements, in a PLT that exaggerates the
importance of symbol table saving during cached page creation, this
patch is a ~3X speedup in cached page creation, and a 9% speedup overall.)
* JavaScriptCore.exp: Updated.
* kjs/JSVariableObject.cpp:
(KJS::JSVariableObject::saveLocalStorage): Updated for changes to SavedProperty,
which has been revised to avoid initializing each SavedProperty twice when building
the array. Store the property names too, so we don't have to store the symbol table
separately. Do this by iterating the symbol table instead of the local storage vector.
(KJS::JSVariableObject::restoreLocalStorage): Ditto. Restore the symbol table as
well as the local storage vector.
* kjs/JSVariableObject.h: Removed save/restoreSymbolTable and do that work inside
save/restoreLocalStorage instead. Made restoreLocalStorage a non-const member function
that takes a const reference to a SavedProperties object.
* kjs/LocalStorage.h: Changed attributes to be unsigned instead of int to match
other declarations of attributes elsewhere.
* kjs/property_map.cpp:
(KJS::SavedProperties::SavedProperties): Updated for data member name change.
(KJS::PropertyMap::save): Updated for data member name change and to use the new
inline init function instead of setting the fields directly. This allows us to
skip initializing the SavedProperty objects when first allocating the array, and
just do it when we're actually setting up the individual elements.
(KJS::PropertyMap::restore): Updated for SavedProperty changes.
* kjs/property_map.h: Changed SavedProperty from a struct to a class. Set it up so
it does not get initialized at construction time to avoid initializing twice when
creating an array of SavedProperty. Removed the m_ prefixes from the members of
the SavedProperties struct. Generally we use m_ for class members and not struct.
2008-02-02 Tony Chang <idealisms@gmail.com>
Reviewed by darin. Landed by eseidel.
Add #define guards for WIN32_LEAN_AND_MEAN and _CRT_RAND_S.
* kjs/config.h:
* wtf/FastMalloc.cpp:
* wtf/TCSpinLock.h:
2008-01-28 Sam Weinig <sam@webkit.org>
Rubber-stamped by Darin Adler.
- Fix whitespace in nodes.h/cpp and nodes2string.cpp.
(NOTE: Specific changed functions elided for space and clarity)
* kjs/nodes.cpp:
* kjs/nodes.h:
* kjs/nodes2string.cpp:
2008-01-27 Sam Weinig <sam@webkit.org>
Reviewed by Oliver Hunt.
Patch for http://bugs.webkit.org/show_bug.cgi?id=17025
nodes.h/cpp has been rolling around in the mud - lets hose it down
- Rename member variables to use the m_ prefix.
(NOTE: Specific changed functions elided for space and clarity)
* kjs/grammar.y:
* kjs/nodes.cpp:
* kjs/nodes.h:
* kjs/nodes2string.cpp:
2008-01-27 Darin Adler <darin@apple.com>
Reviewed by Oliver.
- fix <rdar://problem/5657450> REGRESSION: const is broken
Test: fast/js/const.html
SunSpider said this was 0.3% slower. And I saw some Shark samples in
JSGlobalObject::put -- not a lot but a few. We may be able to regain the
speed, but for now we will take that small hit for correctness sake.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::put): Pass the checkReadOnly flag in to symbolTablePut
instead of passing attributes.
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::symbolTablePut): Removed the code to set attributes
here, since we only set attributes when creating a property. Added the code
to check read-only here, since we need that to implement const!
* kjs/function.cpp:
(KJS::ActivationImp::put): Pass the checkReadOnly flag in to symbolTablePut
instead of passing attributes.
* kjs/nodes.cpp:
(KJS::isConstant): Added.
(KJS::PostIncResolveNode::optimizeVariableAccess): Create a PostIncConstNode
if optimizing for a local variable and the variable is constant.
(KJS::PostDecResolveNode::optimizeVariableAccess): Ditto. But PostDecConstNode.
(KJS::PreIncResolveNode::optimizeVariableAccess): Ditto. But PreIncConstNode.
(KJS::PreDecResolveNode::optimizeVariableAccess): Ditto. But PreDecConstNode.
(KJS::PreIncConstNode::evaluate): Return the value + 1.
(KJS::PreDecConstNode::evaluate): Return the value - 1.
(KJS::PostIncConstNode::evaluate): Return the value converted to a number.
(KJS::PostDecConstNode::evaluate): Ditto.
(KJS::ReadModifyResolveNode::optimizeVariableAccess): Create a ReadModifyConstNode
if optimizing for a local variable and the variable is constant.
(KJS::AssignResolveNode::optimizeVariableAccess): Ditto. But AssignConstNode.
(KJS::ScopeNode::optimizeVariableAccess): Pass the local storage to the
node optimizeVariableAccess functions, since that's where we need to look to
figure out if a variable is constant.
(KJS::FunctionBodyNode::processDeclarations): Moved the call to
optimizeVariableAccess until after localStorage is set up.
(KJS::ProgramNode::processDeclarations): Ditto.
* kjs/nodes.h: Fixed the IsConstant and HasInitializer values. They are used
as flag masks, so a value of 0 will not work for IsConstant. Changed the
first parameter to optimizeVariableAccess to be a const reference to a symbol
table and added a const reference to local storage. Added classes for const
versions of local variable access: PostIncConstNode, PostDecConstNode,
PreIncConstNode, PreDecConstNode, ReadModifyConstNode, and AssignConstNode.
* kjs/object.cpp:
(KJS::JSObject::put): Tweaked comments a bit, and changed the checkReadOnly
expression to match the form used at the two other call sites.
2008-01-27 Darin Adler <darin@apple.com>
Reviewed by Oliver.
- fix http://bugs.webkit.org/show_bug.cgi?id=16498
''.constructor.toString() gives [function]
Test: fast/js/function-names.html
* kjs/array_object.cpp:
(KJS::ArrayObjectImp::ArrayObjectImp): Use the class name as the constructor's function name.
* kjs/bool_object.cpp:
(KJS::BooleanObjectImp::BooleanObjectImp): Ditto.
* kjs/date_object.cpp:
(KJS::DateObjectImp::DateObjectImp): Ditto.
* kjs/error_object.cpp:
(KJS::ErrorPrototype::ErrorPrototype): Make the error object be an Error.
(KJS::ErrorObjectImp::ErrorObjectImp): Use the class name as the constructor's function name.
(KJS::NativeErrorPrototype::NativeErrorPrototype): Take const UString&.
(KJS::NativeErrorImp::NativeErrorImp): Use the prototype's name as the constructor's function
name.
* kjs/error_object.h: Change ErrorPrototype to inherit from ErrorInstance. Change the
NativeErrorImp constructor to take a NativeErrorPrototype pointer for its prototype.
* kjs/function.h: Removed unneeded constructor for internal functions without names.
We want to avoid those!
* kjs/function_object.cpp:
(KJS::functionProtoFuncToString): Removed code that writes out just [function] for functions
that have no names. There's no reason to do that.
(KJS::FunctionObjectImp::FunctionObjectImp): Use the class name as the constructor's
function name.
* kjs/internal.cpp: Removed the unused constructor.
* kjs/number_object.cpp:
(KJS::fractionalPartToString): Marked static for internal linkage.
(KJS::exponentialPartToString): Ditto.
(KJS::numberProtoFuncToPrecision): Removed an unneeded else.
(KJS::NumberObjectImp::NumberObjectImp): Use the class name as the constructor's
function name.
(KJS::NumberObjectImp::getValueProperty): Tweaked formatting.
* kjs/object_object.cpp:
(KJS::ObjectObjectImp::ObjectObjectImp): Use "Object" for the function name.
* kjs/regexp_object.cpp:
(KJS::RegExpObjectImp::RegExpObjectImp): Use "RegExp" for the function name.
* kjs/string_object.cpp:
(KJS::StringObjectImp::StringObjectImp): Use the class name as the constructor's
function name.
2008-01-26 Darin Adler <darin@apple.com>
Reviewed by Oliver.
- fix http://bugs.webkit.org/show_bug.cgi?id=17027
Incorrect Function.toString behaviour with read/modify/write operators performed on negative numbers
Test: fast/js/function-toString-parentheses.html
The problem here was that a NumberNode with a negative number in it had the wrong
precedence. It's not a primary expression, it's a unary operator with a primary
expression after it.
Once the precedence of NumberNode was fixed, the cases from bug 17020 were also
fixed without trying to treat bracket nodes like dot nodes. That wasn't needed.
The reason we handle numbers before dot nodes specially is that the dot is a
legal character in a number. The same is not true of a bracket. Eventually we
could get smarter, and only add the parentheses when there is actual ambiguity.
There is none if the string form of the number already has a dot in it, or if
it's a number with a alphabetic name like infinity or NAN.
* kjs/nodes.h: Renamed back from ObjectAccess to DotExpr.
(KJS::NumberNode::precedence): Return PrecUnary for negative numbers, since
they serialize as a unary operator, not a primary expression.
* kjs/nodes2string.cpp:
(KJS::SourceStream::operator<<): Clear m_numberNeedsParens if this adds
parens; one set is enough.
(KJS::bracketNodeStreamTo): Remove unneeded special flag here. Normal
operator precedence suffices.
(KJS::NewExprNode::streamTo): Ditto.
2008-01-26 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej and Darin.
Fix for http://bugs.webkit.org/show_bug.cgi?id=17020
Function.toString does not parenthesise numbers for the bracket accessor
It turns out that logic was there for all of the dot accessor nodes to make numbers be
parenthesised properly, so it was a trivial extension to extend that to the bracket nodes.
I renamed the enum type to reflect the fact that it is now used for both dot and bracket
accessors.
* kjs/nodes2string.cpp:
(KJS::bracketNodeStreamTo):
(KJS::BracketAccessorNode::streamTo):
2008-01-26 Oliver Hunt <oliver@apple.com>
Reviewed by Darin.
Fix Bug 17018: Incorrect code generated from Function.toString for get/setters in object literals
Don't quote getter and setter names during output, as that is simply wrong.
* kjs/nodes2string.cpp:
(KJS::PropertyNode::streamTo):
2008-01-26 Darin Adler <darin@apple.com>
Reviewed by Eric Seidel.
- http://bugs.webkit.org/show_bug.cgi?id=16860
a bit of cleanup after the Activation optimization
* JavaScriptCore.exp: Export the GlobalExecState constructor instead of
the global flavor of the ExecState constructor. It'd probably be cleaner
to not export either one, but JSGlobalObject inlines the code that
constructs the ExecState. If we changed that, we could remove this export.
* JavaScriptCore.xcodeproj/project.pbxproj: Re-sorted a few things and
put the new source files into the kjs group rather than at the top level.
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState): Marked inline and updated for data member
name changes. This is now only for use for the derived classes. Also removed
code that sets the unused m_savedExec data member for the global case. That
data member is only used for the other two types.
(KJS::ExecState::~ExecState): Marked inline and removed all the code.
The derived class destructors now inclde the appropriate code.
(KJS::ExecState::lexicalGlobalObject): Removed unneeded special case for
an empty scope chain. The bottom function already returns 0 for that case,
so the general case code handles it fine. Also changed to use data members
directly rather than calling functions.
(KJS::GlobalExecState::GlobalExecState): Added. Calls through to the base
class constructor.
(KJS::GlobalExecState::~GlobalExecState): Added.
(KJS::InterpreterExecState::InterpreterExecState): Added. Moved code to
manipulate activeExecStates here since we don't want to have to check for the
special case of globalExec.
(KJS::InterpreterExecState::~InterpreterExecState): Added.
(KJS::EvalExecState::EvalExecState): Added.
(KJS::EvalExecState::~EvalExecState): Added.
(KJS::FunctionExecState::FunctionExecState): Added.
(KJS::FunctionExecState::~FunctionExecState): Added.
* kjs/ExecState.h: Tweaked the header, includes, and declarations a bit.
Made ExecState inherit from Noncopyable. Reformatted some comments and
made them a bit more brief. Rearranged declarations a little bit and removed
unused savedExec function. Changed seenLabels function to return a reference
rather than a pointer. Made constructors and destructor protected, and also
did the same with all data members. Renamed m_thisVal to m_thisValue and
ls to m_labelStack. Added three new derived classes for each of the
types of ExecState. The primary goal here was to remove a branch from the
code in the destructor, but it's also clearer than overloading the arguments
to the ExecState constructor.
* kjs/JSGlobalObject.cpp:
(KJS::getCurrentTime): Fixed formatting.
(KJS::JSGlobalObject::pushActivation): Removed parentheses that don't make
the expression clearer -- other similar sites didn't have these parentheses,
even the one a couple lines earlier that sets stackEntry.
(KJS::JSGlobalObject::tearOffActivation): Got rid of unneeded static_cast
(I think I mentioned this during patch review) and used an early exit so that
the entire contents of the function aren't nested inside an if statement.
Also removed the check of codeType, instead checking Activation for 0.
For now, I kept the codeType check, but inside an assertion.
* kjs/JSGlobalObject.h: Changed type of globalExec to GlobalExecState.
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction): Changed type to FunctionExecState.
(KJS::GlobalFuncImp::callAsFunction): Changed type to EvalExecState.
* kjs/interpreter.cpp:
(KJS::Interpreter::evaluate): Changed type to GlobalExecState.
* kjs/nodes.cpp:
(KJS::ContinueNode::execute): Changed code since seenLabels() returns a
reference now instead of a pointer.
(KJS::BreakNode::execute): Ditto.
(KJS::LabelNode::execute): Ditto.
2008-01-26 Sam Weinig <sam@webkit.org>
Reviewed by Mark Rowe.
Cleanup node2string a little.
- Remove some unnecessary branching.
- Factor out bracket and dot streaming into static inline functions.
* kjs/nodes.h:
* kjs/nodes2string.cpp:
(KJS::bracketNodeStreamTo):
(KJS::dotNodeStreamTo):
(KJS::FunctionCallBracketNode::streamTo):
(KJS::FunctionCallDotNode::streamTo):
(KJS::PostIncBracketNode::streamTo):
(KJS::PostDecBracketNode::streamTo):
(KJS::PostIncDotNode::streamTo):
(KJS::PostDecDotNode::streamTo):
(KJS::DeleteBracketNode::streamTo):
(KJS::DeleteDotNode::streamTo):
(KJS::PreIncBracketNode::streamTo):
(KJS::PreDecBracketNode::streamTo):
(KJS::PreIncDotNode::streamTo):
(KJS::PreDecDotNode::streamTo):
(KJS::ReadModifyBracketNode::streamTo):
(KJS::AssignBracketNode::streamTo):
(KJS::ReadModifyDotNode::streamTo):
(KJS::AssignDotNode::streamTo):
(KJS::WhileNode::streamTo):
2008-01-26 Mark Rowe <mrowe@apple.com>
Reviewed by Darin Adler.
Fix http://bugs.webkit.org/show_bug.cgi?id=17001
Bug 17001: Build error with Gtk port on Mac OS X
If both XP_MACOSX and XP_UNIX are defined then X11.h and Carbon.h will both be included.
These provide conflicting definitions for a type named 'Cursor'. As XP_UNIX is set by
the build system when targeting X11, it doesn't make sense for XP_MACOSX to also be set
in this instance.
* bindings/npapi.h: Don't define XP_MACOSX if XP_UNIX is defined.
2008-01-26 Darin Adler <darin@apple.com>
Reviewed by Oliver.
- fix http://bugs.webkit.org/show_bug.cgi?id=17013
JSC can't round trip certain for-loops
Test: fast/js/toString-for-var-decl.html
* kjs/nodes.h: Added PlaceholderTrueNode so we can put nodes into
for loops without injecting the word "true" into them (nice, but not
the bug fix). Fixed ForNode constructor so expr1WasVarDecl is set
only when there is an expression, since it's common for the actual
variable declaration to be moved by the parser.
* kjs/nodes2string.cpp:
(KJS::PlaceholderTrueNode::streamTo): Added. Empty.
2008-01-25 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Fix for bug 17012: REGRESSION: JSC can't round trip an object literal
Add logic to ensure that object literals and function expressions get
parentheses when necessary.
* kjs/nodes.h:
* kjs/nodes2string.cpp:
(KJS::SourceStream::operator<<):
2008-01-24 Steve Falkenburg <sfalken@apple.com>
Build fix.
* JavaScriptCore.vcproj/JavaScriptCore.sln:
2008-01-24 Steve Falkenburg <sfalken@apple.com>
Build fix.
* JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
Reviewed by Simon.
Fix QDateTime to JS Date conversion.
Several conversion errors (some UTC related, some month
offset related) and the conversion distance for Date
to DateTime conversion weights were fixed (it should never
be better to convert a JS Number into a Date rather than
an int).
* bindings/qt/qt_runtime.cpp:
(KJS::Bindings::convertValueToQVariant):
(KJS::Bindings::convertQVariantToValue):
2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
Reviewed by Simon.
Add support for calling QObjects.
Add support for invokeDefaultMethod (via a call to
a specific slot), and also allow using it as a
constructor, like QtScript.
* bindings/qt/qt_class.cpp:
(KJS::Bindings::QtClass::fallbackObject):
* bindings/qt/qt_instance.cpp:
(KJS::Bindings::QtRuntimeObjectImp::construct):
(KJS::Bindings::QtInstance::QtInstance):
(KJS::Bindings::QtInstance::~QtInstance):
(KJS::Bindings::QtInstance::implementsCall):
(KJS::Bindings::QtInstance::invokeDefaultMethod):
* bindings/qt/qt_instance.h:
* bindings/qt/qt_runtime.cpp:
(KJS::Bindings::findMethodIndex):
(KJS::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod):
(KJS::Bindings::QtRuntimeMetaMethod::callAsFunction):
* bindings/qt/qt_runtime.h:
2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
Reviewed by Simon.
Code style cleanups.
Add spaces before/after braces in inline function.
* bindings/qt/qt_instance.h:
2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
Reviewed by Simon.
Code style cleanups.
Remove spaces and unneeded declared parameter names.
* bindings/qt/qt_instance.cpp:
(KJS::Bindings::QtRuntimeObjectImp::removeFromCache):
2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
Reviewed by Simon.
Clear stale RuntimeObjectImps.
Since other objects can have refs to the QtInstance,
we can't rely on the QtInstance being deleted when the
RuntimeObjectImp is invalidate or deleted. This
could result in a stale JSObject being returned for
a valid Instance.
* bindings/qt/qt_instance.cpp:
(KJS::Bindings::QtRuntimeObjectImp::QtRuntimeObjectImp):
(KJS::Bindings::QtRuntimeObjectImp::~QtRuntimeObjectImp):
(KJS::Bindings::QtRuntimeObjectImp::invalidate):
(KJS::Bindings::QtRuntimeObjectImp::removeFromCache):
(KJS::Bindings::QtInstance::getRuntimeObject):
* bindings/runtime.cpp:
(KJS::Bindings::Instance::createRuntimeObject):
* bindings/runtime.h:
2008-01-23 Alp Toker <alp@atoker.com>
Rubber-stamped by Mark Rowe.
Remove whitespace after -I in automake include lists.
* GNUmakefile.am:
2008-01-23 Michael Goddard <michael.goddard@trolltech.com>
Reviewed by Lars Knoll <lars@trolltech.com>.
Reworked the JavaScriptCore Qt bindings:
* Add initial support for string and variant arrays, as well
as sub QObjects in the JS bindings.
* Don't expose fields marked as not scriptable by moc.
* Add support for dynamic properties and accessing named
QObject children of an object (like QtScript and older
IE DOM style JS).
* Add support for custom toString methods.
* Fine tune some bindings to be closer to QtScript.
Make void functions return undefined, and empty/
null QStrings return a zero length string.
* Create framework for allowing more direct method calls.
Since RuntimeMethod doesn't allow us to add additional
methods/properties to a function, add these classes.
Start prototyping object.signal.connect(...).
* Add signal support to the Qt bindings.
Allow connecting to signals (object.signal.connect(slot)),
disconnecting, and emitting signals. Currently chooses
the first signal that matches the name, so this will need
improvement.
* Add property names, and resolve signals closer to use.
Enumerating properties now returns some of the Qt properties
and signals. Slots and methods aren't quite present. Also,
resolve signal connections etc. closer to the time of use, so
we can do more dynamic resolution based on argument type etc.
Still picks the first one with the same name, at the moment.
* Make signature comparison code consistent.
Use the same code for checking meta signatures in
the method and fallback getters, and avoid a
QByteArray construction when we can.
* Fix minor memory leak, and handle pointers better.
Delete the private object in the dtors, and use RefPtrs
for holding Instances etc.
* Handle method lookup better.
Allow invocation time method lookup based on the arguments,
which is closer to QtScript behaviour. Also, cache the
method lists and delete them in the QtClass dtor (stops
a memory leak).
* Improve JS to Qt data type conversions.
Add some support for Date & RegExp JS objects,
and provide some metrics on the quality of the
conversion.
* A couple of fixes for autotest failures.
Better support for converting lists, read/write only
QMetaProperty support, modified slot search order...)
* bindings/qt/qt_class.cpp:
(KJS::Bindings::QtClass::QtClass):
(KJS::Bindings::QtClass::~QtClass):
(KJS::Bindings::QtClass::name):
(KJS::Bindings::QtClass::fallbackObject):
(KJS::Bindings::QtClass::methodsNamed):
(KJS::Bindings::QtClass::fieldNamed):
* bindings/qt/qt_class.h:
* bindings/qt/qt_instance.cpp:
(KJS::Bindings::QtInstance::QtInstance):
(KJS::Bindings::QtInstance::~QtInstance):
(KJS::Bindings::QtInstance::getRuntimeObject):
(KJS::Bindings::QtInstance::getClass):
(KJS::Bindings::QtInstance::implementsCall):
(KJS::Bindings::QtInstance::getPropertyNames):
(KJS::Bindings::QtInstance::invokeMethod):
(KJS::Bindings::QtInstance::invokeDefaultMethod):
(KJS::Bindings::QtInstance::stringValue):
(KJS::Bindings::QtInstance::booleanValue):
(KJS::Bindings::QtInstance::valueOf):
(KJS::Bindings::QtField::name):
(KJS::Bindings::QtField::valueFromInstance):
(KJS::Bindings::QtField::setValueToInstance):
* bindings/qt/qt_instance.h:
(KJS::Bindings::QtInstance::getBindingLanguage):
(KJS::Bindings::QtInstance::getObject):
* bindings/qt/qt_runtime.cpp:
(KJS::Bindings::QWKNoDebug::QWKNoDebug):
(KJS::Bindings::QWKNoDebug::~QWKNoDebug):
(KJS::Bindings::QWKNoDebug::operator<<):
(KJS::Bindings::):
(KJS::Bindings::valueRealType):
(KJS::Bindings::convertValueToQVariant):
(KJS::Bindings::convertQVariantToValue):
(KJS::Bindings::QtRuntimeMethod::QtRuntimeMethod):
(KJS::Bindings::QtRuntimeMethod::~QtRuntimeMethod):
(KJS::Bindings::QtRuntimeMethod::codeType):
(KJS::Bindings::QtRuntimeMethod::execute):
(KJS::Bindings::QtRuntimeMethodData::~QtRuntimeMethodData):
(KJS::Bindings::QtRuntimeMetaMethodData::~QtRuntimeMetaMethodData):
(KJS::Bindings::QtRuntimeConnectionMethodData::~QtRuntimeConnectionMethodData):
(KJS::Bindings::QtMethodMatchType::):
(KJS::Bindings::QtMethodMatchType::QtMethodMatchType):
(KJS::Bindings::QtMethodMatchType::kind):
(KJS::Bindings::QtMethodMatchType::isValid):
(KJS::Bindings::QtMethodMatchType::isVariant):
(KJS::Bindings::QtMethodMatchType::isMetaType):
(KJS::Bindings::QtMethodMatchType::isUnresolved):
(KJS::Bindings::QtMethodMatchType::isMetaEnum):
(KJS::Bindings::QtMethodMatchType::enumeratorIndex):
(KJS::Bindings::QtMethodMatchType::variant):
(KJS::Bindings::QtMethodMatchType::metaType):
(KJS::Bindings::QtMethodMatchType::metaEnum):
(KJS::Bindings::QtMethodMatchType::unresolved):
(KJS::Bindings::QtMethodMatchType::typeId):
(KJS::Bindings::QtMethodMatchType::name):
(KJS::Bindings::QtMethodMatchData::QtMethodMatchData):
(KJS::Bindings::QtMethodMatchData::isValid):
(KJS::Bindings::QtMethodMatchData::firstUnresolvedIndex):
(KJS::Bindings::indexOfMetaEnum):
(KJS::Bindings::findMethodIndex):
(KJS::Bindings::findSignalIndex):
(KJS::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod):
(KJS::Bindings::QtRuntimeMetaMethod::mark):
(KJS::Bindings::QtRuntimeMetaMethod::callAsFunction):
(KJS::Bindings::QtRuntimeMetaMethod::getOwnPropertySlot):
(KJS::Bindings::QtRuntimeMetaMethod::lengthGetter):
(KJS::Bindings::QtRuntimeMetaMethod::connectGetter):
(KJS::Bindings::QtRuntimeMetaMethod::disconnectGetter):
(KJS::Bindings::QtRuntimeConnectionMethod::QtRuntimeConnectionMethod):
(KJS::Bindings::QtRuntimeConnectionMethod::callAsFunction):
(KJS::Bindings::QtRuntimeConnectionMethod::getOwnPropertySlot):
(KJS::Bindings::QtRuntimeConnectionMethod::lengthGetter):
(KJS::Bindings::QtConnectionObject::QtConnectionObject):
(KJS::Bindings::QtConnectionObject::~QtConnectionObject):
(KJS::Bindings::QtConnectionObject::metaObject):
(KJS::Bindings::QtConnectionObject::qt_metacast):
(KJS::Bindings::QtConnectionObject::qt_metacall):
(KJS::Bindings::QtConnectionObject::execute):
(KJS::Bindings::QtConnectionObject::match):
(KJS::Bindings::::QtArray):
(KJS::Bindings::::~QtArray):
(KJS::Bindings::::rootObject):
(KJS::Bindings::::setValueAt):
(KJS::Bindings::::valueAt):
* bindings/qt/qt_runtime.h:
(KJS::Bindings::QtField::):
(KJS::Bindings::QtField::QtField):
(KJS::Bindings::QtField::fieldType):
(KJS::Bindings::QtMethod::QtMethod):
(KJS::Bindings::QtMethod::name):
(KJS::Bindings::QtMethod::numParameters):
(KJS::Bindings::QtArray::getLength):
(KJS::Bindings::QtRuntimeMethod::d_func):
(KJS::Bindings::QtRuntimeMetaMethod::d_func):
(KJS::Bindings::QtRuntimeConnectionMethod::d_func):
(KJS::Bindings::):
* bindings/runtime.cpp:
(KJS::Bindings::Instance::createBindingForLanguageInstance):
(KJS::Bindings::Instance::createRuntimeObject):
(KJS::Bindings::Instance::reallyCreateRuntimeObject):
* bindings/runtime.h:
2008-01-22 Anders Carlsson <andersca@apple.com>
Reviewed by Darin and Adam.
<rdar://problem/5688975>
div element on microsoft site has wrong left offset.
Return true even if NPN_GetProperty returns null or undefined. This matches Firefox
(and is what the Silverlight plug-in expects).
* bindings/NP_jsobject.cpp:
(_NPN_GetProperty):
2008-01-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Fixed http://bugs.webkit.org/show_bug.cgi?id=16909
REGRESSION: Amazon.com crash (ActivationImp)
(and a bunch of other crashes)
Plus, a .7% SunSpider speedup to boot.
Replaced the buggy currentExec and savedExec mechanisms with an
explicit ExecState stack.
* kjs/collector.cpp:
(KJS::Collector::collect): Explicitly mark the ExecState stack.
(KJS::Collector::reportOutOfMemoryToAllExecStates): Slight change in
behavior: We no longer throw an exception in any global ExecStates,
since global ExecStates are more like pseudo-ExecStates, and aren't
used for script execution. (It's unclear what would happen if you left
an exception waiting around in a global ExecState, but it probably
wouldn't be good.)
2008-01-21 Jan Michael Alonzo <jmalonzo@unpluggable.com>
Reviewed by Alp Toker.
http://bugs.webkit.org/show_bug.cgi?id=16955
Get errors when cross-compile webkit-gtk
* GNUmakefile.am: removed ICU_CFLAGS
2008-01-18 Kevin McCullough <kmccullough@apple.com>
- Build fix.
* kjs/ustring.h:
2008-01-18 Kevin McCullough <kmccullough@apple.com>
- Build fix.
* kjs/ustring.cpp:
* kjs/ustring.h:
(KJS::UString::cost):
2008-01-18 Kevin McCullough <kmccullough@apple.com>
Reviewed by Geoff.
- Correctly report cost of appended strings to trigger GC.
* kjs/ustring.cpp:
(KJS::UString::Rep::create):
(KJS::UString::UString): Don't create unnecssary objects.
(KJS::UString::cost): Report cost if necessary but also keep track of
reported cost.
* kjs/ustring.h:
2008-01-18 Simon Hausmann <hausmann@webkit.org>
Reviewed by Holger.
Fix return type conversions from Qt slots to JS values.
This also fixes fast/dom/open-and-close-by-DOM.html, which called
layoutTestController.windowCount().
When constructing the QVariant that holds the return type we cannot
use the QVarian(Type) constuctor as that will create a null variant.
We have to use the QVariant(Type, void *) constructor instead, just
like in QMetaObject::read() for example.
* bindings/qt/qt_instance.cpp:
(KJS::Bindings::QtInstance::getRuntimeObject):
2008-01-18 Prasanth Ullattil <prasanth.ullattil@trolltech.com>
Reviewed by Simon Hausmann <hausmann@webkit.org>.
Fix compilation on Win64(2): Implemented currentThreadStackBase on X86-64 on Windows
* kjs/collector.cpp:
(KJS::Collector::heapAllocate):
2008-01-18 Prasanth Ullattil <prasanth.ullattil@trolltech.com>
Reviewed by Simon Hausmann <hausmann@webkit.org>.
Fix compilation on Win64(1): Define WTF_PLATFORM_X86_64 correctly on Win64.
* wtf/Platform.h:
2008-01-17 Antti Koivisto <antti@apple.com>
Fix Windows build.
* kjs/regexp_object.cpp:
(KJS::regExpProtoFuncToString):
2008-01-16 Sam Weinig <sam@webkit.org>
Reviewed by Darin.
Fix for http://bugs.webkit.org/show_bug.cgi?id=16901
Convert remaining JS function objects to use the new PrototypeFunction class
- Moves Boolean, Function, RegExp, Number, Object and Global functions to their
own static function implementations so that they can be used with the
PrototypeFunction class. SunSpider says this is 1.003x as fast.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::reset):
* kjs/array_object.h:
* kjs/bool_object.cpp:
(KJS::BooleanInstance::BooleanInstance):
(KJS::BooleanPrototype::BooleanPrototype):
(KJS::booleanProtoFuncToString):
(KJS::booleanProtoFuncValueOf):
(KJS::BooleanObjectImp::BooleanObjectImp):
(KJS::BooleanObjectImp::implementsConstruct):
(KJS::BooleanObjectImp::construct):
(KJS::BooleanObjectImp::callAsFunction):
* kjs/bool_object.h:
(KJS::BooleanInstance::classInfo):
* kjs/error_object.cpp:
(KJS::ErrorPrototype::ErrorPrototype):
(KJS::errorProtoFuncToString):
* kjs/error_object.h:
* kjs/function.cpp:
(KJS::globalFuncEval):
(KJS::globalFuncParseInt):
(KJS::globalFuncParseFloat):
(KJS::globalFuncIsNaN):
(KJS::globalFuncIsFinite):
(KJS::globalFuncDecodeURI):
(KJS::globalFuncDecodeURIComponent):
(KJS::globalFuncEncodeURI):
(KJS::globalFuncEncodeURIComponent):
(KJS::globalFuncEscape):
(KJS::globalFuncUnEscape):
(KJS::globalFuncKJSPrint):
(KJS::PrototypeFunction::PrototypeFunction):
* kjs/function.h:
* kjs/function_object.cpp:
(KJS::FunctionPrototype::FunctionPrototype):
(KJS::functionProtoFuncToString):
(KJS::functionProtoFuncApply):
(KJS::functionProtoFuncCall):
* kjs/function_object.h:
* kjs/number_object.cpp:
(KJS::NumberPrototype::NumberPrototype):
(KJS::numberProtoFuncToString):
(KJS::numberProtoFuncToLocaleString):
(KJS::numberProtoFuncValueOf):
(KJS::numberProtoFuncToFixed):
(KJS::numberProtoFuncToExponential):
(KJS::numberProtoFuncToPrecision):
* kjs/number_object.h:
(KJS::NumberInstance::classInfo):
(KJS::NumberObjectImp::classInfo):
(KJS::NumberObjectImp::):
* kjs/object_object.cpp:
(KJS::ObjectPrototype::ObjectPrototype):
(KJS::objectProtoFuncValueOf):
(KJS::objectProtoFuncHasOwnProperty):
(KJS::objectProtoFuncIsPrototypeOf):
(KJS::objectProtoFuncDefineGetter):
(KJS::objectProtoFuncDefineSetter):
(KJS::objectProtoFuncLookupGetter):
(KJS::objectProtoFuncLookupSetter):
(KJS::objectProtoFuncPropertyIsEnumerable):
(KJS::objectProtoFuncToLocaleString):
(KJS::objectProtoFuncToString):
* kjs/object_object.h:
* kjs/regexp_object.cpp:
(KJS::RegExpPrototype::RegExpPrototype):
(KJS::regExpProtoFuncTest):
(KJS::regExpProtoFuncExec):
(KJS::regExpProtoFuncCompile):
(KJS::regExpProtoFuncToString):
* kjs/regexp_object.h:
2008-01-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej & Darin.
Fixes Bug 16868: Gmail crash
and Bug 16871: Crash when loading apple.com/startpage
<http://bugs.webkit.org/show_bug.cgi?id=16868>
<rdar://problem/5686108>
<http://bugs.webkit.org/show_bug.cgi?id=16871>
<rdar://problem/5686670>
Adds ActivationImp tear-off for cross-window eval() and fixes an
existing garbage collection issue exposed by the ActivationImp tear-off
patch (r29425) that can occur when an ExecState's m_callingExec is
different than its m_savedExec.
* kjs/ExecState.cpp:
(KJS::ExecState::mark):
* kjs/function.cpp:
(KJS::GlobalFuncImp::callAsFunction):
2008-01-16 Sam Weinig <sam@webkit.org>
Reviewed by Oliver.
Clean up MathObjectImp, it needed a little scrubbing.
* kjs/math_object.cpp:
(KJS::MathObjectImp::MathObjectImp):
(KJS::MathObjectImp::getOwnPropertySlot):
(KJS::MathObjectImp::getValueProperty):
(KJS::mathProtoFuncACos):
(KJS::mathProtoFuncASin):
(KJS::mathProtoFuncATan):
(KJS::mathProtoFuncATan2):
(KJS::mathProtoFuncCos):
(KJS::mathProtoFuncExp):
(KJS::mathProtoFuncLog):
(KJS::mathProtoFuncSin):
(KJS::mathProtoFuncSqrt):
(KJS::mathProtoFuncTan):
* kjs/math_object.h:
(KJS::MathObjectImp::classInfo):
(KJS::MathObjectImp::):
2008-01-16 Sam Weinig <sam@webkit.org>
Reviewed by Geoffrey Garen.
Rename Lexer variable bol to atLineStart.
* kjs/lexer.cpp:
(KJS::Lexer::Lexer):
(KJS::Lexer::setCode):
(KJS::Lexer::nextLine):
(KJS::Lexer::lex):
* kjs/lexer.h:
2008-01-16 Sam Weinig <sam@webkit.org>
Reviewed by Geoffrey Garen and Anders Carlsson.
Remove uses of KJS_PURE_ECMA as we don't ever build with it defined,
and we have many features that are not included in the ECMA spec.
* kjs/lexer.cpp:
(KJS::Lexer::Lexer):
(KJS::Lexer::setCode):
(KJS::Lexer::nextLine):
(KJS::Lexer::lex):
* kjs/lexer.h:
* kjs/string_object.cpp:
* kjs/string_object.h:
2008-01-15 Sam Weinig <sam@webkit.org>
Reviewed by Geoffrey Garen.
Fix <rdar://problem/5595552> r27608 introduced a 20% increase in JS binary size, 4% increase in WebCore binary size
- This changes the way JS functions that use Lookup tables are handled. Instead of using
one class per function, which allowed specialization of the virtual callAsFunction
method, we now use one class, PrototypeFunction, which takes a pointer to a static
function to use as the implementation. This significantly decreases the binary size
of JavaScriptCore (about 145k on an Intel only build) while still keeping some of the
speedup r27608 garnered (SunSpider says this is 1.005x as slow, which should leave some
wiggle room from the original 1% speedup) and keeps the functions implementations in separate
functions to help with optimizations.
* JavaScriptCore.exp:
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/array_object.cpp:
(KJS::arrayProtoFuncToString):
(KJS::arrayProtoFuncToLocaleString):
(KJS::arrayProtoFuncJoin):
(KJS::arrayProtoFuncConcat):
(KJS::arrayProtoFuncPop):
(KJS::arrayProtoFuncPush):
(KJS::arrayProtoFuncReverse):
(KJS::arrayProtoFuncShift):
(KJS::arrayProtoFuncSlice):
(KJS::arrayProtoFuncSort):
(KJS::arrayProtoFuncSplice):
(KJS::arrayProtoFuncUnShift):
(KJS::arrayProtoFuncFilter):
(KJS::arrayProtoFuncMap):
(KJS::arrayProtoFuncEvery):
(KJS::arrayProtoFuncForEach):
(KJS::arrayProtoFuncSome):
(KJS::arrayProtoFuncIndexOf):
(KJS::arrayProtoFuncLastIndexOf):
* kjs/array_object.h:
* kjs/date_object.cpp:
(KJS::DatePrototype::getOwnPropertySlot):
(KJS::dateProtoFuncToString):
(KJS::dateProtoFuncToUTCString):
(KJS::dateProtoFuncToDateString):
(KJS::dateProtoFuncToTimeString):
(KJS::dateProtoFuncToLocaleString):
(KJS::dateProtoFuncToLocaleDateString):
(KJS::dateProtoFuncToLocaleTimeString):
(KJS::dateProtoFuncValueOf):
(KJS::dateProtoFuncGetTime):
(KJS::dateProtoFuncGetFullYear):
(KJS::dateProtoFuncGetUTCFullYear):
(KJS::dateProtoFuncToGMTString):
(KJS::dateProtoFuncGetMonth):
(KJS::dateProtoFuncGetUTCMonth):
(KJS::dateProtoFuncGetDate):
(KJS::dateProtoFuncGetUTCDate):
(KJS::dateProtoFuncGetDay):
(KJS::dateProtoFuncGetUTCDay):
(KJS::dateProtoFuncGetHours):
(KJS::dateProtoFuncGetUTCHours):
(KJS::dateProtoFuncGetMinutes):
(KJS::dateProtoFuncGetUTCMinutes):
(KJS::dateProtoFuncGetSeconds):
(KJS::dateProtoFuncGetUTCSeconds):
(KJS::dateProtoFuncGetMilliSeconds):
(KJS::dateProtoFuncGetUTCMilliseconds):
(KJS::dateProtoFuncGetTimezoneOffset):
(KJS::dateProtoFuncSetTime):
(KJS::dateProtoFuncSetMilliSeconds):
(KJS::dateProtoFuncSetUTCMilliseconds):
(KJS::dateProtoFuncSetSeconds):
(KJS::dateProtoFuncSetUTCSeconds):
(KJS::dateProtoFuncSetMinutes):
(KJS::dateProtoFuncSetUTCMinutes):
(KJS::dateProtoFuncSetHours):
(KJS::dateProtoFuncSetUTCHours):
(KJS::dateProtoFuncSetDate):
(KJS::dateProtoFuncSetUTCDate):
(KJS::dateProtoFuncSetMonth):
(KJS::dateProtoFuncSetUTCMonth):
(KJS::dateProtoFuncSetFullYear):
(KJS::dateProtoFuncSetUTCFullYear):
(KJS::dateProtoFuncSetYear):
(KJS::dateProtoFuncGetYear):
* kjs/date_object.h:
* kjs/function.cpp:
(KJS::PrototypeFunction::PrototypeFunction):
(KJS::PrototypeFunction::callAsFunction):
* kjs/function.h:
* kjs/lookup.h:
(KJS::HashEntry::):
(KJS::staticFunctionGetter):
* kjs/math_object.cpp:
(KJS::mathProtoFuncAbs):
(KJS::mathProtoFuncACos):
(KJS::mathProtoFuncASin):
(KJS::mathProtoFuncATan):
(KJS::mathProtoFuncATan2):
(KJS::mathProtoFuncCeil):
(KJS::mathProtoFuncCos):
(KJS::mathProtoFuncExp):
(KJS::mathProtoFuncFloor):
(KJS::mathProtoFuncLog):
(KJS::mathProtoFuncMax):
(KJS::mathProtoFuncMin):
(KJS::mathProtoFuncPow):
(KJS::mathProtoFuncRandom):
(KJS::mathProtoFuncRound):
(KJS::mathProtoFuncSin):
(KJS::mathProtoFuncSqrt):
(KJS::mathProtoFuncTan):
* kjs/math_object.h:
* kjs/string_object.cpp:
(KJS::stringProtoFuncToString):
(KJS::stringProtoFuncValueOf):
(KJS::stringProtoFuncCharAt):
(KJS::stringProtoFuncCharCodeAt):
(KJS::stringProtoFuncConcat):
(KJS::stringProtoFuncIndexOf):
(KJS::stringProtoFuncLastIndexOf):
(KJS::stringProtoFuncMatch):
(KJS::stringProtoFuncSearch):
(KJS::stringProtoFuncReplace):
(KJS::stringProtoFuncSlice):
(KJS::stringProtoFuncSplit):
(KJS::stringProtoFuncSubstr):
(KJS::stringProtoFuncSubstring):
(KJS::stringProtoFuncToLowerCase):
(KJS::stringProtoFuncToUpperCase):
(KJS::stringProtoFuncToLocaleLowerCase):
(KJS::stringProtoFuncToLocaleUpperCase):
(KJS::stringProtoFuncLocaleCompare):
(KJS::stringProtoFuncBig):
(KJS::stringProtoFuncSmall):
(KJS::stringProtoFuncBlink):
(KJS::stringProtoFuncBold):
(KJS::stringProtoFuncFixed):
(KJS::stringProtoFuncItalics):
(KJS::stringProtoFuncStrike):
(KJS::stringProtoFuncSub):
(KJS::stringProtoFuncSup):
(KJS::stringProtoFuncFontcolor):
(KJS::stringProtoFuncFontsize):
(KJS::stringProtoFuncAnchor):
(KJS::stringProtoFuncLink):
* kjs/string_object.h:
2008-01-15 Geoffrey Garen <ggaren@apple.com>
Reviewed by Adam Roben.
Some tweaks to our headerdoc, suggested by David Gatwood on the docs
team.
* API/JSBase.h:
* API/JSObjectRef.h:
* API/JSStringRef.h:
* API/JSValueRef.h:
2008-01-15 Alp Toker <alp@atoker.com>
Rubber-stamped by Anders.
Make the HTTP backend configurable in the GTK+ port. curl is currently
the only option.
* wtf/Platform.h: Don't hard-code WTF_USE_CURL for GTK
2008-01-15 Sam Weinig <sam@webkit.org>
Reviewed by Beth Dakin.
Remove unneeded variable.
* kjs/string_object.cpp:
(KJS::StringProtoFuncSubstr::callAsFunction):
2008-01-14 Steve Falkenburg <sfalken@apple.com>
Use shared vsprops for most vcproj properties.
Reviewed by Darin.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add missing Debug_Internal config.
* JavaScriptCore.vcproj/WTF/WTF.vcproj: Add missing Debug_Internal config.
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2008-01-14 Adam Roben <aroben@apple.com>
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
some headers that were missing from the vcproj so their contents will
be included in Find in Files.
2008-01-14 Adam Roben <aroben@apple.com>
Fix Bug 16871: Crash when loading apple.com/startpage
<http://bugs.webkit.org/show_bug.cgi?id=16871>
<rdar://problem/5686670>
Patch written by Darin, reviewed by me.
* kjs/ExecState.cpp:
(KJS::ExecState::mark): Call ActivationImp::markChildren if our
m_activation is on the stack. This is what ScopeChain::mark also does,
but apparently in some cases it's possible for an ExecState's
ActivationImp to not be in any ScopeChain.
2008-01-14 Kevin McCullough <kmccullough@apple.com>
Reviewed by Oliver.
-<rdar://problem/5622667> REGRESSION (Leopard-ToT): Endless loading loop
trying to view techreport.com comments
- We need to set values in the map, because if they are already in the
map they will not be reset when we use add().
* kjs/array_instance.cpp:
(KJS::ArrayInstance::put):
2008-01-14 Darin Adler <darin@apple.com>
Reviewed by Adam.
- re-speed-up the page load test (my StringImpl change slowed it down)
* wtf/RefCounted.h:
(WTF::RefCounted::RefCounted): Allow derived classes to start with a reference
count other than 0. Eventually everyone will want to start with a 1. This is a
staged change. For now, there's a default of 0, and you can specify 1. Later,
there will be no default and everyone will have to specify. And then later, there
will be a default of 1. Eventually, we can take away even the option of starting
with 0!
* wtf/Vector.h:
(WTF::Vector::Vector): Sped up creation of non-empty vectors by removing the
overhead of first constructing something empty and then calling resize.
(WTF::Vector::clear): Sped up the common case of calling clear on an empty
vector by adding a check for that case.
(WTF::Vector::releaseBuffer): Marked this function inline and removed a branch
in the case of vectors with no inline capacity (normal vectors) by leaving out
the code to copy the inline buffer in that case.
2008-01-14 Alexey Proskuryakov <ap@webkit.org>
Reviewed by David Kilzer.
http://bugs.webkit.org/show_bug.cgi?id=16787
array.splice() with 1 element not working
Test: fast/js/array-splice.html
* kjs/array_object.cpp:
(KJS::ArrayProtoFuncSplice::callAsFunction): Implement this Mozilla extension, and fix
some other edge cases.
2008-01-13 Steve Falkenburg <sfalken@apple.com>
Share common files across projects.
Unify vsprops files
Debug: common.vsprops, debug.vsprops
Debug_Internal: common.vsprops, debug.vsprops, debug_internal.vsprops
Release: common.vsprops, release.vsprops
Shared properties can go into common.vsprops, shared debug settings can go into debug.vsprops.
debug_internal.vsprops will be mostly empty except for file path prefix modifiers.
Reviewed by Adam Roben.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore.vcproj/debug.vsprops: Removed.
* JavaScriptCore.vcproj/debug_internal.vsprops: Removed.
* JavaScriptCore.vcproj/release.vsprops: Removed.
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2008-01-13 Marius Bugge Monsen <mbm@trolltech.com>
Contributions and review by Adriaan de Groot,
Simon Hausmann, Eric Seidel, and Darin Adler.
- http://bugs.webkit.org/show_bug.cgi?id=16590
Compilation fixes for Solaris.
* kjs/DateMath.h:
(KJS::GregorianDateTime::GregorianDateTime): Use the WIN_OS code path
for SOLARIS too, presumably because Solaris also lacks the tm_gtoff and tm_zone
fields.
(KJS::GregorianDateTime::operator tm): Ditto.
* kjs/collector.cpp:
(KJS::currentThreadStackBase): Use thr_stksegment on Solaris.
* wtf/MathExtras.h:
(isfinite): Implement for Solaris.
(isinf): Ditto.
(signbit): Ditto. But this one is wrong, so I added a FIXME.
* wtf/Platform.h: Define PLATFORM(SOLARIS) when "sun" or "__sun" is defined.
2008-01-13 Michael Goddard <michael.goddard@trolltech.com>
Reviewed by Anders Carlsson.
Add binding language type to Instance.
Allows runtime determination of the type of an
Instance, to allow safe casting. Doesn't actually
add any safe casting yet, though.
Add a helper function to get an Instance from a JSObject*.
Given an object and the expected binding language, see if
the JSObject actually wraps an Instance of the given type
and return it. Otherwise return 0.
Move RuntimeObjectImp creations into Instance.
Make the ctor protected, and Instance a friend class, so
that all creation of RuntimeObjectImps goes through
one place.
Remove copy ctor/assignment operator for QtInstance.
Instance itself is Noncopyable, so QtInstance doesn't
need to have these.
Add caching for QtInstance and associated RuntimeObjectImps.
Push any dealings with QtLanguage bindings into QtInstance,
and cache them there, rather than in the Instance layer. Add
a QtRuntimeObjectImp to help with caching.
* JavaScriptCore.exp:
* bindings/c/c_instance.h:
* bindings/jni/jni_instance.h:
* bindings/objc/objc_instance.h:
* bindings/qt/qt_instance.cpp:
(KJS::Bindings::QtRuntimeObjectImp::QtRuntimeObjectImp):
(KJS::Bindings::QtRuntimeObjectImp::~QtRuntimeObjectImp):
(KJS::Bindings::QtRuntimeObjectImp::invalidate):
(KJS::Bindings::QtRuntimeObjectImp::removeFromCache):
(KJS::Bindings::QtInstance::QtInstance):
(KJS::Bindings::QtInstance::~QtInstance):
(KJS::Bindings::QtInstance::getQtInstance):
(KJS::Bindings::QtInstance::getRuntimeObject):
* bindings/qt/qt_instance.h:
(KJS::Bindings::QtInstance::getBindingLanguage):
* bindings/runtime.cpp:
(KJS::Bindings::Instance::createBindingForLanguageInstance):
(KJS::Bindings::Instance::createRuntimeObject):
(KJS::Bindings::Instance::getInstance):
* bindings/runtime.h:
* bindings/runtime_object.h:
(KJS::RuntimeObjectImp::getInternalInstance):
2008-01-12 Alp Toker <alp@atoker.com>
Reviewed by Mark Rowe.
Hide non-public symbols in GTK+/autotools release builds.
* GNUmakefile.am:
2008-01-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Mark Rowe.
Fix http://bugs.webkit.org/show_bug.cgi?id=16852
Fixes leaking of ActivationStackNode objects.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::deleteActivationStack):
(KJS::JSGlobalObject::~JSGlobalObject):
(KJS::JSGlobalObject::init):
(KJS::JSGlobalObject::reset):
* kjs/JSGlobalObject.h:
2008-01-12 Darin Adler <darin@apple.com>
- try to fix Qt Windows build
* pcre/dftables: Remove reliance on the list form of Perl pipes.
2008-01-12 Darin Adler <darin@apple.com>
- try to fix Qt build
* kjs/function.cpp: Added include of scope_chain_mark.h.
* kjs/scope_chain_mark.h: Added multiple-include guards.
2008-01-12 Mark Rowe <mrowe@apple.com>
Another Windows build fix.
* kjs/Activation.h:
2008-01-12 Mark Rowe <mrowe@apple.com>
Attempted Windows build fix. Use struct consistently when forward-declaring
ActivationStackNode and StackActivation.
* kjs/Activation.h:
* kjs/JSGlobalObject.h:
2008-01-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Fixes a problem with the ActivationImp tear-off patch (r29425) where
some of the calls to JSGlobalObject::tearOffActivation() were using
the wrong test to determine whether it should leave a relic behind.
* kjs/function.cpp:
(KJS::FunctionImp::argumentsGetter):
(KJS::ActivationImp::getOwnPropertySlot):
2008-01-11 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fixed <rdar://problem/5665251> REGRESSION (r28880-r28886): Global
variable access (16644)
This bug was caused by var declarations shadowing built-in properties of
the global object.
To match Firefox, we've decided that var declarations will never shadow
built-in properties of the global object or its prototypes. We used to
behave more like IE, which allows shadowing, but walking that line got
us into trouble with websites that sent us down the Firefox codepath.
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::symbolTableGet): New code to support calling
hasProperty before the variable object is fully initialized (so you
can call it during initialization).
* kjs/nodes.cpp:.
(KJS::ProgramNode::initializeSymbolTable): Always do a full hasProperty
check when looking for duplicates, not getDirect, since it only checks
the property map, and not hasOwnProperty, since it doesn't check
prototypes.
(KJS::EvalNode::processDeclarations): ditto
* kjs/property_slot.h:
(KJS::PropertySlot::ungettableGetter): Best function name evar.
2008-01-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej.
Optimized ActivationImp allocation, so that activation records are now
first allocated on an explicitly managed stack and only heap allocated
when necessary. Roughly a 5% improvement on SunSpider, and a larger
improvement on benchmarks that use more function calls.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/Activation.h: Added.
(KJS::ActivationImp::ActivationData::ActivationData):
(KJS::ActivationImp::ActivationImp):
(KJS::ActivationImp::classInfo):
(KJS::ActivationImp::isActivationObject):
(KJS::ActivationImp::isOnStack):
(KJS::ActivationImp::d):
(KJS::StackActivation::StackActivation):
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState):
(KJS::ExecState::~ExecState):
* kjs/ExecState.h:
(KJS::ExecState::replaceScopeChainTop):
(KJS::ExecState::setActivationObject):
(KJS::ExecState::setLocalStorage):
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::reset):
(KJS::JSGlobalObject::pushActivation):
(KJS::JSGlobalObject::checkActivationCount):
(KJS::JSGlobalObject::popActivationHelper):
(KJS::JSGlobalObject::popActivation):
(KJS::JSGlobalObject::tearOffActivation):
* kjs/JSGlobalObject.h:
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::JSVariableObjectData::JSVariableObjectData):
(KJS::JSVariableObject::JSVariableObject):
* kjs/function.cpp:
(KJS::FunctionImp::argumentsGetter):
(KJS::ActivationImp::ActivationImp):
(KJS::ActivationImp::~ActivationImp):
(KJS::ActivationImp::init):
(KJS::ActivationImp::getOwnPropertySlot):
(KJS::ActivationImp::markHelper):
(KJS::ActivationImp::mark):
(KJS::ActivationImp::ActivationData::ActivationData):
(KJS::GlobalFuncImp::callAsFunction):
* kjs/function.h:
* kjs/nodes.cpp:
(KJS::PostIncResolveNode::evaluate):
(KJS::PostDecResolveNode::evaluate):
(KJS::PreIncResolveNode::evaluate):
(KJS::PreDecResolveNode::evaluate):
(KJS::ReadModifyResolveNode::evaluate):
(KJS::AssignResolveNode::evaluate):
(KJS::WithNode::execute):
(KJS::TryNode::execute):
(KJS::FunctionBodyNode::processDeclarations):
(KJS::FuncExprNode::evaluate):
* kjs/object.h:
* kjs/scope_chain.h:
(KJS::ScopeChain::replace):
* kjs/scope_chain_mark.h: Added.
(KJS::ScopeChain::mark):
2008-01-11 Simon Hausmann <hausmann@webkit.org>
Reviewed by Mark Rowe.
Fix the (clean) qmake build. For generating chartables.c we don't
depend on a separate input source file anymore, the dftables perl
script is enough. So use that instead as value for the .input
variable, to ensure that qmake also generates a rule to call dftables.
* pcre/pcre.pri:
2008-01-10 Geoffrey Garen <ggaren@apple.com>
Reviewed by John Sullivan.
Fixed some world leak reports:
* <rdar://problem/5669436> PLT complains about world leak of 1 JavaScript
Interpreter after running cvs-base suite
* <rdar://problem/5669423> PLT complains about world leak if browser
window is open when PLT starts
* kjs/collector.h: Added the ability to distinguish between global
objects and GC-protected global objects, since we only consider the
latter to be world leaks.
* kjs/collector.cpp:
2008-01-11 Mark Rowe <mrowe@apple.com>
Silence qmake warning about ctgen lacking input.
Rubber-stamped by Alp Toker.
* pcre/pcre.pri:
2008-01-10 David Kilzer <ddkilzer@apple.com>
dftables should be rewritten as a script
<http://bugs.webkit.org/show_bug.cgi?id=16818>
<rdar://problem/5681463>
Reviewed by Darin.
Rewrote the dftables utility in Perl. Attempted to switch all
build systems to call the script directly instead of building
a binary first. Only the Xcode build was able to be tested.
* DerivedSources.make: Added pcre directory to VPATH and changed
to invoke dftables directly.
* GNUmakefile.am: Removed build information and changed to invoke
dftables directly.
* JavaScriptCore.vcproj/JavaScriptCore.sln: Removed reference to
dftables project.
* JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Ditto.
* JavaScriptCore.vcproj/dftables: Removed.
* JavaScriptCore.vcproj/dftables/dftables.vcproj: Removed.
* JavaScriptCore.xcodeproj/project.pbxproj: Removed dftables target.
* jscore.bkl: Removed dftables executable definition.
* pcre/dftables: Copied from JavaScriptCore/pcre/dftables.cpp.
* pcre/dftables.cpp: Removed.
* pcre/dftables.pro: Removed.
* pcre/pcre.pri: Removed references to dftables.cpp and changed to
invoke dftables directly.
2008-01-10 Dan Bernstein <mitz@apple.com>
Reviewed by Darin Adler.
- fix http://bugs.webkit.org/show_bug.cgi?id=16782
<rdar://problem/5675331> REGRESSION(r29266): Reproducible crash in fast/replaced/image-map.html
The crash resulted from a native object (DumpRenderTree's
EventSender) causing its wrapper to be invalidated (by clicking a
link that replaced the document in the window) and consequently
deallocated. The fix is to use RefPtrs to protect the native object
from deletion by self-invalidation.
* bindings/runtime_method.cpp:
(RuntimeMethod::callAsFunction):
* bindings/runtime_object.cpp:
(RuntimeObjectImp::fallbackObjectGetter):
(RuntimeObjectImp::fieldGetter):
(RuntimeObjectImp::methodGetter):
(RuntimeObjectImp::put):
(RuntimeObjectImp::defaultValue):
(RuntimeObjectImp::callAsFunction):
2008-01-07 Mark Rowe <mrowe@apple.com>
Reviewed by Maciej Stachowiak.
Turn testIsInteger assertions into compile-time asserts and move them into HashTraits.h
where possible.
* kjs/testkjs.cpp:
* wtf/HashTraits.h:
2008-01-07 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by Mark.
Enable SVG_FONTS by default.
* Configurations/JavaScriptCore.xcconfig:
2008-01-07 Darin Adler <darin@apple.com>
Rubber stamped by David Kilzer.
- get rid of empty fpconst.cpp
* GNUmakefile.am: Remove fpconst.cpp.
* JavaScriptCore.pri: Ditto.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
* JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
* JavaScriptCoreSources.bkl: Ditto.
* kjs/fpconst.cpp: Removed.
2008-01-07 Darin Adler <darin@apple.com>
Reviewed by David Kilzer.
- fix alignment problem with NaN and Inf globals
* kjs/fpconst.cpp: Move the contents of this file from here back to
value.cpp. The reason this was in a separate file is that the DARWIN
version of this used a declaration of the globals with a different
type to avoid creating "init routines". That's no longer necessary for
DARWIN and was never necessary for the non-DARWIN code path.
To make this patch easy to merge, I didn't actually delete this file
yet. We'll do that in a separate changeset.
* kjs/value.cpp: If C99's NAN and INFINITY are present, then use them,
othrewise use the union trick from fpconst.cpp. I think it would be
better to eliminate KJS::NaN and KJS::Inf and just use NAN and INFINITY
directly or std::numeric_limits<double>::quiet_nan() and
std::numeric_limits<double>::infinity(). But when I tried that, it
slowed down SunSpider. Someone else could do that cleanup if they
could do it without slowing down the engine.
2008-01-07 Adam Roben <aroben@apple.com>
Windows build fix
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
JavaScript.h to the project.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
Copy JavaScript.h to WEBKITOUTPUTDIR.
2008-01-07 Timothy Hatcher <timothy@apple.com>
Reviewed by Darin.
Fix Mac build.
* API/JSNode.c:
* API/JSNode.h:
* API/JSNodeList.c:
* API/JSNodeList.h:
* API/JavaScript.h:
* API/JavaScriptCore.h:
* API/minidom.c:
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-01-07 Alp Toker <alp@atoker.com>
Reviewed by Darin.
http://bugs.webkit.org/show_bug.cgi?id=16029
JavaScriptCore.h is not suitable for platforms other than Mac OS X
Introduce a new JavaScriptCore/JavaScript.h public API header. This
should be used by all new portable code using the JavaScriptCore API.
JavaScriptCore/JavaScriptCore.h will remain for compatibility with
existing applications that depend on it including JSStringRefCF.h
which isn't portable.
Also add minidom to the GTK+/autotools build since we can now support
it on all platforms.
* API/JSNode.h:
* API/JSNodeList.h:
* API/JavaScript.h: Added.
* API/JavaScriptCore.h:
* ForwardingHeaders/JavaScriptCore/JavaScript.h: Added.
* GNUmakefile.am:
* JavaScriptCore.xcodeproj/project.pbxproj:
2008-01-06 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Abstract all DateObject.set* functions in preparation for fixing:
http://bugs.webkit.org/show_bug.cgi?id=16753
SunSpider had random changes here and there but was overall a wash.
* kjs/date_object.cpp:
(KJS::fillStructuresUsingTimeArgs):
(KJS::setNewValueFromTimeArgs):
(KJS::setNewValueFromDateArgs):
(KJS::DateProtoFuncSetMilliSeconds::callAsFunction):
(KJS::DateProtoFuncSetUTCMilliseconds::callAsFunction):
(KJS::DateProtoFuncSetSeconds::callAsFunction):
(KJS::DateProtoFuncSetUTCSeconds::callAsFunction):
(KJS::DateProtoFuncSetMinutes::callAsFunction):
(KJS::DateProtoFuncSetUTCMinutes::callAsFunction):
(KJS::DateProtoFuncSetHours::callAsFunction):
(KJS::DateProtoFuncSetUTCHours::callAsFunction):
(KJS::DateProtoFuncSetDate::callAsFunction):
(KJS::DateProtoFuncSetUTCDate::callAsFunction):
(KJS::DateProtoFuncSetMonth::callAsFunction):
(KJS::DateProtoFuncSetUTCMonth::callAsFunction):
(KJS::DateProtoFuncSetFullYear::callAsFunction):
(KJS::DateProtoFuncSetUTCFullYear::callAsFunction):
2008-01-06 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by Dan.
Add new helper function isArabicChar - SVG Fonts support needs it.
* wtf/unicode/icu/UnicodeIcu.h:
(WTF::Unicode::isArabicChar):
* wtf/unicode/qt4/UnicodeQt4.h:
(WTF::Unicode::isArabicChar):
2008-01-06 Alp Toker <alp@atoker.com>
Reviewed by Mark Rowe.
Use $(EXEEXT) to account for the .exe extension in the GTK+ Windows
build. (This is already done correctly in DerivedSources.make.) Issue
noticed by Mikkel when building in Cygwin.
Add a missing slash. This was a hack from the qmake build system that
isn't necessary with autotools.
* GNUmakefile.am:
2008-01-05 Darin Adler <darin@apple.com>
* API/JSRetainPtr.h: One more file that needed the change below.
2008-01-05 Darin Adler <darin@apple.com>
* wtf/OwnPtr.h: OwnPtr needs the same fix as RefPtr below.
2008-01-05 Adam Roben <aroben@apple.com>
Build fix.
Reviewed by Maciej.
* wtf/RetainPtr.h: Use PtrType instead of T* because of the
RemovePointer magic.
2008-01-05 Darin Adler <darin@apple.com>
Rubber stamped by Maciej Stachowiak.
- cut down own PIC branches by using a pointer-to-member-data instead of a
pointer-to-member-function in WTF smart pointers
* wtf/OwnArrayPtr.h:
* wtf/OwnPtr.h:
* wtf/PassRefPtr.h:
* wtf/RefPtr.h:
* wtf/RetainPtr.h:
Use a pointer to the m_ptr member instead of the get member.
The GCC compiler generates better code for this idiom.
2008-01-05 Henry Mason <hmason@mac.com>
Reviewed by Maciej Stachowiak.
http://bugs.webkit.org/show_bug.cgi?id=16738
Bug 16738: Collector block offset could be stored as an cell offset instead of a byte offset
Gives a 0.4% SunSpider boost and prettier code.
* kjs/collector.cpp: Switched to cell offsets from byte offsets
(KJS::Collector::heapAllocate):
(KJS::Collector::sweep):
2008-01-04 Mark Rowe <mrowe@apple.com>
Reviewed by Maciej Stachowiak.
Have the two malloc zones print useful diagnostics if their free method are unexpectedly invoked.
Due to <rdar://problem/5671357> this can happen if an application attempts to free a pointer that
was not allocated by any registered malloc zone on the system.
* kjs/CollectorHeapIntrospector.h:
* wtf/FastMalloc.cpp:
2008-01-04 Alp Toker <alp@atoker.com>
GTK+ autotools build fix. Terminate empty rules.
* GNUmakefile.am:
2008-01-03 Simon Hausmann <hausmann@webkit.org>
Reviewed by Mark Rowe.
Fix compilation with gcc 4.3: limits.h is needed for INT_MAX.
* pcre/pcre_exec.cpp:
2008-01-03 Darin Adler <darin@apple.com>
* tests/mozilla/expected.html: The fix for bug 16696 also fixed a test
case, ecma_3/RegExp/perlstress-002.js, so updated results to expect
that test to succeed.
2008-01-02 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- fix http://bugs.webkit.org/show_bug.cgi?id=16696
JSCRE fails fails to match Acid3 regexp
Test: fast/regex/early-acid3-86.html
The problem was with the cutoff point between backreferences and octal
escape sequences. We need to determine the cutoff point by counting the
total number of capturing brackets, which requires an extra pass through
the expression when compiling it.
* pcre/pcre_compile.cpp:
(CompileData::CompileData): Added numCapturingBrackets. Removed some
unused fields.
(compileBranch): Use numCapturingBrackets when calling checkEscape.
(calculateCompiledPatternLength): Use numCapturingBrackets when calling
checkEscape, and also store the bracket count at the end of the compile.
(jsRegExpCompile): Call calculateCompiledPatternLength twice -- once to
count the number of brackets and then a second time to calculate the length.
2008-01-02 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- fix http://bugs.webkit.org/show_bug.cgi?id=16696
JSCRE fails fails to match Acid3 regexp
Test: fast/regex/early-acid3-86.html
The problem was with the cutoff point between backreferences and octal
escape sequences. We need to determine the cutoff point by counting the
total number of capturing brackets, which requires an extra pass through
the expression when compiling it.
* pcre/pcre_compile.cpp:
(CompileData::CompileData): Added numCapturingBrackets. Removed some
unused fields.
(compileBranch): Use numCapturingBrackets when calling checkEscape.
(calculateCompiledPatternLength): Use numCapturingBrackets when calling
checkEscape, and also store the bracket count at the end of the compile.
(jsRegExpCompile): Call calculateCompiledPatternLength twice -- once to
count the number of brackets and then a second time to calculate the length.
2008-01-02 David Kilzer <ddkilzer@webkit.org>
Reviewed and landed by Darin.
* kjs/nodes.cpp:
(KJS::DoWhileNode::execute): Added a missing return.
2008-01-02 Darin Adler <darin@apple.com>
- try to fix Qt build
* wtf/unicode/qt4/UnicodeQt4.h:
(WTF::Unicode::foldCase): Add some missing const.
2008-01-02 Alice Liu <alice.liu@apple.com>
Reviewed by Sam Weinig.
need to export ASCIICType.h for use in DRT
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* wtf/ASCIICType.h:
(WTF::isASCIIUpper):
2008-01-02 Sam Weinig <sam@webkit.org>
Reviewed by Beth Dakin.
Cleanup error_object.h/cpp.
* kjs/JSGlobalObject.cpp:
(KJS::JSGlobalObject::reset):
* kjs/error_object.cpp:
(KJS::ErrorInstance::ErrorInstance):
(KJS::ErrorPrototype::ErrorPrototype):
(KJS::ErrorProtoFuncToString::ErrorProtoFuncToString):
(KJS::ErrorProtoFuncToString::callAsFunction):
(KJS::ErrorObjectImp::ErrorObjectImp):
(KJS::ErrorObjectImp::implementsConstruct):
(KJS::ErrorObjectImp::construct):
(KJS::ErrorObjectImp::callAsFunction):
(KJS::NativeErrorPrototype::NativeErrorPrototype):
(KJS::NativeErrorImp::NativeErrorImp):
(KJS::NativeErrorImp::implementsConstruct):
(KJS::NativeErrorImp::construct):
(KJS::NativeErrorImp::callAsFunction):
(KJS::NativeErrorImp::mark):
* kjs/error_object.h:
(KJS::ErrorInstance::classInfo):
(KJS::NativeErrorImp::classInfo):
2008-01-02 Mark Rowe <mrowe@apple.com>
Rubber-stamped by Alp Toker.
* GNUmakefile.am: Add missing dependency on grammar.y.
2008-01-01 Darin Adler <darin@apple.com>
Reviewed by Eric.
- fix for http://bugs.webkit.org/show_bug.cgi?id=16695
JSC allows non-identifier codepoints in identifiers (affects Acid3)
Test: fast/js/kde/parse.html
* kjs/lexer.cpp:
(KJS::Lexer::lex): Added additional states to distinguish Unicode escapes at the
start of identifiers from ones inside identifiers. Rejected characters that don't pass
the isIdentStart and isIdentPart tests.
(KJS::Lexer::convertUnicode): Removed incorrect FIXME comment.
* kjs/lexer.h: Added new states to distinguish \u escapes at the start of identifiers
from \u escapes inside identifiers.
2008-01-01 Darin Adler <darin@apple.com>
- rolled scope chain optimization out; it was breaking the world
2008-01-01 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- http://bugs.webkit.org/show_bug.cgi?id=16685
eliminate List::empty() to cut down on PIC branches
Also included one other speed-up -- remove the call to reserveCapacity from
FunctionBodyNode::processDeclarations in all but the most unusual cases.
Together these make SunSpider 1.016x as fast.
* JavaScriptCore.exp: Updated.
* kjs/ExecState.cpp:
(KJS::globalEmptyList): Added. Called only when creating global ExecState
instances.
(KJS::ExecState::ExecState): Broke constructor up into three separate functions,
for the three separate node types. Also went through each of the three and
streamlined as much as possible, removing dead code. This prevents us from having
to access the global in the function body version of the constructor.
* kjs/ExecState.h: Added emptyList(). Replaced the constructor with a set of
three that are specific to the different node types that can create new execution
state objects.
* kjs/array_object.cpp:
(KJS::ArrayProtoFuncToLocaleString::callAsFunction): Use exec->emptyList() instead
of List::empty().
(KJS::ArrayProtoFuncConcat::callAsFunction): Ditto.
(KJS::ArrayProtoFuncSlice::callAsFunction): Ditto.
(KJS::ArrayProtoFuncSplice::callAsFunction): Ditto.
(KJS::ArrayProtoFuncFilter::callAsFunction): Ditto.
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction): Updated to call new ExecState constructor.
(KJS::GlobalFuncImp::callAsFunction): Ditto (for eval).
* kjs/function_object.cpp:
(FunctionObjectImp::construct): Use exec->emptyList() instead of List::empty().
* kjs/list.cpp: Removed List::empty.
* kjs/list.h: Ditto.
* kjs/nodes.cpp:
(KJS::ElementNode::evaluate): Use exec->emptyList() instead of List::empty().
(KJS::ArrayNode::evaluate): Ditto.
(KJS::ObjectLiteralNode::evaluate): Ditto.
(KJS::PropertyListNode::evaluate): Ditto.
(KJS::FunctionBodyNode::processDeclarations): Another speed-up. Check the capacity
before calling reserveCapacity, because it doesn't get inlined the local storage
vector is almost always big enough -- saving the function call overhead is a big
deal.
(KJS::FuncDeclNode::makeFunction): Use exec->emptyList() instead of List::empty().
(KJS::FuncExprNode::evaluate): Ditto.
* kjs/object.cpp:
(KJS::tryGetAndCallProperty): Ditto.
* kjs/property_slot.cpp:
(KJS::PropertySlot::functionGetter): Ditto.
* kjs/string_object.cpp:
(KJS::StringProtoFuncSplit::callAsFunction): Ditto.
2008-01-01 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- fix http://bugs.webkit.org/show_bug.cgi?id=16648
REGRESSION (r28165): Yuku.com navigation prints "jsRegExpExecute failed with result -2"
<rdar://problem/5646486> REGRESSION (r28165): Layout test fast/regex/test1 fails intermittently
Fixes 34 failing test cases in the fast/regex/test1.html test.
Restored the stack which prevents infinite loops for brackets that match the empty
string; it had been removed as an optimization.
Unfortunately, restoring this stack causes the regular expression test in SunSpider
to be 1.095x as slow and the overall test to be 1.004x as slow. Maybe we can find
a correct optimization to restore the speed!
It's possible the original change was on the right track but just off by one.
* pcre/pcre_exec.cpp: Add back eptrblock, but name it BracketChainNode.
(MatchStack::pushNewFrame): Add back the logic needed here.
(startNewGroup): Ditto.
(match): Ditto.
2008-01-01 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- http://bugs.webkit.org/show_bug.cgi?id=16683
speed up function calls by making ScopeChain::push cheaper
This gives a 1.019x speedup on SunSpider.
After doing this, I realized this probably will be obsolete when the optimization
to avoid creating an activation object is done. When we do that one we should check
if rolling this out will speed things up, since this does add overhead at the time
you copy the scope chain.
* kjs/object.h: Removed the ScopeChain::release function. It was
marked inline, and called in exactly one place, so moved it there.
No idea why it was in this header file!
* kjs/scope_chain.cpp: Removed the overload of the ScopeChain::push
function that takes another ScopeChain. It was unused. I think we used
it over in WebCore at one point, but not any more.
* kjs/scope_chain.h: Changed ScopeChainNode into a struct rather than
a class, got rid of its constructor so we can have one that's uninitialized,
and moved the refCount into a derived struct, ScopeChainHeapNode. Made _node
mutable so it can be changed in the moveToHeap function. Changed the copy
constructor and assignment operator to call moveToHeap, since the top node
can't be shared when it's embedded in another ScopeChain object. Updated
functions as needed to handle the case where the first object isn't on the
heap or to add casts for cases where it's guaranteed to be. Changed the push
function to always put the new node into the ScopeChain object; it will get
put onto the heap when needed later.
2008-01-01 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Fixed slight logic error in reserveCapacity, where we would reallocate
the storage buffer unnecessarily.
* wtf/Vector.h:
(WTF::::reserveCapacity): No need to grow the buffer if newCapacity is
equal to capacity().
2008-01-01 Darin Adler <darin@apple.com>
Reviewed by Oliver.
- http://bugs.webkit.org/show_bug.cgi?id=16684
eliminate debugger overhead from function body execution
Speeds SunSpider up 1.003x. That's a small amount, but measurable.
* JavaScriptCore.exp: Updated.
* kjs/Parser.h:
(KJS::Parser::parse): Create the node with a static member function named create() instead
of using new explicitly.
* kjs/grammar.y: Changed calls to new FunctionBodyNode to use FunctionBodyNode::create().
* kjs/nodes.cpp:
(KJS::ProgramNode::create): Added. Calls new.
(KJS::EvalNode::create): Ditto.
(KJS::FunctionBodyNode::create): Ditto, but creates FunctionBodyNodeWithDebuggerHooks
when a debugger is present.
(KJS::FunctionBodyNode::execute): Removed debugger hooks.
(KJS::FunctionBodyNodeWithDebuggerHooks::FunctionBodyNodeWithDebuggerHooks): Added.
(KJS::FunctionBodyNodeWithDebuggerHooks::execute): Calls the debugger, then the code,
then the debugger again.
* kjs/nodes.h: Added create functions, made the constructors private and protected.
2007-12-30 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
More small cleanup to array_object.cpp
* kjs/array_object.cpp:
(KJS::ArrayProtoFuncToString::callAsFunction):
(KJS::ArrayProtoFuncToLocaleString::callAsFunction):
(KJS::ArrayProtoFuncJoin::callAsFunction):
(KJS::ArrayProtoFuncConcat::callAsFunction):
(KJS::ArrayProtoFuncReverse::callAsFunction):
(KJS::ArrayProtoFuncShift::callAsFunction):
(KJS::ArrayProtoFuncSlice::callAsFunction):
(KJS::ArrayProtoFuncSort::callAsFunction):
(KJS::ArrayProtoFuncSplice::callAsFunction):
(KJS::ArrayProtoFuncUnShift::callAsFunction):
(KJS::ArrayProtoFuncFilter::callAsFunction):
(KJS::ArrayProtoFuncMap::callAsFunction):
(KJS::ArrayProtoFuncEvery::callAsFunction):
2007-12-30 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Apply wkstyle to array_object.cpp
* kjs/array_object.cpp:
(KJS::ArrayPrototype::ArrayPrototype):
(KJS::ArrayPrototype::getOwnPropertySlot):
(KJS::ArrayProtoFuncConcat::callAsFunction):
(KJS::ArrayProtoFuncPop::callAsFunction):
(KJS::ArrayProtoFuncReverse::callAsFunction):
(KJS::ArrayProtoFuncShift::callAsFunction):
(KJS::ArrayProtoFuncSlice::callAsFunction):
(KJS::ArrayProtoFuncSort::callAsFunction):
(KJS::ArrayProtoFuncSplice::callAsFunction):
(KJS::ArrayProtoFuncUnShift::callAsFunction):
(KJS::ArrayProtoFuncFilter::callAsFunction):
(KJS::ArrayProtoFuncMap::callAsFunction):
(KJS::ArrayProtoFuncEvery::callAsFunction):
(KJS::ArrayProtoFuncLastIndexOf::callAsFunction):
(KJS::ArrayObjectImp::ArrayObjectImp):
(KJS::ArrayObjectImp::implementsConstruct):
(KJS::ArrayObjectImp::construct):
(KJS::ArrayObjectImp::callAsFunction):
2007-12-30 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Remove maxInt/minInt, replacing with std:max/min<int>()
* kjs/array_object.cpp:
(KJS::ArrayProtoFuncSplice::callAsFunction):
* kjs/operations.cpp:
* kjs/operations.h:
2007-12-30 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Update Number.toString to properly throw exceptions.
Cleanup code in Number.toString implementation.
* kjs/number_object.cpp:
(KJS::numberToString):
* kjs/object.cpp:
(KJS::Error::create): Remove bogus debug lines.
2007-12-28 Eric Seidel <eric@webkit.org>
Reviewed by Oliver.
ASSERT when debugging via Drosera due to missed var lookup optimization.
http://bugs.webkit.org/show_bug.cgi?id=16634
No test case possible.
* kjs/nodes.cpp:
(KJS::BreakpointCheckStatement::optimizeVariableAccess):
* kjs/nodes.h:
2007-12-28 Eric Seidel <eric@webkit.org>
Reviewed by Oliver.
Fix (-0).toFixed() and re-factor a little
Fix (-0).toExponential() and printing of trailing 0s in toExponential
Fix toPrecision(nan) handling
http://bugs.webkit.org/show_bug.cgi?id=16640
* kjs/number_object.cpp:
(KJS::numberToFixed):
(KJS::fractionalPartToString):
(KJS::numberToExponential):
(KJS::numberToPrecision):
2007-12-28 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
More changes to make number code readable
* kjs/number_object.cpp:
(KJS::integer_part_noexp):
(KJS::numberToFixed):
(KJS::numberToExponential):
2007-12-28 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
More small cleanups to toPrecision
* kjs/number_object.cpp:
(KJS::numberToPrecision):
2007-12-28 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
More small attempts to make number code readable
* kjs/number_object.cpp:
(KJS::exponentialPartToString):
(KJS::numberToExponential):
(KJS::numberToPrecision):
2007-12-28 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Break out callAsFunction implementations into static functions
* kjs/number_object.cpp:
(KJS::numberToString):
(KJS::numberToFixed):
(KJS::numberToExponential):
(KJS::numberToPrecision):
(KJS::NumberProtoFunc::callAsFunction):
2007-12-28 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Apply wkstyle/astyle and fix placement of *
* kjs/number_object.cpp:
(KJS::NumberInstance::NumberInstance):
(KJS::NumberPrototype::NumberPrototype):
(KJS::NumberProtoFunc::NumberProtoFunc):
(KJS::integer_part_noexp):
(KJS::intPow10):
(KJS::NumberProtoFunc::callAsFunction):
(KJS::NumberObjectImp::NumberObjectImp):
(KJS::NumberObjectImp::getOwnPropertySlot):
(KJS::NumberObjectImp::getValueProperty):
(KJS::NumberObjectImp::implementsConstruct):
(KJS::NumberObjectImp::construct):
(KJS::NumberObjectImp::callAsFunction):
* kjs/object.cpp:
(KJS::JSObject::put):
2007-12-27 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
ASSERT in JavaScriptCore while viewing WICD test case
http://bugs.webkit.org/show_bug.cgi?id=16626
* kjs/nodes.cpp:
(KJS::ForInNode::execute): move KJS_CHECK_EXCEPTION to proper place
2007-12-26 Jan Michael Alonzo <jmalonzo@unpluggable.com>
Reviewed by Alp Toker.
http://bugs.webkit.org/show_bug.cgi?id=16390
Use autotools or GNU make as the build system for the GTK port
* GNUmakefile.am: Added.
2007-12-25 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- Remove unnecessary redundant check from property setting
http://bugs.webkit.org/show_bug.cgi?id=16602
1.3% speedup on SunSpider.
* kjs/object.cpp:
(KJS::JSObject::put): Don't do canPut check when not needed; let
the PropertyMap handle it.
(KJS::JSObject::canPut): Don't check the static property
table. lookupPut does that already.
2007-12-24 Alp Toker <alp@atoker.com>
Fix builds that don't use AllInOneFile.cpp following breakage
introduced in r28973.
* kjs/grammar.y:
2007-12-24 Maciej Stachowiak <mjs@apple.com>
Reviewed by Eric.
- Optimize variable declarations
http://bugs.webkit.org/show_bug.cgi?id=16585
3.5% speedup on SunSpider.
var statements now result in either assignments or empty statements.
This allows a couple of optimization opportunities:
- No need to branch at runtime to check if there is an initializer
- EmptyStatementNodes can be removed entirely (also done in this patch)
- Assignment expressions get properly optimized for local variables
This patch also includes some code cleanup:
- Most of the old VarStatement/VarDecl logic is now only used for const declarations,
thus it is renamed appropriately
- AssignExprNode is gone
* JavaScriptCore.exp:
* kjs/NodeInfo.h:
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::SourceElements::append):
(KJS::ConstDeclNode::ConstDeclNode):
(KJS::ConstDeclNode::optimizeVariableAccess):
(KJS::ConstDeclNode::handleSlowCase):
(KJS::ConstDeclNode::evaluateSingle):
(KJS::ConstDeclNode::evaluate):
(KJS::ConstStatementNode::optimizeVariableAccess):
(KJS::ConstStatementNode::execute):
(KJS::VarStatementNode::optimizeVariableAccess):
(KJS::VarStatementNode::execute):
(KJS::ForInNode::ForInNode):
(KJS::ForInNode::optimizeVariableAccess):
(KJS::ForInNode::execute):
(KJS::FunctionBodyNode::initializeSymbolTable):
(KJS::ProgramNode::initializeSymbolTable):
(KJS::FunctionBodyNode::processDeclarations):
(KJS::ProgramNode::processDeclarations):
(KJS::EvalNode::processDeclarations):
* kjs/nodes.h:
(KJS::DeclarationStacks::):
(KJS::StatementNode::):
(KJS::ConstDeclNode::):
(KJS::ConstStatementNode::):
(KJS::EmptyStatementNode::):
(KJS::VarStatementNode::):
(KJS::ForNode::):
* kjs/nodes2string.cpp:
(KJS::ConstDeclNode::streamTo):
(KJS::ConstStatementNode::streamTo):
(KJS::ScopeNode::streamTo):
(KJS::VarStatementNode::streamTo):
(KJS::ForNode::streamTo):
(KJS::ForInNode::streamTo):
2007-12-21 Mark Rowe <mrowe@apple.com>
Reviewed by Oliver Hunt.
* JavaScriptCore.exp: Remove unused symbol to prevent a weak external symbol
being generated in JavaScriptCore.framework.
2007-12-21 Darin Adler <darin@apple.com>
Requested by Maciej.
* kjs/nodes.h: Use the new NEVER_INLINE here and eliminate the old
KJS_NO_INLINE. We don't want to have two, and we figured it was better
to keep the one that's in WTF.
2007-12-21 Darin Adler <darin@apple.com>
Reviewed by Eric.
- http://bugs.webkit.org/show_bug.cgi?id=16561
remove debugger overhead from non-debugged JavaScript execution
1.022x as fast on SunSpider.
* JavaScriptCore.exp: Updated.
* kjs/NodeInfo.h: Renamed SourceElementsStub to SourceElements,
since that more accurately describes the role of this object, which
is a reference-counted wrapper for a Vector.
* kjs/Parser.cpp:
(KJS::Parser::didFinishParsing): Changed parameter type to SourceElements,
and use plain assignment instead of set.
* kjs/Parser.h: Changed parameter type of didFinishParsing to a
SourceElements. Also changed m_sourceElements; we now use a RefPtr instead
of an OwnPtr as well.
* kjs/grammar.y: Got rid of all the calls to release() on SourceElements.
That's now handed inside the constructors for various node types, since we now
use vector swapping instead.
* kjs/nodes.cpp:
(KJS::Node::rethrowException): Added NEVER_INLINE, because this was getting inlined
and we want exception handling out of the normal code flow.
(KJS::SourceElements::append): Moved here from the header. This now handles
creating a BreakpointCheckStatement for each statement in the debugger case.
That way we can get breakpoint handling without having it in every execute function.
(KJS::BreakpointCheckStatement::BreakpointCheckStatement): Added.
(KJS::BreakpointCheckStatement::execute): Added. Contains the code that was formerly
in the StatementNode::hitStatement function and the KJS_BREAKPOINT macro.
(KJS::BreakpointCheckStatement::streamTo): Added.
(KJS::ArgumentListNode::evaluateList): Use KJS_CHECKEXCEPTIONVOID since the return
type is void.
(KJS::VarStatementNode::execute): Removed KJS_BREAKPOINT.
(KJS::BlockNode::BlockNode): Changed parameter type to SourceElements.
Changed code to use release since the class now contains a vector rather than
a vector point.
(KJS::BlockNode::optimizeVariableAccess): Updated since member is now a vector
rather than a vector pointer.
(KJS::BlockNode::execute): Ditto.
(KJS::ExprStatementNode::execute): Removed KJS_BREAKPOINT.
(KJS::IfNode::execute): Ditto.
(KJS::IfElseNode::execute): Ditto.
(KJS::DoWhileNode::execute): Ditto.
(KJS::WhileNode::execute): Ditto.
(KJS::ContinueNode::execute): Ditto.
(KJS::BreakNode::execute): Ditto.
(KJS::ReturnNode::execute): Ditto.
(KJS::WithNode::execute): Ditto.
(KJS::CaseClauseNode::optimizeVariableAccess): Updated since member is now a vector
rather than a vector pointer.
(KJS::CaseClauseNode::executeStatements): Ditto.
(KJS::SwitchNode::execute): Removed KJS_BREAKPOINT.
(KJS::ThrowNode::execute): Ditto.
(KJS::TryNode::execute): Ditto.
(KJS::ScopeNode::ScopeNode): Changed parameter type to SourceElements.
(KJS::ProgramNode::ProgramNode): Ditto.
(KJS::EvalNode::EvalNode): Ditto.
(KJS::FunctionBodyNode::FunctionBodyNode): Ditto.
(KJS::ScopeNode::optimizeVariableAccess): Updated since member is now a vector
rather than a vector pointer.
* kjs/nodes.h: Removed hitStatement. Renamed SourceElements to StatementVector.
Renamed SourceElementsStub to SourceElements and made it derive from
ParserRefCounted rather than from Node, hold a vector rather than a pointer to
a vector, and changed the release function to swap with another vector rather
than the pointer idiom. Updated BlockNode and CaseClauseNode to hold actual
vectors instead of pointers to vectors. Added BreakpointCheckStatement.
* kjs/nodes2string.cpp:
(KJS::statementListStreamTo): Changed to work on a vector instead of a pointer
to a vector.
(KJS::BlockNode::streamTo): Ditto.
(KJS::CaseClauseNode::streamTo): Ditto.
* wtf/AlwaysInline.h: Added NEVER_INLINE.
* wtf/PassRefPtr.h: Tweaked formatting. Added clear() function that matches the
ones in OwnPtr and auto_ptr.
* wtf/RefPtr.h: Ditto.
2007-12-21 Darin Adler <darin@apple.com>
- fix broken regression tests
The broken tests were fast/js/do-while-expression-value.html and
fast/js/while-expression-value.html.
* kjs/nodes.cpp: Check in the correct version of this file. I had accidentally landed
an old version of my patch for bug 16471.
(KJS::statementListExecute): The logic here was backwards. Have to set the value
even for non-normal execution results.
2007-12-20 Alexey Proskuryakov <ap@webkit.org>
Windows build fix
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Copy npruntime_internal.h
to WebKitBuild.
2007-12-20 Eric Seidel <eric@webkit.org>
Reviewed by mjs.
Split IfNode into IfNode and IfElseNode for speedup.
http://bugs.webkit.org/show_bug.cgi?id=16470
SunSpider claims this is 1.003x as fast as before.
(This required running with --runs 15 to get consistent enough results to tell!)
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::IfNode::optimizeVariableAccess):
(KJS::IfNode::execute):
(KJS::IfNode::getDeclarations):
(KJS::IfElseNode::optimizeVariableAccess):
(KJS::IfElseNode::execute):
(KJS::IfElseNode::getDeclarations):
* kjs/nodes.h:
(KJS::IfNode::):
(KJS::IfElseNode::):
* kjs/nodes2string.cpp:
(KJS::IfNode::streamTo):
(KJS::IfElseNode::streamTo):
2007-12-20 Darin Adler <darin@apple.com>
Reviewed by Sam.
* wtf/OwnPtr.h:
(WTF::operator==): Added.
(WTF::operator!=): Added.
2007-12-20 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
AST optimization: Avoid NULL-checking ForNode's child nodes.
0.6% speedup on SunSpider.
This is a proof of concept patch that demonstrates how to optimize
grammar productions with optional components, like
for (optional; optional; optional) {
...
}
The parser emits NULL for an optional component that is not present.
Instead of checking for a NULL child at execution time, a node that
expects an optional component to be present more often than not checks
for a NULL child at construction time, and substitutes a viable
alternative node in its place.
(We'd like the parser to start emitting NULL a lot more once we teach
it to emit NULL for certain no-op productions like EmptyStatement and
VariableStatement, so, as a foundation, it's important for nodes with
NULL optional components to be fast.)
* kjs/Parser.cpp:
(KJS::Parser::didFinishParsing): Check for NULL SourceElements. Also,
moved didFinishParsing into the .cpp file because adding a branch while
it was in the header file caused a substantial and inexplicable
performance regression. (Did I mention that GCC is crazy?)
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::BlockNode::BlockNode): Check for NULL SourceElements.
(KJS::ForNode::optimizeVariableAccess): No need to check for NULL here.
(KJS::ForNode::execute): No need to check for NULL here.
* kjs/nodes.h:
(KJS::ForNode::): Check for NULL SourceElements. Substitute a TrueNode
because it's semantically harmless, and it evaluates to boolean in an
efficient manner.
2007-12-20 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Slight logic reordering in JSImmediate::from(double)
This gives a 0.6% improvement in SunSpider.
* kjs/JSImmediate.h:
(KJS::JSImmediate::from):
2007-12-20 Eric Seidel <eric@webkit.org>
Reviewed by mjs.
Fix major Array regression introduced by 28899.
SunSpider claims this is at least 1.37x as fast as pre-regression. :)
* kjs/array_instance.cpp: make Arrays fast again!
2007-12-20 Eric Seidel <eric@webkit.org>
Reviewed by Geoff, then re-rubber-stamped by Geoff after final search/replace and testing.
Small reworking of Date code for 4% speedup on Date tests (0.2% overall)
http://bugs.webkit.org/show_bug.cgi?id=16537
Make msToYear human-readable
Make msToDayInMonth slightly more readable and avoid recalculating msToYear
Remove use of isInLeapYear to avoid calling msToYear
Remove dayInYear call by changing msToDayInMonth to dayInMonthFromDayInYear
Remove more duplicate calls to dayInYear and getUTCOffset for further speedup
* kjs/DateMath.cpp:
(KJS::daysFrom1970ToYear):
(KJS::msToYear):
(KJS::monthFromDayInYear):
(KJS::checkMonth):
(KJS::dayInMonthFromDayInYear):
(KJS::dateToDayInYear):
(KJS::getDSTOffsetSimple):
(KJS::getDSTOffset):
(KJS::gregorianDateTimeToMS):
(KJS::msToGregorianDateTime):
2007-12-20 Rodney Dawes <dobey@wayofthemonkey.com>
Reviewed by Darin Adler.
Proxy includes of npruntime.h or npapi.h through npruntime_internal.h
Include stdio.h in npapi.h for the use of FILE with XP_UNIX defined
This is for building with X11, as some type and enum names conflict
with #define names in X11 headers.
http://bugs.webkit.org/show_bug.cgi?id=15669
* JavaScriptCore.xcodeproj/project.pbxproj:
* bindings/NP_jsobject.h:
* bindings/npapi.h:
* bindings/npruntime.cpp:
* bindings/npruntime_impl.h:
* bindings/npruntime_priv.h:
* bindings/npruntime_internal.h:
* bindings/testbindings.cpp:
* bindings/c/c_class.h:
* bindings/c/c_runtime.h:
* bindings/c/c_utility.h:
2007-12-20 Darin Adler <darin@apple.com>
- re-fix http://bugs.webkit.org/show_bug.cgi?id=16471
Completions need to be smaller (or not exist at all)
Same patch as last time with the test failures problem fixed.
* kjs/function.cpp:
(KJS::GlobalFuncImp::callAsFunction): Make sure to check the completion
type from newExec to see if the execute raised an exception.
2007-12-20 Darin Adler <darin@apple.com>
- roll out that last change -- it was causing test failures;
I'll check it back in after fixing them
2007-12-20 Darin Adler <darin@apple.com>
Reviewed by Eric.
- http://bugs.webkit.org/show_bug.cgi?id=16471
Completions need to be smaller (or not exist at all)
SuSpider shows 2.4% speedup.
Stop using completions in the execution engine.
Instead, the completion type and label target are both
stored in the ExecState.
* API/JSContextRef.cpp: Removed unneeded include of "completion.h".
* bindings/runtime_method.cpp: Removed unused execute function.
* bindings/runtime_method.h: Ditto.
* kjs/ExecState.h: Added completionType, breakOrContinueTarget,
setCompletionType, setNormalCompletion, setBreakCompletion,
setContinueCompletion, setReturnValueCompletion, setThrowCompletion,
setInterruptedCompletion, m_completionType, and m_breakOrContinueTarget.
* kjs/completion.h: Removed constructor and getter for target
for break and continue from Completion. This class is now only
used for the public API to Interpreter and such.
* kjs/date_object.h: Removed unused execute function.
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction): Removed some unneeded
exception processing. Updated to call the new execute function
and to get the completion type from the ExecState. Merged in
the execute function, which repeated some of the same logic and
was called only from here.
(KJS::GlobalFuncImp::callAsFunction): More of the same for eval.
* kjs/function.h: Removed execute.
* kjs/interpreter.cpp:
(KJS::Interpreter::evaluate): Added code to convert the result of
execut into a Completion.
* kjs/nodes.cpp:
(KJS::Node::setErrorCompletion): Renamed from createErrorCompletion.
Now sets the completion type in the ExecState.
(KJS::Node::rethrowException): Now sets the completion type in the
ExecState.
(KJS::StatementNode::hitStatement): Now sets the completion type in
the ExecState.
(KJS::VarStatementNode::execute): Updated to put completion type in
the ExecState instead of a Completion object.
(KJS::statementListExecute): Ditto. Also changed the for loop to use
indices instead of iterators.
(KJS::BlockNode::execute): Updated return type.
(KJS::EmptyStatementNode::execute): Updated to put completion type in
the ExecState instead of a Completion object.
(KJS::ExprStatementNode::execute): Ditto.
(KJS::IfNode::execute): Ditto.
(KJS::DoWhileNode::execute): Ditto. Also streamlined the logic a little
to make the normal case a little faster and moved the end outside the
loop so that "break" can do a break.
(KJS::WhileNode::execute): Ditto.
(KJS::ForNode::execute): Ditto.
(KJS::ForInNode::execute): Ditto.
(KJS::ContinueNode::execute): Updated to put completion type in
the ExecState instead of a Completion object.
(KJS::BreakNode::execute): Ditto.
(KJS::ReturnNode::execute): Ditto.
(KJS::WithNode::execute): Ditto.
(KJS::CaseClauseNode::executeStatements): Ditto. Also renamed to have
execute in its name to reflect the fact that it's a member of the same
family of functions.
(KJS::CaseBlockNode::executeBlock): Ditto.
(KJS::SwitchNode::execute): Ditto.
(KJS::LabelNode::execute): Ditto.
(KJS::ThrowNode::execute): Ditto.
(KJS::TryNode::execute): Ditto.
(KJS::ProgramNode::execute): Ditto.
(KJS::EvalNode::execute): Ditto.
(KJS::FunctionBodyNode::execute): Ditto.
(KJS::FuncDeclNode::execute): Ditto.
* kjs/nodes.h: Renamed setErrorCompletion to createErrorCompletion, made
hitStatement protected, changed return value of execute to a JSValue,
renamed evalStatements to executeStatements, and evalBlock to executeBlock.
* kjs/number_object.h: Removed unused execute function.
2007-12-20 Geoffrey Garen <ggaren@apple.com>
Added Radar number.
* kjs/nodes.cpp:
(KJS::ProgramNode::processDeclarations):
2007-12-20 Geoffrey Garen <ggaren@apple.com>
Linux build fix: config.h has to come first.
* kjs/error_object.cpp:
2007-12-19 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Optimized global access to global variables, using a symbol table.
SunSpider reports a 1.5% overall speedup, a 6.2% speedup on 3d-morph,
and a whopping 33.1% speedup on bitops-bitwise-and.
* API/JSCallbackObjectFunctions.h: Replaced calls to JSObject:: with
calls to Base::, since JSObject is not always our base class. This
was always a bug, but the bug is even more apparent after some of my
changes.
(KJS::::staticFunctionGetter): Replaced use of getDirect with call to
getOwnPropertySlot. Global declarations are no longer stored in the
property map, so a call to getDirect is insufficient for finding
override properties.
* API/testapi.c:
* API/testapi.js: Added test for the getDirect change mentioned above.
* kjs/ExecState.cpp:
* kjs/ExecState.h: Dialed back the optimization to store a direct
pointer to the localStorage buffer. One ExecState can grow the global
object's localStorage without another ExecState's knowledge, so
ExecState can't store a direct pointer to the localStorage buffer
unless/until we invent a way to update all the relevant ExecStates.
* kjs/JSGlobalObject.cpp: Inserted the symbol table into get and put
operations.
(KJS::JSGlobalObject::reset): Reset the symbol table and local storage,
too. Also, clear the property map here, removing the need for a
separate call.
* kjs/JSVariableObject.cpp:
* kjs/JSVariableObject.h: Added support for saving localStorage and the
symbol table to the back/forward cache, and restoring them.
* kjs/function.cpp:
(KJS::GlobalFuncImp::callAsFunction): Renamed progNode to evalNode
because it's an EvalNode, not a ProgramNode.
* kjs/lookup.h:
(KJS::cacheGlobalObject): Replaced put with faster putDirect, since
that's how the rest of lookup.h works. putDirect is safe here because
cacheGlobalObject is only used for objects whose names are not valid
identifiers.
* kjs/nodes.cpp: The good stuff!
(KJS::EvalNode::processDeclarations): Replaced hasProperty with
the new hasOwnProperty, which is slightly faster.
* kjs/object.h: Nixed clearProperties because clear() does this job now.
* kjs/property_map.cpp:
* kjs/property_map.h: More back/forward cache support.
* wtf/Vector.h:
(WTF::::grow): Added fast non-branching grow function. I used it in
an earlier version of this patch, even though it's not used anymore.
2007-12-09 Mark Rowe <mrowe@apple.com>
Reviewed by Oliver Hunt.
Build fix for non-Mac platforms. Move NodeInfo into its own header so that the YYTYPE
declaration in grammar.h is able to declare members of that type.
* kjs/NodeInfo.h: Added.
(KJS::createNodeInfo):
(KJS::mergeDeclarationLists):
(KJS::appendToVarDeclarationList):
* kjs/grammar.y:
* kjs/lexer.cpp:
2007-12-19 Oliver Hunt <oliver@apple.com>
Make appendToVarDeclarationList static
RS=Weinig.
* kjs/grammar.y:
2007-12-18 Oliver Hunt <oliver@apple.com>
Remove dead code due to removal of post-parse declaration discovery.
RS=Geoff.
Due to the removal of the declaration discovery pass after parsing we
no longer need any of the logic used for that discovery.
* kjs/nodes.cpp:
(KJS::Node::Node):
(KJS::VarDeclNode::VarDeclNode):
(KJS::BlockNode::BlockNode):
(KJS::ForInNode::ForInNode):
(KJS::CaseBlockNode::CaseBlockNode):
* kjs/nodes.h:
(KJS::VarStatementNode::):
(KJS::IfNode::):
(KJS::DoWhileNode::):
(KJS::WhileNode::):
(KJS::WithNode::):
(KJS::LabelNode::):
(KJS::TryNode::):
(KJS::FuncDeclNode::):
(KJS::CaseClauseNode::):
(KJS::ClauseListNode::):
(KJS::SwitchNode::):
2007-12-18 Oliver Hunt <oliver@apple.com>
Replace post-parse pass to find declarations with logic in the parser itself
Reviewed by Geoff.
Instead of finding declarations in a pass following the initial parsing of
a program, we incorporate the logic directly into the parser. This lays
the groundwork for further optimisations (such as improving performance in
declaration expressions -- var x = y; -- to match that of standard assignment)
in addition to providing a 0.4% performance improvement in SunSpider.
* JavaScriptCore.exp:
* kjs/Parser.cpp:
(KJS::Parser::parse):
* kjs/Parser.h:
(KJS::Parser::didFinishParsing):
(KJS::Parser::parse):
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::ParserTracked::ParserTracked):
(KJS::ParserTracked::~ParserTracked):
(KJS::ParserTracked::ref):
(KJS::ParserTracked::deref):
(KJS::ParserTracked::refcount):
(KJS::ParserTracked::clearNewTrackedObjects):
(KJS::Node::Node):
(KJS::ScopeNode::ScopeNode):
(KJS::ProgramNode::ProgramNode):
(KJS::EvalNode::EvalNode):
(KJS::FunctionBodyNode::FunctionBodyNode):
(KJS::FunctionBodyNode::initializeSymbolTable):
(KJS::FunctionBodyNode::processDeclarations):
* kjs/nodes.h:
(KJS::ParserTracked::):
(KJS::Node::):
(KJS::ScopeNode::):
2007-12-18 Xan Lopez <xan@gnome.org>
Reviewed by Geoff.
Fix http://bugs.webkit.org/show_bug.cgi?id=14521
Bug 14521: JavaScriptCore fails to build on Linux/PPC gcc 4.1.2
* wtf/TCSpinLock.h:
(TCMalloc_SpinLock::Unlock):
Use less strict memory operand constraint on inline asm generation.
PLATFORM(DARWIN) left unpatched due to Apple's GCC bug.
Patch by David Kilzer <ddkilzer@webkit.org>
2007-12-18 Mark Rowe <mrowe@apple.com>
Rubber-stamped by Maciej Stachowiak.
Remove outdated and non-functioning project files for the Apollo port.
* JavaScriptCore.apolloproj: Removed.
2007-12-18 Darin Adler <darin@apple.com>
- fix Windows build
* pcre/pcre_exec.cpp:
(jsRegExpExecute): Change back from false/true to 0/1 -- I probably should not have
deleted MATCH_MATCH and MATCH_NOMATCH, but I'm going to leave them out.
2007-12-18 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- fix http://bugs.webkit.org/show_bug.cgi?id=16458
REGRESSION (r28164): regular expressions can now hang due to lack of a match limit
<rdar://problem/5636067>
Test: fast/regex/slow.html
Slows down SunSpider a bit (about 1.01x); filed a bug to follow up on that:
http://bugs.webkit.org/show_bug.cgi?id=16503
* pcre/pcre.h: Changed name of error code to not specifically mention "recursion".
* pcre/pcre_exec.cpp:
(match): Replaced the depth limit, MATCH_RECURSION_LIMIT, with a total match looping
limit, matchLimit. Also eliminated the constants for MATCH_MATCH and MATCH_NOMATCH,
since they are just true and false (1 and 0).
(jsRegExpExecute): More of the MATCH_MATCH change.
2007-12-17 Darin Adler <darin@apple.com>
- speculative build fix for non-gcc platforms
* pcre/pcre_exec.cpp: (match): Remove unused cases from return switch.
2007-12-16 Mark Rowe <mrowe@apple.com>
Speculative build fix for non-Mac platforms.
* pcre/pcre_compile.cpp: Include string.h for memset, memmove, etc.
2007-12-16 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=16438
- removed some more unused code
- changed quite a few more names to WebKit-style
- moved more things out of pcre_internal.h
- changed some indentation to WebKit-style
- improved design of the functions for reading and writing
2-byte values from the opcode stream (in pcre_internal.h)
* pcre/dftables.cpp:
(main): Added the kjs prefix a normal way in lieu of using macros.
* pcre/pcre_compile.cpp: Moved some definitions here from pcre_internal.h.
(errorText): Name changes, fewer typedefs.
(checkEscape): Ditto. Changed uppercase conversion to use toASCIIUpper.
(isCountedRepeat): Name change.
(readRepeatCounts): Name change.
(firstSignificantOpcode): Got rid of the use of OP_lengths, which is
very lightly used here. Hard-coded the length of OP_BRANUMBER.
(firstSignificantOpcodeSkippingAssertions): Ditto. Also changed to
use the advanceToEndOfBracket function.
(getOthercaseRange): Name changes.
(encodeUTF8): Ditto.
(compileBranch): Name changes. Removed unused after_manual_callout and
the code to handle it. Removed code to handle OP_ONCE since we never
emit this opcode. Changed to use advanceToEndOfBracket in more places.
(compileBracket): Name changes.
(branchIsAnchored): Removed code to handle OP_ONCE since we never emit
this opcode.
(bracketIsAnchored): Name changes.
(branchNeedsLineStart): More fo the same.
(bracketNeedsLineStart): Ditto.
(branchFindFirstAssertedCharacter): Removed OP_ONCE code.
(bracketFindFirstAssertedCharacter): More of the same.
(calculateCompiledPatternLengthAndFlags): Ditto.
(returnError): Name changes.
(jsRegExpCompile): Ditto.
* pcre/pcre_exec.cpp: Moved some definitions here from pcre_internal.h.
(matchRef): Updated names.
Improved macros to use the do { } while(0) idiom so they expand to single
statements rather than to blocks or multiple statements. And refeactored
the recursive match macros.
(MatchStack::pushNewFrame): Name changes.
(getUTF8CharAndIncrementLength): Name changes.
(match): Name changes. Removed the ONCE opcode.
(jsRegExpExecute): Name changes.
* pcre/pcre_internal.h: Removed quite a few unneeded includes. Rewrote
quite a few comments. Removed the macros that add kjs prefixes to the
functions with external linkage; instead renamed the functions. Removed
the unneeded typedefs pcre_uint16, pcre_uint32, and uschar. Removed the
dead and not-all-working code for LINK_SIZE values other than 2, although
we aim to keep the abstraction working. Removed the OP_LENGTHS macro.
(put2ByteValue): Replaces put2ByteOpcodeValueAtOffset.
(get2ByteValue): Replaces get2ByteOpcodeValueAtOffset.
(put2ByteValueAndAdvance): Replaces put2ByteOpcodeValueAtOffsetAndAdvance.
(putLinkValueAllowZero): Replaces putOpcodeValueAtOffset; doesn't do the
addition, since a comma is really no better than a plus sign. Added an
assertion to catch out of range values and changed the parameter type to
int rather than unsigned.
(getLinkValueAllowZero): Replaces getOpcodeValueAtOffset.
(putLinkValue): New function that most former callers of the
putOpcodeValueAtOffset function can use; asserts the value that is
being stored is non-zero and then calls putLinkValueAllowZero.
(getLinkValue): Ditto.
(putLinkValueAndAdvance): Replaces putOpcodeValueAtOffsetAndAdvance. No
caller was using an offset, which makes sense given the advancing behavior.
(putLinkValueAllowZeroAndAdvance): Ditto.
(isBracketOpcode): Added. For use in an assertion.
(advanceToEndOfBracket): Renamed from moveOpcodePtrPastAnyAlternateBranches,
and removed comments about how it's not well designed. This function takes
a pointer to the beginning of a bracket and advances to the end of the
bracket.
* pcre/pcre_tables.cpp: Updated names.
* pcre/pcre_ucp_searchfuncs.cpp:
(kjs_pcre_ucp_othercase): Ditto.
* pcre/pcre_xclass.cpp:
(getUTF8CharAndAdvancePointer): Ditto.
(kjs_pcre_xclass): Ditto.
* pcre/ucpinternal.h: Ditto.
* wtf/ASCIICType.h:
(WTF::isASCIIAlpha): Added an int overload, like the one we already have for
isASCIIDigit.
(WTF::isASCIIAlphanumeric): Ditto.
(WTF::isASCIIHexDigit): Ditto.
(WTF::isASCIILower): Ditto.
(WTF::isASCIISpace): Ditto.
(WTF::toASCIILower): Ditto.
(WTF::toASCIIUpper): Ditto.
2007-12-16 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fix http://bugs.webkit.org/show_bug.cgi?id=16459
REGRESSION: assertion failure with regexp with \B in a case-ignoring character range
<rdar://problem/5646361>
The problem was that \B was not handled properly in character classes.
Test: fast/js/regexp-overflow.html
* pcre/pcre_compile.cpp:
(check_escape): Added handling of ESC_b and ESC_B in character classes here.
Allows us to get rid of the handling of \b in character classes from all the
call sites that handle it separately and to handle \B properly as well.
(compileBranch): Remove the ESC_b handling, since it's not needed any more.
(calculateCompiledPatternLengthAndFlags): Ditto.
2007-12-16 Mark Rowe <mrowe@apple.com>
Reviewed by Maciej Stachowiak.
Fix http://bugs.webkit.org/show_bug.cgi?id=16448
Bug 16448: [GTK] Celtic Kane JavaScript performance on Array test is slow relative to Mac
* kjs/array_instance.cpp:
(KJS::compareByStringPairForQSort):
(KJS::ArrayInstance::sort): Convert JSValue's to strings once up front and then sort the
results. This avoids calling toString twice per comparison, but requires a temporary buffer
so we only use this approach in cases where the array being sorted is not too large.
2007-12-16 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler and Maciej Stachowiak.
More refactoring to support global variable optimization.
Changed SymbolTable to use RefPtr<UString::Rep> as its key instead of
UString::Rep*. With globals, the symbol table can outlast the
declaration node for any given symbol, so the symbol table needs to ref
its symbol names.
In support, specialized HashMaps with RefPtr keys to allow lookup
via raw pointer, avoiding refcount churn.
SunSpider reports a .6% speedup (prolly just noise).
* JavaScriptCore.vcproj/WTF/WTF.vcproj: Added new file: wtf/RefPtrHashMap.h
* JavaScriptCore.xcodeproj/project.pbxproj: ditto
* kjs/JSVariableObject.cpp:
(KJS::JSVariableObject::getPropertyNames): Symbol table keys are RefPtrs now.
* kjs/SymbolTable.h: Modified key traits to match RefPtr. Added a
static Rep* for null, which helps compute the deletedValue() trait.
* wtf/HashMap.h: #include the RefPtr specialization so everyone can use it.
* wtf/RefPtrHashMap.h: Copied from wtf/HashMap.h. Added overloaded versions
of find(), contains(), get(), set(), add(), remove(), and take() that take
raw pointers as keys.
2007-12-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
http://bugs.webkit.org/show_bug.cgi?id=16162
Problems with float parsing on Linux (locale-dependent parsing was used).
* kjs/dtoa.cpp: Removed USE_LOCALE to reduce future confusion.
* kjs/lexer.cpp: (KJS::Lexer::lex): Parse with kjs_strtod, not the system one.
2007-12-14 Alp Toker <alp@atoker.com>
Reviewed by Mark Rowe.
Enable the AllInOneFile.cpp optimization for the GTK+ port.
* JavaScriptCore.pri:
2007-12-14 Mark Rowe <mrowe@apple.com>
Unreviewed. Remove commented out fprintf's that were for debugging purposes only.
* wtf/FastMalloc.cpp:
(WTF::TCMalloc_PageHeap::IncrementalScavenge):
2007-12-14 Mark Rowe <mrowe@apple.com>
Reviewed by Maciej Stachowiak.
Don't use the MADV_DONTNEED code path for now as it has no effect on Mac OS X and is
currently untested on other platforms.
* wtf/TCSystemAlloc.cpp:
(TCMalloc_SystemRelease): Return after releasing memory rather than potentially falling
through into another mechanism if multiple are supported.
2007-12-14 Alp Toker <alp@atoker.com>
Build fix for GTK+/Qt and ports that don't use AllInOneFile.cpp.
Include UnusedParam.h.
* wtf/TCSystemAlloc.cpp:
2007-12-14 Oliver Hunt <oliver@apple.com>
Reviewed by Stephanie.
Fix build on windows
* wtf/FastMalloc.cpp:
(WTF::TCMalloc_PageHeap::IncrementalScavenge):
2007-12-14 Dan Bernstein <mitz@apple.com>
- try again to fix the Windows build
* wtf/TCSystemAlloc.cpp:
(TCMalloc_SystemRelease):
2007-12-14 Dan Bernstein <mitz@apple.com>
- try to fix the Windows build
* wtf/TCSystemAlloc.cpp:
(TCMalloc_SystemRelease):
2007-12-14 Mark Rowe <mrowe@apple.com>
Reviewed by Maciej and Oliver.
Add final changes to make TCMalloc release memory to the system.
This results in a 0.4% regression against ToT, but this is offset
against the gains made by the original TCMalloc r38 merge - in fact
we retain around 0.3-0.4% progression overall.
* wtf/FastMalloc.cpp:
(WTF::InitSizeClasses):
(WTF::TCMalloc_PageHeap::IncrementalScavenge):
* wtf/TCSystemAlloc.cpp:
(TCMalloc_SystemRelease):
2007-12-14 Darin Adler <darin@apple.com>
Reviewed by Sam.
- removed unnecessary includes of "Vector.h"
* wtf/HashMap.h:
(WTF::copyKeysToVector): Make the type of the vector be a template parameter.
This allows copying keys into a vector of a base class or one with an inline capacity.
(WTF::copyValuesToVector): Ditto.
* wtf/HashSet.h:
(WTF::copyToVector): Ditto.
2007-12-14 Anders Carlsson <andersca@apple.com>
Reviewed by Darin and Geoff.
<rdar://problem/5619295>
REGRESSION: 303-304: Embedded YouTube video fails to render- JS errors (16150) (Flash 9)
Get rid of unnecessary and incorrect security checks for plug-ins accessing JavaScript objects.
The way this used to work was that each NPObject that wrapped a JSObject would have a root object
corresponding to the frame object (used for managing the lifecycle) and an origin root object (used for
doing security checks).
This would prevent a plug-in from accessing a frame's window object if it's security origin was different
(some parts of the window, such as the location object, can be accessed from frames with different security
origins, and those checks are being done in WebCore).
Also, if a plug-in were to access a window object of a frame that later went away, it could lead to that
Window JSObject being garbage collected and the NPObject pointing to freed memory.
How this works now is that there is no origin root object anymore, and all NPObject wrappers that are created
for a plug-in will have the root object of the containing frame of that plug-in.
* bindings/NP_jsobject.cpp:
(jsDeallocate):
Don't free the origin root object.
(_NPN_CreateScriptObject):
Remove the origin root object parameter.
(_NPN_InvokeDefault):
(_NPN_Invoke):
(_NPN_Evaluate):
(_NPN_GetProperty):
(_NPN_SetProperty):
(_NPN_RemoveProperty):
(_NPN_HasProperty):
(_NPN_HasMethod):
(_NPN_Enumerate):
Get rid of all security checks.
* bindings/NP_jsobject.h:
Remove originRootObject from the JavaScriptObject struct.
* bindings/c/c_utility.cpp:
(KJS::Bindings::convertValueToNPVariant):
Always use the root object from the ExecState.
2007-12-13 Steve Falkenburg <sfalken@apple.com>
Move source file generation into its own vcproj to fix build dependencies.
Reviewed by Adam.
* JavaScriptCore.vcproj/JavaScriptCore.sln:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Added.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: Added.
* JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
2007-12-13 Alp Toker <alp@atoker.com>
http://bugs.webkit.org/show_bug.cgi?id=16406
[Gtk] JavaScriptCore needs -lpthread
Build fix for Debian and any other platforms that don't implicitly
link to pthread.
Link to pthread on non-Windows platforms until this dependency is
removed from JSC.
2007-12-11 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Build fix: Note some variables that are used only for ASSERTs.
* API/testapi.c:
(Base_finalize):
(globalObject_initialize):
(testInitializeFinalize):
2007-12-11 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Fixed: All JS tests crash on Windows.
NDEBUG wasn't defined when compiling testkjs in release builds, so the
HashTable definition in HashTable.h included an extra data member.
The solution was to add NDEBUG to the release testkjs configuration on
Windows and Mac.
For giggles, I also added other missing #defines to testkjs on Windows.
* Configurations/Base.xcconfig:
* Configurations/JavaScriptCore.xcconfig:
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/testkjs.cpp:
(main):
2007-12-11 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Removed bogus ASSERT.
ASSERT should only be used when we know that a code path will not be
taken. This code path is taken often during the jsFunFuzz test.
* pcre/pcre_exec.cpp:
(jsRegExpExecute):
2007-12-11 Darin Adler <darin@apple.com>
* wtf/unicode/qt4/UnicodeQt4.h: Try to fix Qt build by adding U16_IS_SINGLE.
2007-12-10 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
- fix http://bugs.webkit.org/show_bug.cgi?id=16379
REGRESSION(r28525): Failures in http/tests/xmlhttprequest/response-encoding.html and
fast/dom/xmlhttprequest-html-response-encoding.html
and <rdar://problem/5640230> REGRESSION (306A4-ToT): Access violation in PCRE function
find_firstassertedchar
Test: fast/js/regexp-find-first-asserted.html
* pcre/pcre_compile.cpp:
(compileBracket): Take out unnecessary initialization of out parameters.
(branchFindFirstAssertedCharacter): Added. Broke out the half of the function that handles
a branch.
(bracketFindFirstAssertedCharacter): Renamed from find_firstassertedchar. Also removed the
options parameter -- the caller can handle the options.
(jsRegExpCompile): Changed call site to call the appropriate bracket or branch version of
the find_firstassertedchar function. Also put the REQ_IGNORE_CASE code here instead of
passing in the options.
2007-12-10 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Split this:
FunctionBodyNode
^
|
ProgramNode
into this:
ScopeNode
^ ^ ^
| | |
FunctionBodyNode ProgramNode EvalNode
in preparation for specializing each class more while optimizing global
variable access.
Also removed some cruft from the FunctionBodyNode interface to simplify
things.
SunSpider says this patch is a .8% speedup, which seems reasonable,
since it eliminates a few branches and adds KJS_FAST_CALL in a few
places.
Layout tests and JS tests pass. Also, this baby builds on Windows! (Qt
mileage may vary...)
2007-12-10 Geoffrey Garen <ggaren@apple.com>
RS by Mark Rowe.
Mac build fix: added some exported symbols, now that Parser::parse is
defined in the header.
* JavaScriptCore.exp:
2007-12-10 Sam Weinig <sam@webkit.org>
Build fix.
Template methods need to be in the header.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* kjs/Parser.cpp:
* kjs/Parser.h:
(KJS::Parser::parse):
2007-12-10 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Merged different implementations of Parser::parse into a single,
templatized implementation, in preparation for adding yet another
implementation for "eval" code.
JS and layout tests pass.
2007-12-10 Timothy Hatcher <timothy@apple.com>
Reviewed by Mark Rowe
<rdar://problem/5639463> Bundle versions on Tiger should be 4523.x not 523.x
* Configurations/Version.xcconfig: Some Tiger versions of Xcode don't set MAC_OS_X_VERSION_MAJOR,
so assume Tiger and use a 4 for the SYSTEM_VERSION_PREFIX.
2007-12-10 Mark Rowe <mrowe@apple.com>
Tiger build fix.
* kjs/grammar.y: Use @1 and @0 in place of @$ where Tiger's bison chokes.
2007-12-10 Darin Adler <darin@apple.com>
Reviewed by Mark Rowe.
- fix http://bugs.webkit.org/show_bug.cgi?id=16375
REGRESSION: Safari crashes on quit
Probably a debug-only issue.
* kjs/Parser.cpp:
(KJS::parser): Create the parser and never destroy it by using a pointer instead
of a global object.
2007-12-09 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
- fix http://bugs.webkit.org/show_bug.cgi?id=16369
REGRESSION (r28525): regular expression tests failing due to bad firstByte optimization
* pcre/pcre_compile.cpp: Changed some names to use interCaps intead of under_scores.
(branchIsAnchored): Broke is_anchored into two separate functions; this one works on a
branch and the other on an anchor. The old function would only work on a bracket.
Also removed unneeded parameters; the anchored check does not require the bracket
map or the options any more because we have a reduced set of features.
(bracketIsAnchored): Ditto.
(branchNeedsLineStart): Broke canApplyFirstCharOptimization into two functions and gave
both a better name. This is the function that was returning the wrong value. The failure
was beacuse the old function would only work on a bracket.
(bracketNeedsLineStart): Ditto.
(jsRegExpCompile): Changed to call the appropriate branch or bracket flavor of the
functions based on whether we compiled an outer bracket. Also removed inaccurate comments
and unneeded parameters.
- other small changes
* pcre/pcre.h: Renumbered error codes, in a logical order. First, normal failure, then
the recursion limit, then running out of memory, and finally an unexpected internal error.
* pcre/pcre_exec.cpp: Fixed indentation.
(jsRegExpExecute): Corrected an inaccurate comment.
2007-12-09 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fix http://bugs.webkit.org/show_bug.cgi?id=16370
REGRESSION (r28540): source URL and line number no longer set for outer function/programs
Test: fast/js/exception-linenums-in-html-1.html
Test: fast/js/exception-linenums-in-html-2.html
Test: fast/js/exception-linenums.html
By the time the ProgramNode was constructed, the source URL was empty.
* kjs/Parser.cpp:
(KJS::Parser::parseProgram): Added code to set and clear m_sourceURL, which is now
handled here instead of in the lexer; it needs to still be set when we create the
program node. Call setLoc to set the first and last line number.
(KJS::Parser::parseFunctionBody): Ditto, but for the body.
(KJS::Parser::parse): Removed the sourceURL argument.
* kjs/Parser.h: Added sourceURL(), m_sourceURL, and m_lastLine. Added a lastLine
parameter to didFinishParsing, since the bison grammar knows the last line number
and we otherwise do not know it. Removed the sourceURL parameter from parse, since
that's now handled at a higher level.
* kjs/grammar.y: Pass the last line number to didFinishParsing.
* kjs/lexer.cpp:
(KJS::Lexer::setCode): Removed the sourceURL argument and the code to set m_sourceURL.
(KJS::Lexer::clear): Ditto.
* kjs/lexer.h: More of the same.
* kjs/nodes.cpp:
(KJS::FunctionBodyNode::FunctionBodyNode): Get the source URL from the parser rather
than from the lexer. Removed unneeded call to setLoc, since the line numbers already
both default to -1.
2007-12-08 Oliver Hunt <oliver@apple.com>
Reviewed by Sam W.
Split the ENABLE_SVG_EXPERIMENTAL_FEATURES flag into separate flags.
Fixes <rdar://problem/5620249> Must disable SVG animation
<rdar://problem/5612772> Disable SVG filters on Mac to match Windows behavior
Minor config changes.
* Configurations/JavaScriptCore.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj:
2007-12-07 Sam Weinig <sam@webkit.org>
Reviewed by Darin.
- Rename isSafeScript to allowsAccessFrom.
* bindings/NP_jsobject.cpp:
(_isSafeScript):
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::allowsAccessFrom): Reverse caller/argument of allowsAccessFrom to match
the new call.
2007-12-07 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Refactored variable access optimization: Removed the assumption that
the FunctionBodyNode holds the symbol table.
2007-12-07 Geoffrey Garen <ggaren@apple.com>
Build fix: added #include.
* kjs/nodes.cpp:
2007-12-07 Geoffrey Garen <ggaren@apple.com>
Build fix: added #include.
* kjs/interpreter.cpp:
2007-12-07 Geoffrey Garen <ggaren@apple.com>
Build fix: added #include.
* kjs/grammar.y:
2007-12-07 Geoffrey Garen <ggaren@apple.com>
Build fix: added #include.
* kjs/function_object.cpp:
2007-12-07 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Fixed crash seen running layout tests.
Reverted a change I made earlier today. Added a comment to try to
discourage myself from making this mistake a third time.
* kjs/function.cpp:
(KJS::ActivationImp::mark):
* kjs/function.h:
(KJS::ActivationImp::ActivationImpData::ActivationImpData):
2007-12-07 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Refactored parsing of global code: Removed the assumption that
ProgramNode inherits from FunctionBodyNode from the parser.
* kjs/Parser.cpp:
(KJS::Parser::parseProgram):
(KJS::Parser::parseFunctionBody):
(KJS::Parser::parse):
* kjs/Parser.h:
(KJS::Parser::didFinishParsing):
* kjs/function.cpp:
* kjs/grammar.y:
* kjs/nodes.h:
2007-12-07 Geoffrey Garen <ggaren@apple.com>
Build fix: added JSVariableObject.cpp to the .pri file.
* JavaScriptCore.pri:
2007-12-07 Geoffrey Garen <ggaren@apple.com>
Build fix: added #include.
* kjs/function.cpp:
2007-12-07 Steve Falkenburg <sfalken@apple.com>
Re-named our B&I flag from BUILDBOT to PRODUCTION.
Reviewed by Sam Weinig.
* JavaScriptCore.vcproj/JavaScriptCore.make:
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2007-12-07 Geoffrey Garen <ggaren@apple.com>
Build fix: removed stray name qualification.
* kjs/function.h:
(KJS::ActivationImp::ActivationImp):
2007-12-07 Geoffrey Garen <ggaren@apple.com>
Build fix: moved functions with qualified names outside of class
declaration.
* kjs/JSVariableObject.h:
(KJS::JSVariableObject::symbolTableGet):
(KJS::JSVariableObject::symbolTablePut):
2007-12-07 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Next step in refactoring JSGlobalObject: Added JSVariableObject class,
and factored symbol-table-related code into it. (JSGlobalObject doesn't
use the symbol table code yet, though.)
Layout and JS tests, and testapi, pass. SunSpider reports no regression.
2007-12-07 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- fix http://bugs.webkit.org/show_bug.cgi?id=16185
jsRegExpCompile should not add implicit non-capturing bracket
While this does not make SunSpider faster, it will make many regular
expressions a bit faster.
* pcre/pcre_compile.cpp: Moved CompileData struct in here from the
header since it's private to this file.
(compile_branch): Updated for function name change.
(compile_bracket): Renamed from compile_regex, since, for one thing,
this does not compile an entire regular expression.
(calculateCompiledPatternLengthAndFlags): Removed unused item_count
local variable. Renamed CompileData to cd instead of compile_block
to be consistent with other functions. Added code to set the
needOuterBracket flag if there's at least one "|" at the outer level.
(jsRegExpCompile): Renamed CompileData to cd instead of compile_block
to be consistent with other functions. Removed unneeded "size" field
from the compiled regular expression. If no outer bracket is needed,
then use compile_branch to compile the regular expression.
* pcre/pcre_internal.h: Removed the CompileData struct, which is now
private to pcre_compile.cpp. Removed the size member from JSRegExp.
2007-12-06 Kevin Ollivier <kevino@theolliviers.com>
MSVC7 build fix due to a compiler bug with placement new and/or
templates and casting.
Reviewed by Darin Adler.
* wtf/Vector.h:
(WTF::::append):
2007-12-06 Darin Adler <darin@apple.com>
Reviewed by Eric Seidel.
- fix http://bugs.webkit.org/show_bug.cgi?id=16321
new RegExp("[\u0097]{4,6}", "gmy") crashes in DEBUG builds
<rdar://problem/5632992>
Test: fast/js/regexp-oveflow.html
* pcre/pcre_compile.cpp:
(calculateCompiledPatternLengthAndFlags): In the case where a single character
character class is optimized to not use a character class at all, the preflight
code was not setting the lastitemlength variable.
2007-12-05 Mark Rowe <mrowe@apple.com>
Qt Windows build fix. Include the time-related headers in the correct place.
* kjs/JSGlobalObject.cpp:
* kjs/interpreter.cpp:
2007-12-05 Darin Adler <darin@apple.com>
Not reviewed; just undoing a previous commit.
- remove earlier incorrect fix for http://bugs.webkit.org/show_bug.cgi?id=16220
<rdar://problem/5625221> Crash opening www.news.com (CNet)
The real bug was the backwards ?: in the compile function, which Geoff just
fixed. Rolling out the incorrect earlier fix.
* pcre/pcre_compile.cpp: (calculateCompiledPatternLengthAndFlags): Take out
the unneeded preflight change. The regression test proves this is still working
fine, so the bug remains fixed.
2007-12-01 Mark Rowe <mrowe@apple.com>
Build fix. Include headers before trying to use the things that they declare.
* kjs/JSImmediate.cpp:
* kjs/nodes.cpp:
* kjs/object.cpp:
* kjs/object_object.cpp:
* kjs/regexp_object.cpp:
* kjs/string_object.cpp:
2007-12-05 Geoffrey Garen <ggaren@apple.com>
Build fix: added some #includes.
* kjs/JSImmediate.cpp:
2007-12-05 Geoffrey Garen <ggaren@apple.com>
Build fix: added some #includes.
* kjs/JSGlobalObject.cpp:
* kjs/JSImmediate.cpp:
2007-12-05 Geoffrey Garen <ggaren@apple.com>
Build fix: Fixed #include spelling.
* kjs/debugger.cpp:
2007-12-05 Geoffrey Garen <ggaren@apple.com>
Build fix: added #include.
* kjs/debugger.cpp:
2007-12-05 Geoffrey Garen <ggaren@apple.com>
Build fix: added a forward declaration.
* kjs/debugger.h:
2007-12-05 Geoffrey Garen <ggaren@apple.com>
Build fix: added an #include.
* kjs/error_object.cpp:
2007-12-05 Geoffrey Garen <ggaren@apple.com>
Build fix: added an #include.
* kjs/bool_object.cpp:
2007-12-05 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Third step in refactoring JSGlobalObject: Moved data members and
functions accessing data members from Interpreter to JSGlobalObject.
Changed Interpreter member functions to static functions.
This resolves a bug in global object bootstrapping, where the global
ExecState could be used when uninitialized.
This is a big change, but it's mostly code motion and renaming.
Layout and JS tests, and testjsglue and testapi, pass. SunSpider reports
a .7% regression, but Shark sees no difference related to this patch,
and SunSpider reported a .7% speedup from an earlier step in this
refactoring, so I think it's fair to call that a wash.
2007-12-05 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler. (Or vice versa.)
Fixed ASSERT during run-javascriptcore-tests. (Darin just added the
ASSERT, but the bug wasn't new.)
* pcre/pcre_compile.cpp:
(compile_branch): The ?: operator here was backwards, causing us to
execute the loop too many times, adding stray KET opcodes to the
compiled regular expression.
2007-12-05 Kevin McCullough <kmccullough@apple.com>
Reviewed by Geoff.
- Wait until local variable data is fully constructed before notifying the debugger of entering
or leaving a call frame.
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction):
* kjs/nodes.cpp:
(KJS::FunctionBodyNode::execute):
2007-12-05 Mark Rowe <mrowe@apple.com>
Reviewed by Oliver.
Build fix for GCC 4.2. Cast via a union to avoid strict-aliasing issues.
* wtf/FastMalloc.cpp:
(WTF::):
(WTF::getPageHeap):
2007-12-05 Mark Rowe <mrowe@apple.com>
Reviewed by Darin.
Fix testkjs in 64-bit.
When built for 64-bit the TCMalloc spin lock uses pthread mutexes rather than a custom spin lock
implemented in assembly. If we fail to initialize the pthread mutex, attempts to lock or unlock
it will fail and trigger a call to abort.
* wtf/FastMalloc.cpp: Initialize the spin lock so that we can later lock and unlock it.
* wtf/TCSpinLock.h: Add an Init method to the optimised spin lock.
2007-12-04 Oliver Hunt <oliver@apple.com>
Fix gtk build.
* wtf/TCSystemAlloc.cpp:
2007-12-03 Oliver Hunt <oliver@apple.com>
Reviewed by Mark Rowe and Geoff Garen.
Merge TCMalloc r38
It also result in a performance progression between 0.5% and
0.9% depending on the test, however most if not all of this
gain will be consumed by the overhead involved in the later
change to release memory to the system.
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* wtf/FastMalloc.cpp:
(WTF::KernelSupportsTLS):
(WTF::CheckIfKernelSupportsTLS):
(WTF::):
(WTF::ClassIndex):
(WTF::SLL_Next):
(WTF::SLL_SetNext):
(WTF::SLL_Push):
(WTF::SLL_Pop):
(WTF::SLL_PopRange):
(WTF::SLL_PushRange):
(WTF::SLL_Size):
(WTF::SizeClass):
(WTF::ByteSizeForClass):
(WTF::NumMoveSize):
(WTF::InitSizeClasses):
(WTF::AllocationSize):
(WTF::TCMalloc_PageHeap::GetSizeClassIfCached):
(WTF::TCMalloc_PageHeap::CacheSizeClass):
(WTF::TCMalloc_PageHeap::init):
(WTF::TCMalloc_PageHeap::New):
(WTF::TCMalloc_PageHeap::AllocLarge):
(WTF::TCMalloc_PageHeap::Carve):
(WTF::TCMalloc_PageHeap::Delete):
(WTF::TCMalloc_PageHeap::IncrementalScavenge):
(WTF::PagesToMB):
(WTF::TCMalloc_PageHeap::Dump):
(WTF::TCMalloc_PageHeap::GrowHeap):
(WTF::TCMalloc_PageHeap::Check):
(WTF::ReleaseFreeList):
(WTF::TCMalloc_PageHeap::ReleaseFreePages):
(WTF::TCMalloc_ThreadCache_FreeList::Push):
(WTF::TCMalloc_ThreadCache_FreeList::PushRange):
(WTF::TCMalloc_ThreadCache_FreeList::PopRange):
(WTF::TCMalloc_ThreadCache_FreeList::Pop):
(WTF::TCMalloc_Central_FreeList::length):
(WTF::TCMalloc_Central_FreeList::tc_length):
(WTF::TCMalloc_Central_FreeList::Init):
(WTF::TCMalloc_Central_FreeList::ReleaseListToSpans):
(WTF::TCMalloc_Central_FreeList::EvictRandomSizeClass):
(WTF::TCMalloc_Central_FreeList::MakeCacheSpace):
(WTF::TCMalloc_Central_FreeList::ShrinkCache):
(WTF::TCMalloc_Central_FreeList::InsertRange):
(WTF::TCMalloc_Central_FreeList::RemoveRange):
(WTF::TCMalloc_Central_FreeList::FetchFromSpansSafe):
(WTF::TCMalloc_Central_FreeList::Populate):
(WTF::TCMalloc_ThreadCache::Init):
(WTF::TCMalloc_ThreadCache::Cleanup):
(WTF::TCMalloc_ThreadCache::Allocate):
(WTF::TCMalloc_ThreadCache::Deallocate):
(WTF::TCMalloc_ThreadCache::FetchFromCentralCache):
(WTF::TCMalloc_ThreadCache::ReleaseToCentralCache):
(WTF::TCMalloc_ThreadCache::Scavenge):
(WTF::TCMalloc_ThreadCache::PickNextSample):
(WTF::TCMalloc_ThreadCache::NewHeap):
(WTF::TCMalloc_ThreadCache::GetThreadHeap):
(WTF::TCMalloc_ThreadCache::GetCache):
(WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
(WTF::TCMalloc_ThreadCache::InitTSD):
(WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
(WTF::TCMallocStats::ExtractStats):
(WTF::TCMallocStats::DumpStats):
(WTF::TCMallocStats::DumpStackTraces):
(WTF::TCMallocStats::TCMallocImplementation::MarkThreadIdle):
(WTF::TCMallocStats::TCMallocImplementation::ReleaseFreeMemory):
(WTF::TCMallocStats::TCMallocGuard::TCMallocGuard):
(WTF::TCMallocStats::TCMallocGuard::~TCMallocGuard):
(WTF::TCMallocStats::DoSampledAllocation):
(WTF::TCMallocStats::CheckCachedSizeClass):
(WTF::TCMallocStats::CheckedMallocResult):
(WTF::TCMallocStats::SpanToMallocResult):
(WTF::TCMallocStats::do_malloc):
(WTF::TCMallocStats::do_free):
(WTF::TCMallocStats::do_memalign):
(WTF::TCMallocStats::do_malloc_stats):
(WTF::TCMallocStats::do_mallopt):
(WTF::TCMallocStats::do_mallinfo):
(WTF::TCMallocStats::realloc):
(WTF::TCMallocStats::cpp_alloc):
(WTF::TCMallocStats::operator new):
(WTF::TCMallocStats::):
(WTF::TCMallocStats::operator new[]):
(WTF::TCMallocStats::malloc_stats):
(WTF::TCMallocStats::mallopt):
(WTF::TCMallocStats::mallinfo):
* wtf/TCPackedCache.h: Added.
(PackedCache::PackedCache):
(PackedCache::Put):
(PackedCache::Has):
(PackedCache::GetOrDefault):
(PackedCache::Clear):
(PackedCache::EntryToValue):
(PackedCache::EntryToUpper):
(PackedCache::KeyToUpper):
(PackedCache::UpperToPartialKey):
(PackedCache::Hash):
(PackedCache::KeyMatch):
* wtf/TCPageMap.h:
(TCMalloc_PageMap2::PreallocateMoreMemory):
* wtf/TCSystemAlloc.cpp:
(TCMalloc_SystemRelease):
* wtf/TCSystemAlloc.h:
2007-12-04 Anders Carlsson <andersca@apple.com>
Reviewed by Sam.
Make isSafeScript const.
* kjs/JSGlobalObject.h:
(KJS::JSGlobalObject::isSafeScript):
2007-12-04 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- fix first part of http://bugs.webkit.org/show_bug.cgi?id=16220
<rdar://problem/5625221> Crash opening www.news.com (CNet)
Test: fast/js/regexp-overflow.html
* pcre/pcre_compile.cpp:
(calculateCompiledPatternLengthAndFlags): Add room for the additional BRA/KET that
was generated in the compile code but not taken into account here.
2007-12-03 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- fix http://bugs.webkit.org/show_bug.cgi?id=15618
<rdar://problem/5619353> REGRESSION: Stack overflow/crash in KJS::equal (15618)
Test: fast/js/recursion-limit-equal.html
* kjs/operations.cpp: (KJS::equal): Check the exception from toPrimitive.
2007-12-03 Dan Bernstein <mitz@apple.com>
- fix a copy-and-paste-o
* bindings/npruntime.cpp:
(_NPN_GetIntIdentifier):
2007-12-03 Dan Bernstein <mitz@apple.com>
Reviewed by Darin Adler.
- fix an ASSERT when getIntIdentifier is called with 0 or -1
* bindings/npruntime.cpp:
(_NPN_GetIntIdentifier): We cannot use the hashmap for 0 and -1 since
they are the empty value and the deleted value. Instead, keep the
identifiers for those two integers in a static array.
2007-12-02 Darin Adler <darin@apple.com>
Reviewed by Mitz.
- fix http://bugs.webkit.org/show_bug.cgi?id=15848
<rdar://problem/5619330> REGRESSION: Assertion failure viewing comments page on digg.com
Test: fast/js/sparse-array.html
* kjs/array_instance.cpp:
(KJS::ArrayInstance::inlineGetOwnPropertySlot): Check sparse array cutoff before looking
in hash map. Can't avoid the branch because we can't look for 0 in the hash.
(KJS::ArrayInstance::deleteProperty): Ditto.
2007-12-02 Geoffrey Garen <ggaren@apple.com>
Build fix: added an #include.
* kjs/collector.cpp:
2007-12-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Eric Seidel.
Second step in refactoring JSGlobalObject: moved virtual functions from
Interpreter to JSGlobalObject.
Layout and JS tests pass. SunSpider reports a .7% speedup -- don't
believe his lies.
2007-12-01 Alp Toker <alp@atoker.com>
Reviewed by Adam Roben.
http://bugs.webkit.org/show_bug.cgi?id=16228
kJSClassDefinitionEmpty is not exported with JS_EXPORT
Add JS_EXPORT to kJSClassDefinitionEmpty.
Make the gcc compiler check take precedence over the WIN32||_WIN32
check to ensure that symbols are exported on Windows when using gcc.
Add a TODO referencing the bug about JS_EXPORT in the Win build
(http://bugs.webkit.org/show_bug.cgi?id=16227)
Don't define JS_EXPORT as 'extern' when the compiler is unknown since
it would result in the incorrect expansion:
extern extern const JSClassDefinition kJSClassDefinitionEmpty;
(This was something we inherited from CFBase.h that doesn't make sense
for JSBase.h)
* API/JSBase.h:
* API/JSObjectRef.h:
2007-11-30 Geoffrey Garen <ggaren@apple.com>
Reviewed by Beth Dakin.
Reversed the ownership relationship between Interpreter and JSGlobalObject.
Now, the JSGlobalObject owns the Interpreter, and top-level objects
that need the two to persist just protect the JSGlobalObject from GC.
Global object bootstrapping looks a little odd right now, but it will
make much more sense soon, after further rounds of refactoring.
* bindings/runtime_root.h: Made this class inherit from RefCounted,
to avoid code duplication.
* kjs/collector.cpp:
(KJS::Collector::collect): No need to give special GC treatment to
Interpreters, since we mark their global objects, which mark them.
* kjs/interpreter.cpp:
(KJS::Interpreter::mark): No need to mark our global object, since it
marks us.
* kjs/interpreter.h: Don't inherit from RefCounted -- JSGlobalObject
owns us directly.
* kjs/testkjs.cpp: Modified to follow the new rules.
(createGlobalObject):
(runWithScripts):
2007-11-30 Brent Fulgham <bfulgham@gmail.com>
Reviewed by Eric.
* ChangeLog:
* pcre/pcre_compile.cpp:
(compile_branch):
2007-11-30 Eric Seidel <eric@webkit.org>
No review, build fix only.
Fix uninitialized var warnings in release build.
* JavaScriptCore.xcodeproj/project.pbxproj:
* pcre/pcre_compile.cpp:
(compile_regex):
2007-11-30 Darin Adler <darin@apple.com>
Reviewed by Adam Roben.
- fix http://bugs.webkit.org/show_bug.cgi?id=16207
JavaScript regular expressions should match UTF-16 code units rather than characters
SunSpider says this is 5.5% faster on the regexp test, 0.4% faste overall.
Test: fast/js/regexp-non-bmp.html
Renamed ANY_CHAR to NOT_NEWLINE to more-accurately reflect its meaning.
* pcre/pcre_compile.cpp:
(compile_branch): Removed calls to the UTF-16 character accessor functions, replacing
them with simple pointer dereferences in some cases, and no code at all in others.
(calculateCompiledPatternLengthAndFlags): Ditto.
* pcre/pcre_exec.cpp:
(match): Fixed indentation of some case labels (including all the BEGIN_OPCODE).
Removed calls to the UTF-16 character accessor functions, replacing them with simple
pointer dereferences in some cases, and no code at all in others. Also removed some
explicit UTF-16 support code in a few cases. Removed the unneeded "UTF-8" code path
in the ANY_CHAR repeat code, and in another case, eliminated the code to check against
end_subject in because it is already done outside the loop.
(jsRegExpExecute):
* pcre/pcre_internal.h: Removed all the UTF-16 helper functions.
2007-11-30 Eric Seidel <eric@webkit.org>
Reviewed by darin.
PCRE crashes under GuardMalloc
http://bugs.webkit.org/show_bug.cgi?id=16127
check against patternEnd to make sure we don't walk off the end of the string
* pcre/pcre_compile.cpp:
(compile_branch):
(calculateCompiledPatternLengthAndFlags):
2007-11-30 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Fix layout test regressions caused by r28186
http://bugs.webkit.org/show_bug.cgi?id=16195
change first_byte and req_byte back to shorts instead of chars
(I think PCRE stuffs information in the high bits)
* pcre/pcre_internal.h:
2007-11-29 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej and Darin.
Make the JS collector work with multiple threads
Under heavy contention it was possible the GC to suspend other
threads inside the pthread spinlock, which could lead to the GC
thread blocking on the pthread spinlock itself.
We now determine and store each thread's stack base when it is
registered, thus removing the need for any calls to pthread_get_stackaddr_np
that needed the pthread spinlock.
* kjs/collector.cpp:
(KJS::Collector::Thread::Thread):
(KJS::Collector::registerThread):
(KJS::Collector::markOtherThreadConservatively):
2007-11-29 Adam Roben <aroben@apple.com>
Windows build fix
Removed some unreachable code (ironically, the code was some
ASSERT_NOT_REACHED()s).
* pcre/pcre_compile.cpp:
(compile_branch):
* pcre/pcre_exec.cpp:
(match):
2007-11-29 Eric Seidel <eric@webkit.org>
Reviewed by Mark Rowe.
Fix for --guard crash of fast/js/regexp-charclass-crash introduced by r28151.
* pcre/pcre_compile.cpp:
(is_anchored):
2007-11-28 Mark Rowe <mrowe@apple.com>
Gtk build fix. Rubber-stamped by Eric.
* pcre/pcre_exec.cpp:
(match): Add braces around the body of the case statement to prevent
wanings about jumps across the initialization of a variable.
2007-11-29 Eric Seidel <eric@webkit.org>
Reviewed by Mark Rowe.
Attempt to fix non-mac builds after PCRE cleanup.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCoreSources.bkl:
* pcre/pcre.pri:
2007-11-28 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Centralize code for subjectPtr adjustments using inlines, only ever check for a single
trailing surrogate (as UTF16 only allows one), possibly fix PCRE bugs involving char
classes and garbled UTF16 strings.
* pcre/pcre_exec.cpp:
(match):
(jsRegExpExecute):
* pcre/pcre_internal.h:
(getPreviousChar):
(movePtrToPreviousChar):
(movePtrToNextChar):
(movePtrToStartOfCurrentChar):
2007-11-28 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
change getChar* functions to return result and push 'c' into local scopes for clarity
* pcre/pcre_compile.cpp:
(compile_branch):
(calculateCompiledPatternLengthAndFlags):
* pcre/pcre_exec.cpp:
(match):
* pcre/pcre_internal.h:
(getChar):
(getCharAndAdvance):
(getCharAndLength):
(getCharAndAdvanceIfSurrogate):
2007-11-28 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Comment cleanup
* pcre/pcre_exec.cpp:
(match):
2007-11-26 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Further cleanups to calculateCompiledPatternLengthAndFlags
* pcre/pcre_compile.cpp:
(calculateCompiledPatternLengthAndFlags):
* pcre/pcre_internal.h:
2007-11-26 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Give consistent naming to the RegExp options/compile flags
* pcre/pcre_compile.cpp:
(compile_branch):
(is_anchored):
(find_firstassertedchar):
(printCompiledRegExp):
(jsRegExpCompile):
* pcre/pcre_exec.cpp:
(jsRegExpExecute):
* pcre/pcre_internal.h:
2007-11-26 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Pull first_byte and req_byte optimizations out into separate static funtions, SunSpider reported this as a win.
* pcre/pcre_exec.cpp:
(tryFirstByteOptimization):
(tryRequiredByteOptimization):
(jsRegExpExecute):
* pcre/pcre_internal.h:
2007-11-26 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
give PCRE_MULTILINE a better name: OptionMatchAcrossMultipleLines
* pcre/pcre_compile.cpp:
(compile_branch):
(is_anchored):
(printCompiledRegExp):
(jsRegExpCompile):
* pcre/pcre_exec.cpp:
(jsRegExpExecute):
* pcre/pcre_internal.h:
2007-11-26 Eric Seidel <eric@webkit.org>
Reviewed by Oliver.
Deprecate jsRegExpExecute's offset-vector fallback code
* pcre/pcre_exec.cpp:
(jsRegExpExecute):
2007-11-26 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Make cur_is_word and prev_is_word locals, and change OP_ANY to OP_ANY_CHAR for clarity
* pcre/pcre_compile.cpp:
(find_fixedlength):
(compile_branch):
(canApplyFirstCharOptimization):
* pcre/pcre_exec.cpp:
(match):
* pcre/pcre_internal.h:
2007-11-26 Eric Seidel <eric@webkit.org>
Reviewed by Mitz & Maciej.
Change _NC operators to use _IGNORING_CASE for clarity
* pcre/pcre_compile.cpp:
(find_fixedlength):
(compile_branch):
(find_firstassertedchar):
* pcre/pcre_exec.cpp:
(match):
* pcre/pcre_internal.h:
2007-11-26 Eric Seidel <eric@webkit.org>
Reviewed by Mitz.
Remove branch from return
* pcre/pcre_compile.cpp:
(compile_branch):
* pcre/pcre_exec.cpp:
(match):
2007-11-26 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Add repeatInformationFromInstructionOffset inline
* pcre/pcre_exec.cpp:
(repeatInformationFromInstructionOffset):
(match):
2007-11-26 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Remove no longer used error code JSRegExpErrorMatchLimit
* kjs/regexp.cpp:
(KJS::RegExp::match):
* pcre/pcre.h:
* pcre/pcre_internal.h:
2007-11-26 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Make i locally scoped for better code clarity
* pcre/pcre_exec.cpp:
(match):
2007-11-26 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Give subjectPtr and instructionPtr sane names, reduce size of MatchFrame for a 0.2% speedup.
* pcre/pcre_compile.cpp:
(compile_branch):
(calculateCompiledPatternLengthAndFlags):
* pcre/pcre_exec.cpp:
(match_ref):
(MatchStack::pushNewFrame):
(getUTF8CharAndIncrementLength):
(match):
* pcre/pcre_internal.h:
(getChar):
(getCharAndAdvance):
(getCharAndLength):
(getCharAndAdvanceIfSurrogate):
* pcre/pcre_xclass.cpp:
(getUTF8CharAndAdvancePointer):
2007-11-26 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Small speedup (0.7%) by simplifying canUseStackBufferForNextFrame() check
* pcre/pcre_exec.cpp:
(MatchStack::MatchStack):
(MatchStack::popCurrentFrame):
2007-11-25 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Lower MATCH_LIMIT_RECURSION to more sane levels to prevent hangs on run-javascriptcore-tests
* pcre/pcre_internal.h:
2007-11-25 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Remove match_is_group variable for another 5% speedup
* pcre/pcre_compile.cpp:
* pcre/pcre_exec.cpp:
(startNewGroup):
(match):
2007-11-28 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Abstract frame variables into locals and args
* pcre/pcre_compile.cpp:
(compile_branch):
* pcre/pcre_exec.cpp:
(match):
* pcre/pcre_internal.h:
2007-11-28 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Section off MatchData arguments into args struct
* pcre/pcre_exec.cpp:
(MatchStack::pushNewFrame):
(match):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Remove redundant eptrblock struct
* pcre/pcre_exec.cpp:
(MatchStack::pushNewFrame):
(match):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Remove redundant match_call_count and move recursion check out of super-hot code path
SunSpider says this is at least an 8% speedup for regexp.
* pcre/pcre_exec.cpp:
(MatchStack::MatchStack):
(MatchStack::pushNewFrame):
(MatchStack::popCurrentFrame):
(MatchStack::popAllFrames):
(match):
(jsRegExpExecute):
* pcre/pcre_internal.h:
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Get rid of GETCHAR* macros, replacing them with better named inlines
* pcre/pcre_compile.cpp:
(compile_branch):
(calculateCompiledPatternLengthAndFlags):
* pcre/pcre_exec.cpp:
(match):
* pcre/pcre_internal.h:
(getCharAndAdvance):
(getCharAndLength):
(getCharAndAdvanceIfSurrogate):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Further cleanup GET/PUT inlines
* pcre/pcre_internal.h:
(putOpcodeValueAtOffset):
(getOpcodeValueAtOffset):
(putOpcodeValueAtOffsetAndAdvance):
(put2ByteOpcodeValueAtOffset):
(get2ByteOpcodeValueAtOffset):
(put2ByteOpcodeValueAtOffsetAndAdvance):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Give GET, PUT better names, and add (poor) moveOpcodePtrPastAnyAlternateBranches
* pcre/pcre_compile.cpp:
(firstSignificantOpCodeSkippingAssertions):
(find_fixedlength):
(complete_callout):
(compile_branch):
(compile_regex):
(is_anchored):
(canApplyFirstCharOptimization):
(find_firstassertedchar):
* pcre/pcre_exec.cpp:
(match):
* pcre/pcre_internal.h:
(putOpcodeValueAtOffset):
(getOpcodeValueAtOffset):
(putOpcodeValueAtOffsetAndAdvance):
(put2ByteOpcodeValueAtOffset):
(get2ByteOpcodeValueAtOffset):
(moveOpcodePtrPastAnyAlternateBranches):
* pcre/pcre_ucp_searchfuncs.cpp:
(_pcre_ucp_othercase):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Add inlines for toLowerCase, isWordChar, isSpaceChar for further regexp speedup
* pcre/pcre_compile.cpp:
(compile_branch):
(jsRegExpCompile):
* pcre/pcre_exec.cpp:
(match):
(jsRegExpExecute):
* pcre/pcre_internal.h:
(toLowerCase):
(flipCase):
(classBitmapForChar):
(charTypeForChar):
(isWordChar):
(isSpaceChar):
(CompileData::CompileData):
* pcre/pcre_xclass.cpp:
(_pcre_xclass):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
cleanup _pcre_ucp_othercase
* pcre/pcre_ucp_searchfuncs.cpp:
(_pcre_ucp_othercase):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Use better variable names for case ignoring options
* pcre/pcre_compile.cpp:
(compile_branch):
(find_firstassertedchar):
(printCompiledRegExp):
(jsRegExpCompile):
* pcre/pcre_exec.cpp:
(match_ref):
(match):
(jsRegExpExecute):
* pcre/pcre_internal.h:
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
split first_significant_code into two simpler functions
* pcre/pcre_compile.cpp:
(firstSignificantOpCode):
(firstSignificantOpCodeSkippingAssertions):
(is_anchored):
(canApplyFirstCharOptimization):
(find_firstassertedchar):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
clean up is_counted_repeat
* pcre/pcre_compile.cpp:
(is_counted_repeat):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
clean up check_escape
* pcre/pcre_compile.cpp:
(check_escape):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Reformat find_fixedlength
* pcre/pcre_compile.cpp:
(find_fixedlength):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
reformat is_anchored
* pcre/pcre_compile.cpp:
(is_anchored):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Remove unused function could_be_empty_branch
* pcre/pcre_compile.cpp:
(first_significant_code):
(find_fixedlength):
(compile_branch):
(canApplyFirstCharOptimization):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Pass around MatchData objects by reference
* pcre/pcre_exec.cpp:
(pchars):
(match_ref):
(match):
(jsRegExpExecute):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
give PCRE_STARTLINE a better name and rename match_data to MatchData
* pcre/pcre_compile.cpp:
(compile_branch):
(canApplyFirstCharOptimization):
(find_firstassertedchar):
(printCompiledRegExp):
(jsRegExpCompile):
* pcre/pcre_exec.cpp:
(pchars):
(jsRegExpExecute):
* pcre/pcre_internal.h:
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Clean up find_firstassertedchar
* pcre/pcre_compile.cpp:
(get_othercase_range):
(find_firstassertedchar):
(calculateCompiledPatternLengthAndFlags):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Tim Hatcher.
Pass around CompileData& instead of CompileData*
* pcre/pcre_compile.cpp:
(compile_branch):
(jsRegExpCompile):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Clean up compile_branch, move _pcre_ord2utf8, and rename CompileData
* JavaScriptCore.xcodeproj/project.pbxproj:
* pcre/pcre_compile.cpp:
(_pcre_ord2utf8):
(calculateCompiledPatternLengthAndFlags):
(jsRegExpCompile):
* pcre/pcre_internal.h:
* pcre/pcre_ord2utf8.cpp: Removed.
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
removing more macros
* pcre/pcre_compile.cpp:
(could_be_empty_branch):
(compile_branch):
(calculateCompiledPatternLengthAndFlags):
* pcre/pcre_exec.cpp:
(match):
(jsRegExpExecute):
* pcre/pcre_internal.h:
* pcre/pcre_xclass.cpp:
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
clean up formating in compile_branch
* pcre/pcre_compile.cpp:
(compile_branch):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Fix spacing for read_repeat_counts
* pcre/pcre_compile.cpp:
(read_repeat_counts):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Get rid of PCRE custom char types
* pcre/pcre_compile.cpp:
(check_escape):
(complete_callout):
(compile_branch):
(compile_regex):
(calculateCompiledPatternLengthAndFlags):
(jsRegExpCompile):
* pcre/pcre_exec.cpp:
(match_ref):
(match):
(jsRegExpExecute):
* pcre/pcre_internal.h:
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
reformat get_othercase_range
* pcre/pcre_compile.cpp:
(get_othercase_range):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Remove register keyword and more cleanup
* pcre/pcre_compile.cpp:
(find_fixedlength):
(compile_branch):
(is_anchored):
(is_startline):
(find_firstassertedchar):
(calculateCompiledPatternLengthAndFlags):
(jsRegExpCompile):
* pcre/pcre_exec.cpp:
(MatchStack::canUseStackBufferForNextFrame):
(MatchStack::allocateNextFrame):
(MatchStack::pushNewFrame):
(MatchStack::frameIsStackAllocated):
(MatchStack::popCurrentFrame):
(MatchStack::unrollAnyHeapAllocatedFrames):
(getUTF8CharAndIncrementLength):
(match):
(jsRegExpExecute):
* pcre/pcre_internal.h:
(PUT2INC):
(isLeadingSurrogate):
(isTrailingSurrogate):
(decodeSurrogatePair):
(getChar):
* pcre/pcre_ord2utf8.cpp:
(_pcre_ord2utf8):
* pcre/pcre_xclass.cpp:
(getUTF8CharAndAdvancePointer):
(_pcre_xclass):
2007-11-24 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Clean up jsRegExpExecute
* pcre/pcre_compile.cpp:
(returnError):
(jsRegExpCompile):
* pcre/pcre_exec.cpp:
(jsRegExpExecute):
* pcre/pcre_internal.h:
2007-11-29 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff.
Merging updated system alloc and spinlock code from r38 of TCMalloc.
This is needed as a precursor to the merge of TCMalloc proper.
* wtf/FastMalloc.cpp:
(WTF::TCMalloc_PageHeap::GrowHeap):
* wtf/TCSpinLock.h:
(TCMalloc_SpinLock::TCMalloc_SpinLock):
(TCMalloc_SpinLock::):
(TCMalloc_SpinLock::Lock):
(TCMalloc_SpinLock::Unlock):
(TCMalloc_SpinLock::IsHeld):
* wtf/TCSystemAlloc.cpp:
(TrySbrk):
(TryMmap):
(TryVirtualAlloc):
(TryDevMem):
(TCMalloc_SystemAlloc):
* wtf/TCSystemAlloc.h:
2007-11-28 Brady Eidson <beidson@apple.com>
Reviewed by Geoff
Add copyKeysToVector utility, mirroring copyValuesToVector
Also change the copyValuesToVector implementation to be a little more attractive
* wtf/HashMap.h:
(WTF::copyKeysToVector):
(WTF::copyValuesToVector):
2007-11-27 Alp Toker <alp@atoker.com>
Reviewed by Mark Rowe.
Add a list of public JavaScriptCore headers for installation.
This follows the convention used for the Qt and GTK+ header lists.
* headers.pri: Added.
2007-11-27 Alp Toker <alp@atoker.com>
Prospective MSVC build fix.
Roll back dllexport/dllimport support for now.
* API/JSBase.h:
2007-11-27 Alp Toker <alp@atoker.com>
Reviewed by Maciej.
http://bugs.webkit.org/show_bug.cgi?id=15569
[gtk] GTK JavaScriptCore needs to export symbols for JSC API and WTF
Introduce JS_EXPORT to mark symbols to be exported as public API.
Export all public symbols in the JavaScriptCore C API.
This matches conventions for exporting symbols set by the CF and CG
frameworks.
* API/JSBase.h:
* API/JSContextRef.h:
* API/JSObjectRef.h:
* API/JSStringRef.h:
* API/JSStringRefBSTR.h:
* API/JSStringRefCF.h:
* API/JSValueRef.h:
2007-11-27 Anders Carlsson <andersca@apple.com>
Reviewed by Adam.
Make PropertyNameArray and ScopeChain COMEnumVariant friendly.
* kjs/PropertyNameArray.cpp:
(KJS::PropertyNameArray::swap):
Implement PropertyNameArray::swap.
* kjs/PropertyNameArray.h:
Add ValueType typedef. Replace PropertyNameArrayIterator with
PropertyNameArray::const_iterator.
* kjs/nodes.cpp:
(KJS::ForInNode::execute):
* kjs/scope_chain.cpp:
(KJS::ScopeChain::print):
Update for changes to PropertyNameArray.
* kjs/scope_chain.h:
Add const_iterator and ValueType typedef.
2007-11-27 Anders Carlsson <andersca@apple.com>
Reviewed by Darin.
Add a ValueType typedef.
* wtf/Vector.h:
2007-11-26 Darin Adler <darin@apple.com>
Reviewed by Mitz.
- fix http://bugs.webkit.org/show_bug.cgi?id=16096
REGRESSION (r26653-r26699): Plaxo.com addressbook does not load in webkit nightlies
Test: fast/js/regexp-overflow.html
* pcre/pcre_compile.cpp: (calculateCompiledPatternLengthAndFlags):
Removed a stray "ptr++" that I added by accident when merging the
changes between PCRE 6.4 and 6.5.
2007-11-26 Geoffrey Garen <ggaren@apple.com>
Reviewed by Kevin McCullough.
Fixed <rdar://problem/5597937> REGRESSION (r27126): Drosera does not
show variables (can't enumerate ActivationImp properties)
Implemented a custom ActivationImp::getPropertyNames, since
ActivationImp now uses a custom property storage mechanism for local
variables.
* kjs/function.cpp:
(KJS::ActivationImp::getPropertyNames):
* kjs/function.h:
2007-11-26 Alp Toker <alp@atoker.com>
GTK+/Qt/Wx build fix for breakage introduced in r28039.
* ForwardingHeaders/JavaScriptCore/JSRetainPtr.h: Added.
2007-11-24 Laszlo Gombos <laszlo.gombos@gmail.com>
Reviewed by Maciej Stachowiak.
Fix minor compiler warning (GCC 4.1.3)
* pcre/pcre_internal.h:
* pcre/pcre_ucp_searchfuncs.cpp:
(_pcre_ucp_othercase):
2007-11-25 Mark Rowe <mrowe@apple.com>
Reviewed by Dan Bernstein.
Fix http://bugs.webkit.org/show_bug.cgi?id=16129
Bug 16129: REGRESSION (r27761-r27811): malloc error while visiting http://mysit.es (crashes release build)
* pcre/pcre_compile.cpp: Change errorcode to be passed by reference so that any error code is propagated
to our caller like they expect.
2007-11-23 Kevin Ollivier <kevino@theolliviers.com>
MSVC7 build fix. (rand_s doesn't exist there)
Reviewed by Adam Roben.
* kjs/config.h:
* wtf/MathExtras.h:
2007-11-23 Kevin Ollivier <kevino@theolliviers.com>
wx build fix. Move WX_PYTHON logic into project build settings,
add WebKitLibraries dirs on Win, and explicitly include JSCore
headers in testkjs rather than getting them from a template.
(Include dir order of JSCore/WTF and ICU headers is important due
to wtf/unicode/utf8.h.)
* jscore.bkl:
2007-11-23 Simon Hausmann <hausmann@webkit.org>
Reviewed by George Staikos <staikos@kde.org>.
Fix make (dist)clean on Windows.
OBJECTS_DIR_WTR does not exist anymore, use GENERATED_SOURCES_DIR.
* JavaScriptCore.pri:
* pcre/pcre.pri:
2007-11-22 Simon Hausmann <hausmann@kde.org>
Reviewed by George.
Make the directory of where to put the generated sources configurable through the GENERATED_SOURCE_DIR variable
* JavaScriptCore.pri:
* pcre/pcre.pri:
2007-11-22 Simon Hausmann <hausmann@kde.org>
Reviewed by George.
Centralize the setup for all the extra compilers in a addExtraCompiler function.
This allows adding a "generated_files" target that builds all generated files using "make generated_files".
For the build inside Qt we do not generate actual rules for the extra compilers but instead
do the variable substitution of compiler.output manually and add the generated sources to SOURCES.
* JavaScriptCore.pri:
* pcre/pcre.pri:
2007-11-20 Mark Rowe <mrowe@apple.com>
Reviewed by Tim Hatcher.
<rdar://problem/5602936> Need to resolve new GCC 4.2 warnings
Fix all warnings emitted by GCC 4.2 when building JavaScriptCore. This allows builds with
-Werror to succeed. At present they will crash when executed due to code that is not safe
under strict aliasing (<rdar://problem/5536806>).
* Configurations/Base.xcconfig: Remove the -Wno-long-double flag.
* kjs/date_object.cpp:
(KJS::formatTime): Test whether the stack-allocated string is empty rather than at a non-null address.
* kjs/dtoa.cpp:
(Bigint::): Tweak formatting to silence warnings.
* pcre/pcre_exec.cpp:
(match): Tweak formatting to silence warnings
* wtf/Assertions.cpp: Add printf format attribute to functions that warrant it.
* wtf/Assertions.h: Ditto.
2007-11-19 Kevin Ollivier <kevino@theolliviers.com>
wx port build fix (wx headers include ctype functions).
* kjs/config.h:
2007-11-19 Kevin Ollivier <kevino@theolliviers.com>
Remove outdated and unused Windows port files.
Reviewed by Adam Roben.
* Makefile.vc: Removed.
* README-Win32.txt: Removed.
2007-11-18 Eric Seidel <eric@webkit.org>
Reviewed by Oliver.
* tests/mozilla/jsDriver.pl: exit non-0 when user aborts test run
2007-11-17 Mark Rowe <mrowe@apple.com>
Reviewed by Darin Adler.
Fix: <rdar://problem/5607032> REGRESSION: testapi exits with assertion failure in debug build
<rdar://problem/5440659> JSGlobalContextCreate throws away globalObjectClass's prototype
http://bugs.webkit.org/show_bug.cgi?id=16033
Split Interpreter's initialization into two distinct steps: the creation of the global prototypes
and constructors, and storing them on the global object. This allows JSClassRef's passed to
JSGlobalContextCreate to be instantiated with the correct prototype.
* API/JSCallbackObject.cpp: Assert at compile-time that the custom global object will fit in a collector cell.
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(KJS::::JSCallbackObject):
(KJS::::init):
* API/JSContextRef.cpp:
(JSGlobalContextCreate): Construct and set the interpreter's global object separately. When globalObjectClass
is passed we need to set the interpreter's global object before doing the JSCallbackObject's initialization to
prevent any JSObjectInitializeCallback's being invoked before a global object is set.
* API/testapi.c:
(globalObject_initialize): Test the object passed in is correct and that it has the expected global properties.
(globalObject_get):
(globalObject_set):
(main):
* API/testapi.js: Test that any static properties exposed by the global object's custom class are found.
* JavaScriptCore.exp:
* bindings/testbindings.cpp:
(main): Update for changes in Interpreter method signatures.
* bindings/testbindings.mm:
(main): Ditto.
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState):
(KJS::ExecState::mark):
(KJS::ExecState::setGlobalObject):
* kjs/ExecState.h: Rename scope to m_scopeChain.
* kjs/interpreter.cpp:
(KJS::Interpreter::Interpreter):
(KJS::Interpreter::init):
(KJS::Interpreter::globalObject):
(KJS::Interpreter::setGlobalObject):
(KJS::Interpreter::resetGlobalObjectProperties):
(KJS::Interpreter::createObjectsForGlobalObjectProperties):
(KJS::Interpreter::setGlobalObjectProperties): Switch to using putDirect to ensure that the global object's put method
cannot interfere with setting of the global properties. This prevents a user-written JSClassRef from attempting to
call back into JavaScript from the initialization of the global object's members.
* kjs/interpreter.h:
* kjs/testkjs.cpp:
(setupInterpreter): Update for changes in Interpreter method signatures.
2007-11-17 Mark Rowe <mrowe@apple.com>
Reviewed by Sam Weinig.
Prevent testapi from reporting false leaks. Clear out local variables pointing at
JSObjectRefs to allow their values to be collected.
* API/testapi.c:
(main):
2007-11-17 Mark Rowe <mrowe@apple.com>
Reviewed by Sam Weinig.
Prevent testapi from crashing if testapi.js can not be found by nil-checking the result of createStringWithContentsOfFile.
* API/testapi.c:
(main):
2007-11-17 Alp Toker <alp@atoker.com>
Reviewed by Eric.
http://bugs.webkit.org/show_bug.cgi?id=16032
JS minidom is not portable
Use a plain UTF-8 string instead of a CFString.
Print to stdout, not stderr like CFShow() would have done, since that
behaviour seems unintentional.
* API/minidom.c:
(main):
2007-11-17 Steve Falkenburg <sfalken@apple.com>
Windows build fix.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2007-11-16 Mark Rowe <mrowe@apple.com>
Windows build fix.
* kjs/lexer.cpp:
(KJS::Lexer::record8):
2007-11-16 Mark Rowe <mrowe@apple.com>
Reviewed by Eric.
Replace strings, identifier, buffer8 and buffer16 members of Lexer with vectors.
SunSpider claims this is a 0.7% speedup.
* kjs/lexer.cpp:
(KJS::Lexer::Lexer):
(KJS::Lexer::lex):
(KJS::Lexer::record8):
(KJS::Lexer::record16):
(KJS::Lexer::scanRegExp):
(KJS::Lexer::clear):
(KJS::Lexer::makeIdentifier):
(KJS::Lexer::makeUString):
* kjs/lexer.h:
* kjs/ustring.cpp:
(KJS::UString::UString): Add a convenience constructor that takes a const Vector<UChar>&.
* kjs/ustring.h:
2007-11-16 Adam Roben <aroben@apple.com>
Windows build fix
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Add a new include path
and ignore the int -> bool conversion warning.
2007-11-16 Alexey Proskuryakov <ap@webkit.org>
Fix Windows debug build.
Rubber-stamped by Eric
* pcre/pcre_exec.cpp: (match): Removed ASSERT_NOT_REACHED assertions that were making MSVC
complain about unreachable code.
2007-11-15 Mark Rowe <mrowe@apple.com>
Gtk build fix.
* kjs/Parser.cpp:
2007-11-15 Mark Rowe <mrowe@apple.com>
Mac build and header search path sanity fix.
Reviewed by Sam Weinig and Tim Hatcher.
Move base setting for HEADER_SEARCH_PATHS into Base.xcconfig, and extend
it in JavaScriptCore.xcconfig. This removes the need to override it on a
per-target basis inside the .xcodeproj file.
* Configurations/Base.xcconfig:
* Configurations/JavaScriptCore.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj:
2007-11-15 Mark Rowe <mrowe@apple.com>
Qt build fix.
* kjs/Parser.h:
2007-11-15 Geoffrey Garen <ggaren@apple.com>
Reviewed by Eric Seidel.
Another round of grammar / parsing cleanup.
1. Created distinct parser calls for parsing function bodies vs
programs. This will help later with optimizing global variable access.
2. Turned Parser into a singleton. Cleaned up Lexer's singleton
interface.
3. Modified Lexer to free a little more memory when done lexing. (Added
FIXMEs for similar issues that I didn't fix.)
4. Changed Lexer::makeIdentifier and Lexer::makeUString to start
respecting the arguments passed to them. (No behavior change, but this
problem could have caused serious problems for an unsuspecting user of
these functions.)
5. Removed KJS_DEBUG_MEM because it was bit-rotted.
6. Removed Parser::prettyPrint because the same work was simpler to do
at the call site.
7. Some renames:
"Parser::accept" => "Parser::didFinishParsing"
"Parser::sid" => "Parser::m_sourceID"
"Lexer::doneParsing" => "Lexer::clear"
"sid" => "sourceId"
"lineno" => "lineNo"
* JavaScriptCore.exp:
* kjs/Parser.cpp:
(KJS::Parser::Parser):
(KJS::Parser::parseProgram):
(KJS::Parser::parseFunctionBody):
(KJS::Parser::parse):
(KJS::Parser::didFinishParsing):
(KJS::parser):
* kjs/Parser.h:
(KJS::Parser::sourceId):
* kjs/function.cpp:
(KJS::GlobalFuncImp::callAsFunction):
* kjs/function_object.cpp:
(FunctionObjectImp::construct):
* kjs/grammar.y:
* kjs/interpreter.cpp:
(KJS::Interpreter::checkSyntax):
(KJS::Interpreter::evaluate):
* kjs/interpreter.h:
* kjs/lexer.cpp:
(kjsyylex):
(KJS::lexer):
(KJS::Lexer::Lexer):
(KJS::Lexer::~Lexer):
(KJS::Lexer::scanRegExp):
(KJS::Lexer::doneParsing):
(KJS::Lexer::makeIdentifier):
(KJS::Lexer::makeUString):
* kjs/lexer.h:
(KJS::Lexer::pattern):
(KJS::Lexer::flags):
(KJS::Lexer::sawError):
* kjs/nodes.cpp:
(KJS::Node::Node):
(KJS::FunctionBodyNode::FunctionBodyNode):
* kjs/nodes.h:
* kjs/testkjs.cpp:
(prettyPrintScript):
(kjsmain):
* kjs/ustring.cpp:
* kjs/ustring.h:
2007-11-15 Oliver Hunt <oliver@apple.com>
Reviewed by Darin.
<rdar://problem/5601548> REGRESSION: All SourceElements and their children leak after a syntax error
Add a stub node to maintain the Vector of SourceElements until assignment.
* kjs/grammar.y:
* kjs/nodes.h:
(KJS::SourceElementsStub::SourceElementsStub):
(KJS::SourceElementsStub::append):
(KJS::SourceElementsStub::release):
(KJS::SourceElementsStub::):
(KJS::SourceElementsStub::precedence):
2007-11-15 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Abstract most of RMATCH into MatchStack functions.
SunSpider claims this, combined with the last 2 patches was a 1% speedup, 10% for dna-regexp.
* pcre/pcre_exec.cpp:
(MatchStack::canUseStackBufferForNextFrame):
(MatchStack::allocateNextFrame):
(MatchStack::pushNewFrame):
(MatchStack::frameIsStackAllocated):
(MatchStack::popCurrentFrame):
(MatchStack::unrollAnyHeapAllocatedFrames):
(match):
2007-11-15 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Remove RETURN_ERROR, add MatchStack
* pcre/pcre_exec.cpp:
(MatchStack::MatchStack):
(MatchStack::unrollAnyHeapAllocatedFrames):
(matchError):
(match):
2007-11-15 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Clean up match function to match WebKit style
* JavaScriptCore.xcodeproj/project.pbxproj:
* pcre/pcre_exec.cpp:
(match):
2007-11-15 Steve Falkenburg <sfalken@apple.com>
Windows build fix.
* JavaScriptCore.vcproj/JavaScriptCore.make:
2007-11-14 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
http://bugs.webkit.org/show_bug.cgi?id=15982
Improve JSString UTF-8 decoding
* API/JSStringRef.cpp:
(JSStringCreateWithUTF8CString): Use strict decoding, return 0 on error.
* wtf/unicode/UTF8.cpp:
(WTF::Unicode::convertUTF16ToUTF8):
(WTF::Unicode::convertUTF8ToUTF16):
* wtf/unicode/UTF8.h:
Made these function names start with a lower case letter.
* kjs/ustring.cpp: (KJS::UString::UTF8String): Updated for the above renaming.
* bindings/c/c_utility.cpp:
(KJS::Bindings::convertUTF8ToUTF16WithLatin1Fallback): Renamed to highlight the difference
from convertUTF8ToUTF16 in wtf/unicode.
(KJS::Bindings::convertNPStringToUTF16): Updated for the above renaming.
(KJS::Bindings::identifierFromNPIdentifier): Ditto.
* bindings/c/c_utility.h: Made convertUTF8ToUTF16WithLatin1Fallback() a file static.
2007-11-14 Sam Weinig <sam@webkit.org>
Rubber-stamped by Anders.
Fix the Xcode project file after it was messed up in r27402.
* JavaScriptCore.xcodeproj/project.pbxproj:
2007-11-14 Eric Seidel <eric@webkit.org>
Reviewed by Oliver.
More PCRE style cleanup.
* pcre/pcre_compile.cpp:
(compile_regex):
2007-11-14 Adam Roben <aroben@apple.com>
Clean up the bison conflict checking script
Reviewed by Geoff.
* DerivedSources.make:
2007-11-14 Eric Seidel <eric@webkit.org>
Reviewed by Geoff.
Another round of PCRE cleanups: inlines
SunSpider claims that this, combined with my previous PCRE cleanup were a 0.7% speedup, go figure.
* pcre/pcre_compile.cpp:
(jsRegExpCompile):
* pcre/pcre_exec.cpp:
(match):
(jsRegExpExecute):
* pcre/pcre_internal.h:
(PUT):
(GET):
(PUT2):
(GET2):
(isNewline):
2007-11-14 Eric Seidel <eric@webkit.org>
Reviewed by Sam.
Give PCRE a (small) bath.
Fix some formating and break things off into separate functions
http://bugs.webkit.org/show_bug.cgi?id=15993
* pcre/pcre_compile.cpp:
(calculateCompiledPatternLengthAndFlags):
(printCompiledRegExp):
(returnError):
(jsRegExpCompile):
* pcre/pcre_internal.h:
(compile_data::compile_data):
2007-11-14 Geoffrey Garen <ggaren@apple.com>
Reviewed by Eric Seidel.
Cleaned up the JavaScript grammar a bit.
1. Changed BlockNode to always hold a child vector (which may be empty),
eliminating a few NULL-check branches in the common execution case.
2. Changed the Block production to correctly report its starting and
ending line numbers to the debugger. (It used to report its ending line
as its starting line.) Also, removed duplicate line-reporting code
inside the BlockNode constructor.
3. Moved curly braces up from FunctionBody production into parent
productions. (I had to move the line number reporting code, too, since
it depends on the location of the curly braces.) This matches the ECMA
spec more closely, and makes some future changes I plan easier.
4. Fixed statementList* convenience functions to deal appropriately with
empty Vectors.
SunSpider reports a small and statistically insignificant speedup.
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::statementListPushFIFO):
(KJS::statementListGetDeclarations):
(KJS::statementListInitializeDeclarationStack):
(KJS::statementListInitializeVariableAccessStack):
(KJS::BlockNode::BlockNode):
(KJS::BlockNode::optimizeVariableAccess):
(KJS::BlockNode::getDeclarations):
(KJS::BlockNode::execute):
(KJS::FunctionBodyNode::initializeDeclarationStacks):
(KJS::FunctionBodyNode::optimizeVariableAccess):
2007-11-13 Anders Carlsson <andersca@apple.com>
Add RefCounted.h (And remove Shared.h)
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
2007-11-13 Geoffrey Garen <ggaren@apple.com>
Build fix.
* kjs/regexp.h:
2007-11-13 Geoffrey Garen <ggaren@apple.com>
Reviewed by Anders Carlsson.
Renamed Shared to RefCounted.
* API/JSClassRef.h:
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/interpreter.h:
* kjs/regexp.h:
* wtf/RefCounted.h: Copied from JavaScriptCore/wtf/Shared.h.
(WTF::RefCounted::RefCounted):
* wtf/Shared.h: Removed.
2007-11-13 Adam Roben <aroben@apple.com>
Build fix
Reviewed by Geoff.
* kjs/regexp.h: Added a missing #include.
2007-11-13 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Moved Shared.h into wtf so it could be used in more places. Deployed
Shared in places where JSCore previously had hand-rolled ref-counting
classes.
* API/JSClassRef.cpp:
(OpaqueJSClass::OpaqueJSClass):
* API/JSClassRef.h:
* API/JSObjectRef.cpp:
(JSClassRetain):
(JSClassRelease):
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/interpreter.cpp:
(KJS::Interpreter::init):
* kjs/interpreter.h:
* kjs/regexp.cpp:
(KJS::RegExp::RegExp):
* kjs/regexp.h:
* wtf/Shared.h: Copied from WebCore/platform/Shared.h.
2007-11-13 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Add an ASSERT to getTruncatedInt32 to enforce proper usage.
Best part about this patch? It doesn't break the web!
* kjs/JSImmediate.h:
(KJS::JSImmediate::getTruncatedInt32):
(KJS::JSImmediate::toDouble):
(KJS::JSImmediate::getUInt32):
2007-11-13 Alexey Proskuryakov <ap@webkit.org>
Windows build fix.
* bindings/c/c_utility.cpp:
(KJS::Bindings::convertUTF8ToUTF16):
* kjs/ustring.cpp:
(KJS::UString::UTF8String):
* wtf/unicode/UTF8.cpp:
(WTF::Unicode::ConvertUTF8ToUTF16):
2007-11-13 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- fix http://bugs.webkit.org/show_bug.cgi?id=11231
RegExp bug when handling newline characters
and a number of other differences between PCRE behvior
and JavaScript regular expressions:
+ single-digit sequences like \4 should be treated as octal
character constants, unless there is a sufficient number
of brackets for them to be treated as backreferences
+ \8 turns into the character "8", not a binary zero character
followed by "8" (same for 9)
+ only the first 3 digits should be considered part of an
octal character constant (the old behavior was to decode
an arbitrarily long sequence and then mask with 0xFF)
+ if \x is followed by anything other than two valid hex digits,
then it should simply be treated a the letter "x"; that includes
not supporting the \x{41} syntax
+ if \u is followed by anything less than four valid hex digits,
then it should simply be treated a the letter "u"
+ an extra "+" should be a syntax error, rather than being treated
as the "possessive quantifier"
+ if a "]" character appears immediately after a "[" character that
starts a character class, then that's an empty character class,
rather than being the start of a character class that includes a
"]" character
+ a "$" should not match a terminating newline; we could have gotten
PCRE to handle this the way we wanted by passing an appropriate option
Test: fast/js/regexp-no-extensions.html
* pcre/pcre_compile.cpp:
(check_escape): Check backreferences against bracount to catch both
overflows and things that should be treated as octal. Rewrite octal
loop to not go on indefinitely. Rewrite both hex loops to match and
remove \x{} support.
(compile_branch): Restructure loops so that we don't special-case a "]"
at the beginning of a character class. Remove code that treated "+" as
the possessive quantifier.
(jsRegExpCompile): Change the "]" handling here too.
* pcre/pcre_exec.cpp: (match): Changed CIRC to match the DOLL implementation.
Changed DOLL to remove handling of "terminating newline", a Perl concept
which we don't need.
* tests/mozilla/expected.html: Two tests are fixed now:
ecma_3/RegExp/regress-100199.js and ecma_3/RegExp/regress-188206.js.
One test fails now: ecma_3/RegExp/perlstress-002.js -- our success before
was due to a bug (we treated all 1-character numeric escapes as backreferences).
The date tests also now both expect success -- whatever was making them fail
before was probably due to the time being close to a DST shift; maybe we need
to get rid of those tests.
2007-11-13 Darin Adler <darin@apple.com>
* kjs/JSImmediate.h: (KJS::JSImmediate::getTruncatedInt32):
Remove too-strong assert that was firing constantly and preventing even basic
web browsing from working in a debug build. This function is used in many
cases where the immediate value is not a number; the assertion could perhaps
be added back later with a bit of reorganization.
2007-11-13 Alp Toker <alp@atoker.com>
Build fix for breakage to non-Mac builds introduced in r27746.
* kjs/ustring.cpp:
2007-11-13 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Clean up evaluateToBoolean functions to use inlines instead of copy/paste code
* kjs/JSImmediate.h:
* kjs/nodes.cpp:
(KJS::GreaterNode::inlineEvaluateToBoolean):
(KJS::GreaterNode::evaluate):
(KJS::LessEqNode::inlineEvaluateToBoolean):
(KJS::LessEqNode::evaluate):
(KJS::GreaterEqNode::inlineEvaluateToBoolean):
(KJS::GreaterEqNode::evaluate):
(KJS::InNode::evaluateToBoolean):
(KJS::EqualNode::inlineEvaluateToBoolean):
(KJS::EqualNode::evaluate):
(KJS::NotEqualNode::inlineEvaluateToBoolean):
(KJS::NotEqualNode::evaluate):
(KJS::StrictEqualNode::inlineEvaluateToBoolean):
(KJS::StrictEqualNode::evaluate):
(KJS::NotStrictEqualNode::inlineEvaluateToBoolean):
(KJS::NotStrictEqualNode::evaluate):
* kjs/nodes.h:
2007-11-12 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Fixed http://bugs.webkit.org/show_bug.cgi?id=15958
base64 spends 1.1% of total time checking for special Infinity case
Use a fast character test instead of calling strncmp.
1.1% speedup on string-base64. SunSpider reports a .4% speedup overall;
Sharks reports only .1%. Who are you going to believe? Huh?
* kjs/ustring.cpp:
(KJS::UString::toDouble):
2007-11-12 Eric Seidel <eric@webkit.org>
Reviewed by Oliver.
Add evaluateToInt32 and evaluateUInt32 methods and deploy them.
Fix a few missing evaluateToBoolean methods
Deploy all evaluateTo* functions to more nodes to avoid slowdowns
http://bugs.webkit.org/show_bug.cgi?id=15950
SunSpider claims this is at least a 1.4% speedup.
* kjs/JSImmediate.h:
(KJS::JSImmediate::getTruncatedInt32):
(KJS::JSImmediate::toDouble):
(KJS::JSImmediate::getUInt32):
* kjs/nodes.cpp:
(KJS::ExpressionNode::evaluateToNumber):
(KJS::ExpressionNode::evaluateToInt32):
(KJS::ExpressionNode::evaluateToUInt32):
(KJS::NumberNode::evaluateToInt32):
(KJS::NumberNode::evaluateToUInt32):
(KJS::ImmediateNumberNode::evaluateToInt32):
(KJS::ImmediateNumberNode::evaluateToUInt32):
(KJS::ResolveNode::evaluate):
(KJS::ResolveNode::evaluateToNumber):
(KJS::ResolveNode::evaluateToBoolean):
(KJS::ResolveNode::evaluateToInt32):
(KJS::ResolveNode::evaluateToUInt32):
(KJS::LocalVarAccessNode::evaluateToInt32):
(KJS::LocalVarAccessNode::evaluateToUInt32):
(KJS::BracketAccessorNode::evaluateToNumber):
(KJS::BracketAccessorNode::evaluateToBoolean):
(KJS::BracketAccessorNode::evaluateToInt32):
(KJS::BracketAccessorNode::evaluateToUInt32):
(KJS::DotAccessorNode::inlineEvaluate):
(KJS::DotAccessorNode::evaluate):
(KJS::DotAccessorNode::evaluateToNumber):
(KJS::DotAccessorNode::evaluateToBoolean):
(KJS::DotAccessorNode::evaluateToInt32):
(KJS::DotAccessorNode::evaluateToUInt32):
(KJS::NewExprNode::inlineEvaluate):
(KJS::NewExprNode::evaluate):
(KJS::NewExprNode::evaluateToNumber):
(KJS::NewExprNode::evaluateToBoolean):
(KJS::NewExprNode::evaluateToInt32):
(KJS::NewExprNode::evaluateToUInt32):
(KJS::FunctionCallResolveNode::inlineEvaluate):
(KJS::FunctionCallResolveNode::evaluate):
(KJS::FunctionCallResolveNode::evaluateToNumber):
(KJS::FunctionCallResolveNode::evaluateToBoolean):
(KJS::FunctionCallResolveNode::evaluateToInt32):
(KJS::FunctionCallResolveNode::evaluateToUInt32):
(KJS::LocalVarFunctionCallNode::evaluate):
(KJS::LocalVarFunctionCallNode::evaluateToNumber):
(KJS::LocalVarFunctionCallNode::evaluateToBoolean):
(KJS::LocalVarFunctionCallNode::evaluateToInt32):
(KJS::LocalVarFunctionCallNode::evaluateToUInt32):
(KJS::FunctionCallDotNode::evaluate):
(KJS::FunctionCallDotNode::evaluateToNumber):
(KJS::FunctionCallDotNode::evaluateToBoolean):
(KJS::FunctionCallDotNode::evaluateToInt32):
(KJS::FunctionCallDotNode::evaluateToUInt32):
(KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
(KJS::PostDecLocalVarNode::evaluateToNumber):
(KJS::PostDecLocalVarNode::evaluateToBoolean):
(KJS::PostDecLocalVarNode::evaluateToInt32):
(KJS::PostDecLocalVarNode::evaluateToUInt32):
(KJS::typeStringForValue):
(KJS::UnaryPlusNode::evaluate):
(KJS::UnaryPlusNode::evaluateToBoolean):
(KJS::UnaryPlusNode::evaluateToNumber):
(KJS::UnaryPlusNode::evaluateToInt32):
(KJS::BitwiseNotNode::inlineEvaluateToInt32):
(KJS::BitwiseNotNode::evaluate):
(KJS::BitwiseNotNode::evaluateToNumber):
(KJS::BitwiseNotNode::evaluateToBoolean):
(KJS::BitwiseNotNode::evaluateToInt32):
(KJS::MultNode::evaluateToBoolean):
(KJS::MultNode::evaluateToInt32):
(KJS::MultNode::evaluateToUInt32):
(KJS::DivNode::evaluateToInt32):
(KJS::DivNode::evaluateToUInt32):
(KJS::ModNode::evaluateToBoolean):
(KJS::ModNode::evaluateToInt32):
(KJS::ModNode::evaluateToUInt32):
(KJS::AddNode::evaluateToNumber):
(KJS::AddNode::evaluateToInt32):
(KJS::AddNode::evaluateToUInt32):
(KJS::AddNumbersNode::evaluateToInt32):
(KJS::AddNumbersNode::evaluateToUInt32):
(KJS::SubNode::evaluateToInt32):
(KJS::SubNode::evaluateToUInt32):
(KJS::LeftShiftNode::inlineEvaluateToInt32):
(KJS::LeftShiftNode::evaluate):
(KJS::LeftShiftNode::evaluateToNumber):
(KJS::LeftShiftNode::evaluateToInt32):
(KJS::RightShiftNode::inlineEvaluateToInt32):
(KJS::RightShiftNode::evaluate):
(KJS::RightShiftNode::evaluateToNumber):
(KJS::RightShiftNode::evaluateToInt32):
(KJS::UnsignedRightShiftNode::inlineEvaluateToUInt32):
(KJS::UnsignedRightShiftNode::evaluate):
(KJS::UnsignedRightShiftNode::evaluateToNumber):
(KJS::UnsignedRightShiftNode::evaluateToInt32):
(KJS::LessNode::inlineEvaluateToBoolean):
(KJS::LessNode::evaluate):
(KJS::LessNode::evaluateToBoolean):
(KJS::LessNumbersNode::inlineEvaluateToBoolean):
(KJS::LessNumbersNode::evaluate):
(KJS::LessNumbersNode::evaluateToBoolean):
(KJS::LessStringsNode::inlineEvaluateToBoolean):
(KJS::LessStringsNode::evaluate):
(KJS::BitAndNode::evaluate):
(KJS::BitAndNode::inlineEvaluateToInt32):
(KJS::BitAndNode::evaluateToNumber):
(KJS::BitAndNode::evaluateToBoolean):
(KJS::BitAndNode::evaluateToInt32):
(KJS::BitXOrNode::inlineEvaluateToInt32):
(KJS::BitXOrNode::evaluate):
(KJS::BitXOrNode::evaluateToNumber):
(KJS::BitXOrNode::evaluateToBoolean):
(KJS::BitXOrNode::evaluateToInt32):
(KJS::BitOrNode::inlineEvaluateToInt32):
(KJS::BitOrNode::evaluate):
(KJS::BitOrNode::evaluateToNumber):
(KJS::BitOrNode::evaluateToBoolean):
(KJS::BitOrNode::evaluateToInt32):
(KJS::ConditionalNode::evaluateToNumber):
(KJS::ConditionalNode::evaluateToInt32):
(KJS::ConditionalNode::evaluateToUInt32):
(KJS::valueForReadModifyAssignment):
(KJS::AssignExprNode::evaluate):
(KJS::AssignExprNode::evaluateToBoolean):
(KJS::AssignExprNode::evaluateToNumber):
(KJS::AssignExprNode::evaluateToInt32):
(KJS::VarDeclNode::handleSlowCase):
* kjs/nodes.h:
(KJS::FunctionCallResolveNode::precedence):
(KJS::AddNode::precedence):
(KJS::AddNode::):
(KJS::LessNumbersNode::):
(KJS::LessStringsNode::):
* kjs/value.cpp:
(KJS::JSValue::toInt32SlowCase):
(KJS::JSValue::toUInt32SlowCase):
* kjs/value.h:
(KJS::JSValue::asCell):
(KJS::JSValue::toInt32):
(KJS::JSValue::toUInt32):
2007-11-12 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
http://bugs.webkit.org/show_bug.cgi?id=15953
Add UTF-8 encoding/decoding to WTF
* kjs/ustring.h: Moved UTF8SequenceLength() and decodeUTF8Sequence() to wtf/unicode.
* kjs/ustring.cpp: (KJS::UString::UTF8String): Changed this function to take a strict/lenient
parameter. Callers are not interested in getting decoding results in strict mode, so
this allows for bailing out as soon as an error is seen.
* kjs/function.cpp:
(KJS::encode): Updated for new UString::UTF8String() signature.
* API/JSStringRef.cpp:
(JSStringCreateWithCharacters): Disambiguate UChar.
(JSStringCreateWithUTF8CString): Actually use UTF-8 when creating the string!
* bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16): Use ConvertUTF8ToUTF16().
* wtf/unicode/UTF8.cpp: Added.
(WTF::Unicode::inlineUTF8SequenceLengthNonASCII):
(WTF::Unicode::inlineUTF8SequenceLength):
(WTF::Unicode::UTF8SequenceLength):
(WTF::Unicode::decodeUTF8Sequence):
(WTF::Unicode::):
(WTF::Unicode::ConvertUTF16ToUTF8):
(WTF::Unicode::isLegalUTF8):
(WTF::Unicode::ConvertUTF8ToUTF16):
* wtf/unicode/UTF8.h: Added.
(WTF::Unicode::):
Some code moved from ustring.h, some adapted from unicode.org sources.
* JavaScriptCore.exp:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
Added UTF8.{h,cpp}
2007-11-12 Josh Aas <joshmoz@gmail.com>
Reviewed by Darin.
- http://bugs.webkit.org/show_bug.cgi?id=15946
add NPPValue NPPVpluginDrawingModel (Mozilla bug 403418 compat)
* bindings/npapi.h:
2007-11-12 Darin Adler <darin@apple.com>
Reviewed by Sam.
- http://bugs.webkit.org/show_bug.cgi?id=15951
REGRESSION: assertion failure in regexp match() when running JS tests
Test: fast/js/regexp-many-brackets.html
* pcre/pcre_exec.cpp: (match): Added back accidentally-removed case for
the BRANUMBER opcode.
2007-11-12 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- fix use of prefix and config.h, got rid of a few unneeded things in
the PCRE code; no behavior changes
* API/JSBase.cpp: Added include of config.h.
* API/JSCallbackConstructor.cpp: Ditto.
* API/JSCallbackFunction.cpp: Ditto.
* API/JSCallbackObject.cpp: Ditto.
* API/JSClassRef.cpp: Ditto.
* API/JSContextRef.cpp: Ditto.
* API/JSObjectRef.cpp: Ditto.
* API/JSStringRef.cpp: Ditto.
* API/JSValueRef.cpp: Ditto.
* JavaScriptCorePrefix.h: Removed obsolete <ctype.h> workaround.
Moved new/delete macros after includes, as they are in WebCore's prefix.
Removed "config.h".
* pcre/dftables.cpp: (main): Changed back to not use a separate maketables
function. This is needed for PCRE, but not helpful for our use. Also changed
the tables to all be 128 entries long instead of 256, since only the first
128 are ever used.
* pcre/pcre_compile.cpp: Added include of config.h. Eliminated digitab,
which was only being used to check hex digits. Changed all uses of TRUE and
FALSE to use the C++ true and false instead.
(check_escape): Just the TRUE/FALSE thing.
(is_counted_repeat): Ditto.
(could_be_empty_branch): Ditto.
(get_othercase_range): Ditto.
(compile_branch): Ditto.
(compile_regex): Ditto.
(is_anchored): Ditto.
(is_startline): Ditto.
(find_firstassertedchar): Ditto.
(jsRegExpCompile): Ditto.
* pcre/pcre_exec.cpp: Added include of config.h. Changed all uses of TRUE and
FALSE to use the C++ true and false instead.
(match_ref): Just the TRUE/FALSE thing.
(match): Ditto. Removed some unneeded braces.
(jsRegExpExecute): Just the TRUE/FALSE thing.
* pcre/pcre_internal.h: Moved the constants needed by dftables.cpp to the top
of the file instead of the bottom, so they can be used. Also changed the table
sizes to 128 instead of 256. Removed macro definitions of FALSE and TRUE.
Set array sizes for all the const arrays. Changed _pcre_utf8_table1_size to
be a macro instead of a extern int.
* pcre/pcre_maketables.cpp: Removed. It's all in dftables.cpp now.
* pcre/pcre_tables.cpp: Made table sizes explicit.
* pcre/pcre_xclass.cpp: Just the TRUE/FALSE thing.
2007-11-12 Adam Roben <aroben@apple.com>
Build fix
* wtf/FastMalloc.h: Add missing using statement.
2007-11-11 Oliver Hunt <oliver@apple.com>
Reviewed by Darin.
Add special fastZeroedMalloc function to replace a
number of fastCalloc calls where one argument was 1.
This results in a 0.4% progression in SunSpider, more
than making up for the earlier regression caused by
additional overflow checks.
* JavaScriptCore.exp:
* kjs/array_instance.cpp:
* kjs/property_map.cpp:
* wtf/FastMalloc.cpp:
* wtf/FastMalloc.h:
* wtf/HashTable.h:
2007-11-11 Adam Roben <aroben@apple.com>
Fix <rdar://5578982> ASSERT in HashTable::checkTableConsistencyExceptSize beneath WebNotificationCenter
The bug was due to a mismatch between HashMap::remove and
HashTable::checkTableConsistency. HashMap::remove can delete the value
stored in the HashTable (by derefing it), which is not normally
allowed by HashTable. It's OK in this case because the value is about
to be removed from the table, but HashTable wasn't aware of this.
HashMap::remove now performs the consistency check itself before
derefing the value.
Darin noticed that the same bug would occur in HashSet, so I've fixed
it there as well.
Reviewed by Darin.
* wtf/HashMap.h:
(WTF::HashMap::remove): Perform the HashTable consistency check
manually before calling deref.
* wtf/HashSet.h:
(WTF::HashSet::remove): Ditto.
* wtf/HashTable.h: Made checkTableConsistency public so that HashMap
and HashSet can call it.
(WTF::HashTable::removeAndInvalidateWithoutEntryConsistencyCheck):
Added.
(WTF::HashTable::removeAndInvalidate): Added.
(WTF::HashTable::remove):
(WTF::HashTable::removeWithoutEntryConsistencyCheck): Added.
2007-11-11 Mark Rowe <mrowe@apple.com>
Build fix. Use the correct filename case.
* kjs/nodes.h:
2007-11-11 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Fixed http://bugs.webkit.org/show_bug.cgi?id=15902
15% of string-validate-input.js is spent compiling the same regular expression
Store a compiled representation of the regular expression in the AST.
Only a .2% SunSpider speedup overall, but a 10.6% speedup on
string-validate-input.js.
* kjs/nodes.cpp:
(KJS::RegExpNode::evaluate):
* kjs/nodes.h:
(KJS::RegExpNode::):
* kjs/nodes2string.cpp:
(KJS::RegExpNode::streamTo):
* kjs/regexp.cpp:
(KJS::RegExp::flags):
* kjs/regexp.h:
(KJS::RegExp::pattern):
* kjs/regexp_object.cpp:
(KJS::RegExpObjectImp::construct):
(KJS::RegExpObjectImp::createRegExpImp):
* kjs/regexp_object.h:
2007-11-11 Oliver Hunt <oliver@apple.com>
Reviewed by Eric.
Partial fix for <rdar://problem/5585334> numfuzz: integer overflows opening malformed SVG file in WebCore::ImageBuffer::create
Unfortunately this is a very slight regression, but is unavoidable.
* wtf/FastMalloc.cpp:
2007-11-10 Eric Seidel <eric@webkit.org>
Reviewed by darin.
Add simple type inferencing to the parser, and create custom
AddNode and LessNode subclasses based on inferred types.
http://bugs.webkit.org/show_bug.cgi?id=15884
SunSpider claims this is at least a 0.5% speedup.
* JavaScriptCore.exp:
* kjs/grammar.y:
* kjs/internal.cpp:
(KJS::NumberImp::getPrimitiveNumber):
(KJS::GetterSetterImp::getPrimitiveNumber):
* kjs/internal.h:
* kjs/lexer.cpp:
(KJS::Lexer::lex):
* kjs/nodes.cpp:
(KJS::Node::Node):
(KJS::StringNode::evaluate):
(KJS::StringNode::evaluateToNumber):
(KJS::StringNode::evaluateToBoolean):
(KJS::RegExpNode::evaluate):
(KJS::UnaryPlusNode::optimizeVariableAccess):
(KJS::AddNode::evaluate):
(KJS::AddNode::evaluateToNumber):
(KJS::AddNumbersNode::inlineEvaluateToNumber):
(KJS::AddNumbersNode::evaluate):
(KJS::AddNumbersNode::evaluateToNumber):
(KJS::AddStringsNode::evaluate):
(KJS::AddStringLeftNode::evaluate):
(KJS::AddStringRightNode::evaluate):
(KJS::lessThan):
(KJS::lessThanEq):
(KJS::LessNumbersNode::evaluate):
(KJS::LessStringsNode::evaluate):
* kjs/nodes.h:
(KJS::ExpressionNode::):
(KJS::RegExpNode::):
(KJS::RegExpNode::precedence):
(KJS::TypeOfResolveNode::):
(KJS::LocalVarTypeOfNode::):
(KJS::UnaryPlusNode::):
(KJS::UnaryPlusNode::precedence):
(KJS::AddNode::):
(KJS::AddNode::precedence):
(KJS::AddNumbersNode::):
(KJS::AddStringLeftNode::):
(KJS::AddStringRightNode::):
(KJS::AddStringsNode::):
(KJS::LessNode::):
(KJS::LessNode::precedence):
(KJS::LessNumbersNode::):
(KJS::LessStringsNode::):
* kjs/nodes2string.cpp:
(KJS::StringNode::streamTo):
* kjs/object.cpp:
* kjs/object.h:
* kjs/value.h:
(KJS::JSValue::getPrimitiveNumber):
2007-11-11 Darin Adler <darin@apple.com>
- try another way of fixing dftables builds -- refactor pcre_internal.h a bit
* pcre/pcre_internal.h: Make most of this header do nothing when DFTABLES is set.
Later we can break it into two files.
* JavaScriptCore.vcproj/dftables/dftables.vcproj: Take out now-unneeded include paths.
* pcre/dftables.cpp: Set DFTABLES. Use delete instead of free.
* pcre/dftables.pro: Take out now-unneeded include paths.
* pcre/pcre_maketables.cpp: Use new instead of malloc.
2007-11-11 Darin Adler <darin@apple.com>
* pcre/dftables.pro: Try fixing Qt builds (I looked at qt-win) by adding
another include path.
2007-11-11 Darin Adler <darin@apple.com>
* JavaScriptCore.xcodeproj/project.pbxproj: Try fixing Mac Tiger builds
by adding another include path.
2007-11-11 Darin Adler <darin@apple.com>
Reviewed by Sam.
- http://bugs.webkit.org/show_bug.cgi?id=15924
next round of changes to JSRegExp (formerly PCRE)
This is a combination of converting to C++, tweaking the API, and adding
some additional optimizations.
Future steps will involve getting rid of the use of UTF-8 completely
(we'll use UTF-16 exclusively instead), eliminating more source files,
and some more speed-ups.
SunSpider says the current round is an 0.9% speed-up overall, and a
5.3% speed-up for regexp.
* JavaScriptCore.exp: Updated for new entry points.
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.vcproj/dftables/dftables.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* jscore.bkl:
Updated for new source file names and ForwardingHeaders.
* kjs/regexp.cpp:
(KJS::RegExp::RegExp): Changed to use the error message without calling
strdup on it and to pass the new types and options.
(KJS::RegExp::~RegExp): Removed the now-unneeded free of the error message.
(KJS::RegExp::match): Pass the new types and options.
* kjs/regexp.h: Update type of m_constructionError.
* pcre/AUTHORS: Update to reflect the status of the project -- we don't include
the Google parts, and this isn't the PCRE library, per se.
* pcre/COPYING: Ditto.
* pcre/dftables.cpp: Copied from JavaScriptCore/pcre/dftables.c.
(main): Removed unneeded ctype_digit.
* pcre/pcre.h: Convert to C++, tweak API a bit. Use UChar instead of JSRegExpChar.
* pcre/pcre_compile.cpp: Copied from JavaScriptCore/pcre/pcre_compile.c.
Moved a lot of private stuff used only within this file here from pcre_internal.h.
Renumbered the error codes.
(error_text): Use a single string with embedded nulls for the error text (I got
this idea from newer versions of PCRE).
(check_escape): Changed return type to be enum instead of int. Replaced ctype_digit
uses with isASCIIDigit.
(is_counted_repeat): Ditto.
(read_repeat_counts): Ditto.
(first_significant_code): Ditto.
(find_fixedlength): Ditto.
(could_be_empty_branch): Ditto.
(compile_branch): Ditto. Also removed some code that handles changing options.
JavaScript doesn't have any of the features that allow options to change.
(compile_regex): Updated for change to options parameter.
(is_anchored): Ditto.
(find_firstassertedchar): Ditto.
(jsRegExpCompile): Changed to take separate flags instead of an options int.
Also changed to call new/delete instead of pcre_malloc/free.
(jsRegExpFree): Ditto.
* pcre/pcre_exec.cpp: Copied from JavaScriptCore/pcre/pcre_exec.c.
Added a case that uses computed goto for the opcode loop, but did not turn it on.
Changed the RMATCH macro to handle returns more efficiently by putting the where
pointer in the new frame instead of the old one, allowing us to branch to the
return with a single statement. Switched to new/delete from pcre_malloc/free.
Changed many RRETURN callers to not set the return value since it's already
set correctly. Replaced the rrc variable with an is_match variable. Values other
than "match" and "no match" are now handled differently. This allows us to remove
the code to check for those cases in various rules.
(match): All the case statements use a macro BEGIN_OPCODE instead. And all the
continue statements, or break statements that break out of the outer case use
a macro NEXT_OPCODE instead. Replaced a few if statements with assertions.
(jsRegExpExecute): Use new/delete instead of pcre_malloc/free. Removed unused
start_match field from the match block.
* pcre/pcre_internal.h: Moved the last few configuration macros from pcre-config.h
in here. Removed various unused types. Converted from JSRegExpChar to UChar.
Eliminated pcre_malloc/free. Replaced the opcode enum with a macro that can be
used in multiple places. Unfortunately we lose the comments for each opcode; we
should find a place to put those back. Removed ctype_digit.
* pcre/pcre_maketables.cpp: Copied from JavaScriptCore/pcre/pcre_maketables.c.
(pcre_maketables): Got rid of the conditional code that allows this to be compiled
in -- it's only used for dftables now (and soon may be obsolete entirely).
Changed code for cbit_digit to not use isdigit, and took the "_" case out of the
loop. Removed ctype_digit.
* pcre/pcre_ord2utf8.cpp: Copied from JavaScriptCore/pcre/pcre_ord2utf8.c.
* pcre/pcre_tables.cpp: Copied from JavaScriptCore/pcre/pcre_tables.c.
Moved _pcre_OP_lengths out of here into pcre_exec.cpp.
* pcre/pcre_ucp_searchfuncs.cpp: Copied from JavaScriptCore/pcre/pcre_ucp_searchfuncs.c.
Updated for other file name changes.
* pcre/pcre_xclass.cpp: Copied from JavaScriptCore/pcre/pcre_xclass.c.
* pcre/ucpinternal.h: Updated header.
* pcre/ucptable.cpp: Copied from JavaScriptCore/pcre/ucptable.c.
* wtf/ASCIICType.h: (WTF::isASCIIDigit): Removed a branch by changing from && to
& for this operation. Also added an overload that takes an int because that's
useful for PCRE. Later we could optimize for int and overload other functions in
this file; stuck to this simple one for now.
* wtf/unicode/icu/UnicodeIcu.h: Removed unused isUpper.
* wtf/unicode/qt4/UnicodeQt4.h: Ditto.
* pcre/LICENCE: Removed.
* pcre/pcre-config.h: Removed.
* wtf/FastMallocPCRE.cpp: Removed.
* pcre/dftables.c: Renamed to cpp.
* pcre/pcre_compile.c: Ditto.
* pcre/pcre_exec.c: Ditto.
* pcre/pcre_maketables.c: Ditto.
* pcre/pcre_ord2utf8.c: Ditto.
* pcre/pcre_tables.c: Ditto.
* pcre/pcre_ucp_searchfuncs.c: Ditto.
* pcre/pcre_xclass.c: Ditto.
* pcre/ucptable.c: Ditto.
2007-11-11 Eric Seidel <eric@webkit.org>
Reviewed by Oliver.
Add KJS_CHECKEXCEPTIONBOOLEAN to match rest of nodes.cpp
* kjs/nodes.cpp:
(KJS::ExpressionNode::evaluateToBoolean):
(KJS::LessNode::evaluateToBoolean):
(KJS::GreaterNode::evaluateToBoolean):
(KJS::LessEqNode::evaluateToBoolean):
(KJS::GreaterEqNode::evaluateToBoolean):
(KJS::InstanceOfNode::evaluateToBoolean):
(KJS::InNode::evaluateToBoolean):
(KJS::EqualNode::evaluateToBoolean):
(KJS::NotEqualNode::evaluateToBoolean):
(KJS::StrictEqualNode::evaluateToBoolean):
(KJS::NotStrictEqualNode::evaluateToBoolean):
(KJS::LogicalAndNode::evaluateToBoolean):
(KJS::LogicalOrNode::evaluateToBoolean):
(KJS::ConditionalNode::evaluateToBoolean):
2007-11-10 Darin Adler <darin@apple.com>
Reviewed by Sam.
- fix http://bugs.webkit.org/show_bug.cgi?id=15927
REGRESSION(r27487): delete a.c followed by __defineGetter__("c", ...) incorrectly deletes another property
and <rdar://problem/5586384> REGRESSION (r27487): Can't switch out of Edit HTML Source mode on Leopard Wiki
Test: fast/js/delete-then-put.html
* kjs/property_map.cpp:
(KJS::PropertyMap::put): Added a missing "- 1"; code to find an empty slot was not working.
(KJS::PropertyMap::checkConsistency): Added a missing range check that would have caught this
problem before.
- roll out a last-minute change to my evaluateToBoolean patch that was incorrect.
* kjs/nodes.h: (KJS::ExprStatementNode::ExprStatementNode): Take out call to
optimizeForUnnecessaryResult, since the result is used in some cases.
2007-11-10 Adam Roben <aroben@apple.com>
Windows build fix
Roll out some changes that were (seemingly accidentally) checked in
with r27664.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2007-11-10 Darin Adler <darin@apple.com>
Reviewed by Sam.
- http://bugs.webkit.org/show_bug.cgi?id=15915
add an evaluation path for booleans like the one we have for numbers
Gives 1.1% on SunSpider.
* kjs/grammar.y: Create TrueNode and FalseNode instead of BooleanNode.
* kjs/nodes.h: Changed to use Noncopyable. Moved optimizeForUnnecessaryResult
down from Node to ExpressionNode. Changed some classes to not inherit from
ExpressionNode where not necessary, and removed unnneeded evaluate functions
as well as evaluate functions that need not be virtual. Call the
optimizeForUnnecessaryResult function on the start of a for loop too.
* kjs/nodes.cpp:
(KJS::ExpressionNode::evaluateToBoolean): Added.
(KJS::FalseNode::evaluate): Added.
(KJS::TrueNode::evaluate): Added.
(KJS::NumberNode::evaluateToBoolean): Added.
(KJS::StringNode::evaluateToBoolean): Added.
(KJS::LocalVarAccessNode::evaluateToBoolean): Added.
(KJS::BracketAccessorNode::evaluateToBoolean): Added.
(KJS::LogicalNotNode::evaluate): Changed to call evaluateToBoolean.
(KJS::LogicalNotNode::evaluateToBoolean): Added.
(KJS::lessThan): Changed to return bool.
(KJS::lessThanEq): Ditto.
(KJS::LessNode::evaluate): Changed since lessThan returns bool.
(KJS::LessNode::evaluateToBoolean): Added.
(KJS::GreaterNode::evaluate): Changed since lessThanEq returns bool.
(KJS::GreaterNode::evaluateToBoolean): Added.
(KJS::LessEqNode::evaluate): Changed since lessThanEq returns bool.
(KJS::LessEqNode::evaluateToBoolean): Added.
(KJS::GreaterEqNode::evaluate): Changed since lessThan returns bool.
(KJS::GreaterEqNode::evaluateToBoolean): Added.
(KJS::InstanceOfNode::evaluateToBoolean): Added.
(KJS::InNode::evaluateToBoolean): Added.
(KJS::EqualNode::evaluateToBoolean): Added.
(KJS::NotEqualNode::evaluateToBoolean): Added.
(KJS::StrictEqualNode::evaluateToBoolean): Added.
(KJS::NotStrictEqualNode::evaluateToBoolean): Added.
(KJS::ConditionalNode::evaluate): Changed to call evaluateToBoolean.
(KJS::IfNode::execute): Ditto.
(KJS::DoWhileNode::execute): Ditto.
(KJS::WhileNode::execute): Ditto.
(KJS::ForNode::execute): Ditto.
* kjs/nodes2string.cpp:
(KJS::FalseNode::streamTo): Added.
(KJS::TrueNode::streamTo): Added.
2007-11-09 Adam Roben <aroben@apple.com>
Windows build fix
Reviewed by Darin.
* kjs/value.h:
(KJS::jsNumber): Add some explicit casts.
2007-11-08 Darin Adler <darin@apple.com>
- fix build
* kjs/grammar.y:
* kjs/nodes.h:
* kjs/property_map.cpp:
2007-11-08 Darin Adler <darin@apple.com>
- roll out accidentally-checked in changes
* kjs/nodes.cpp: Back to previous version.
* kjs/nodes.h: Ditto.
* kjs/grammar.y: Ditto.
2007-11-08 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15912
fasta spends a lot of time in qsort
* kjs/property_map.cpp:
(KJS::PropertyMap::getEnumerablePropertyNames):
Use insertion sort instead of qsort for small sets of property names.
We can probably do some even-better speedups of for/in, but this nets
0.6% overall and 6.7% on fasta.
2007-11-08 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15906
getting characters by indexing into a string is very slow
This fixes one source of the slowness -- the conversion to an unused
Identifier as we call the get function from the slot -- but doesn't
fix others, such as the fact that we have to allocate a new UString::Rep
for every single character.
Speeds up string-base64 30%, and at least 0.5% overall.
But does slow down access-fannkuch quite a bit. Might be worth
revisiting in the future to see what we can do about that (although
I did look at a profile for a while).
* kjs/property_slot.h: Add a new marker for "numeric" property slots;
slots where we don't need to pass the identifier to the get function.
(KJS::PropertySlot::getValue): Added code to call the numeric get function.
(KJS::PropertySlot::setCustomNumeric): Added.
* kjs/string_object.cpp:
(KJS::StringInstance::indexGetter): Changed to use substr() instead
of constructing a wholly new UString each time.
(KJS::stringInstanceNumericPropertyGetter): Added. Like indexGetter, but
takes advantage of setCustomNumeric to avoid creating an Identifier.
(KJS::StringInstance::getOwnPropertySlot): Changed to use setCustomNumeric.
2007-11-08 Darin Adler <darin@apple.com>
Reviewed by Oliver.
- http://bugs.webkit.org/show_bug.cgi?id=15904
more speed-ups possible by tightening up int version of JSImmediate
1% improvement of SunSpider
* kjs/JSImmediate.h: Eliminate the now-unneeded FPBitValues struct template.
(KJS::JSImmediate::from): Overload for most numeric types; many types can
do fewer branches and checks.
(KJS::JSImmediate::getUInt32): Removed unneeded check for undefined.
(KJS::JSImmediate::getTruncatedInt32): Ditto.
(KJS::JSImmediate::getTruncatedUInt32): Ditto. There's no difference any more
between getUInt32 and getTruncatedUInt32, so that's worth a rename and merge later.
* kjs/grammar.y: Update since fromDouble is now just from.
* kjs/nodes.h: Ditto.
* kjs/value.h: (KJS::jsNumber): Overload for most numeric types.
2007-11-08 Kevin Ollivier <kevino@theolliviers.com>
Bakefiles for building JavaScriptCore, needed by wx port.
Reviewed by Mark Rowe.
* JavaScriptCoreSources.bkl: Added.
* jscore.bkl: Added.
2007-11-08 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Fix regression caused by earlier bitwise and optimisation. 1 & undefined != 1.
The implementation of JSImmediate::areBothImmediateNumbers relies on
(JSImmediate::getTag(immediate1) & JSImmediate::getTag(immediate2)) having
a unique result when both immediate values are numbers.
The regression was due to UndefinedType & NumberType returning NumberType (3 & 1).
By swapping the value of NumberType and UndefinedType this ceases to be a problem.
* kjs/JSType.h:
2007-11-08 Darin Adler <darin@apple.com>
- fix build
* kjs/nodes.h: Add missing parameter name.
2007-11-08 Eric Seidel <eric@webkit.org>
Reviewed by darin.
Add ExpressionNode subclass of Node, use it.
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::ForInNode::ForInNode):
* kjs/nodes.h:
(KJS::ExpressionNode::):
(KJS::NullNode::):
(KJS::NullNode::precedence):
(KJS::BooleanNode::):
(KJS::BooleanNode::precedence):
(KJS::RegExpNode::):
(KJS::RegExpNode::precedence):
(KJS::ThisNode::):
(KJS::ThisNode::precedence):
(KJS::ResolveNode::):
(KJS::ElementNode::):
(KJS::ArrayNode::):
(KJS::PropertyNode::):
(KJS::PropertyNode::precedence):
(KJS::PropertyNode::name):
(KJS::PropertyListNode::):
(KJS::ObjectLiteralNode::):
(KJS::ObjectLiteralNode::precedence):
(KJS::BracketAccessorNode::):
(KJS::DotAccessorNode::):
(KJS::DotAccessorNode::precedence):
(KJS::ArgumentListNode::):
(KJS::ArgumentsNode::):
(KJS::NewExprNode::):
(KJS::NewExprNode::precedence):
(KJS::FunctionCallValueNode::):
(KJS::FunctionCallValueNode::precedence):
(KJS::FunctionCallResolveNode::):
(KJS::FunctionCallBracketNode::):
(KJS::FunctionCallBracketNode::precedence):
(KJS::FunctionCallDotNode::):
(KJS::FunctionCallDotNode::precedence):
(KJS::PrePostResolveNode::):
(KJS::PostfixBracketNode::):
(KJS::PostfixBracketNode::precedence):
(KJS::PostIncBracketNode::):
(KJS::PostIncBracketNode::isIncrement):
(KJS::PostDecBracketNode::):
(KJS::PostDecBracketNode::isIncrement):
(KJS::PostfixDotNode::):
(KJS::PostfixDotNode::precedence):
(KJS::PostIncDotNode::):
(KJS::PostIncDotNode::isIncrement):
(KJS::PostDecDotNode::):
(KJS::PostDecDotNode::isIncrement):
(KJS::PostfixErrorNode::):
(KJS::PostfixErrorNode::precedence):
(KJS::DeleteResolveNode::):
(KJS::DeleteBracketNode::):
(KJS::DeleteBracketNode::precedence):
(KJS::DeleteDotNode::):
(KJS::DeleteDotNode::precedence):
(KJS::DeleteValueNode::):
(KJS::DeleteValueNode::precedence):
(KJS::VoidNode::):
(KJS::VoidNode::precedence):
(KJS::TypeOfResolveNode::):
(KJS::TypeOfValueNode::):
(KJS::PrefixBracketNode::):
(KJS::PrefixBracketNode::precedence):
(KJS::PreIncBracketNode::):
(KJS::PreIncBracketNode::isIncrement):
(KJS::PreDecBracketNode::):
(KJS::PreDecBracketNode::isIncrement):
(KJS::PrefixDotNode::):
(KJS::PrefixDotNode::precedence):
(KJS::PreIncDotNode::):
(KJS::PreIncDotNode::isIncrement):
(KJS::PreDecDotNode::):
(KJS::PreDecDotNode::isIncrement):
(KJS::PrefixErrorNode::):
(KJS::PrefixErrorNode::precedence):
(KJS::UnaryPlusNode::):
(KJS::UnaryPlusNode::precedence):
(KJS::NegateNode::):
(KJS::NegateNode::precedence):
(KJS::BitwiseNotNode::):
(KJS::BitwiseNotNode::precedence):
(KJS::LogicalNotNode::):
(KJS::LogicalNotNode::precedence):
(KJS::AddNode::):
(KJS::AddNode::precedence):
(KJS::LeftShiftNode::):
(KJS::LeftShiftNode::precedence):
(KJS::RightShiftNode::):
(KJS::RightShiftNode::precedence):
(KJS::UnsignedRightShiftNode::):
(KJS::UnsignedRightShiftNode::precedence):
(KJS::LessNode::):
(KJS::LessNode::precedence):
(KJS::GreaterNode::):
(KJS::GreaterNode::precedence):
(KJS::LessEqNode::):
(KJS::LessEqNode::precedence):
(KJS::GreaterEqNode::):
(KJS::GreaterEqNode::precedence):
(KJS::InstanceOfNode::):
(KJS::InstanceOfNode::precedence):
(KJS::InNode::):
(KJS::InNode::precedence):
(KJS::EqualNode::):
(KJS::EqualNode::precedence):
(KJS::NotEqualNode::):
(KJS::NotEqualNode::precedence):
(KJS::StrictEqualNode::):
(KJS::StrictEqualNode::precedence):
(KJS::NotStrictEqualNode::):
(KJS::NotStrictEqualNode::precedence):
(KJS::BitAndNode::):
(KJS::BitAndNode::precedence):
(KJS::BitOrNode::):
(KJS::BitOrNode::precedence):
(KJS::BitXOrNode::):
(KJS::BitXOrNode::precedence):
(KJS::LogicalAndNode::):
(KJS::LogicalAndNode::precedence):
(KJS::LogicalOrNode::):
(KJS::LogicalOrNode::precedence):
(KJS::ConditionalNode::):
(KJS::ConditionalNode::precedence):
(KJS::ReadModifyResolveNode::):
(KJS::ReadModifyResolveNode::precedence):
(KJS::AssignResolveNode::):
(KJS::AssignResolveNode::precedence):
(KJS::ReadModifyBracketNode::):
(KJS::ReadModifyBracketNode::precedence):
(KJS::AssignBracketNode::):
(KJS::AssignBracketNode::precedence):
(KJS::AssignDotNode::):
(KJS::AssignDotNode::precedence):
(KJS::ReadModifyDotNode::):
(KJS::ReadModifyDotNode::precedence):
(KJS::AssignErrorNode::):
(KJS::AssignErrorNode::precedence):
(KJS::CommaNode::):
(KJS::CommaNode::precedence):
(KJS::AssignExprNode::):
(KJS::AssignExprNode::precedence):
(KJS::ExprStatementNode::):
(KJS::IfNode::):
(KJS::DoWhileNode::):
(KJS::WhileNode::):
(KJS::ReturnNode::):
(KJS::WithNode::):
(KJS::ThrowNode::):
(KJS::ParameterNode::):
(KJS::CaseClauseNode::):
(KJS::CaseClauseNode::precedence):
(KJS::ClauseListNode::):
(KJS::SwitchNode::):
2007-11-08 Oliver Hunt <oliver@apple.com>
Reviewed by Sam.
Add a fast path for bitwise-and of two immediate numbers for a 0.7% improvement in SunSpider (4% bitop improvement).
This only improves bitwise-and performance, as the additional logic required
for similar code paths on or, xor, and shifting requires additional operations
and branches that negate (and in certain cases, regress) any advantage we might
otherwise receive.
This improves performance on all bitop tests, the cryptography tests, as well as
the string-base64 and string-unpack-code tests. No significant degradation on
any other tests.
* kjs/JSImmediate.h:
(KJS::JSImmediate::areBothImmediateNumbers):
(KJS::JSImmediate::andImmediateNumbers):
* kjs/nodes.cpp:
(KJS::BitAndNode::evaluate):
* kjs/value.h:
(KJS::jsNumberFromAnd):
2007-11-08 Adam Roben <aroben@apple.com>
Stop using KJS inside of MathExtras.h
Reviewed by Darin.
* wtf/MathExtras.h: Removed an unused header, and a now-unused
forward-declaration.
(wtf_atan2): Use std::numeric_limits intead of KJS.
2007-11-08 Sam Weinig <sam@webkit.org>
Windows build fix.
* kjs/date_object.cpp:
(KJS::DateProtoFuncToLocaleString::callAsFunction): Fix unused arg warning.
(KJS::DateProtoFuncToLocaleDateString::callAsFunction): ditto
(KJS::DateProtoFuncToLocaleTimeString::callAsFunction): ditto
2007-11-08 Mark Rowe <mrowe@apple.com>
Gtk build fix.
* kjs/lookup.h: Add missing include.
2007-11-08 Sam Weinig <sam@webkit.org>
Reviewed by Darin.
Convert JavaScript internal function objects to use one class per
function. This avoids a switch statement inside what used to be
the shared function classes and will allow Shark to better analyze
the code.
To make this switch, the value property of the HashEntry was changed
to a union of an intptr_t (which is used to continue handle valueGetters)
and function pointer which points to a static constructor for the
individual new function objects.
SunSpider claims this is a 1.0% speedup.
* kjs/array_object.cpp:
(KJS::ArrayPrototype::getOwnPropertySlot):
(KJS::getProperty):
(KJS::ArrayProtoFuncToString::callAsFunction):
(KJS::ArrayProtoFuncToLocaleString::callAsFunction):
(KJS::ArrayProtoFuncJoin::callAsFunction):
(KJS::ArrayProtoFuncConcat::callAsFunction):
(KJS::ArrayProtoFuncPop::callAsFunction):
(KJS::ArrayProtoFuncPush::callAsFunction):
(KJS::ArrayProtoFuncReverse::callAsFunction):
(KJS::ArrayProtoFuncShift::callAsFunction):
(KJS::ArrayProtoFuncSlice::callAsFunction):
(KJS::ArrayProtoFuncSort::callAsFunction):
(KJS::ArrayProtoFuncSplice::callAsFunction):
(KJS::ArrayProtoFuncUnShift::callAsFunction):
(KJS::ArrayProtoFuncFilter::callAsFunction):
(KJS::ArrayProtoFuncMap::callAsFunction):
(KJS::ArrayProtoFuncEvery::callAsFunction):
(KJS::ArrayProtoFuncForEach::callAsFunction):
(KJS::ArrayProtoFuncSome::callAsFunction):
(KJS::ArrayProtoFuncIndexOf::callAsFunction):
(KJS::ArrayProtoFuncLastIndexOf::callAsFunction):
* kjs/array_object.h:
(KJS::ArrayPrototype::classInfo):
* kjs/create_hash_table:
* kjs/date_object.cpp:
(KJS::DatePrototype::getOwnPropertySlot):
(KJS::DateProtoFuncToString::callAsFunction):
(KJS::DateProtoFuncToUTCString::callAsFunction):
(KJS::DateProtoFuncToDateString::callAsFunction):
(KJS::DateProtoFuncToTimeString::callAsFunction):
(KJS::DateProtoFuncToLocaleString::callAsFunction):
(KJS::DateProtoFuncToLocaleDateString::callAsFunction):
(KJS::DateProtoFuncToLocaleTimeString::callAsFunction):
(KJS::DateProtoFuncValueOf::callAsFunction):
(KJS::DateProtoFuncGetTime::callAsFunction):
(KJS::DateProtoFuncGetFullYear::callAsFunction):
(KJS::DateProtoFuncGetUTCFullYear::callAsFunction):
(KJS::DateProtoFuncToGMTString::callAsFunction):
(KJS::DateProtoFuncGetMonth::callAsFunction):
(KJS::DateProtoFuncGetUTCMonth::callAsFunction):
(KJS::DateProtoFuncGetDate::callAsFunction):
(KJS::DateProtoFuncGetUTCDate::callAsFunction):
(KJS::DateProtoFuncGetDay::callAsFunction):
(KJS::DateProtoFuncGetUTCDay::callAsFunction):
(KJS::DateProtoFuncGetHours::callAsFunction):
(KJS::DateProtoFuncGetUTCHours::callAsFunction):
(KJS::DateProtoFuncGetMinutes::callAsFunction):
(KJS::DateProtoFuncGetUTCMinutes::callAsFunction):
(KJS::DateProtoFuncGetSeconds::callAsFunction):
(KJS::DateProtoFuncGetUTCSeconds::callAsFunction):
(KJS::DateProtoFuncGetMilliSeconds::callAsFunction):
(KJS::DateProtoFuncGetUTCMilliseconds::callAsFunction):
(KJS::DateProtoFuncGetTimezoneOffset::callAsFunction):
(KJS::DateProtoFuncSetTime::callAsFunction):
(KJS::DateProtoFuncSetMilliSeconds::callAsFunction):
(KJS::DateProtoFuncSetUTCMilliseconds::callAsFunction):
(KJS::DateProtoFuncSetSeconds::callAsFunction):
(KJS::DateProtoFuncSetUTCSeconds::callAsFunction):
(KJS::DateProtoFuncSetMinutes::callAsFunction):
(KJS::DateProtoFuncSetUTCMinutes::callAsFunction):
(KJS::DateProtoFuncSetHours::callAsFunction):
(KJS::DateProtoFuncSetUTCHours::callAsFunction):
(KJS::DateProtoFuncSetDate::callAsFunction):
(KJS::DateProtoFuncSetUTCDate::callAsFunction):
(KJS::DateProtoFuncSetMonth::callAsFunction):
(KJS::DateProtoFuncSetUTCMonth::callAsFunction):
(KJS::DateProtoFuncSetFullYear::callAsFunction):
(KJS::DateProtoFuncSetUTCFullYear::callAsFunction):
(KJS::DateProtoFuncSetYear::callAsFunction):
(KJS::DateProtoFuncGetYear::callAsFunction):
* kjs/date_object.h:
* kjs/lookup.cpp:
(KJS::Lookup::find):
* kjs/lookup.h:
(KJS::HashEntry::):
(KJS::staticFunctionGetter):
(KJS::staticValueGetter):
(KJS::getStaticPropertySlot):
(KJS::getStaticFunctionSlot):
(KJS::lookupPut):
* kjs/math_object.cpp:
(KJS::MathObjectImp::getOwnPropertySlot):
(KJS::MathProtoFuncAbs::callAsFunction):
(KJS::MathProtoFuncACos::callAsFunction):
(KJS::MathProtoFuncASin::callAsFunction):
(KJS::MathProtoFuncATan::callAsFunction):
(KJS::MathProtoFuncATan2::callAsFunction):
(KJS::MathProtoFuncCeil::callAsFunction):
(KJS::MathProtoFuncCos::callAsFunction):
(KJS::MathProtoFuncExp::callAsFunction):
(KJS::MathProtoFuncFloor::callAsFunction):
(KJS::MathProtoFuncLog::callAsFunction):
(KJS::MathProtoFuncMax::callAsFunction):
(KJS::MathProtoFuncMin::callAsFunction):
(KJS::MathProtoFuncPow::callAsFunction):
(KJS::MathProtoFuncRandom::callAsFunction):
(KJS::MathProtoFuncRound::callAsFunction):
(KJS::MathProtoFuncSin::callAsFunction):
(KJS::MathProtoFuncSqrt::callAsFunction):
(KJS::MathProtoFuncTan::callAsFunction):
* kjs/math_object.h:
(KJS::MathObjectImp::classInfo):
(KJS::MathObjectImp::):
* kjs/string_object.cpp:
(KJS::StringPrototype::getOwnPropertySlot):
(KJS::StringProtoFuncToString::callAsFunction):
(KJS::StringProtoFuncValueOf::callAsFunction):
(KJS::StringProtoFuncCharAt::callAsFunction):
(KJS::StringProtoFuncCharCodeAt::callAsFunction):
(KJS::StringProtoFuncConcat::callAsFunction):
(KJS::StringProtoFuncIndexOf::callAsFunction):
(KJS::StringProtoFuncLastIndexOf::callAsFunction):
(KJS::StringProtoFuncMatch::callAsFunction):
(KJS::StringProtoFuncSearch::callAsFunction):
(KJS::StringProtoFuncReplace::callAsFunction):
(KJS::StringProtoFuncSlice::callAsFunction):
(KJS::StringProtoFuncSplit::callAsFunction):
(KJS::StringProtoFuncSubstr::callAsFunction):
(KJS::StringProtoFuncSubstring::callAsFunction):
(KJS::StringProtoFuncToLowerCase::callAsFunction):
(KJS::StringProtoFuncToUpperCase::callAsFunction):
(KJS::StringProtoFuncToLocaleLowerCase::callAsFunction):
(KJS::StringProtoFuncToLocaleUpperCase::callAsFunction):
(KJS::StringProtoFuncLocaleCompare::callAsFunction):
(KJS::StringProtoFuncBig::callAsFunction):
(KJS::StringProtoFuncSmall::callAsFunction):
(KJS::StringProtoFuncBlink::callAsFunction):
(KJS::StringProtoFuncBold::callAsFunction):
(KJS::StringProtoFuncFixed::callAsFunction):
(KJS::StringProtoFuncItalics::callAsFunction):
(KJS::StringProtoFuncStrike::callAsFunction):
(KJS::StringProtoFuncSub::callAsFunction):
(KJS::StringProtoFuncSup::callAsFunction):
(KJS::StringProtoFuncFontcolor::callAsFunction):
(KJS::StringProtoFuncFontsize::callAsFunction):
(KJS::StringProtoFuncAnchor::callAsFunction):
(KJS::StringProtoFuncLink::callAsFunction):
* kjs/string_object.h:
2007-11-08 Adam Roben <aroben@apple.com>
Windows build fix
Reviewed by Sam and Ada.
* wtf/MathExtras.h: Get rid of a circular #include dependency to fix
the build.
2007-11-08 Adam Roben <aroben@apple.com>
Fix a precedence warning on Windows
* kjs/JSImmediate.h:
(KJS::JSImmediate::toBoolean):
2007-11-08 Mark Rowe <mrowe@apple.com>
Build fix for JavaScriptGlue.
* wtf/MathExtras.h: Include stdlib.h for srand and RAND_MAX.
2007-11-08 Darin Adler <darin@apple.com>
- Windows build fix
* kjs/JSImmediate.h: Include MathExtras.h rather than math.h since this file uses "signbit".
2007-11-08 Oliver Hunt <oliver@apple.com>
Reviewed by Darin.
Replace the use of floats for immediate values with the use of integers for a 4.5% improvement in SunSpider.
Unfortunately this change results in NaN, +Inf, -Inf, and -0 being heap allocated now, but
we should now have faster array access, faster immediate to double conversion, and the
potential to further improve bitwise operators in future.
This also removes the need for unions to avoid strict aliasing problems when extracting
a value from immediates.
* kjs/JSImmediate.h:
(KJS::JSImmediate::trueImmediate):
(KJS::JSImmediate::falseImmediate):
(KJS::JSImmediate::undefinedImmediate):
(KJS::JSImmediate::nullImmediate):
(KJS::JSImmediate::toBoolean):
* kjs/value.h:
(KJS::jsNaN):
2007-11-07 Eric Seidel <eric@webkit.org>
Reviewed by Darin and Oliver.
Add evaluateToNumber parallel evaluation tree to speed up number operations.
Make ImmediateNumberNode a subclass of NumberNode.
Share evaluate logic between evaluate and evaluateToNumber using inline functions
There is still a lot of improvement to be made here.
SunSpider claims this is a 1.0% speedup overall (nbody 7.9%), base64 slowing 2.0%
Given the huge win that this prepares us for with simple type inferencing I see the small
regression in base64 being worth the substantial overall improvement.
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::Node::evaluateToNumber):
(KJS::NumberNode::evaluate):
(KJS::NumberNode::evaluateToNumber):
(KJS::StringNode::evaluateToNumber):
(KJS::LocalVarAccessNode::inlineEvaluate):
(KJS::LocalVarAccessNode::evaluate):
(KJS::LocalVarAccessNode::evaluateToNumber):
(KJS::BracketAccessorNode::inlineEvaluate):
(KJS::BracketAccessorNode::evaluate):
(KJS::BracketAccessorNode::evaluateToNumber):
(KJS::NegateNode::evaluate):
(KJS::NegateNode::evaluateToNumber):
(KJS::MultNode::inlineEvaluateToNumber):
(KJS::MultNode::evaluate):
(KJS::MultNode::evaluateToNumber):
(KJS::DivNode::inlineEvaluateToNumber):
(KJS::DivNode::evaluate):
(KJS::DivNode::evaluateToNumber):
(KJS::ModNode::inlineEvaluateToNumber):
(KJS::ModNode::evaluate):
(KJS::ModNode::evaluateToNumber):
(KJS::throwOutOfMemoryErrorToNumber):
(KJS::addSlowCaseToNumber):
(KJS::add):
(KJS::addToNumber):
(KJS::AddNode::evaluateToNumber):
(KJS::SubNode::inlineEvaluateToNumber):
(KJS::SubNode::evaluate):
(KJS::SubNode::evaluateToNumber):
(KJS::valueForReadModifyAssignment):
(KJS::ReadModifyLocalVarNode::evaluate):
(KJS::ReadModifyResolveNode::evaluate):
(KJS::ReadModifyDotNode::evaluate):
(KJS::ReadModifyBracketNode::evaluate):
* kjs/nodes.h:
(KJS::Node::):
(KJS::NumberNode::):
(KJS::ImmediateNumberNode::):
(KJS::AddNode::precedence):
* kjs/nodes2string.cpp:
(KJS::NumberNode::streamTo):
2007-11-07 Mark Rowe <mrowe@apple.com>
Reviewed by Eric.
Fix up initialization after being mangled in r27572, and remove the
ternary expression as extraCost will always be zero for the numeric
heap.
* kjs/collector.cpp:
(KJS::Collector::heapAllocate):
2007-11-07 Mark Rowe <mrowe@apple.com>
Gtk build fix.
* kjs/regexp_object.cpp:
2007-11-07 Geoffrey Garen <ggaren@apple.com>
Reviewed by Beth Dakin.
Eliminated a bogus (though compiled-out) branch in the collector.
* kjs/collector.cpp:
(KJS::Collector::heapAllocate):
2007-11-06 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Fixed part of http://bugs.webkit.org/show_bug.cgi?id=15861
5.8% of string-validate-input.js is spent creating RegExpImps
Put RegExpImp properties into a static hashtable to avoid a slew of
PropertyMap churn when creating a RegExpImp.
Factored important bits of regular expression implementation out of
RegExpImp (the JS object) and into RegExp (the PCRE wrapper class),
making RegExp a ref-counted class. (This will help later.)
Removed PCRE_POSIX support because I didn't quite know how to test it
and keep it working with these changes.
1.1% SunSpider speedup. 5.8% speedup on string-validate-input.js.
* kjs/regexp.h: A few interface changes:
1. Renamed "subpatterns()" => "numSubpatterns()"
2. Made flag enumeration private and replaced it with public getters for
specific flags.
3. Made RegExp ref-counted so RegExps can be shared by RegExpImps.
4. Made RegExp take a string of flags instead of an int, eliminating
duplicated flag parsing code elsewhere.
* kjs/regexp_object.cpp:
(KJS::RegExpProtoFunc::callAsFunction): For RegExp.compile:
- Fixed a bug where compile(undefined) would throw an exception.
- Removed some now-redundant code.
- Used RegExp sharing to eliminate an allocation and a bunch of
PropertyMap thrash. (Not a big win since compile is a deprecated
function. I mainly did this to test the plubming.)
2007-11-07 Simon Hausmann <hausmann@kde.org>
Reviewed by nobody, Qt/Windows build fix.
JavaScriptCore.pri expects OBJECTS_DIR to be set, so set it in
testkjs.pro, too, where it's included from.
* kjs/testkjs.pro:
2007-11-07 Simon Hausmann <shausman@trolltech.com>
Reviewed by Lars.
Fix "nmake clean" for the Qt/Windows build by replacing tmp/ with a variable that ends with the correct type of slash/backslash depending on the choice of compiler/make tool.
* JavaScriptCore.pri:
* pcre/pcre.pri:
2007-11-07 Lars Knoll <lars@trolltech.com>
Reviewed by Simon.
fix umemcasecmp
Pretty embarrassing bug. Has the potential to fix quite a few test failures.
* wtf/unicode/qt4/UnicodeQt4.h:
(WTF::Unicode::umemcasecmp):
2007-11-06 Maciej Stachowiak <mjs@apple.com>
Reviewed by Eric.
- only collect when the heap is full, unless we have lots of extra cost garbage
1.1% SunSpider speedup.
This shouldn't hit memory use much since the extra space in those
blocks hangs around either way.
* kjs/collector.cpp:
(KJS::Collector::heapAllocate):
(KJS::Collector::collect): Fix logic error that reversed the sense of collect's
return value.
2007-11-06 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Avoid unnecessarily boxing the result from post inc/decrement for 0.3% gain in sunspider
We now convert the common 'for (...; ...; <var>++) ...' to the semantically identical
'for (...; ...; ++<var>) ...'.
* kjs/nodes.cpp:
(KJS::PostIncResolveNode::optimizeForUnnecessaryResult):
(KJS::PostIncLocalVarNode::evaluate):
(KJS::PostIncLocalVarNode::optimizeForUnnecessaryResult):
(KJS::PostDecResolveNode::optimizeForUnnecessaryResult):
(KJS::PostDecLocalVarNode::evaluate):
(KJS::PostDecLocalVarNode::optimizeForUnnecessaryResult):
* kjs/nodes.h:
(KJS::PrePostResolveNode::):
(KJS::PostIncResolveNode::):
(KJS::PostIncLocalVarNode::):
(KJS::PostDecResolveNode::):
(KJS::PostDecLocalVarNode::):
(KJS::PreIncResolveNode::):
(KJS::PreDecResolveNode::):
(KJS::ForNode::ForNode):
2007-11-06 Eric Seidel <eric@webkit.org>
Reviewed by darin.
This fixes a regressed layout test for string + object
SunSpider claims this was an overall 0.3% speedup, although some individual tests were slower.
* kjs/nodes.cpp:
(KJS::add): remove erroneous "fast path" for string + *
2007-11-06 Geoffrey Garen <ggaren@apple.com>
Reviewed by Eric Seidel.
Added toJSNumber, a fast path for converting a JSValue to a JS number,
and deployed it in postfix expressions. In the fast case this
eliminates a call to jsNumber.
0.4% speedup on SunSpider.
* ChangeLog:
* kjs/nodes.cpp:
(KJS::PostIncResolveNode::evaluate):
(KJS::PostIncLocalVarNode::evaluate):
(KJS::PostDecResolveNode::evaluate):
(KJS::PostDecLocalVarNode::evaluate):
(KJS::PostIncBracketNode::evaluate):
(KJS::PostDecBracketNode::evaluate):
(KJS::PostIncDotNode::evaluate):
(KJS::PostDecDotNode::evaluate):
(KJS::UnaryPlusNode::evaluate):
* kjs/value.h:
(KJS::JSValue::toJSNumber):
2007-11-06 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15846
REGRESSION (r27387): Memory corruption when running fast/js/kde/delete.html
There was a mistake in the algorithm used to find an empty slot in the property
map entries vector; when we were putting in a new property value and not overwriting
an existing deleted sentinel, we would enlarge the entries vector, but would not
overwrite the stale data that's in the new part. It was easy to pin this down by
turning on property map consistency checks -- I never would have landed with this
bug if I had run the regression tests once with consistency checks on!
* kjs/property_map.cpp: (KJS::PropertyMap::put): Changed logic for the case where
foundDeletedElement is false to always use the item at the end of the entries vector.
Also allowed me to merge with the logic for the "no deleted sentinels at all" case.
2007-11-06 Oliver Hunt <oliver@apple.com>
RS=Darin.
Fix previous patch to use a 3 bit shift, a 16 bit shift causes a regression in sunspider.
* kjs/nodes.cpp:
(KJS::add):
2007-11-06 Oliver Hunt <oliver@apple.com>
Reviewed by Darin.
Replace boolean comparisons in AddNode with mask
comparisons for a 0.2% improvement in sunspider.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/nodes.cpp:
(KJS::add):
2007-11-06 Eric Seidel <eric@webkit.org>
Reviewed by darin.
SunSpider claims this is a 1.1% speedup.
* kjs/nodes.cpp:
(KJS::throwOutOfMemoryError): Added, non inline.
(KJS::addSlowCase): renamed from add(), non inline.
(KJS::add): add fast path for String + String, Number + Number and String + *
2007-11-06 Eric Seidel <eric@webkit.org>
Reviewed by mjs.
Avoid more UString creation.
SunSpider claims this is a 0.4% speedup.
* kjs/regexp_object.cpp:
(KJS::RegExpObjectImp::construct): use UString::find(UChar)
2007-11-05 Mark Rowe <mrowe@apple.com>
Mac build fix.
* kjs/array_object.cpp:
(KJS::ArrayProtoFunc::callAsFunction):
2007-11-05 Adam Roben <aroben@apple.com>
Windows build fix
* kjs/list.h:
2007-11-05 Mark Rowe <mrowe@apple.com>
Build fix. Add missing #include.
* kjs/operations.cpp:
2007-11-05 Eric Seidel <eric@webkit.org>
Reviewed by mjs.
Remove another call to toString(exec)
SunSpider claims this is a 0.5% speedup.
* kjs/operations.cpp:
(KJS::equal): remove another toString
2007-11-05 Eric Seidel <eric@webkit.org>
* kjs/operations.cpp:
(KJS::equal): correct broken change.
2007-11-05 Eric Seidel <eric@webkit.org>
Reviewed by mjs.
Remove one more call to toString(exec).
SunSpider claims this is a 0.7% speedup.
* kjs/operations.cpp:
(KJS::equal): remove a call to toString()
2007-11-05 Mark Rowe <mrowe@apple.com>
Gtk build fix.
* pcre/pcre.pri:
2007-11-05 Mark Rowe <mrowe@apple.com>
Gtk build fix.
* kjs/list.cpp:
2007-11-05 Geoffrey Garen <ggaren@apple.com>
Touched a file to test my new HTTP access.
* kjs/scope_chain.cpp:
2007-11-05 Alp Toker <alp@atoker.com>
Unreviewed build fix for qmake-based ports.
Someone with a better understanding of qmake still needs to sort out
the INCLUDEPATH/DEPENDPATH mess.
* JavaScriptCore.pri:
2007-11-05 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
http://bugs.webkit.org/show_bug.cgi?id=15835
Switched List implementation from a custom heap allocator to an inline
Vector, for a disappointing .5% SunSpider speedup.
Also renamed List::slice to List::getSlice because "get" is the
conventional prefix for functions returning a value through an out
parameter.
* kjs/array_object.cpp:
(KJS::ArrayProtoFunc::callAsFunction): Removed some redundant function
calls and memory accesses.
* kjs/bool_object.cpp:
(BooleanObjectImp::construct): Removed questionable use of iterator.
* kjs/list.cpp:
* kjs/list.h: New List class, implemented in terms of Vector. Two
interesting differences:
1. The inline capacity is 8, not 5. Many of the Lists constructed
during a SunSpider run are larger than 5; almost none are larger
than 8.
2. The growth factor is 4, not 2. Since we can guarantee that Lists
aren't long-lived, we can grow them more aggressively, to avoid
excessive copying.
* kjs/regexp_object.cpp:
(RegExpObjectImp::construct): Removed redundant function calls.
* kjs/string_object.cpp:
(KJS::StringObjectImp::construct): Removed questionable use of iterator.
* wtf/Vector.h:
(WTF::::uncheckedAppend): Added a fast, unchecked version of append.
2007-11-05 Mark Rowe <mrowe@apple.com>
Reviewed by Alp Toker.
Add DEPENDPATH to JavaScriptCore and pcre to help qmake with dependencies.
* JavaScriptCore.pri:
* pcre/pcre.pri:
2007-11-04 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15826
optimize opcode loop and case insensitive ASCII compares for a 30% speedup
SunSpider says it's 2.6% faster overall, 32.5% in the regular expression tests.
* pcre/pcre_internal.h: Added OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
* pcre/pcre_compile.c:
(find_fixedlength): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC. Also
added OP_NOT since there was no reason it should not be in here.
(could_be_empty_branch): Ditto.
(compile_branch): Streamlined all the single-character cases; there was a bit of
duplicate code. Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC as needed.
But in particular, compile to those opcodes when the single character match is
ASCII.
(find_firstassertedchar): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
* pcre/pcre_exec.c: (match): Removed the "min", "minimize", and "op" fields from
the matchframe, after I discovered that none of them needed to be saved and restored
across recursive match calls. Also eliminated the ignored result field from the
matchframe, since I discovered that rrc ("recursive result code") was already the
exact same thing. Moved the handling of opcodes higher than OP_BRA into the default
statement of the switch instead of doing them before the switch. This removes a
branch from each iteration of the opcode interpreter, just as removal of "op"
removed at least one store from each iteration. Last, but not least, add the
OP_ASCII_CHAR and OP_ASCII_LETTER_NC functions. Neither can ever match a
surrogate pair and the letter case can be handled efficiently.
2007-11-04 Darin Adler <darin@apple.com>
* pcre/pcre_exec.c: (match): Try to fix the Windows build by removing unreachable code.
2007-11-03 Darin Adler <darin@apple.com>
- fix non-Mac builds; remove some more unused PCRE stuff
* pcre/pcre_compile.c:
(compile_branch): Removed branch chain and some unused ESC values.
(compile_regex): Ditto.
(jsRegExpCompile): Ditto.
* pcre/pcre_exec.c:
(match): Removed unused branch targets. Don't use macros any more.
(jsRegExpExecute): More of the same.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update for removed files.
* JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
* pcre/pcre.pri: Ditto.
* pcre/MERGING: Removed.
* pcre/pcre_fullinfo.c: Removed.
* pcre/pcre_get.c: Removed.
* pcre/pcre_internal.h:
* pcre/ucp.h: Removed.
2007-11-03 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15821
remove unused PCRE features for speed
A first step toward removing the PCRE features we don't use.
This gives a 0.8% speedup on SunSpider, and a 6.5% speedup on
the SunSpider regular expression test.
Replaced the public interface with one that doesn't use the
name PCRE. Removed code we don't need for JavaScript and various
configurations we don't use. This is in preparation for still
more changes in the future. We'll probably switch to C++ and
make some even more significant changes to the regexp engine
to get some additional speed.
There's probably additional unused stuff that I haven't
deleted yet.
This does mean that our PCRE is now a fork, but I think that's
not really a big deal.
* JavaScriptCore.exp: Remove the 5 old entry points and add
the 3 new entry points for WebCore's direct use of the regular
expression engine.
* kjs/config.h: Remove the USE(PCRE16) define. I decided to flip
its sense and now there's a USE(POSIX_REGEX) instead, which should
probably not be set by anyone. Maybe later we'll just get rid of it
altogether.
* kjs/regexp.h:
* kjs/regexp.cpp:
(KJS::RegExp::RegExp): Switch to new jsRegExp function names and
defines. Cut down on the number of functions used.
(KJS::RegExp::~RegExp): Ditto.
(KJS::RegExp::match): Ditto.
* pcre/dftables.c: (main): Get rid of ctype_letter and ctype_meta,
which are unused.
* pcre/pcre-config.h: Get rid of EBCIDIC, PCRE_DATA_SCOPE, const,
size_t, HAVE_STRERROR, HAVE_MEMMOVE, HAVE_BCOPY, NEWLINE,
POSIX_MALLOC_THRESHOLD, NO_RECURSE, SUPPORT_UCP, SUPPORT_UTF8,
and JAVASCRIPT. These are all no longer configurable in our copy
of the library.
* pcre/pcre.h: Remove the macro-based kjs prefix hack, the PCRE
version macros, PCRE_UTF16, the code to set up PCRE_DATA_SCOPE,
the include of <stdlib.h>, and most of the constants and
functions defined in this header. Changed the naming scheme to
use a JSRegExp prefix rather than a pcre prefix. In the future,
we'll probably change this to be a C++ header.
* pcre/pcre_compile.c: Removed all unused code branches,
including many whole functions and various byte codes.
Kept changes outside of removal to a minimum.
(check_escape):
(first_significant_code):
(find_fixedlength):
(find_recurse):
(could_be_empty_branch):
(compile_branch):
(compile_regex):
(is_anchored):
(is_startline):
(find_firstassertedchar):
(jsRegExpCompile): Renamed from pcre_compile2 and changed the
parameters around a bit.
(jsRegExpFree): Added.
* pcre/pcre_exec.c: Removed many unused opcodes and variables.
Also started tearing down the NO_RECURSE mechanism since it's
now the default. In some cases there were things in the explicit
frame that could be turned into plain old local variables and
other small like optimizations.
(pchars):
(match_ref):
(match): Changed parameters quite a bit since it's now not used
recursively.
(jsRegExpExecute): Renamed from pcre_exec.
* pcre/pcre_internal.h: Get rid of PCRE_DEFINITION, PCRE_SPTR,
PCRE_IMS, PCRE_ICHANGED, PCRE_NOPARTIAL, PCRE_STUDY_MAPPED,
PUBLIC_OPTIONS, PUBLIC_EXEC_OPTIONS, PUBLIC_DFA_EXEC_OPTIONS,
PUBLIC_STUDY_OPTIONS, MAGIC_NUMBER, 16 of the opcodes,
_pcre_utt, _pcre_utt_size, _pcre_try_flipped, _pcre_ucp_findprop,
and _pcre_valid_utf8. Also moved pcre_malloc and pcre_free here.
* pcre/pcre_maketables.c: Changed to only compile in dftables.
Also got rid of many of the tables that we don't use.
* pcre/pcre_tables.c: Removed the unused Unicode property tables.
* pcre/pcre_ucp_searchfuncs.c: Removed everything except for
_pcre_ucp_othercase.
* pcre/pcre_xclass.c: (_pcre_xclass): Removed uneeded support
for classes based on Unicode properties.
* wtf/FastMallocPCRE.cpp: Removed unused bits. It would be good
to eliminate this completely, but we need the regular expression
code to be C++ first.
* pcre/pcre_fullinfo.c:
* pcre/pcre_get.c:
* pcre/ucp.h:
Files that are no longer needed. I didn't remove them with this
check-in, because I didn't want to modify all the project files.
2007-11-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Sam.
- remove NaN check from JSImmediate::fromDouble for 0.5% SunSpider speedup
It turns out that doing this check costs more than it saves.
* kjs/JSImmediate.h:
(KJS::JSImmediate::fromDouble):
2007-11-03 Sam Weinig <sam@webkit.org>
Reviewed by Oliver.
Remove dummy variable from ClassInfo reducing the size of the struct by 1 word.
The variable had been kept around for binary compatibility, but since nothing
else is there is no point in continuing to keep it around.
* API/JSCallbackConstructor.cpp:
* API/JSCallbackFunction.cpp:
* API/JSCallbackObject.cpp:
* bindings/objc/objc_runtime.mm:
* bindings/runtime_array.cpp:
* bindings/runtime_object.cpp:
* kjs/array_instance.cpp:
* kjs/array_object.cpp:
* kjs/bool_object.cpp:
* kjs/date_object.cpp:
* kjs/error_object.cpp:
* kjs/function.cpp:
* kjs/internal.cpp:
* kjs/lookup.h:
* kjs/math_object.cpp:
* kjs/number_object.cpp:
* kjs/object.h:
* kjs/regexp_object.cpp:
* kjs/string_object.cpp:
2007-11-03 Kevin McCullough <kmccullough@apple.com>
- Updated testkjs results to make the build bots green until we
can fix the tests that are failing. The new failures are in DST.
* tests/mozilla/expected.html:
2007-11-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Adam.
- don't print the var twice for ForInNodes with a var declaration
* kjs/nodes2string.cpp:
(KJS::ForInNode::streamTo):
2007-11-03 Darin Adler <darin@apple.com>
* pcre/pcre_compile.c: (check_escape): Windows build fix. Get rid of
C-incompatible declaration.
2007-11-03 Mark Rowe <mrowe@apple.com>
Gtk build fix.
* kjs/nodes.cpp: Add missing include.
2007-11-03 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fix http://bugs.webkit.org/show_bug.cgi?id=15814
<rdar://problem/5536644> fast/js/kde/encode_decode_uri.html fails
These changes cause us to match the JavaScript specification and pass the
fast/js/kde/encode_decode_uri.html test.
* kjs/function.cpp: (KJS::encode): Call the UTF-8 string conversion in its
new strict mode, throwing an exception if there are malformed UTF-16 surrogate
pairs in the text.
* kjs/ustring.h: Added a strict version of the UTF-8 string conversion.
* kjs/ustring.cpp:
(KJS::decodeUTF8Sequence): Removed code to disallow U+FFFE and U+FFFF; while
those might be illegal in some sense, they aren't supposed to get any special
handling in the place where this function is currently used.
(KJS::UString::UTF8String): Added the strictness.
2007-11-03 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15812
some JavaScript tests (from the Mozilla test suite) are failing
Two or three fixes get 7 more of the Mozilla tests passing.
This gets us down from 61 failing tests to 54.
* kjs/interpreter.h: (KJS::Interpreter::builtinRegExp):
Made this inline and gave it a more specific type. Some day we should
probably do that for all of these -- might even get a bit of a speed
boost from it.
* kjs/interpreter.cpp: Removed Interpreter::builtinRegExp now that it's
inline in the header.
* kjs/regexp_object.h:
* kjs/regexp_object.cpp:
(KJS::RegExpProtoFunc::callAsFunction): Moved test and exec out of the
switch statement into the RegExpImp object, so they can be shared with
RegExpImp::callAsFunction.
(KJS::RegExpImp::match): Added. Common code used by both test and exec.
(KJS::RegExpImp::test): Added.
(KJS::RegExpImp::exec): Added.
(KJS::RegExpImp::implementsCall): Added.
(KJS::RegExpImp::callAsFunction): Added.
(KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate): Initialize
lastInput to null rather than empty string -- we take advantage of the
difference in RegExpImp::match.
(KJS::RegExpObjectImp::input): Added. No reason to go through hash tables
just to get at a field like this.
* pcre/pcre_compile.c: (check_escape): Changed the \u handling to match
the JavaScript specification. If there are not 4 hex digits after the \u,
then it's processed as if it wasn't an escape sequence at all.
* pcre/pcre_internal.h: Added IS_NEWLINE, with the appropriate definition
for JavaScript (4 specific Unicode values).
* pcre/pcre_exec.c:
(match): Changed all call sites to use IS_NEWLINE.
(pcre_exec): Ditto.
* tests/mozilla/expected.html: Updated to expect 7 more successful tests.
2007-11-03 David D. Kilzer <ddkilzer@webkit.org>
Sort files(...); sections of Xcode project files.
Rubber-stamped by Darin.
* JavaScriptCore.xcodeproj/project.pbxproj:
2007-11-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- remove VarDeclListNode and simplify VarDeclNode evaluation for 0.4% SunSpider speedup
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::VarDeclNode::optimizeVariableAccess):
(KJS::VarDeclNode::getDeclarations):
(KJS::VarDeclNode::handleSlowCase):
(KJS::VarDeclNode::evaluateSingle):
(KJS::VarDeclNode::evaluate):
(KJS::VarStatementNode::execute):
* kjs/nodes.h:
(KJS::VarDeclNode::):
(KJS::VarStatementNode::):
* kjs/nodes2string.cpp:
(KJS::VarDeclNode::streamTo):
2007-11-03 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
http://bugs.webkit.org/show_bug.cgi?id=15800
REGRESSION (r27303): RegExp leaks
* kjs/regexp_object.h:
(KJS::RegExpImp::setRegExp):
(KJS::RegExpImp::regExp):
(KJS::RegExpImp::classInfo):
* kjs/regexp_object.cpp:
(RegExpImp::RegExpImp):
(RegExpImp::~RegExpImp):
Renamed reg member variable to m_regExp, changed it to use OwnPtr.
2007-11-02 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- add SourceElements as a typedef for Vector<RefPtr<StatementNode> >.
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::statementListPushFIFO):
(KJS::statementListGetDeclarations):
(KJS::statementListInitializeDeclarationStacks):
(KJS::statementListInitializeVariableAccessStack):
(KJS::statementListExecute):
(KJS::BlockNode::BlockNode):
(KJS::FunctionBodyNode::FunctionBodyNode):
(KJS::ProgramNode::ProgramNode):
* kjs/nodes.h:
(KJS::CaseClauseNode::):
2007-11-02 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15791
change property map data structure for less memory use, better speed
The property map now has an array of indices and a separate array of
property map entries. This slightly slows down lookup because of a second
memory acess, but makes property maps smaller and faster to iterate in
functions like mark().
SunSpider says this is 1.2% faster, although it makes the bitwise-end test
more than 10% slower. To fix that we'll need to optimize global variable lookup.
* kjs/property_map.cpp:
(KJS::PropertyMapEntry::PropertyMapEntry):
(KJS::PropertyMapHashTable::entries):
(KJS::PropertyMapHashTable::allocationSize):
(KJS::SavedProperties::SavedProperties):
(KJS::SavedProperties::~SavedProperties):
(KJS::PropertyMap::checkConsistency):
(KJS::PropertyMap::~PropertyMap):
(KJS::PropertyMap::clear):
(KJS::PropertyMap::get):
(KJS::PropertyMap::getLocation):
(KJS::PropertyMap::put):
(KJS::PropertyMap::insert):
(KJS::PropertyMap::createTable):
(KJS::PropertyMap::rehash):
(KJS::PropertyMap::remove):
(KJS::PropertyMap::mark):
(KJS::comparePropertyMapEntryIndices):
(KJS::PropertyMap::containsGettersOrSetters):
(KJS::PropertyMap::getEnumerablePropertyNames):
(KJS::PropertyMap::save):
(KJS::PropertyMap::restore):
* kjs/property_map.h:
2007-11-02 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15807
HashMap needs a take() function that combines get and remove
* wtf/HashMap.h: Added take function. Simplistic implementation for now,
but still does only one hash table lookup.
* kjs/array_instance.cpp: (KJS::ArrayInstance::put): Use take rather than
a find followed by a remove.
2007-11-02 David Carson <dacarson@gmail.com>
Reviewed by Darin.
Fix compiler warning "warning: suggest parentheses around && within ||"
http://bugs.webkit.org/show_bug.cgi?id=15764
* kjs/value.h: (KJS::JSValue::isNumber): Add parentheses.
2007-11-01 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
In preparation for making List a simple stack-allocated Vector:
Removed all instances of List copying and/or assignment, and made List
inherit from Noncopyable.
Functions that used to return a List by copy now take List& out
parameters.
Layout tests and JS tests pass.
* kjs/list.cpp:
(KJS::List::slice): Replaced copyTail with a more generic slice
alternative. (JavaScriptCore only calls slice(1), but WebCore calls
slice(2)).
2007-11-01 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Fixed http://bugs.webkit.org/show_bug.cgi?id=15785
REGRESSION(r27344): Crash on load at finance.yahoo.com
Reverted a small portion of my last check-in. (The speedup and the List
removal are still there, though.)
ActivationImp needs to hold a pointer to its function, and mark that
pointer (rather than accessing its function through its ExecState, and
counting on the active scope to mark its function) because a closure
can cause an ActivationImp to outlive its ExecState along with any
active scope.
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState):
* kjs/function.cpp:
(KJS::FunctionImp::~FunctionImp):
(KJS::ActivationImp::ActivationImp):
* kjs/function.h:
(KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):
Also made HashTable a little more crash-happy in debug builds, so
problems like this will show up earlier:
* wtf/HashTable.h:
(WTF::HashTable::~HashTable):
2007-11-01 Geoffrey Garen <ggaren@apple.com>
Reviewed by Adam Roben.
Addressed some of Darin's review comments.
Used perl -p, which is the shorthand while(<>) {}.
Made sure not to suppress bison's output.
Added line to removed bison_out.txt, since this script removes other
intermediate files, too.
* DerivedSources.make:
2007-11-01 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Removed List from ActivationImp, in preparation for making all lists
stack-allocated.
Tests pass.
1.0% speedup on SunSpider, presumably due to reduced List refcount thrash.
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState):
(KJS::ExecState::~ExecState):
* kjs/function.cpp:
(KJS::ActivationImp::ActivationImp):
(KJS::ActivationImp::createArgumentsObject):
* kjs/function.h:
(KJS::ActivationImp::ActivationImpPrivate::ActivationImpPrivate):
2007-11-01 Adam Roben <aroben@apple.com>
Use jsNumberCell instead of jsNumber when converting double constants to JSValues
This fixes fast/js/math.html, ecma/Date/15.9.5.10-1.js, and
ecma/Date/15.9.5.12-1.js, which were suffering from a bug in MSVC.
It also gets rid of an MSVC warning that we previously had to silence.
Reviewed by Geoff.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn
back on the "overflow in constant arithmetic" warning.
* kjs/number_object.cpp:
(NumberObjectImp::getValueProperty): Use jsNumberCell instead of
jsNumber.
2007-10-31 Adam Roben <aroben@apple.com>
Windows build fix
* kjs/ExecState.h:
2007-10-31 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- shave some cycles off of local storage access for a 1% SunSpider speedup
Keep the LocalStorage pointer in the ExecState, instead of getting
it from the ActivationImp all the time.
* kjs/ExecState.cpp:
(KJS::ExecState::updateLocalStorage):
* kjs/ExecState.h:
(KJS::ExecState::localStorage):
* kjs/nodes.cpp:
(KJS::LocalVarAccessNode::evaluate):
(KJS::LocalVarFunctionCallNode::evaluate):
(KJS::PostIncLocalVarNode::evaluate):
(KJS::PostDecLocalVarNode::evaluate):
(KJS::LocalVarTypeOfNode::evaluate):
(KJS::PreIncLocalVarNode::evaluate):
(KJS::PreDecLocalVarNode::evaluate):
(KJS::ReadModifyLocalVarNode::evaluate):
(KJS::AssignLocalVarNode::evaluate):
(KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
2007-10-31 Adam Roben <aroben@apple.com>
Fix a crash on launch due to a static initializer race
We now use fast inline assembler spinlocks which can be statically
initialized at compile time.
As a side benefit, this speeds up SunSpider by 0.4%.
Reviewed by Oliver.
* wtf/FastMalloc.cpp:
* wtf/TCSpinLock.h:
(TCMalloc_SpinLock::Lock):
(TCMalloc_SpinLock::Unlock):
(TCMalloc_SlowLock):
* wtf/TCSystemAlloc.cpp:
2007-10-31 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam.
- Corrected spelling.
* wtf/HashTraits.h:
2007-10-31 Mark Rowe <mrowe@apple.com>
Further Gtk build fixage.
* kjs/regexp_object.cpp:
2007-10-31 Mark Rowe <mrowe@apple.com>
Gtk build fix.
* kjs/regexp.h:
2007-10-31 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fix http://bugs.webkit.org/show_bug.cgi?id=15749
RegExp/RegExpObjectImp cause needless UString creation
Speeds things up 0.4% according to SunSpider.
* kjs/config.h: Define USE(PCRE16) instead of HAVE(PCREPOSIX),
because this library doesn't use the real PCRE -- it uses its
own PCRE that works on UTF-16.
* kjs/regexp.h: Removed a few unused functions. Changed the ifdef.
Use Noncopyable. Change the return value of match.
* kjs/regexp.cpp:
(KJS::RegExp::RegExp): Call pcre_compile2, for a slight speed boost.
(KJS::RegExp::~RegExp): PCRE16 rather than PCREPOSIX.
(KJS::RegExp::match): Change to return the position as an int and the
ovector as a OwnArrayPtr<int> for efficiency and clearer storage management.
* kjs/regexp_object.h: Change performMatch and arrayOfMatches to no longer
require a result string.
* kjs/regexp_object.cpp:
(RegExpProtoFunc::callAsFunction): Update for new signature of performMatch.
(RegExpObjectImp::performMatch): Change so it doesn't return a string.
(RegExpObjectImp::arrayOfMatches): Simplify by unifying the handling of
the main result with the backreferences; now it doesn't need to take
a result parameter.
(RegExpObjectImp::getBackref): Minor tweaks.
(RegExpObjectImp::getLastParen): Ditto.
(RegExpObjectImp::getLeftContext): Ditto.
(RegExpObjectImp::getRightContext): Ditto.
(RegExpObjectImp::getValueProperty): Change LastMatch case to call
getBackref(0) so we don't need a separate getLastMatch function.
* kjs/string_object.cpp:
(KJS::replace): Update to use new performMatch, including merging the
matched string section with the other substrings.
(KJS::StringProtoFunc::callAsFunction): Update functions to use the
new performMatch and match. Also change to use OwnArrayPtr.
2007-10-31 Oliver Hunt <oliver@apple.com>
* kjs/nodes.h: include OwnPtr.h
2007-10-31 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Remove SourceCodeElement class and replaced with a Vector for a 0.8% gain on sunspider
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::statementListPushFIFO):
(KJS::statementListGetDeclarations):
(KJS::statementListInitializeDeclarationStacks):
(KJS::statementListInitializeVariableAccessStack):
(KJS::statementListExecute):
(KJS::BlockNode::optimizeVariableAccess):
(KJS::BlockNode::BlockNode):
(KJS::BlockNode::getDeclarations):
(KJS::BlockNode::execute):
(KJS::CaseClauseNode::optimizeVariableAccess):
(KJS::CaseClauseNode::getDeclarations):
(KJS::CaseClauseNode::evalStatements):
(KJS::FunctionBodyNode::initializeDeclarationStacks):
(KJS::FunctionBodyNode::optimizeVariableAccess):
* kjs/nodes.h:
* kjs/nodes2string.cpp:
(KJS::statementListStreamTo):
(KJS::BlockNode::streamTo):
(KJS::CaseClauseNode::streamTo):
2007-10-30 Mark Rowe <mrowe@apple.com>
* kjs/property_map.cpp: Added a missing using directive to fix the build
for non-Mac ports. Mac worked only because it does the AllInOneFile compile.
2007-10-31 Maciej Stachowiak <mjs@apple.com>
* kjs/property_map.cpp: Include HashTable.h the right way to fix the build
for non-Mac ports.
2007-10-31 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
http://bugs.webkit.org/show_bug.cgi?id=11001
WebKit doesn't support RegExp.compile method
Test: fast/js/regexp-compile.html
* kjs/regexp_object.cpp:
(RegExpPrototype::RegExpPrototype):
(RegExpProtoFunc::callAsFunction):
* kjs/regexp_object.h:
(KJS::RegExpProtoFunc::):
Added RegExp.compile.
* tests/mozilla/expected.html: js1_2/regexp/compile.js now passes.
2007-10-31 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- get rid of integer divide in PropertyMap and HashTable for 1% SunSpider speedup
Integer divide sucks. Fortunately, a bunch of shifts and XORs
biased towards the high bits is sufficient to provide a good
double hash. Besides the SunSpider win, I used the dump statistics
mode for both to verify that collisions did not increase and that
the longest collision chain is not any longer.
* kjs/property_map.cpp:
(KJS::doubleHash):
(KJS::PropertyMap::get):
(KJS::PropertyMap::getLocation):
(KJS::PropertyMap::put):
(KJS::PropertyMap::insert):
(KJS::PropertyMap::remove):
(KJS::PropertyMap::checkConsistency):
* wtf/HashTable.h:
(WTF::doubleHash):
(WTF::::lookup):
(WTF::::lookupForWriting):
(WTF::::fullLookupForWriting):
(WTF::::add):
2007-10-30 Adam Roben <aroben@apple.com>
* kjs/collector.h: Make HeapType public so it can be used for non-member
things like the HeapConstants struct template. Fixes the build on Windows.
2007-10-30 Adam Roben <aroben@apple.com>
Change ALWAYS_INLINE and WTF_PRIVATE_INLINE to use __forceinline on Windows
Speeds up SunSpider by 0.4%.
Reviewed by Steve and Maciej.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
a warning during LTCG in release builds about double -> float
conversion.
* wtf/AlwaysInline.h:
* wtf/FastMalloc.h:
2007-10-30 Adam Roben <aroben@apple.com>
Use GetCurrentThreadId instead of pthread_self in FastMalloc
Speeds up SunSpider by 0.3%.
Reviewed by Steve.
* wtf/FastMalloc.cpp:
(WTF::TCMalloc_ThreadCache::InitTSD):
(WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
2007-10-30 Adam Roben <aroben@apple.com>
Switch to a Win32 critical section implementation of spinlocks
Speeds up SunSpider by 0.4%.
Reviewed by Steve.
* wtf/FastMalloc.cpp:
* wtf/TCSpinLock.h:
(TCMalloc_SpinLock::TCMalloc_SpinLock):
(TCMalloc_SpinLock::Init):
(TCMalloc_SpinLock::Finalize):
(TCMalloc_SpinLock::Lock):
(TCMalloc_SpinLock::Unlock):
* wtf/TCSystemAlloc.cpp:
2007-10-30 Adam Roben <aroben@apple.com>
Fix Bug 15586: REGRESSION (r26759-r26785): Windows nightly builds crash with Safari 3 Public Beta
http://bugs.webkit.org/show_bug.cgi?id=15586
Also fixes: <rdar://5565303> Cannot use regsvr32.exe to register WebKit.dll
Use Win32 TLS functions instead of __declspec(thread), which breaks
delay-loading.
Reviewed by Steve.
* wtf/FastMalloc.cpp:
(WTF::getThreadHeap):
(WTF::TCMalloc_ThreadCache::InitModule):
2007-10-30 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- allocate numbers in half-size cells, for an 0.5% SunSpider speedup
http://bugs.webkit.org/show_bug.cgi?id=15772
We do this by using a single mark bit per two number cells, and
tweaking marking.
Besides being an 0.5% win overall, this is a 7.1% win on morph.
* kjs/collector.cpp:
(KJS::Collector::heapAllocate):
(KJS::Collector::markStackObjectsConservatively):
(KJS::Collector::sweep):
* kjs/collector.h:
(KJS::SmallCollectorCell::):
2007-10-30 Geoffrey Garen <ggaren@apple.com>
Reviewed by Adam Roben, Sam Weinig.
Made conflicts in grammar.y a persistent build failure.
* DerivedSources.make:
2007-10-30 Kevin McCullough <kmccullough@apple.com>
Reviewed by Adam and Geoff.
- Added a new cast so all the casts are in the same place.
* API/APICast.h:
(toGlobalRef):
2007-10-30 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Fixed <rdar://problem/5567504> shift/reduce conflict introduced in r24457
JS tests, including
ecma_2/Statements/dowhile-001.js
ecma_2/Statements/dowhile-002.js
ecma_2/Statements/dowhile-003.js
ecma_2/Statements/dowhile-004.js
ecma_2/Statements/dowhile-005.js
ecma_2/Statements/dowhile-006.js
ecma_2/Statements/dowhile-007.js
js1_2/statements/do_while.js
and layout tests, including
do-while-expression-value.html
do-while-semicolon.html
do-while-without-semicolon.html
pass.
* kjs/grammar.y: Use the explicit "error" production, as we do with other
automatic semicolon insertions, to disambiguate "do { } while();" from
"do { } while()" followed by ";" (the empty statement).
2007-10-29 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Debranching remaining assignment nodes, and miscellaneous cleanup
Split read-modify code paths out of AssignBracketNode and AssignDotNode
Removed now unnecessary check for write-only assignment in ReadModifyLocalVarNode
and ReadModifyResolveNode evaluate methods
Leads to a 1% gain in SunSpider.
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::ReadModifyLocalVarNode::evaluate):
(KJS::ReadModifyResolveNode::evaluate):
(KJS::AssignDotNode::evaluate):
(KJS::ReadModifyDotNode::optimizeVariableAccess):
(KJS::ReadModifyDotNode::evaluate):
(KJS::AssignBracketNode::evaluate):
(KJS::ReadModifyBracketNode::optimizeVariableAccess):
(KJS::ReadModifyBracketNode::evaluate):
* kjs/nodes.h:
(KJS::AssignBracketNode::):
(KJS::AssignBracketNode::precedence):
(KJS::AssignDotNode::):
(KJS::AssignDotNode::precedence):
* kjs/nodes2string.cpp:
(KJS::ReadModifyBracketNode::streamTo):
(KJS::AssignBracketNode::streamTo):
(KJS::ReadModifyDotNode::streamTo):
(KJS::AssignDotNode::streamTo):
2007-10-29 Oliver Hunt <oliver@apple.com>
Debranching various Node::evaluate implementations
Reviewed by Maciej.
Split the read-modify-write assignment cases out of AssignResolveNode and into ReadModifyResolveNode
Split the increment and decrement cases for Prefix- and Postfix- ResolveNode, BracketNode, and DotNode
Gains 1.6% on SunSpider
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::PostIncResolveNode::optimizeVariableAccess):
(KJS::PostIncResolveNode::evaluate):
(KJS::PostIncLocalVarNode::evaluate):
(KJS::PostDecResolveNode::optimizeVariableAccess):
(KJS::PostDecResolveNode::evaluate):
(KJS::PostDecLocalVarNode::evaluate):
(KJS::PostIncBracketNode::evaluate):
(KJS::PostDecBracketNode::evaluate):
(KJS::PostIncDotNode::evaluate):
(KJS::PostDecDotNode::evaluate):
(KJS::PreIncResolveNode::optimizeVariableAccess):
(KJS::PreIncLocalVarNode::evaluate):
(KJS::PreIncResolveNode::evaluate):
(KJS::PreDecResolveNode::optimizeVariableAccess):
(KJS::PreDecLocalVarNode::evaluate):
(KJS::PreDecResolveNode::evaluate):
(KJS::PreIncBracketNode::evaluate):
(KJS::PreDecBracketNode::evaluate):
(KJS::PreIncDotNode::evaluate):
(KJS::PreDecDotNode::evaluate):
(KJS::ReadModifyResolveNode::optimizeVariableAccess):
(KJS::AssignResolveNode::optimizeVariableAccess):
(KJS::AssignLocalVarNode::evaluate):
(KJS::AssignResolveNode::evaluate):
* kjs/nodes.h:
(KJS::PostDecResolveNode::):
(KJS::PostDecResolveNode::precedence):
(KJS::PostDecLocalVarNode::):
(KJS::PostfixBracketNode::):
(KJS::PostfixBracketNode::precedence):
(KJS::PostIncBracketNode::):
(KJS::PostIncBracketNode::isIncrement):
(KJS::PostDecBracketNode::):
(KJS::PostDecBracketNode::isIncrement):
(KJS::PostfixDotNode::):
(KJS::PostfixDotNode::precedence):
(KJS::PostIncDotNode::):
(KJS::PostIncDotNode::isIncrement):
(KJS::PostDecDotNode::):
(KJS::PreIncResolveNode::):
(KJS::PreDecResolveNode::):
(KJS::PreDecResolveNode::precedence):
(KJS::PreDecLocalVarNode::):
(KJS::PrefixBracketNode::):
(KJS::PrefixBracketNode::precedence):
(KJS::PreIncBracketNode::):
(KJS::PreIncBracketNode::isIncrement):
(KJS::PreDecBracketNode::):
(KJS::PreDecBracketNode::isIncrement):
(KJS::PrefixDotNode::):
(KJS::PrefixDotNode::precedence):
(KJS::PreIncDotNode::):
(KJS::PreIncDotNode::isIncrement):
(KJS::PreDecDotNode::):
(KJS::ReadModifyResolveNode::):
(KJS::ReadModifyLocalVarNode::):
(KJS::AssignResolveNode::):
(KJS::AssignResolveNode::precedence):
* kjs/nodes2string.cpp:
(KJS::PostIncResolveNode::streamTo):
(KJS::PostDecResolveNode::streamTo):
(KJS::PostfixBracketNode::streamTo):
(KJS::PostfixDotNode::streamTo):
(KJS::PreIncResolveNode::streamTo):
(KJS::PreDecResolveNode::streamTo):
(KJS::ReadModifyResolveNode::streamTo):
(KJS::AssignResolveNode::streamTo):
2007-10-29 Maciej Stachowiak <mjs@apple.com>
Not reviewed, build fix.
- Include Vector.h in a way that actually works.
* kjs/LocalStorage.h:
2007-10-29 Maciej Stachowiak <mjs@apple.com>
Not reviewed, build fix.
- Install LocalStorage.h as a private header.
* JavaScriptCore.xcodeproj/project.pbxproj:
2007-10-29 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- Define good VectorTraits for LocalStorage entry for 0.5% speed improvement on SunSpider.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/LocalStorage.h: Added.
(KJS::LocalStorageEntry::LocalStorageEntry):
(WTF::):
* kjs/function.h:
* kjs/nodes.cpp:
(KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
2007-10-29 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Some small tweaks that I notice while reviewing Oliver's last patch.
Includes removal of an unnecessary KJS_CHECKEXCEPTIONVALUE.
No change in SunSpider because SunSpider doesn't take the code path that
would execute the unnecessary KJS_CHECKEXCEPTIONVALUE much.
* kjs/nodes.cpp:
(KJS::LocalVarPostfixNode::evaluate):
(KJS::TypeOfResolveNode::optimizeVariableAccess):
(KJS::LocalVarTypeOfNode::evaluate):
(KJS::PrefixResolveNode::optimizeVariableAccess):
(KJS::LocalVarPrefixNode::evaluate):
(KJS::AssignResolveNode::optimizeVariableAccess):
(KJS::LocalVarAssignNode::evaluate):
* kjs/nodes.h:
(KJS::LocalVarTypeOfNode::):
(KJS::PrefixResolveNode::):
(KJS::LocalVarPrefixNode::):
(KJS::AssignResolveNode::):
(KJS::LocalVarAssignNode::):
2007-10-29 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
SunSpider claims this was a 0.7% speedup.
* kjs/string_object.cpp:
(KJS::StringProtoFunc::callAsFunction): avoid mallocing a jsString in the common case
2007-10-29 Maciej Stachowiak <mjs@apple.com>
Reviewed by Mark.
- re-enable asserts for access to empty or deleted keys
* wtf/HashTable.h:
(WTF::::lookup):
(WTF::::lookupForWriting):
(WTF::::fullLookupForWriting):
(WTF::::add):
2007-10-29 Eric Seidel <eric@webkit.org>
Build fix only, no review.
* JavaScriptCore.exp: Export symbol for new StringInstance::getOwnPropertySlot
2007-10-29 Mark Rowe <mrowe@apple.com>
Gtk build fix. Move struct declarations into nodes.h.
* kjs/grammar.y:
* kjs/nodes.h:
2007-10-29 Eric Seidel <eric@webkit.org>
Reviewed by darin.
Give StringInstance a getOwnPropertySlot(ExecState, unsigned, PropertySlot) fastpath, just like Arrays.
Make it a compile time error to use toString(ExecState) on a StringInstance
SunSpider claims this was a 6.6% speedup overall (22% on string-base64)
* kjs/internal.h:
(KJS::StringImp::getLength):
* kjs/string_object.cpp:
(KJS::StringInstance::lengthGetter):
(KJS::StringInstance::inlineGetOwnPropertySlot):
(KJS::StringInstance::getOwnPropertySlot):
* kjs/string_object.h:
2007-10-28 Oliver Hunt <oliver@apple.com>
Reviewed by Darin.
Add nodes to allow Assignment, TypeOf, and prefix operators to
make use of the new optimised local variable look up.
5% gain on sunspider
* kjs/nodes.cpp:
(KJS::TypeOfResolveNode::optimizeVariableAccess):
(KJS::LocalTypeOfAccessNode::evaluate):
(KJS::PrefixResolveNode::optimizeVariableAccess):
(KJS::PrefixLocalAccessNode::evaluate):
(KJS::AssignResolveNode::optimizeVariableAccess):
(KJS::AssignLocalAccessNode::evaluate):
* kjs/nodes.h:
(KJS::TypeOfResolveNode::):
(KJS::TypeOfResolveNode::precedence):
(KJS::LocalTypeOfAccessNode::):
(KJS::PrefixResolveNode::):
(KJS::PrefixResolveNode::precedence):
(KJS::PrefixLocalAccessNode::):
(KJS::AssignResolveNode::):
(KJS::AssignLocalAccessNode::):
2007-10-28 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- avoid creating and then breaking circular lists in the parser, instead track head and tail pointers at parse time
http://bugs.webkit.org/show_bug.cgi?id=15748
Not a significant speedup or slowdown on SunSpider.
* kjs/Parser.cpp:
(KJS::clearNewNodes):
* kjs/Parser.h:
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::BlockNode::BlockNode):
(KJS::CaseBlockNode::CaseBlockNode):
(KJS::FunctionBodyNode::FunctionBodyNode):
(KJS::SourceElementsNode::SourceElementsNode):
(KJS::ProgramNode::ProgramNode):
* kjs/nodes.h:
(KJS::ElementNode::):
(KJS::ArrayNode::):
(KJS::PropertyListNode::):
(KJS::ObjectLiteralNode::):
(KJS::ArgumentListNode::):
(KJS::ArgumentsNode::):
(KJS::VarDeclListNode::):
(KJS::VarStatementNode::):
(KJS::ForNode::):
(KJS::ParameterNode::):
(KJS::FuncExprNode::):
(KJS::FuncDeclNode::):
(KJS::SourceElementsNode::):
(KJS::CaseClauseNode::):
(KJS::ClauseListNode::):
2007-10-28 Mark Rowe <mrowe@apple.com>
Disable assertions in a manner that doesn't break the Qt Windows build.
* wtf/HashTable.h:
(WTF::::lookup):
(WTF::::lookupForWriting):
(WTF::::fullLookupForWriting):
2007-10-28 Geoffrey Garen <ggaren@apple.com>
Temporarily disabling some ASSERTs I introduced in my last check-in
because of http://bugs.webkit.org/show_bug.cgi?id=15747
Lots of layout tests fail the !HashTranslator::equal(KeyTraits::emptyValue() ASSERT
* wtf/HashTable.h:
(WTF::::lookup):
(WTF::::lookupForWriting):
(WTF::::fullLookupForWriting):
(WTF::::add):
2007-10-28 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Fixed http://bugs.webkit.org/show_bug.cgi?id=15746
#ifndef ASSERT_DISABLED is no good!
Replaced with #if !ASSERT_DISABLED.
* wtf/HashTable.h:
(WTF::::lookup):
(WTF::::lookupForWriting):
(WTF::::fullLookupForWriting):
(WTF::::add):
2007-10-28 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Added FunctionCallResolveNode, PostfixResolveNode, and DeleteResolveNode
to the AST transfom that replaces slow resolve nodes with fast local
variable alternatives.
2.5% speedup on SunSpider.
Also added some missing copyright notices.
* kjs/nodes.cpp:
(KJS::FunctionCallResolveNode::optimizeVariableAccess):
(KJS::FunctionCallResolveNode::evaluate):
(KJS::LocalVarFunctionCallNode::evaluate):
(KJS::PostfixResolveNode::optimizeVariableAccess):
(KJS::PostfixResolveNode::evaluate):
(KJS::LocalVarPostfixNode::evaluate):
(KJS::DeleteResolveNode::optimizeVariableAccess):
(KJS::DeleteResolveNode::evaluate):
(KJS::LocalVarDeleteNode::evaluate):
* kjs/nodes.h:
(KJS::FunctionCallResolveNode::):
(KJS::LocalVarFunctionCallNode::LocalVarFunctionCallNode):
(KJS::PostfixResolveNode::):
(KJS::LocalVarPostfixNode::LocalVarPostfixNode):
(KJS::DeleteResolveNode::):
(KJS::LocalVarDeleteNode::LocalVarDeleteNode):
2007-10-28 Eric Seidel <eric@webkit.org>
Reviewed by darin.
Inline UString::Rep::deref() for a 0.8% improvement in SunSpider
Add virtual keyword to a few virtual functions previously unmarked.
* kjs/internal.h:
(KJS::StringImp::type):
(KJS::NumberImp::type):
* kjs/ustring.h:
(KJS::UString::Rep::deref):
2007-10-28 Darin Adler <darin@apple.com>
- fix "broken everything" from the storage leak fix
* wtf/RefPtr.h: (WTF::RefPtr::RefPtr): Added a PlacementNewAdopt constructor.
* kjs/ustring.h: (KJS::UString::UString): Pass PlacementNewAdopt along to RefPtr.
2007-10-28 Darin Adler <darin@apple.com>
Reviewed by Adam.
- turn on unused parameter waring on Mac OS X because it's already on elsewhere
* Configurations/Base.xcconfig: Took out -wno-unused-parameter.
* API/JSNode.c:
* API/JSNodeList.c:
* API/minidom.c:
* API/testapi.c:
Fixed unused variables by using them or marked them with UNUSED_PARAM.
* kjs/CollectorHeapIntrospector.h: (KJS::CollectorHeapIntrospector::zoneCalloc):
Removed parameter names to indicate they are unused.
2007-10-28 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fix a storage leak where we ref the UString every time we replace
a ResolveNode with a LocalVarAccessNode
* kjs/identifier.h: (KJS::Identifier::Identifier): Added a constructor
that takes PlacementNewAdopt.
* kjs/nodes.h: (KJS::ResolveNode::ResolveNode): Initialize the ident
with PlacementNewAdopt instead of the old value of ident.
* kjs/ustring.h: (KJS::UString::UString): Added a constructor that
takes PlacementNewAdopt.
2007-10-28 Darin Adler <darin@apple.com>
- Windows build fix; get rid of unused parameter
* kjs/nodes.cpp: (KJS::ResolveNode::optimizeVariableAccess): Don't pass it.
* kjs/nodes.h: (KJS::LocalVarAccessNode::LocalVarAccessNode): Remove it.
The assertions weren't all that helpful.
2007-10-28 Mark Rowe <mrowe@apple.com>
Gtk build fix. Add include of MathExtras.h.
* kjs/string_object.cpp:
2007-10-28 Mark Rowe <mrowe@apple.com>
Reviewed by Maciej and Tim.
Replace uses of isNaN and isInf with isnan and isinf, and
remove isNaN and isInf.
* kjs/config.h: Remove unused HAVE_'s.
* kjs/date_object.cpp:
(KJS::DateInstance::getTime):
(KJS::DateInstance::getUTCTime):
(KJS::DateProtoFunc::callAsFunction):
(KJS::DateObjectImp::construct):
(KJS::DateObjectFuncImp::callAsFunction):
* kjs/function.cpp:
(KJS::GlobalFuncImp::callAsFunction):
* kjs/math_object.cpp:
(MathFuncImp::callAsFunction):
* kjs/nodes2string.cpp:
(KJS::isParserRoundTripNumber):
* kjs/number_object.cpp:
(NumberProtoFunc::callAsFunction):
* kjs/operations.cpp:
* kjs/operations.h:
* kjs/string_object.cpp:
(KJS::StringProtoFunc::callAsFunction):
* kjs/ustring.cpp:
(KJS::UString::from):
* kjs/value.cpp:
(KJS::JSValue::toInteger):
(KJS::JSValue::toInt32SlowCase):
(KJS::JSValue::toUInt32SlowCase):
2007-10-28 Geoffrey Garen <ggaren@apple.com>
Build fix: use the new-fangled missingSymbolMarker().
* kjs/nodes.cpp:
(KJS::ResolveNode::optimizeVariableAccess):
* kjs/nodes.h:
(KJS::LocalVarAccessNode::LocalVarAccessNode):
2007-10-28 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak, Darin Adler.
Much supporting work done by Maciej Stachowiak, Maks Orlovich, and
Cameron Zwarich.
AST transfom to replace slow resolve nodes with fast local variable
alternatives that do direct memory access. Currently, only ResolveNode
provides a fast local variable alternative. 6 others are soon to come.
16.7% speedup on SunSpider.
Most of this patch is just scaffolding to support iterating all the
resolve nodes in the AST through optimizeResolveNodes(). In
optimizeResolveNodes(), most classes just push their child nodes onto
the processing stack, while ResolveNodes actually replace themselves in
the tree with more optimized alternatives, if possible.
Here are the interesting bits:
* kjs/nodes.h: Added PlacementNewAdoptTag, along with implementations
in Node and ResolveNode. This tag allows you to use placement new to
swap out a base class Node in favor of a subclass copy that holds the
same data. (Without this tag, default initialization would NULL out
RefPtrs, change line numbers, etc.)
* kjs/nodes.cpp:
(KJS::ResolveNode::evaluate): Since we're taking the slow path, ASSERT
that the fast path is impossible, to make sure we didn't leave anything
on the table.
(KJS::FunctionBodyNode::optimizeResolveNodes): Here's where the AST
transformation happens.
(KJS::ResolveNode::optimizeResolveNodes): Here's where the ResolveNode
optimization happens.
* kjs/function.h: Added symbolTable() accessor for, for the sake of
an ASSERT.
2007-10-28 Mark Rowe <mrowe@apple.com>
Reviewed by Maciej.
Fix "AllInOneFile.o has a global initializer in it".
Some versions of gcc generate a global initializer for std::numeric_limits<size_t>::max().
We can avoid this by moving it inside an inline function.
* kjs/SymbolTable.h:
(KJS::missingSymbolMarker):
* kjs/function.cpp:
(KJS::ActivationImp::getOwnPropertySlot):
(KJS::ActivationImp::put):
2007-10-28 Maciej Stachowiak <mjs@apple.com>
Reviewed by Mark.
- Added assertions to protect against adding empty or deleted keys to a HashTable
* wtf/HashTable.h:
(WTF::HashTable::lookup):
(WTF::HashTable::lookupForWriting):
(WTF::HashTable::fullLookupForWriting):
(WTF::HashTable::add):
2007-10-28 Darin Adler <darin@apple.com>
- fix GTK build
* kjs/nodes2string.cpp: (KJS::isParserRoundTripNumber):
Use isNaN and isInf instead of isnan and isinf.
2007-10-28 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15735
remove GroupNode to simplify AST and possibly get a modest speedup
This patch removes 4 node types: GroupNode, PropertyNameNode,
FunctionCallParenBracketNode, and FunctionCallParenDotNode.
To remove GroupNode, we add knowledge of precedence to the tree nodes,
and use that when serializing to determine where parentheses are needed.
This means we no longer have to represent parentheses in the tree.
The precedence values are named after productions in the grammar from the
JavaScript standard.
SunSpider says this is an 0.4% speedup.
* kjs/function.h:
* kjs/function.cpp: Removed escapeStringForPrettyPrinting -- it's part of
serialization, so I moved it to the file that takes care of that.
* kjs/grammar.y: Changed makeGetterOrSetterPropertyNode to use 0 to
indicate failure instead of a separate boolean. Got rid of PropertyNameNode
by merging the PropertyName rule into the Property rule (which was easier
than figuring out how to pass the Identifier from one node to another).
Got rid of GroupNode, nodeInsideAllParens(), FunctionCallParenBracketNode,
and FunctionCallParenDotNode.
* kjs/nodes.h: Removed unused forward declarations and Operator values.
Added Precedence enum, and precedence function to all nodes. Removed
nodeInsideAllParens. Added streamBinaryOperator function for serialization.
Removed GroupNode and PropertyNameNode. Made PropertyNode store an Identifier.
Removed FunctionCallParenBracketNode and FunctionCallParenDotNode.
* kjs/nodes.cpp: Removed Node::nodinsideAllParens, GroupNode, and PropertyNameNode.
(KJS::PropertyListNode::evaluate): Changed code to get name directly instead
of converting it from an Identifier to a jsString then back to a UString
then into an Identifier again!
* kjs/nodes2string.cpp: Changed special-token implementation to use a separate
function for each of Endl, Indent, Unindent, and DotExpr instead of using a
single function with a switch. Added a precedence that you can stream in, to
cause the next node serialized to add parentheses based on that precedence value.
(KJS::operatorString): Moved to the top of the file.
(KJS::escapeStringForPrettyPrinting): Moved here from function.cpp. Removed old
workaround for snprintf, since StringExtras.h takes care of that.
(KJS::operator<<): Made the char and char* versions faster by using UString's
character append functions instead of constructing a UString. Added the logic
to the Node* version to add parentheses if needed.
(KJS::Node::streamLeftAssociativeBinaryOperator): Added helper function.
(KJS::ElementNode::streamTo): Use PrecAssignment for the elements.
(KJS::BracketAccessorNode::streamTo): Use PrecCall for the expression before
the bracket.
(KJS::DotAccessorNode::streamTo): Use PrecCall for the expression before the dot.
(KJS::ArgumentListNode::streamTo): Use PrecAssignment for the arguments.
(KJS::NewExprNode::streamTo): Use PrecMember for the expression.
(KJS::FunctionCallValueNode::streamTo): Use PrecCall.
(KJS::FunctionCallBracketNode::streamTo): Ditto.
(KJS::FunctionCallDotNode::streamTo): Ditto.
(KJS::PostfixBracketNode::streamTo): Ditto.
(KJS::PostfixDotNode::streamTo): Ditto.
(KJS::PostfixErrorNode::streamTo): Use PrecLeftHandSide.
(KJS::DeleteBracketNode::streamTo): Use PrecCall.
(KJS::DeleteDotNode::streamTo): Ditto.
(KJS::DeleteValueNode::streamTo): Use PrecUnary.
(KJS::VoidNode::streamTo): Ditto.
(KJS::TypeOfValueNode::streamTo): Ditto.
(KJS::PrefixBracketNode::streamTo): Use PrecCall.
(KJS::PrefixDotNode::streamTo): Ditto.
(KJS::PrefixErrorNode::streamTo): Use PrecUnary.
(KJS::UnaryPlusNode::streamTo): Ditto.
(KJS::NegateNode::streamTo): Ditto.
(KJS::BitwiseNotNode::streamTo): Ditto.
(KJS::LogicalNotNode::streamTo): Ditto.
(KJS::MultNode::streamTo): Use streamLeftAssociativeBinaryOperator.
(KJS::DivNode::streamTo): Ditto.
(KJS::ModNode::streamTo): Ditto.
(KJS::AddNode::streamTo): Ditto.
(KJS::SubNode::streamTo): Ditto.
(KJS::LeftShiftNode::streamTo): Ditto.
(KJS::RightShiftNode::streamTo): Ditto.
(KJS::UnsignedRightShiftNode::streamTo): Ditto.
(KJS::LessNode::streamTo): Ditto.
(KJS::GreaterNode::streamTo): Ditto.
(KJS::LessEqNode::streamTo): Ditto.
(KJS::GreaterEqNode::streamTo): Ditto.
(KJS::InstanceOfNode::streamTo): Ditto.
(KJS::InNode::streamTo): Ditto.
(KJS::EqualNode::streamTo): Ditto.
(KJS::NotEqualNode::streamTo): Ditto.
(KJS::StrictEqualNode::streamTo): Ditto.
(KJS::NotStrictEqualNode::streamTo): Ditto.
(KJS::BitAndNode::streamTo): Ditto.
(KJS::BitXOrNode::streamTo): Ditto.
(KJS::BitOrNode::streamTo): Ditto.
(KJS::LogicalAndNode::streamTo): Ditto.
(KJS::LogicalOrNode::streamTo): Ditto.
(KJS::ConditionalNode::streamTo): Ditto.
(KJS::AssignResolveNode::streamTo): Use PrecAssignment for the right side.
(KJS::AssignBracketNode::streamTo): Use PrecCall for the expression before
the bracket and PrecAssignment for the right side.
(KJS::AssignDotNode::streamTo): Ditto.
(KJS::AssignErrorNode::streamTo): Use PrecLeftHandSide for the left side
and PrecAssignment for the right side.
(KJS::CommaNode::streamTo): Use PrecAssignment for both expressions.
(KJS::AssignExprNode::streamTo): Use PrecAssignment.
2007-10-28 Kevin Ollivier <kevino@theolliviers.com>
Define wx port and set wx port USE options.
Reviewed by Adam Roben.
* wtf/Platform.h:
2007-10-28 Mark Rowe <mrowe@apple.com>
We don't include "config.h" in headers.
* bindings/jni/jni_instance.h:
* kjs/regexp.h:
* wtf/TCPageMap.h:
* wtf/TCSpinLock.h:
2007-10-28 Maciej Stachowiak <mjs@apple.com>
Rubber stamped by Mark.
- avoid using non-portable SIZE_T_MAX in favor of std::numeric_limits
* kjs/SymbolTable.h:
(KJS::SymbolTableIndexHashTraits::emptyValue):
* kjs/function.cpp:
(KJS::ActivationImp::getOwnPropertySlot):
(KJS::ActivationImp::put):
2007-10-28 Maciej Stachowiak <mjs@apple.com>
Reviewed by Eric.
- switch SymbolTable to be a HashMap instead of a PropertyMap for 3% SunSpider speedup
* kjs/SymbolTable.h:
(KJS::IdentifierRepHash::hash): Special hash function for identifier reps.
(KJS::IdentifierRepHash::equal): ditto
(KJS::SymbolTableIndexHashTraits::emptyValue): Special HashTraits for the index value.
(KJS::SymbolTable): change to a typedef for a HashMap.
* kjs/function.cpp:
(KJS::ActivationImp::getOwnPropertySlot): Adjusted for new SymbolTable API.
(KJS::ActivationImp::deleteProperty): ditto
(KJS::ActivationImp::put): ditto
* kjs/nodes.cpp:
(KJS::FunctionBodyNode::initializesymbolTable): Adjusted, since
you now have to store a UString::rep, not an identifier.
2007-10-27 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- numerous HashTable performance improvements
This does not quite add up to a measurable win on SunSpider, but it allows a
follow-on > 3% improvement and probably helps WebCore too.
I made the following improvements, among others:
- Made HashFunctions note whether it is ok to compare a real value with the equal() function
to the empty or deleted value, and used this to optimize the comparisons done in hash lookup.
- Specialized lookup so it doesn't have to do so many extra branches and build so many extra
std::pairs for cases that don't need them. There are now four versions, one for read-only access,
two for writing, and one folded directly into add() (these all were improvments).
- Made HashMap::get() use lookup() directly instead of find() to avoid having to build iterators.
- Made a special constructor for iterators that knows it points to
a valid filled cell and so skips updating itself.
- Reordered memory accesses in the various lookup functions for better code generation
- Made simple translators avoid passing a hash code around
- Other minor tweaks
* wtf/HashTable.h:
(WTF::):
(WTF::HashTableConstIterator::HashTableConstIterator):
(WTF::HashTableIterator::HashTableIterator):
(WTF::IdentityHashTranslator::translate):
(WTF::HashTable::end):
(WTF::HashTable::lookup):
(WTF::HashTable::lookupForWriting):
(WTF::HashTable::makeKnownGoodIterator):
(WTF::HashTable::makeKnownGoodConstIterator):
(WTF::::lookup):
(WTF::::lookupForWriting):
(WTF::::fullLookupForWriting):
(WTF::::add):
(WTF::::addPassingHashCode):
(WTF::::reinsert):
(WTF::::find):
(WTF::::contains):
* kjs/identifier.cpp:
(WTF::):
* wtf/HashFunctions.h:
(WTF::):
* wtf/HashMap.h:
(WTF::):
(WTF::::get):
* wtf/HashSet.h:
(WTF::):
(WTF::::add):
* wtf/ListHashSet.h:
(WTF::ListHashSetTranslator::translate):
2007-10-27 Darin Adler <darin@apple.com>
Reviewed by Eric.
- fix ASCIICType.h for some Windows compiles
* wtf/ASCIICType.h: Check the compiler, not the OS, since it's the
compiler/library that has the wchar_t that is just a typedef.
2007-10-27 Kevin McCullough <kmccullough@apple.com>
- BuildFix
- Forgot to change the build step when I changed the filename.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2007-10-27 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Fixed the rest of "ASSERTION FAILED: _hash in KJS::UString::Rep::
computedHash()"
http://bugs.webkit.org/show_bug.cgi?id=15718
* kjs/identifier.cpp: Fixed more cases where an Identifier didn't get a
hash value. Also changed O(n) strlen to O(1) check for empty string.
(KJS::Identifier::add):
* kjs/ustring.cpp: Changed O(n) strlens to O(1) checks for empty string.
(KJS::UString::UString):
(KJS::UString::operator=):
2007-10-27 Darin Adler <darin@apple.com>
Reviewed by Eric.
- fix pow on Windows
* wtf/MathExtras.h: (wtf_pow): Add a special case for MSVC, which has
a "pow" function that does not properly handle the case where arg1 is
NaN and arg2 is 0.
* kjs/math_object.cpp: (MathFuncImp::callAsFunction): Don't explicity
specify "::pow" -- just "pow" is fine.
2007-10-27 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15711
force JSImmediate to be inlined for roughly 1.2% SunSpider speedup
* kjs/JSImmediate.h: Put ALWAYS_INLINE on everything.
* kjs/object.h: Removed redundant includes.
* kjs/value.h: Ditto.
2007-10-27 Maciej Stachowiak <mjs@apple.com>
Reviewed by Mark.
- fixed "ASSERTION FAILED: _hash in KJS::UString::Rep::computedHash()"
http://bugs.webkit.org/show_bug.cgi?id=15718
* kjs/identifier.cpp:
(KJS::Identifier::addSlowCase): Ensure that empty Identifiers have a hash computed,
now that we count on all Identifiers already having one.
2007-10-27 Mark Rowe <mrowe@apple.com>
Silence a warning.
* kjs/SymbolTable.h:
2007-10-27 Mark Rowe <mrowe@apple.com>
Gtk build fix.
* kjs/function.h:
2007-10-26 Kevin McCullough <kmccullough@apple.com>
Rubber stamp by Adam.
- Renamed JSStringRefCOM to JSStringRefBSTR since it he only thing the
files contain are functions that operate on BSTRs.
* API/JSStringRefBSTR.cpp: Copied from API/JSStringRefCOM.cpp.
* API/JSStringRefBSTR.h: Copied from API/JSStringRefCOM.h.
* API/JSStringRefCOM.cpp: Removed.
* API/JSStringRefCOM.h: Removed.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2007-10-26 Kevin McCullough <kmccullough@apple.com>
Reviewed by Adam.
- Made JSStringCreateWithBSTR capable of handling null BSTRs.
* API/JSStringRefCOM.cpp:
(JSStringCreateWithBSTR):
2007-10-26 Sam Weinig <sam@webkit.org>
Windows build fix.
* kjs/SymbolTable.h: Add header gaurd.
* kjs/nodes.h: #include "SymbolTable.h"
2007-10-26 Geoffrey Garen <ggaren@apple.com>
Suggested by Anders Carlsson.
Fixed tyop.
* kjs/function.cpp:
(KJS::ActivationImp::getOwnPropertySlot):
2007-10-26 Geoffrey Garen <ggaren@apple.com>
Suggested by Darin Adler.
Use computedHash(), which is safer than just directly accessing _hash.
* kjs/lookup.cpp:
(KJS::Lookup::findEntry):
(KJS::Lookup::find):
2007-10-26 Geoffrey Garen <ggaren@apple.com>
Build fix: svn add SymbolTable.h
* kjs/SymbolTable.h: Added.
(KJS::SymbolTable::set):
(KJS::SymbolTable::get):
2007-10-26 Geoffrey Garen <ggaren@apple.com>
Build fix: export SymbolTable.h to WebCore.
* JavaScriptCore.xcodeproj/project.pbxproj:
2007-10-26 Geoffrey Garen <ggaren@apple.com>
Comment tweak suggested by Maciej.
* kjs/function.cpp:
(KJS::ActivationImp::getOwnPropertySlot):
2007-10-26 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Tweaked property maps to remove 2 branches. 2.5% speedup on SunSpider.
* kjs/property_map.cpp: Use a special no branch accessor to the UString's
hash value. Also, return immediately instead of branching to the end
of the loop if the value is not found.
(KJS::PropertyMap::get):
(KJS::PropertyMap::getLocation):
(KJS::PropertyMap::put):
(KJS::PropertyMap::insert):
(KJS::PropertyMap::remove):
(KJS::PropertyMap::checkConsistency):
* kjs/ustring.h:
(KJS::UString::Rep::computedHash): Special no branch accessor to the
UString's hash value. Used when the caller knows that the hash value
has already been computed. (For example, if the caller got the UString
from an Identifier.)
2007-10-26 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Switched ActivationImp to using a symbol table. For now, though, all
clients take the slow path.
Net .6% speedup on SunSpider.
Slowdowns:
- ActivationImp now mallocs in its constructor
- Local variable hits use an extra level of indirection to retrieve
data
- Local variable misses do two lookups
Speedups:
- Fast initialization of local variables upon function entry
* JavaScriptCore.xcodeproj/project.pbxproj: Added SymbolTable.h
* kjs/function.cpp:
(KJS::ActivationImp::ActivationImp): Malloc a private structure to hold
data that won't fit in a JSCell.
(KJS::ActivationImp::argumentsGetter): Use slow symbol table path for
lookup.
(KJS::ActivationImp::getOwnPropertySlot): ditto
(KJS::ActivationImp::deleteProperty): ditto
(KJS::ActivationImp::put): ditto
(KJS::ActivationImp::createArgumentsObject): ditto
(KJS::ActivationImp::mark): Call JSObject::mark first so that one of
our properties doesn't try to recursively mark us. (This caused a crash
in earlier testing. Not sure why we haven't run into it before.)
* kjs/nodes.cpp: Functions now build a symbol table the first time
they're called.
(KJS::VarDeclNode::evaluate):
(KJS::FunctionBodyNode::FunctionBodyNode):
(KJS::FunctionBodyNode::initializeSymbolTable):
(KJS::FunctionBodyNode::processDeclarations):
(KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
(KJS::FunctionBodyNode::processDeclarationsForProgramCode):
* kjs/nodes.h:
(KJS::FunctionBodyNode::symbolTable):
* wtf/Forward.h: Added Vector.
2007-10-26 Kevin McCullough <kmccullough@apple.com>
- Corrected function name mistake in this changelog.
2007-10-26 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam and Steve.
- Added convenience methods for converting between BSTR and JSStringRefs
* API/JSStringRefCOM.cpp: Added.
(JSStringCreateWithBSTR):
(JSStringCopyBSTR):
* API/JSStringRefCOM.h: Added.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2007-10-26 Mark Rowe <mrowe@apple.com>
Windows build fix.
* kjs/collector.cpp:
(KJS::Collector::collect):
2007-10-26 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Make the JSC GC use a separate heap for JSNumbers to get a 0.7-1.4% progression in SunSpider.
* kjs/CollectorHeapIntrospector.cpp:
(KJS::CollectorHeapIntrospector::init):
(KJS::CollectorHeapIntrospector::enumerate):
* kjs/CollectorHeapIntrospector.h:
* kjs/collector.cpp:
(KJS::Collector::recordExtraCost):
(KJS::Collector::heapAllocate):
(KJS::Collector::allocate):
(KJS::Collector::allocateNumber):
(KJS::Collector::registerThread):
(KJS::Collector::markStackObjectsConservatively):
(KJS::Collector::markMainThreadOnlyObjects):
(KJS::Collector::sweep):
(KJS::Collector::collect):
* kjs/collector.h:
* kjs/internal.h:
(KJS::NumberImp::operator new):
Force numbers to be allocated in the secondary heap.
2007-10-26 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- encourage GCC a little harder to inline a few hot functions for 1.5% improvement on SunSpider.
* kjs/value.h:
(KJS::JSValue::getUInt32):
(KJS::JSValue::getTruncatedInt32):
(KJS::JSValue::toNumber):
* wtf/PassRefPtr.h:
(WTF::PassRefPtr::~PassRefPtr):
* wtf/RefPtr.h:
(WTF::RefPtr::operator->):
2007-10-26 Mark Rowe <mrowe@apple.com>
Gtk build fix.
* kjs/ExecState.h:
2007-10-26 Maciej Stachowiak <mjs@apple.com>
Reviewed by Mark.
- Merge Context class fully into ExecState, since they are always created and used together.
No measurable performance impact but this is a useful cleanup.
* JavaScriptCore.pri:
* kjs/ExecState.cpp:
(KJS::ExecState::ExecState):
(KJS::ExecState::~ExecState):
(KJS::ExecState::mark):
(KJS::ExecState::lexicalInterpreter):
* kjs/ExecState.h:
(KJS::ExecState::dynamicInterpreter):
(KJS::ExecState::setException):
(KJS::ExecState::clearException):
(KJS::ExecState::exception):
(KJS::ExecState::exceptionSlot):
(KJS::ExecState::hadException):
(KJS::ExecState::scopeChain):
(KJS::ExecState::callingExecState):
(KJS::ExecState::propertyNames):
* kjs/collector.cpp:
(KJS::Collector::reportOutOfMemoryToAllInterpreters):
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction):
(KJS::FunctionImp::argumentsGetter):
(KJS::FunctionImp::callerGetter):
(KJS::GlobalFuncImp::callAsFunction):
* kjs/interpreter.cpp:
(KJS::Interpreter::Interpreter):
(KJS::Interpreter::init):
(KJS::Interpreter::evaluate):
(KJS::Interpreter::mark):
* kjs/interpreter.h:
(KJS::Interpreter::setCurrentExec):
(KJS::Interpreter::currentExec):
* kjs/nodes.cpp:
(KJS::currentSourceId):
(KJS::currentSourceURL):
(KJS::ThisNode::evaluate):
(KJS::ResolveNode::evaluate):
(KJS::FunctionCallResolveNode::evaluate):
(KJS::PostfixResolveNode::evaluate):
(KJS::DeleteResolveNode::evaluate):
(KJS::TypeOfResolveNode::evaluate):
(KJS::PrefixResolveNode::evaluate):
(KJS::AssignResolveNode::evaluate):
(KJS::VarDeclNode::evaluate):
(KJS::DoWhileNode::execute):
(KJS::WhileNode::execute):
(KJS::ForNode::execute):
(KJS::ForInNode::execute):
(KJS::ContinueNode::execute):
(KJS::BreakNode::execute):
(KJS::ReturnNode::execute):
(KJS::WithNode::execute):
(KJS::SwitchNode::execute):
(KJS::LabelNode::execute):
(KJS::TryNode::execute):
(KJS::FunctionBodyNode::processDeclarationsFunctionCode):
(KJS::FunctionBodyNode::processDeclarationsProgramCode):
(KJS::FunctionBodyNode::processDeclarations):
(KJS::FuncDeclNode::makeFunction):
(KJS::FuncExprNode::evaluate):
2007-10-26 Mark Rowe <mrowe@apple.com>
Windows build fix.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2007-10-26 Mark Rowe <mrowe@apple.com>
Gtk build fix.
* JavaScriptCore.pri:
* kjs/ExecState.cpp:
2007-10-26 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- moved Context class into ExecState.{h,cpp} in preparation for merging
ExecState and Context classes.
* kjs/ExecState.h: Moved CodeType enum and Context class here in
preparation for merging ExecState and Context.
* kjs/ExecState.cpp: Moved Context class here from Context.cpp.
(KJS::Context::Context):
(KJS::Context::~Context):
(KJS::Context::mark):
* kjs/context.h: Removed.
* kjs/Context.cpp: Removed.
* kjs/function.h: Removed CodeType enum.
* kjs/LabelStack.h: Added. Pulled LabelStack class out of internal.h.
* kjs/internal.h: Removed LabelStack.
* JavaScriptCore.xcodeproj/project.pbxproj: Added new file, removed ones that are gone.
* kjs/collector.cpp: Fixed includes.
* kjs/function.cpp: ditto
* kjs/internal.cpp: ditto
* kjs/interpreter.cpp: ditto
* kjs/lookup.h: ditto
* kjs/nodes.cpp: ditto
2007-10-26 Mark Rowe <mrowe@apple.com>
Windows build fix.
* kjs/string_object.cpp:
(KJS::StringObjectFuncImp::callAsFunction):
2007-10-25 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15703
fix numeric functions -- improve correctness and speed
Gives about 1% gain on SunSpider.
* kjs/value.h: Added toIntegerPreserveNan, removed toUInt16.
(KJS::JSValue::toInt32): Changed to call getTruncatedInt32 in a way that works
with both immediate and number values.
(KJS::JSValue::toUInt32): Ditto.
* kjs/value.cpp:
(KJS::JSValue::toInteger): Moved the logic from roundValue here, with a couple
differences. One is that it now correctly returns 0 for NaN, and another is that
there's no special case for 0 or infinity, since the general case already handles
those correctly.
(KJS::JSValue::toIntegerPreserveNaN): Added. Like toInteger, but without the
check for NaN.
(KJS::JSValue::toInt32SlowCase): Call toNumber instead of roundValue. The
truncation done by the typecast already does the necessary truncation that
roundValue was doing.
(KJS::JSValue::toUInt32SlowCase): Ditto.
(KJS::JSValue::toUInt16): Removed.
* kjs/internal.h: Removed roundValue.
* kjs/internal.cpp: Ditto.
* kjs/array_object.cpp: (KJS::ArrayProtoFunc::callAsFunction): Remove unneeded
code to handle NaN in Array.slice; toInteger now never returns NaN as specified.
* kjs/date_object.cpp:
(KJS::fillStructuresUsingTimeArgs): Replaced call to roundValue with a call to
toNumber as specified.
(KJS::DateProtoFunc::callAsFunction): In SetTime case, replaced call to roundValue
with a call to toNumber and timeClip as specified.
(KJS::DateObjectImp::construct): Removed unnecessary checks of numArgs in cases
where the default behavior of toInt32 (returning 0) was already correct. Replaced
call to roundValue with a call to toNumber as specified.
(KJS::DateObjectFuncImp::callAsFunction): Ditto.
* kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed unnecessary special
cases for the pow function that the library already handles correctly.
* kjs/number_object.cpp: (NumberProtoFunc::callAsFunction): Changed ToString to
call toIntegerPreserveNaN, so we can continue to handle the NaN case differently.
The real toInteger now returns 0 for NaN. Took out unneeded special case in
ToFixed for undefined; was only needed because our toInteger was wrong. Same
thing in ToExponential. Changed ToPrecision to call toIntegerPreserveNaN.
* kjs/string_object.cpp:
(KJS::StringProtoFunc::callAsFunction): Took out CharAt and CharCodeAt special
cases for undefined that were only needed because toInteger was wrong. Same in
IndexOf, and was able to remove some special cases. In LastIndexOf, used
toIntegerPreserveNaN, but was able to remove some special cases there too.
Changed Substr implementation to preserve correct behavior with the change
to toInteger and match the specification. Also made sure we weren't converting
an out of range double to an int.
(KJS::StringObjectFuncImp::callAsFunction): Changed constructor to just use
toUInt32, because truncating toUInt32 to 16 bits is the same thing and there's
no reason to have toUInt16 as a second, less-optimized function that's only
called at this one call site.
* wtf/MathExtras.h: Added trunc function for Windows.
2007-10-25 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Tweaked the inner hashtable lookup loop to remove a branch in the "not
found" case. .5% speedup on SunSpider.
* JavaScriptCore.xcodeproj/project.pbxproj:
* wtf/HashTable.h:
(WTF::::lookup):
2007-10-25 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- fold together toPrimitive() and toNumber() conversions for 0.5% gain on SunSpider
* kjs/nodes.cpp:
(KJS::SubNode::evaluate): Subtract directly, since toPrimitive() is not
adding any value over toNumber() here.
(KJS::valueForReadModifyAssignment): Ditto.
(KJS::lessThan): Use new getPrimitiveNumber() method to avoid some virtual calls
and branches.
(KJS::lessThanEq): Ditto.
* JavaScriptCore.exp: Export new functions as needed.
* kjs/value.h:
(KJS::JSValue::toPrimitive): Fixed formatting.
(KJS::JSValue::getPrimitiveNumber): New method - this simultaneously converts
to number and tells you whether a toPrimitive() conversion with a Number hint
would have given a string.
* kjs/internal.cpp:
(KJS::StringImp::getPrimitiveNumber): Implemented.
(KJS::NumberImp::getPrimitiveNumber): ditto
(KJS::GetterSetterImp::getPrimitiveNumber): ditto
(KJS::StringImp::toPrimitive): Fixed formatting.
(KJS::NumberImp::toPrimitive): ditto
(KJS::GetterSetterImp::toPrimitive): ditto
* kjs/internal.h:
* kjs/object.cpp:
(KJS::JSObject::getPrimitiveNumber): Implemented.
* kjs/object.h:
2007-10-25 Sam Weinig <sam@webkit.org>
Reviewed by Adam Roben.
Remove JSStringRefCFHack from windows as it is no longer needed.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2007-10-25 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Rolled out my last patch. It turns out that I needed 2 words, not 1,
so it didn't help.
2007-10-25 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
Fixed http://bugs.webkit.org/show_bug.cgi?id=15694
Shrink the size of an activation object by 1 word
This is in preparation for adding a symbol table to the activation
object.
The basic strategy here is to rely on the mutual exclusion between
the arguments object pointer and the function pointer (you only need
the latter in order to create the former), and store them in the same
place. The LazyArgumentsObject class encapsulates this strategy.
Also inlined the ArgumentsImp constructor, for good measure.
SunSpider reports no regression. Regression tests pass.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/Context.cpp:
(KJS::Context::~Context):
* kjs/function.cpp:
(KJS::ActivationImp::LazyArgumentsObject::createArgumentsObject):
(KJS::ActivationImp::LazyArgumentsObject::mark):
(KJS::ActivationImp::argumentsGetter):
(KJS::ActivationImp::mark):
* kjs/function.h:
(KJS::ActivationImp::LazyArgumentsObject::LazyArgumentsObject):
(KJS::ActivationImp::LazyArgumentsObject::getOrCreate):
(KJS::ActivationImp::LazyArgumentsObject::resetArguments):
(KJS::ActivationImp::LazyArgumentsObject::setArgumentsObject):
(KJS::ActivationImp::LazyArgumentsObject::argumentsObject):
(KJS::ActivationImp::LazyArgumentsObject::setFunction):
(KJS::ActivationImp::LazyArgumentsObject::function):
(KJS::ActivationImp::LazyArgumentsObject::createdArgumentsObject):
(KJS::ActivationImp::LazyArgumentsObject::):
(KJS::ActivationImp::ActivationImp::ActivationImp):
(KJS::ActivationImp::resetArguments):
2007-10-25 Adam Roben <aroben@apple.com>
Change JavaScriptCore.vcproj to use DerivedSources.make
We were trying to emulate the logic of make in
build-generated-files.sh, but we got it wrong. We now use a
build-generated-files very much like the one that WebCore uses to
invoke make.
We also now only have a Debug configuration of dftables which we build
even when doing a Release build of JavaScriptCore. dftables also no
longer has the "_debug" name suffix.
Changes mostly made by Darin, reviewed by me.
* DerivedSources.make: Add a variable to set the extension used for
the dftables executable.
* JavaScriptCore.vcproj/JavaScriptCore.sln: Updated to use Debug
dftables in Release configurations.
* JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Ditto.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
- Updated include path to point to the new location of the derived
sources.
- Modified pre-build event to pass the right arguments to
build-generated-files.sh and not call dftables directly.
- Added the derived source files to the project.
- Removed grammarWrapper.cpp, which isn't needed now that we're
compiling grammar.cpp directly.
* JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
Slightly modified from the WebCore version.
* JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Removed.
* JavaScriptCore.vcproj/dftables/dftables.vcproj:
- Changed the output location to match Mac.
- Removed the Release configuration.
- Removed the _debug suffix.
2007-10-25 Geoffrey Garen <ggaren@apple.com>
Reviewed by Eric Seidel.
Slightly elaborated the differences between declaration procesing in
Function Code and Program Code.
.3% speedup on SunSpider.
* kjs/nodes.cpp:
(KJS::FunctionBodyNode::processDeclarationsFunctionCode):
(KJS::FunctionBodyNode::processDeclarationsProgramCode): Store a
minimum set of attributes instead of recomputing all the time. Also,
ignore m_parameters, since programs don't have arguments.
2007-10-25 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
More preparation work before adding long-running mode to testkjs.
* kjs/testkjs.cpp:
(TestFunctionImp::callAsFunction):
(prettyPrintScript):
(runWithScripts):
(parseArguments):
(kjsmain):
(fillBufferWithContentsOfFile):
2007-10-25 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Bring testkjs code out of the dark ages in preparation for more
radical improvements (like long-running testing support!)
* kjs/testkjs.cpp:
(TestFunctionImp::callAsFunction):
(setupInterpreter):
(doIt):
(fillBufferWithContentsOfFile):
2007-10-25 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Make a fast path for declaration processing inside Function Code.
Lifted declaration processing code up from individual declaration nodes
and into processDeclarations.
Broke out processDeclarations into two cases, depending on the type of
code. This eliminates 2 branches, and facilitates more radical
divergeance in the future.
2.5% SunSpider speedup.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/nodes.cpp:
(KJS::FunctionBodyNode::initializeDeclarationStacks):
(KJS::FunctionBodyNode::processDeclarationsFunctionCode):
(KJS::FunctionBodyNode::processDeclarationsProgramCode):
(KJS::FunctionBodyNode::execute):
(KJS::FuncDeclNode::makeFunction):
* kjs/nodes.h:
2007-10-25 Maciej Stachowiak <mjs@apple.com>
Reviewed by Adam.
- add header includes needed on platforms that don't use AllInOneFile.cpp
* API/JSCallbackObject.cpp:
* kjs/Context.cpp:
* kjs/ExecState.cpp:
* kjs/array_instance.cpp:
* kjs/function_object.cpp:
* kjs/interpreter.cpp:
* kjs/nodes.cpp:
2007-10-25 Eric Seidel <eric@webkit.org>
Reviewed by Geoff.
* JavaScriptCore.xcodeproj/project.pbxproj: re-mark JSGlobalObject.h as private
2007-10-25 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Fixed http://bugs.webkit.org/show_bug.cgi?id=15683
Re-order declaration initialization to avoid calling hasProperty inside
VarDeclNode::processDeclaration
.7% speedup on SunSpider.
* kjs/function.h:
* kjs/function.cpp: Merged parameter processing into FunctionBodyNode's
other processing of declared symbols, so the order of execution could
change.
* kjs/nodes.cpp:
(KJS::VarDeclNode::getDeclarations): Added special case for the
"arguments" property name, explained in the comment.
(KJS::VarDeclNode::processDeclaration): Removed call to hasProperty
in the case of function code, since we know the declared symbol
management will resolve conflicts between symbols. Yay!
(KJS::VarDeclListNode::getDeclarations): Now that VarDeclNode's
implementation of getDeclarations is non-trivial, we can't take a
short-cut here any longer -- we need to put the VarDecl node on the
stack so it gets processed normally.
(KJS::FunctionBodyNode::processDeclarations): Changed the order of
processing to enforce mutual exclusion rules.
* kjs/nodes.h:
(KJS::DeclarationStacks::DeclarationStacks): Structure includes an
ExecState now, for fast access to the "arguments" property name.
2007-10-24 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Add a JSGlobalObject class and remove the InterpreterMap
http://bugs.webkit.org/show_bug.cgi?id=15681
This required making JSCallbackObject a template class to allow for
JSGlobalObjects with JSCallbackObject functionality.
SunSpider claims this was a 0.5% speedup.
* API/JSCallbackObject.cpp:
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h: Copied from API/JSCallbackObject.cpp.
(KJS::::JSCallbackObject):
(KJS::::init):
(KJS::::~JSCallbackObject):
(KJS::::initializeIfNeeded):
(KJS::::className):
(KJS::::getOwnPropertySlot):
(KJS::::put):
(KJS::::deleteProperty):
(KJS::::implementsConstruct):
(KJS::::construct):
(KJS::::implementsHasInstance):
(KJS::::hasInstance):
(KJS::::implementsCall):
(KJS::::callAsFunction):
(KJS::::getPropertyNames):
(KJS::::toNumber):
(KJS::::toString):
(KJS::::setPrivate):
(KJS::::getPrivate):
(KJS::::inherits):
(KJS::::cachedValueGetter):
(KJS::::staticValueGetter):
(KJS::::staticFunctionGetter):
(KJS::::callbackGetter):
* API/JSClassRef.cpp:
(OpaqueJSClass::prototype):
* API/JSContextRef.cpp:
(JSGlobalContextCreate):
* API/JSObjectRef.cpp:
(JSObjectMake):
(JSObjectGetPrivate):
(JSObjectSetPrivate):
* API/JSValueRef.cpp:
(JSValueIsObjectOfClass):
* JavaScriptCore.exp:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bindings/c/c_utility.cpp:
(KJS::Bindings::convertValueToNPVariant):
* bindings/jni/jni_jsobject.cpp:
* bindings/objc/objc_utility.mm:
(KJS::Bindings::convertValueToObjcValue):
* kjs/Context.cpp:
(KJS::Context::Context):
* kjs/ExecState.cpp:
(KJS::ExecState::lexicalInterpreter):
* kjs/JSGlobalObject.h: Added.
(KJS::JSGlobalObject::JSGlobalObject):
(KJS::JSGlobalObject::isGlobalObject):
(KJS::JSGlobalObject::interpreter):
(KJS::JSGlobalObject::setInterpreter):
* kjs/array_instance.cpp:
* kjs/context.h:
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction):
(KJS::GlobalFuncImp::callAsFunction):
* kjs/interpreter.cpp:
(KJS::Interpreter::Interpreter):
(KJS::Interpreter::init):
(KJS::Interpreter::~Interpreter):
(KJS::Interpreter::globalObject):
(KJS::Interpreter::initGlobalObject):
(KJS::Interpreter::evaluate):
* kjs/interpreter.h:
* kjs/lookup.h:
(KJS::cacheGlobalObject):
* kjs/object.h:
(KJS::JSObject::isGlobalObject):
* kjs/testkjs.cpp:
2007-10-24 Eric Seidel <eric@webkit.org>
Build fix for Gtk, no review.
* kjs/collector.cpp: #include "context.h"
2007-10-24 Eric Seidel <eric@webkit.org>
Reviewed by Maciej.
Stop checking isOutOfMemory after every allocation, instead let the collector
notify all ExecStates if we ever hit this rare condition.
SunSpider claims this was a 2.2% speedup.
* kjs/collector.cpp:
(KJS::Collector::collect):
(KJS::Collector::reportOutOfMemoryToAllInterpreters):
* kjs/collector.h:
* kjs/nodes.cpp:
(KJS::TryNode::execute):
2007-10-24 Mark Rowe <mrowe@apple.com>
Gtk build fix.
* kjs/identifier.h: Remove extra qualification.
2007-10-24 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Disable ALWAYS_INLINE in debug builds, since it drives the debugger
crazy.
* wtf/AlwaysInline.h:
2007-10-24 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
Inlined the fast path for creating an Identifier from an Identifier.
This is a .4% speedup on SunSpider overall, but as big as a 2.5%
speedup on certain individual tests. 65% of the Identifiers creating
by SunSpider are already Identifiers.
(The main reason I'm making this change is that it resolves a large
regression in a patch I haven't checked in yet.)
* JavaScriptCore.exp:
* kjs/identifier.cpp:
(KJS::Identifier::addSlowCase):
* kjs/identifier.h:
(KJS::Identifier::Identifier::add):
2007-10-24 Lars Knoll <lars@trolltech.com>
Reviewed by Simon.
some changes to the way JS values are converted to Qt values in the script bindings. Added support for converting JS arrays into QStringList's.
* bindings/qt/qt_instance.cpp:
(KJS::Bindings::QtInstance::invokeMethod):
* bindings/qt/qt_runtime.cpp:
(KJS::Bindings::convertValueToQVariant):
(KJS::Bindings::QtField::setValueToInstance):
2007-10-24 Oliver Hunt <oliver@apple.com>
Reviewed by Darin.
Remove old relation method, replace with specialised LessThan and lessThenEq functions for a 0.5-0.6% improvement in SunSpider
* kjs/nodes.cpp:
(KJS::lessThan):
(KJS::lessThanEq):
(KJS::LessNode::evaluate):
(KJS::GreaterNode::evaluate):
(KJS::LessEqNode::evaluate):
(KJS::GreaterEqNode::evaluate):
* kjs/operations.cpp:
* kjs/operations.h:
2007-10-24 Eric Seidel <eric@webkit.org>
Reviewed by darin.
* kjs/nodes.h:
(KJS::ImmediateNumberNode::): Fix ASSERT correctness (and debug build!)
2007-10-24 Darin Adler <darin@apple.com>
Reviewed by Eric.
* kjs/object.cpp: (KJS::JSObject::defaultValue): Get rid of a little
Identifier ref/deref for what SunSpider claims is a 0.4% speedup.
2007-10-24 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- separate out the code to create a hash table the first time from the code
to rehash
SunSpider claims this was a 0.7% speedup.
* kjs/property_map.cpp:
(KJS::PropertyMap::expand): Changed to call either createTable or rehash.
(KJS::PropertyMap::createTable): Added. For the case where we had no table.
(KJS::PropertyMap::rehash): Removed code needed only in the case where we
had no table.
* kjs/property_map.h: Added createTable.
2007-10-24 Eric Seidel <eric@webkit.org>
Reviewed by darin.
Add ImmediateNumberNode to hold a JSValue* instead of a double for numbers
which can be represented by JSImmediate.
SunSpider claims this was a 0.6% speedup.
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::NumberNode::evaluate):
(KJS::ImmediateNumberNode::evaluate):
* kjs/nodes.h:
(KJS::Node::):
(KJS::ImmediateNumberNode::):
* kjs/nodes2string.cpp:
(ImmediateNumberNode::streamTo):
2007-10-24 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15657
change static hash tables to use powers of two for speed
Seems to give 0.7% SunSpider speedup.
* kjs/create_hash_table: Updated to generate new format.
* kjs/lookup.cpp:
(KJS::keysMatch): Took out unneeded typecast.
(KJS::findEntry): Updated to expect table type 3 -- changed the printf to a plain old assert.
Replaced the modulus with a bit mask.
(KJS::Lookup::findEntry): Get the hash directly, since we know identifiers already have computed
their hash -- saves a branch.
(KJS::Lookup::find): Ditto.
* kjs/lookup.h: Changed attr from 2-byte value to one-byte value. Replaced hashSize with hashSizeMask.
2007-10-24 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- remove KJS_CHECKEXCEPTIONs in places where exceptions can't happen for 0.6% SunSpider speedup
* kjs/nodes.cpp:
(KJS::DoWhileNode::execute):
(KJS::WhileNode::execute):
(KJS::ForNode::execute):
(KJS::ForInNode::execute):
(KJS::SourceElementsNode::execute):
2007-10-23 Darin Adler <darin@apple.com>
Reviewed by Maciej.
* kjs/JSImmediate.h: (KJS::JSImmediate::getUInt32):
Changed an && to an & for a 1% gain in SunSpider.
2007-10-23 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Reduce branching in implementations of some operator implementations, yielding 1.3% boost to SunSpider.
* kjs/nodes.cpp:
(KJS::MultNode::evaluate):
(KJS::DivNode::evaluate):
(KJS::ModNode::evaluate):
(KJS::add):
(KJS::sub):
(KJS::AddNode::evaluate):
(KJS::SubNode::evaluate):
(KJS::valueForReadModifyAssignment):
* kjs/operations.cpp:
* kjs/operations.h:
2007-10-23 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Separating all of the simple (eg. non-read-modify-write) binary operators
into separate classes in preparation for further JS optimisations.
Happily this produces a 0.8% to 1.0% performance increase in SunSpider with
no further work.
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/grammar.y:
* kjs/nodes.cpp:
(KJS::MultNode::evaluate):
(KJS::DivNode::evaluate):
(KJS::ModNode::evaluate):
(KJS::AddNode::evaluate):
(KJS::SubNode::evaluate):
(KJS::LeftShiftNode::evaluate):
(KJS::RightShiftNode::evaluate):
(KJS::UnsignedRightShiftNode::evaluate):
(KJS::LessNode::evaluate):
(KJS::GreaterNode::evaluate):
(KJS::LessEqNode::evaluate):
(KJS::GreaterEqNode::evaluate):
(KJS::InstanceOfNode::evaluate):
(KJS::InNode::evaluate):
(KJS::EqualNode::evaluate):
(KJS::NotEqualNode::evaluate):
(KJS::StrictEqualNode::evaluate):
(KJS::NotStrictEqualNode::evaluate):
(KJS::BitAndNode::evaluate):
(KJS::BitXOrNode::evaluate):
(KJS::BitOrNode::evaluate):
(KJS::LogicalAndNode::evaluate):
(KJS::LogicalOrNode::evaluate):
* kjs/nodes.h:
(KJS::MultNode::):
(KJS::DivNode::):
(KJS::ModNode::):
(KJS::AddNode::):
(KJS::SubNode::):
(KJS::LeftShiftNode::):
(KJS::RightShiftNode::):
(KJS::UnsignedRightShiftNode::):
(KJS::LessNode::):
(KJS::GreaterNode::):
(KJS::LessEqNode::):
(KJS::GreaterEqNode::):
(KJS::InstanceOfNode::):
(KJS::InNode::):
(KJS::EqualNode::):
(KJS::NotEqualNode::):
(KJS::StrictEqualNode::):
(KJS::NotStrictEqualNode::):
(KJS::BitAndNode::):
(KJS::BitOrNode::):
(KJS::BitXOrNode::):
(KJS::LogicalAndNode::):
(KJS::LogicalOrNode::):
* kjs/nodes2string.cpp:
(MultNode::streamTo):
(DivNode::streamTo):
(ModNode::streamTo):
(AddNode::streamTo):
(SubNode::streamTo):
(LeftShiftNode::streamTo):
(RightShiftNode::streamTo):
(UnsignedRightShiftNode::streamTo):
(LessNode::streamTo):
(GreaterNode::streamTo):
(LessEqNode::streamTo):
(GreaterEqNode::streamTo):
(InstanceOfNode::streamTo):
(InNode::streamTo):
(EqualNode::streamTo):
(NotEqualNode::streamTo):
(StrictEqualNode::streamTo):
(NotStrictEqualNode::streamTo):
(BitAndNode::streamTo):
(BitXOrNode::streamTo):
(BitOrNode::streamTo):
(LogicalAndNode::streamTo):
2007-10-23 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fix http://bugs.webkit.org/show_bug.cgi?id=15639
fix Math.abs(0), Math.ceil(-0), and Math.floor(-0)
Test: fast/js/math.html
* kjs/math_object.cpp: (MathFuncImp::callAsFunction):
Fix abs to look at the sign bit. Add a special case for values in the range
between -0 and -1 and a special case for ceil and for -0 for floor.
2007-10-23 Darin Adler <darin@apple.com>
Reviewed by Eric.
- streamline exception handling code for a >1% speed-up of SunSpider
* kjs/nodes.cpp: Changed macros to use functions for everything that's not
part of normal execution. We'll take function call overhead when propagating
an exception or out of memory.
(KJS::createOutOfMemoryCompletion): Added.
(KJS::substitute): Use append instead of the relatively inefficient + operator.
(KJS::Node::rethrowException): Added.
* kjs/nodes.h: Added rethrowException.
2007-10-22 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fix http://bugs.webkit.org/show_bug.cgi?id=15636
some JavaScriptCore regression tests are failing due to numeric conversion
This should restore correctness and make speed better too, restoring some
of the optimization we lost in my last check-in.
* kjs/JSImmediate.h:
(KJS::JSImmediate::getTruncatedInt32): Added. Uses the range checking idiom
I used in my patch yesterday.
(KJS::JSImmediate::getTruncatedUInt32): Ditto.
* kjs/internal.h: Removed getInt32 and added getTruncatedInt/UInt32.
* kjs/internal.cpp:
(KJS::NumberImp::getUInt32): Changed to always use double, since I can't find
a way to write this more efficiently for float.
(KJS::NumberImp::getTruncatedInt32): Added.
(KJS::NumberImp::getTruncatedUInt32): Added.
* kjs/value.h: Removed getInt32 and added getTruncatedInt/UInt32.
(KJS::JSValue::getUInt32):
(KJS::JSValue::getTruncatedInt32): Added.
(KJS::JSValue::getTruncatedUInt32): Added.
(KJS::JSValue::toInt32): Changed getInt32 call to getTruncatedInt32.
(KJS::JSValue::toUInt32): Changed getUInt32 call to getTruncatedUInt32.
* kjs/value.cpp:
(KJS::JSCell::getTruncatedInt32): Added.
(KJS::JSCell::getTruncatedUInt32): Added.
(KJS::JSValue::toInteger): Changed getUInt32 call to getTruncatedInt32.
(KJS::JSValue::toInt32SlowCase): Removed extra getInt32 call I accidentally
had left in here.
(KJS::JSValue::toUInt32SlowCase): Ditto.
(KJS::JSValue::toUInt16): Changed getUInt32 call to getTruncatedUInt32.
* JavaScriptCore.exp: Updated.
2007-10-22 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- fix http://bugs.webkit.org/show_bug.cgi?id=15632
js1_5/Array/array-001.js test failing
One of the JavaScriptCore tests was failing; it failed because of
my change to NumberImp::getUInt32. The incorrect code I copied was
from JSImmediate::getUInt32, and was a pre-existing bug.
This patch fixes correctness, but will surely slow down SunSpider.
We may be able to code this tighter and get the speed back.
* kjs/JSImmediate.h:
(KJS::JSImmediate::getInt32): Renamed from toInt32 to more accurately
reflect the fact that this function only returns true if the value is
accurate (no fractional part, etc.). Changed code so that it returns
false when the value has a fraction.
(KJS::JSImmediate::getUInt32): Ditto.
* kjs/internal.cpp:
(KJS::NumberImp::getInt32): Changed code so that it returns false when
the value has a fraction. Restores the old behavior.
(KJS::NumberImp::getUInt32): Ditto.
* kjs/value.h:
(KJS::JSValue::getInt32): Updated for name change.
(KJS::JSValue::getUInt32): Ditto.
(KJS::JSValue::toInt32): Ditto.
(KJS::JSValue::toUInt32): Ditto.
2007-10-22 Darin Adler <darin@apple.com>
Reviewed by Brady.
- fix crash seen when running JavaScriptCore tests
* kjs/array_instance.cpp: (KJS::ArrayInstance::mark):
Copy and paste error: I accidentally had code here that was
making a copy of the HashMap -- that's illegal inside a mark
function and was unnecessary. The other callsite was modifying
the map as it iterated it, but this function is not.
2007-10-22 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver.
- Avoid moving floats into integer registers in jsNumber() for 3% speedup on SunSpider
http://bugs.webkit.org/show_bug.cgi?id=15627
* kjs/JSImmediate.h:
(KJS::JSImmediate::fromDouble): Avoid moving floats to integer
registers since this is very slow.
2007-10-22 Darin Adler <darin@apple.com>
Reviewed by Eric Seidel.
- http://bugs.webkit.org/show_bug.cgi?id=15617
improve speed of integer conversions
Makes SunSpider 6% faster.
* kjs/JSImmediate.h: Added toInt32 and toUInt32, with separate versions for
32-bit and 64-bit.
* kjs/value.h:
(KJS::JSValue::getUInt32): Call JSImmediate::toUInt32.
* kjs/internal.h: Added getInt32.
* kjs/internal.cpp:
(KJS::NumberImp::getInt32): Added.
(KJS::NumberImp::getUInt32): Replaced with more-optimal implementation
stolen from JSValue.
* kjs/value.h:
(KJS::jsNumber): Marked ALWAYS_INLINE, because this wasn't getting
inlined.
(KJS::JSValue::getInt32): Added.
(KJS::JSValue::getUInt32): Changed to call the new JSImmediate::toUInt32
to avoid converting from float to double.
(KJS::JSValue::toInt32): Made inline, separated out the slow case.
(KJS::JSValue::toUInt32): Ditto.
* kjs/value.cpp:
(KJS::JSCell::getInt32): Added.
(KJS::JSValue::toInt32SlowCase): Renamed from toInt32. Changed to use the
new getInt32. Added a faster case for in-range numbers.
(KJS::JSValue::toUInt32SlowCase): Ditto.
(KJS::JSValue::toUInt16): Added a faster case for in-range numbers.
* JavaScriptCore.exp: Updated for changes.
2007-10-22 Adam Roben <aroben@apple.com>
Windows build fix
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Turn off
warning about implicit conversion to bool.
2007-10-22 Mark Rowe <mrowe@apple.com>
Gtk build fix.
* kjs/array_instance.cpp:
2007-10-22 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15606
make cut-off for sparse vs. dense arrays smarter for speed with large arrays
Makes the morph test in SunSpider 26% faster, and the overall
benchmark 3% faster.
This also fixes some small problems we had with the distinction
between nonexistent and undefined values in arrays.
* kjs/array_instance.h: Tweaked formatting and naming.
* kjs/array_instance.cpp: Copied from kjs/array_object.cpp.
(KJS::storageSize): Added. Computes the size of the storage given a vector length.
(KJS::increasedVectorLength): Added. Implements the rule for resizing the vector.
(KJS::isDenseEnoughForVector): Added.
(KJS::ArrayInstance::ArrayInstance): Initialize the new fields.
(KJS::ArrayInstance::~ArrayInstance): Since m_storage is now never 0, delete it.
(KJS::ArrayInstance::getItem): Updated for name changes.
(KJS::ArrayInstance::lengthGetter): Ditto.
(KJS::ArrayInstance::inlineGetOwnPropertySlot): Added. Allows both versions of
getOwnPropertySlot to share more code.
(KJS::ArrayInstance::getOwnPropertySlot): Just refactored, no code change.
(KJS::ArrayInstance::put): Added logic for extending the vector as long as the
array is dense enough. Also keep m_numValuesInVector up to date.
(KJS::ArrayInstance::deleteProperty): Added code to keep m_numValuesInVector
up to date.
(KJS::ArrayInstance::getPropertyNames): Fixed bug where this would omit names
for array indices with undefined values.
(KJS::ArrayInstance::increaseVectorLength): Renamed from resizeStorage. Also
simplified to only handle getting larger.
(KJS::ArrayInstance::setLength): Added code to update m_numValuesInVector, to
zero out the unused part of the vector and to delete the map if it's no longer
needed.
(KJS::ArrayInstance::mark): Tweaked formatting.
(KJS::compareByStringForQSort): Ditto.
(KJS::ArrayInstance::sort): Ditto.
(KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
Ditto.
(KJS::compareWithCompareFunctionForQSort): Ditto.
(KJS::ArrayInstance::compactForSorting): Fixed bug where this would turn
undefined values into nonexistent values in some cases.
* kjs/array_object.h: Removed MAX_ARRAY_INDEX.
* kjs/array_object.cpp: Removed ArrayInstance. Moved to a separate file.
* JavaScriptCore.pri: Added array_instance.cpp.
* JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
* kjs/AllInOneFile.cpp: Ditto.
2007-10-22 Andrew Wellington <proton@wiretapped.net>
Reviewed by Mark Rowe.
Fix for local database support after r26879
Ensure that ENABLE_DATABASE and ENABLE_ICONDATABASE are correctly set
* Configurations/JavaScriptCore.xcconfig:
2007-10-22 Simon Hausmann <hausmann@kde.org>
Reviewed by Alp.
Build fix for the non-qmake builds.
* wtf/Platform.h: Default to enabling the database features unless
otherwise specified. (similar to ENABLE_ICONDATABASE)
2007-10-22 Holger Freyther <zecke@selfish.org>
Reviewed by Simon Hausmann <hausmann@kde.org>.
* Do not build testkjs as an application bundle. This is
needed for run-javascriptcore-tests on OSX.
* Also, based on r26633, allow to test the WebKit/Qt port on OSX.
* Set DYLD_LIBRARY_PATH if it was set in the environment. It must be set
as we do not have -rpath on OSX.
* kjs/testkjs.pro:
2007-10-21 Mark Rowe <mrowe@apple.com>
Reviewed by Alp.
http://bugs.webkit.org/show_bug.cgi?id=15575
Bug 15575: [GTK] Implement threading using GThread
* wtf/Platform.h: Do not enable pthreads for Gtk.
2007-10-21 Mark Rowe <mrowe@apple.com>
Reviewed by Mitz.
Fix http://bugs.webkit.org/show_bug.cgi?id=15603
Bug 15603: Regression(r26847): Crash when sorting an empty array from JavaScript
* kjs/array_object.cpp:
(KJS::freeStorage): Reinstate null-check that was removed in r26847.
2007-10-21 Darin Adler <darin@apple.com>
- fix Windows build
* kjs/array_instance.h: Removed unused ExecState parameter.
* kjs/array_object.cpp:
(KJS::ArrayInstance::put): Ditto.
(KJS::ArrayInstance::setLength): Ditto.
2007-10-21 Darin Adler <darin@apple.com>
* kjs/array_object.cpp: (KJS::ArrayInstance::put):
Add missing assignment that was causing regression test crash.
2007-10-21 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15585
speed up sparse arrays by using a custom map
Speeds up SunSpider by 10%.
* kjs/array_object.cpp:
(allocateStorage): Leave room for an additional pointer.
(reallocateStorage): Ditto.
(freeStorage): Ditto.
(ArrayInstance::~ArrayInstance): Delete the overflow map if present.
(ArrayInstance::getItem): Read values from the overflow map if present.
Removed the check of length, since it slows down the common case.
(ArrayInstance::getOwnPropertySlot): Ditto. Also removed the fallback
to the property map.
(ArrayInstance::put): Write values into the overflow map as needed.
Also create overflow map when needed.
(ArrayInstance::deleteProperty): Remove values from the overflow map
as appropriate.
(ArrayInstance::getPropertyNames): Add a name for each identifier in
the property map. This is extremely inefficient.
(ArrayInstance::setLength): Remove any values in the overflow map
that are past the new length, as we formerly did with the property map.
(ArrayInstance::mark): Mark any values in the overflow map.
(compareByStringForQSort): Removed unneeded undefined case, since
compactForSorting guarantees we will have no undefined values.
(compareWithCompareFunctionForQSort): Ditto.
(ArrayInstance::compactForSorting): Copy all the values out of the
overflow map and destroy it.
* kjs/property_map.h: Removed now-unused getSparseArrayPropertyNames.
* kjs/property_map.cpp: Ditto.
2007-10-20 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=15579
stop churning identifier reference counts copying Completion objects
* kjs/completion.h: Replace the Identifier with an Identifier*.
* kjs/nodes.cpp:
(ForInNode::execute): Update for change to Completion constructor.
(ContinueNode::execute): Ditto.
(BreakNode::execute): Ditto.
2007-10-20 Mark Rowe <mrowe@apple.com>
Reviewed by Alp.
Gtk changes needed to enable HTML 5 client-side database storage.
* wtf/Platform.h: Have Gtk use pthreads for now.
2007-10-20 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Fixed http://bugs.webkit.org/show_bug.cgi?id=15570
Store gathered declaration nodes in the function body node.
This means that you only have to gather the declaration nodes the first
time the function executes. Performance gain of 2.10% on SunSpider,
0.90% on command-line JS iBench.
* kjs/nodes.cpp: Split declaration stack initialization code off into
initializeDeclarationStacks().
(FunctionBodyNode::FunctionBodyNode):
(FunctionBodyNode::initializeDeclarationStacks):
(FunctionBodyNode::processDeclarations):
* kjs/nodes.h: Changed DeclarationStacks structure to hold references,
since the actual Vectors are now stored either on the stack or in the
function body node.
2007-10-19 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
http://bugs.webkit.org/show_bug.cgi?id=15559
Moved processDeclarations call into FunctionBodyNode::execute
To improve encapsulation, moved processDeclarations call into
FunctionBodyNode::execute. Also marked processDeclarations
ALWAYS_INLINE, since it has only 1 caller now. This is a .71% speedup
on command-line JS iBench.
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction):
(KJS::GlobalFuncImp::callAsFunction):
* kjs/function.h:
* kjs/interpreter.cpp:
(KJS::Interpreter::evaluate):
* kjs/nodes.cpp:
(FunctionBodyNode::execute):
* kjs/nodes.h:
2007-10-19 Brady Eidson <beidson@apple.com>
Reviewed by Sam
Queue -> Deque! and small style tweaks
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
* wtf/Deque.h: Added.
(WTF::DequeNode::DequeNode):
(WTF::Deque::Deque):
(WTF::Deque::~Deque):
(WTF::Deque::size):
(WTF::Deque::isEmpty):
(WTF::Deque::append):
(WTF::Deque::prepend):
(WTF::Deque::first):
(WTF::Deque::last):
(WTF::Deque::removeFirst):
(WTF::Deque::clear):
* wtf/Queue.h: Removed.
2007-10-19 Brady Eidson <beidson@apple.com>
Reviewed by Oliver
Added a simple LinkedList based Queue to wtf
We can make a better, more sophisticated an efficient one later, but have
needed one for some time, now!
* JavaScriptCore.xcodeproj/project.pbxproj:
* wtf/Queue.h: Added.
(WTF::QueueNode::QueueNode):
(WTF::Queue::Queue):
(WTF::Queue::~Queue):
(WTF::Queue::size):
(WTF::Queue::isEmpty):
(WTF::Queue::append):
(WTF::Queue::prepend):
(WTF::Queue::first):
(WTF::Queue::last):
(WTF::Queue::removeFirst):
(WTF::Queue::clear):
2007-10-19 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by Anders.
Try to fix Qt/Win build slave, by including windows.h also on Qt/Win.
* kjs/testkjs.cpp: Change PLATFORM(WIN) to PLATFORM(WIN_OS)
2007-10-19 Simon Hausmann <hausmann@kde.org>
Reviewed by Lars.
Fix compilation on Windows when wchar_t is a typedef instead of a native type (triggered by -Zc:wchar_t-).
Don't provide the wchar_t overloads then as they conflict with the unsigned short ones.
* wtf/ASCIICType.h:
(WTF::isASCIIAlpha):
(WTF::isASCIIAlphanumeric):
(WTF::isASCIIDigit):
(WTF::isASCIIHexDigit):
(WTF::isASCIILower):
(WTF::isASCIISpace):
(WTF::toASCIILower):
(WTF::toASCIIUpper):
2007-10-19 Simon Hausmann <hausmann@kde.org>
Reviewed by Lars.
Another build fix for the windows/qt build: Apply the same fix as in revision 26686 also to kjs/config.h to disable the disallowctype feature.
* kjs/config.h:
2007-10-18 Maciej Stachowiak <mjs@apple.com>
Reviewed by Adam.
- use __declspec(thread) for fast thread-local storage on Windows
- 2.2% speedup on sunspider (on Windows)
- 7% speedup on the string section
- 6% speedup on JS iBench
- fixed <rdar://problem/5473084> PLT on Windows got 2.5% slower between r25406 and r25422
- fixed at least some of <rdar://5527965? i-Bench JS was 14% slower in 310A11 than 310A10
* wtf/FastMalloc.cpp:
(WTF::getThreadHeap):
(WTF::setThreadHeap):
(WTF::TCMalloc_ThreadCache::GetCache):
(WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
(WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
2007-10-17 Darin Adler <darin@apple.com>
Reviewed by Mark Rowe.
- fix http://bugs.webkit.org/show_bug.cgi?id=15543
<rdar://problem/5545639> REGRESSION (r26697):
GoogleDocs: Can't create new documents or open existing ones
Test: fast/js/regexp-non-character.html
* pcre/pcre_compile.c: (check_escape): Take out the checks for valid characters
in the \u sequences -- not needed and actively harmful.
2007-10-17 Anders Carlsson <andersca@apple.com>
Reviewed by Oliver.
* wtf/Platform.h:
#define USE_PTHREADS on Mac.
2007-10-17 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Merged DeclaredFunctionImp into FunctionImp (the base class) because
the distinction between the two was unused.
Removed codeType() from FunctionImp because FunctionImp and its
subclasses all returned FunctionCode, so it was unused, practically
speaking.
Removed a different codeType() from GlobalFuncImp because it was unused.
(Perhaps it was vestigial from a time when GlobalFuncImp used to
inherit from FunctionImp.)
* bindings/runtime_method.cpp:
* bindings/runtime_method.h:
* kjs/function.cpp:
(KJS::FunctionImp::FunctionImp):
(KJS::FunctionImp::callAsFunction):
(KJS::FunctionImp::construct):
(KJS::FunctionImp::execute):
(KJS::FunctionImp::processVarDecls):
* kjs/function.h:
(KJS::FunctionImp::implementsConstruct):
(KJS::FunctionImp::scope):
* kjs/function_object.cpp:
(FunctionProtoFunc::callAsFunction):
(FunctionObjectImp::construct):
* kjs/nodes.cpp:
(FuncDeclNode::processFuncDecl):
(FuncExprNode::evaluate):
2007-10-17 Adam Roben <aroben@apple.com>
Windows build fix part 2.
Fix was by Darin, reviewed by Anders and Adam.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add
FastMallocPCRE.cpp to the project, and let Visual Studio have its way
with the post-build step.
* pcre/pcre.h: Don't DLL export the entry points just because this
is Win32 -- this is an internal copy of PCRE and should be private.
* pcre/pcre_compile.c: Fix an uninitialized variable warning --
there's no real problem but it's better to quiet the compiler by
tweaking the code slightly than turn off the warning entirely.
2007-10-17 Adam Roben <aroben@apple.com>
Windows build fix.
Reviewed by Anders.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
some mismatched signed/unsigned comparison warnings.
* pcre/pcre_exec.c:
(match): #if-out some labels that don't seem to exist.
2007-10-17 Mark Rowe <mrowe@apple.com>
Gtk build fix.
* JavaScriptCore.pri: Add FastMallocPCRE.cpp.
* pcre/pcre_get. #if out two functions that depend on pcre_get_stringnumber, which
is currently unavailable for UTF-16.
2007-10-16 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- merged PCRE changes between 6.4 and 6.5
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
Removed pcre_config.c, pcre_globals.c, pcre_info.c, pcre_maketables.c,
pcre_printint.src, pcre_refcount.c, pcre_study.c, pcre_try_flipped.c,
pcre_ucp_findchar.c, pcre_version.c, and ucptable.c. Added pcre_ucp_searchfuncs.c.
* pcre/AUTHORS:
* pcre/LICENCE:
* pcre/MERGING:
* pcre/dftables.c:
* pcre/pcre-config.h:
* pcre/pcre.h:
* pcre/pcre.pri:
* pcre/pcre_compile.c:
* pcre/pcre_exec.c:
* pcre/pcre_fullinfo.c:
* pcre/pcre_get.c:
* pcre/pcre_internal.h:
* pcre/pcre_maketables.c:
* pcre/pcre_ord2utf8.c:
* pcre/pcre_tables.c:
* pcre/pcre_ucp_searchfuncs.c: Copied from pcre/pcre_ucp_findchar.c.
* pcre/pcre_xclass.c:
* pcre/ucp.h:
* pcre/ucpinternal.h:
* pcre/ucptable.c:
Updated with new versions from the PCRE 6.5 release, merged with changes.
* pcre/pcre_config.c: Removed.
* pcre/pcre_globals.c: Removed.
* pcre/pcre_info.c: Removed.
* pcre/pcre_printint.src: Removed.
* pcre/pcre_refcount.c: Removed.
* pcre/pcre_study.c: Removed.
* pcre/pcre_try_flipped.c: Removed.
* pcre/pcre_ucp_findchar.c: Removed.
* pcre/pcre_version.c: Removed.
2007-10-16 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Removed KJS_VERBOSE because it was getting in the way of readability,
and the messages didn't seem very helpful.
* kjs/function.cpp:
(KJS::FunctionImp::callAsFunction):
(KJS::FunctionImp::passInParameters):
* kjs/lookup.h:
(KJS::lookupPut):
* kjs/object.cpp:
(KJS::JSObject::put):
* kjs/value.h:
2007-10-16 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Removed the Parameter class because it was a redundant wrapper around
Identifier.
* kjs/function.cpp:
(KJS::FunctionImp::passInParameters):
(KJS::FunctionImp::getParameterName):
* kjs/nodes.cpp:
(FunctionBodyNode::addParam):
* kjs/nodes.h:
(KJS::FunctionBodyNode::):
2007-10-16 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Global replace of assert with ASSERT.
2007-10-16 Adam Roben <aroben@apple.com>
Make testkjs not delay-load WebKit
Soon, delay-loading WebKit will be impossible (because we will be
using __declspec(thread) for thread-local storage). This change
prepares testkjs for the future.
Reviewed by Sam.
* JavaScriptCore.vcproj/JavaScriptCore.sln: Removed WebKitInitializer,
added FindSafari.
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Don't link against
WebKitInitializer, don't delay-load WebKit.
* kjs/testkjs.cpp: Don't use WebKitInitializer.
2007-10-16 Adam Roben <aroben@apple.com>
Updated testkjs for the rename of WebKit_debug.dll to WebKit.dll for the Debug configuration
Reviewed by Kevin McCullough.
* JavaScriptCore.vcproj/debug.vsprops: Added WebKitDLLConfigSuffix.
* JavaScriptCore.vcproj/debug_internal.vsprops: Ditto.
* JavaScriptCore.vcproj/release.vsprops: Ditto.
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Use
WebKitDLLConfigSuffix when referring to WebKit.dll, and fixed a typo
in the name of icuuc36[_debug].dll.
2007-10-16 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Re-structured variable and function declaration code.
Command-line JS iBench shows no regression.
Here are the changes:
1. Function declarations are now processed at the same time as var
declarations -- namely, immediately upon entry to an execution context.
This does not match Firefox, which waits to process a function
declaration until the declaration's containing block executes, but it
does match IE and the ECMA spec. (10.1.3 states that var and function
declarations should be processed at the same time -- namely, "On
entering an execution context." 12.2 states that "A Block does not
define a new execution scope.")
2. Declaration processing proceeds iteratively now, rather than
recursively, storing the nodes is finds in stacks. This will later
facilitate an optimization to hold on to the gathered declaration nodes,
rather than re-fetching them in every function call.
[ http://bugs.webkit.org/show_bug.cgi?id=14868 ]
Modified these tests because they expected the incorrect Mozilla
behavior described above:
* tests/mozilla/ecma_3/Function/scope-001.js:
* tests/mozilla/js1_5/Scope/regress-184107.js:
2007-10-16 Darin Adler <darin@apple.com>
- try to fix the GTK build
* kjs/ustring.cpp: Include ASCIICType.h, not ASCIICtype.h.
2007-10-16 Darin Adler <darin@apple.com>
- try to fix the Windows build
* kjs/date_object.cpp: (KJS::parseDate): A couple instances of isspace were
in here. Not sure why it wasn't failing elsewhere. Changed to isASCIISpace.
2007-10-16 Darin Adler <darin@apple.com>
- try to fix the GTK build
* kjs/ustring.cpp: Include ASCIICType.h.
2007-10-16 Darin Adler <darin@apple.com>
Reviewed by Maciej and Geoff (and looked over by Eric).
- http://bugs.webkit.org/show_bug.cgi?id=15519
eliminate use of <ctype.h> for processing ASCII
* wtf/ASCIICType.h: Added.
* wtf/DisallowCType.h: Added.
* kjs/config.h: Include DisallowCType.h.
* kjs/date_object.cpp:
(KJS::skipSpacesAndComments):
(KJS::findMonth):
(KJS::parseDate):
* kjs/function.cpp:
(KJS::decode):
* kjs/ustring.cpp:
(KJS::UString::toDouble):
Use ASCIICType.h functions instead of ctype.h ones.
2007-10-14 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixes for "New JavaScript benchmark"
http://bugs.webkit.org/show_bug.cgi?id=15515
* kjs/testkjs.cpp:
(TestFunctionImp::callAsFunction): Implement "load" for compatibility
with SpiderMonkey.
(TestFunctionImp::): ditto
(doIt): ditto
(kjsmain): Drop useless --> from output.
2007-10-15 Geoffrey Garen <ggaren@apple.com>
Removed unnecessary #include.
* API/JSObjectRef.cpp:
2007-10-15 Geoffrey Garen <ggaren@apple.com>
Double-reverse build fix. My tree was out of date.
* kjs/nodes.cpp:
(NumberNode::evaluate):
2007-10-15 Geoffrey Garen <ggaren@apple.com>
Build fix.
* kjs/nodes.cpp:
(NumberNode::evaluate):
2007-10-15 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Removed surprising self-named "hack" that made nested functions
available as named properties of their containing functions, and placed
containing function objects in the scope chains of nested functions.
There were a few reasons to remove this "hack:"
1. It contradicted FF, IE, and the ECMA spec.
2. It incurred a performance penalty, since merely parsing a function
required parsing its body for nested functions (and so on).
3. SVN history contains no explanation for why it was added. It was just
legacy code in a large merge a long, long time ago.
[ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
* kjs/nodes.cpp:
(FuncDeclNode::processFuncDecl):
2007-10-15 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Removed the concept of AnonymousCode. It was unused, and it doesn't
exist in the ECMA spec.
[ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
* kjs/Context.cpp:
(KJS::Context::Context):
* kjs/function.h:
* kjs/nodes.cpp:
(ReturnNode::execute):
2007-10-15 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
Made function parameters DontDelete. This matches FF and the vague
description in ECMA 10.1.3. It's also required in order to make
symbol table based lookup of function parameters valid. (If the
parameters aren't DontDelete, you can't guarantee that you'll find
them later in the symbol table.)
[ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
* kjs/function.cpp:
(KJS::FunctionImp::passInParameters):
2007-10-15 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Some Vector optimizations. These are especially important when using
Vector as a stack for implementing recursive algorithms iteratively.
[ Broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
1. Added shrink(), which is a version of resize() that you can call
to save a branch / improve code generation and inlining when you know
that the vector is not getting bigger.
2. Changed subclassing relationship in VectorBuffer to remove a call to
fastFree() in the destructor for the inlineCapacity != 0 template
specialization. This brings inline Vectors one step closer to true
stack-allocated arrays.
Also changed abort() to CRASH(), since the latter works better.
* wtf/Vector.h:
(WTF::VectorBufferBase::allocateBuffer):
(WTF::VectorBufferBase::deallocateBuffer):
(WTF::VectorBufferBase::VectorBufferBase):
(WTF::VectorBufferBase::~VectorBufferBase):
(WTF::):
(WTF::VectorBuffer::VectorBuffer):
(WTF::VectorBuffer::~VectorBuffer):
(WTF::VectorBuffer::deallocateBuffer):
(WTF::VectorBuffer::releaseBuffer):
(WTF::Vector::clear):
(WTF::Vector::removeLast):
(WTF::::operator):
(WTF::::fill):
(WTF::::shrink):
2007-10-12 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
Fixed http://bugs.webkit.org/show_bug.cgi?id=15490
Iteration statements sometimes incorrectly evaluate to the empty value
(KDE r670547).
[ Broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]
This patch is a merge of KDE r670547, with substantial modification
for performance.
It fixes do-while statements to evaluate to a value. (They used
to evaluate to the empty value in all cases.)
It also fixes SourceElementsNode to maintain the value of abnormal
completions like "break" and "continue."
It also re-works the main execution loop in SourceElementsNode so that
it (1) makes a little more sense and (2) avoids unnecessary work. This
is a .28% speedup on command-line JS iBench.
* kjs/nodes.cpp:
(DoWhileNode::execute):
(SourceElementsNode::execute):
2007-10-15 Simon Hausmann <hausmann@kde.org>
Reviewed by Lars.
Fix compilation with gcc 4.3 by including 'limits' due to the use of std::numeric_limits.
* wtf/HashTraits.h:
2007-10-5 Kevin Ollivier <kevino@theolliviers.com>
Reviewed by Adam.
Add support for MSVC7, and fix cases where PLATFORM(WIN) should
be PLATFORM(WIN_OS) for other ports building on Windows.
* kjs/DateMath.cpp:
(KJS::getDSTOffsetSimple):
* kjs/JSImmediate.h:
* wtf/Assertions.cpp:
* wtf/Assertions.h:
* wtf/Platform.h:
* wtf/StringExtras.h:
(snprintf):
(vsnprintf):
2007-10-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Darin.
Adds NegateNode optimization from KJS. The relevant revision in KDE
is 666736.
* kjs/grammar.y:
* kjs/nodes.cpp:
(NumberNode::evaluate):
* kjs/nodes.h:
(KJS::Node::):
(KJS::NumberNode::):
* kjs/nodes2string.cpp:
(NumberNode::streamTo):
2007-10-14 Jason Foreman <jason@threeve.org>
Reviewed by Maciej.
Fix http://bugs.webkit.org/show_bug.cgi?id=15145
Ensure that if adjusting n to minimize the difference of n*intPow10(e-p+1) to x,
that the property n < intPow10(p) is maintained.
* kjs/number_object.cpp:
(NumberProtoFunc::callAsFunction):
== Rolled over to ChangeLog-2007-10-14 ==
|