Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GNUR-BC compiler #12

Merged
merged 75 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
45c5763
WIP - support for switch
fikovnik Feb 23, 2024
feb5e49
WIP - support for switch compiles
fikovnik Mar 1, 2024
579b3b6
WIP - assign
fikovnik Mar 4, 2024
bcbc981
WIP - assign complex
fikovnik Mar 7, 2024
0cdaf2f
WIP - assign dollar inline
fikovnik Mar 7, 2024
bcdafa4
Add missingOK to compile entrypoint
fikovnik Mar 8, 2024
dfb84be
WIP - add subsetting
fikovnik Mar 9, 2024
49fa284
Speeding up tests
fikovnik Mar 9, 2024
f48f2f8
Refactor the GNUR->BC conversion
fikovnik Mar 14, 2024
4fa099b
Add support for @<-
fikovnik Mar 14, 2024
06ad599
Fixes
fikovnik Mar 16, 2024
38ce22e
Symbol can be empty
fikovnik Mar 16, 2024
4db6886
Compiling identical
fikovnik Apr 5, 2024
a944f00
Fix how environments are handled
fikovnik Apr 6, 2024
45a635e
The body of unzip compiles
fikovnik Apr 6, 2024
db951c7
The resolution of the symbols is still not working right
fikovnik Apr 6, 2024
35e94ee
Fix baseenv / basenamespace resolution
fikovnik Apr 22, 2024
73baf87
Add more features to constant folding.
fikovnik Apr 22, 2024
aefa085
Add constant folding of : (and few fixes).
fikovnik Apr 23, 2024
a1d30dc
Add constant folding of `-`.
fikovnik Apr 23, 2024
660bf59
Add constant folding of `^`.
fikovnik Apr 24, 2024
ae9d819
Fix `compileComplexAssign`.
fikovnik Apr 24, 2024
c16be2f
Remove functions that do not come from basenamespace.
fikovnik Apr 24, 2024
7d6fbd3
Yet another switch bug.
fikovnik Apr 24, 2024
cfc547a
Add constant folding of `c` of ints.
fikovnik Apr 24, 2024
e82977a
Fix max constant size.
fikovnik Apr 24, 2024
def797c
Fix constant fold of `c` (empty - returns NULL)
fikovnik Apr 24, 2024
038ff01
Fix the bootstrapping
fikovnik Apr 24, 2024
fb881f3
Add constant folding of `(`.
fikovnik Apr 25, 2024
3854a09
Add symbol interning
fikovnik Apr 25, 2024
8e3edae
Fixed named arguments in constant folding.
fikovnik Apr 25, 2024
0405969
Added log2 to constant folding.
fikovnik Apr 25, 2024
83cced4
Fixed constant folding.
fikovnik Apr 25, 2024
e0ac4e5
Add constant folding of `/`.
fikovnik Apr 25, 2024
8e9f748
Fix the instruction patching order.
fikovnik Apr 25, 2024
0533c99
Added tools.
fikovnik Apr 25, 2024
05a3563
Add constant folding of `c`.
fikovnik Apr 25, 2024
c6bfc31
Compare BCSXP structurally
fikovnik May 10, 2024
b006d1d
Add constants.
fikovnik May 10, 2024
f1d0554
Add coercions
fikovnik May 14, 2024
062ec83
Add mayCallBrowser
fikovnik May 14, 2024
7d33169
Add coercions and better constant folding
fikovnik May 17, 2024
ec4b386
Fix the genCode logic
fikovnik May 20, 2024
308c5a4
Fix log inlining with multiple parameters.
fikovnik May 20, 2024
6def9fd
Refactored arith folding
fikovnik May 21, 2024
bbdfa00
Add sqrt folding
fikovnik May 21, 2024
6bb9cc1
Add plus folding
fikovnik May 21, 2024
1a9fcd4
Add seq.int folding
fikovnik May 22, 2024
03c3d82
Fix RDS read, all test pass.
fikovnik May 22, 2024
6a510a7
Merge branch 'main' into bc-compiler
fikovnik May 22, 2024
331df4d
Updated to R 4.3.2
fikovnik May 23, 2024
f8e866e
Reformat code using spotless
fikovnik May 23, 2024
271c42a
Explict isNA methods.
fikovnik May 24, 2024
ade04ad
Removed the special casing of POW for INT
fikovnik May 26, 2024
8c1e492
Inline the functions to test.
fikovnik May 26, 2024
e4cea27
Move all constant folding into separate class.
fikovnik May 26, 2024
eea8c2b
Disable spotbugs
fikovnik May 26, 2024
47c6491
Cleanup
fikovnik May 26, 2024
9f5a016
Remove the explicit loop context
fikovnik May 26, 2024
87e0510
Simplify the constant folding.
fikovnik May 26, 2024
2b1f165
Formatting
fikovnik May 26, 2024
b9f6c93
Cleanup
fikovnik May 26, 2024
4bcba59
Cleanup
fikovnik May 26, 2024
6097e67
Cleanup
fikovnik May 26, 2024
4a0b5b5
Cleanup
fikovnik May 27, 2024
f265984
Reformat
fikovnik May 28, 2024
995df97
Reformat
fikovnik May 28, 2024
98cb716
Cleanup
fikovnik May 28, 2024
6ed5695
Cleanup and comments
fikovnik May 29, 2024
f8c9ade
API cleanup
fikovnik May 30, 2024
0bad581
API cleanup
fikovnik May 30, 2024
60bc421
API cleanup
fikovnik May 30, 2024
da52b67
API cleanup
fikovnik May 30, 2024
920a34e
Cleanup
fikovnik May 30, 2024
e7f8918
Cleanup
fikovnik May 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

283 changes: 283 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 15 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
</dependencies>
<build>
<!-- Snapshots aren't test resources, because we have to write to them, so we access them
at their actual locations (bundled are overridden on recompile). -->
at their actual locations (bundled are overridden on recompile). -->
<plugins>
<!-- git-build-hook, install git hooks when you run any maven command so you don't forget -->
<plugin>
Expand Down Expand Up @@ -196,19 +196,20 @@
</executions>
</plugin>
<!-- spotbugs, static analysis on bytecode -->
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.8.2.0</version>
<!-- `executions` is required to run this on verify -->
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- ignored for now -->
<!-- <plugin>-->
<!-- <groupId>com.github.spotbugs</groupId>-->
<!-- <artifactId>spotbugs-maven-plugin</artifactId>-->
<!-- <version>4.8.2.0</version>-->
<!-- &lt;!&ndash; `executions` is required to run this on verify &ndash;&gt;-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>check</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- pmd (and cpd), static analysis on syntax -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/prlprg/RSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

import org.prlprg.sexp.BaseEnvSXP;
import org.prlprg.sexp.GlobalEnvSXP;
import org.prlprg.sexp.NamespaceEnvSXP;

public interface RSession {
NamespaceEnvSXP baseNamespace();

BaseEnvSXP baseEnv();

GlobalEnvSXP globalEnv();
Expand All @@ -13,4 +16,6 @@ public interface RSession {
boolean isSpecial(String name);

boolean isBuiltinInternal(String name);

NamespaceEnvSXP getNamespace(String name, String version);
}
Loading
Loading