Commit 3c28308
committed
This change set implements param scope and the body scope as parallel scopes.
The previous logic of having param scope as an inner scope to the body
scope does not work well in eval cases. This changelist only addresses
function definitions in the param scope. I will be working on the eval
cases next. This works in interpreter mode right now. Backend changes are
not done yet.
Two new bytecodes were added. BeginBodyScope marks the beginning of the
body scope where a new closure object is created for the body scope. Until
then closure created for the param scope is used. After BeginBodyScope
theparam scope one is not used other than copying the initial value for
the body scope symbols from the param scope symbols. This required the
creation of another new bytecode LdParamSlot. This also include some
refactoring required for enabling these.1 parent 2905975 commit 3c28308
22 files changed
Lines changed: 1345 additions & 867 deletions
File tree
- lib
- Parser
- Runtime
- Base
- ByteCode
- Language
- Library/InJavascript
- test/es6
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4615 | 4615 | | |
4616 | 4616 | | |
4617 | 4617 | | |
4618 | | - | |
| 4618 | + | |
4619 | 4619 | | |
4620 | 4620 | | |
4621 | | - | |
| 4621 | + | |
4622 | 4622 | | |
4623 | | - | |
| 4623 | + | |
4624 | 4624 | | |
4625 | 4625 | | |
4626 | 4626 | | |
| 4627 | + | |
| 4628 | + | |
4627 | 4629 | | |
4628 | 4630 | | |
4629 | 4631 | | |
| |||
4859 | 4861 | | |
4860 | 4862 | | |
4861 | 4863 | | |
4862 | | - | |
4863 | 4864 | | |
4864 | 4865 | | |
4865 | 4866 | | |
| 4867 | + | |
4866 | 4868 | | |
4867 | | - | |
4868 | | - | |
| 4869 | + | |
| 4870 | + | |
| 4871 | + | |
4869 | 4872 | | |
4870 | | - | |
| 4873 | + | |
| 4874 | + | |
| 4875 | + | |
| 4876 | + | |
| 4877 | + | |
| 4878 | + | |
| 4879 | + | |
4871 | 4880 | | |
4872 | | - | |
4873 | | - | |
4874 | | - | |
| 4881 | + | |
| 4882 | + | |
| 4883 | + | |
| 4884 | + | |
| 4885 | + | |
| 4886 | + | |
| 4887 | + | |
| 4888 | + | |
| 4889 | + | |
| 4890 | + | |
4875 | 4891 | | |
4876 | 4892 | | |
4877 | 4893 | | |
4878 | | - | |
| 4894 | + | |
| 4895 | + | |
4879 | 4896 | | |
4880 | | - | |
4881 | | - | |
4882 | | - | |
4883 | | - | |
4884 | | - | |
4885 | | - | |
4886 | | - | |
4887 | | - | |
4888 | | - | |
4889 | | - | |
4890 | | - | |
| 4897 | + | |
| 4898 | + | |
4891 | 4899 | | |
4892 | 4900 | | |
4893 | 4901 | | |
4894 | 4902 | | |
4895 | 4903 | | |
4896 | | - | |
| 4904 | + | |
4897 | 4905 | | |
4898 | 4906 | | |
4899 | | - | |
| 4907 | + | |
| 4908 | + | |
| 4909 | + | |
4900 | 4910 | | |
4901 | 4911 | | |
4902 | 4912 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
| 416 | + | |
417 | 417 | | |
418 | | - | |
| 418 | + | |
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| |||
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
| 461 | + | |
461 | 462 | | |
462 | 463 | | |
463 | 464 | | |
| |||
1028 | 1029 | | |
1029 | 1030 | | |
1030 | 1031 | | |
| 1032 | + | |
1031 | 1033 | | |
1032 | 1034 | | |
1033 | 1035 | | |
| |||
1129 | 1131 | | |
1130 | 1132 | | |
1131 | 1133 | | |
| 1134 | + | |
1132 | 1135 | | |
1133 | 1136 | | |
1134 | 1137 | | |
| |||
3674 | 3677 | | |
3675 | 3678 | | |
3676 | 3679 | | |
| 3680 | + | |
3677 | 3681 | | |
3678 | 3682 | | |
3679 | 3683 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1945 | 1945 | | |
1946 | 1946 | | |
1947 | 1947 | | |
| 1948 | + | |
1948 | 1949 | | |
1949 | 1950 | | |
1950 | 1951 | | |
| |||
2567 | 2568 | | |
2568 | 2569 | | |
2569 | 2570 | | |
2570 | | - | |
2571 | | - | |
| 2571 | + | |
2572 | 2572 | | |
2573 | 2573 | | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
2574 | 2581 | | |
2575 | 2582 | | |
2576 | 2583 | | |
| |||
2945 | 2952 | | |
2946 | 2953 | | |
2947 | 2954 | | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
2948 | 2958 | | |
2949 | 2959 | | |
2950 | 2960 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
| 835 | + | |
835 | 836 | | |
836 | 837 | | |
837 | 838 | | |
| |||
0 commit comments