Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 897caa6425c5
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fe380ea395cb
Choose a head ref
  • 2 commits
  • 33 files changed
  • 1 contributor

Commits on Oct 19, 2016

  1. [Truffle] Commit the Antlr generated pack parser.

    We'll rewrite it by hand in the future. We aren't planning on more
    parsers written with Antlr in the future so it doesn't make sense to
    have just this tiny one.
    chrisseaton committed Oct 19, 2016
    Copy the full SHA
    bb7f65e View commit details
  2. Copy the full SHA
    fe380ea View commit details
Showing with 4,106 additions and 209 deletions.
  1. +0 −60 mx.jruby/mx_jruby.py
  2. +1 −15 mx.jruby/suite.py
  3. +0 −4 truffle/pom.rb
  4. +0 −12 truffle/pom.xml
  5. +0 −79 truffle/src/main/antlr4/org/jruby/truffle/core/format/pack/Pack.g4
  6. +0 −5 truffle/src/main/java/org/jruby/truffle/Main.java
  7. +0 −1 truffle/src/main/java/org/jruby/truffle/cext/CExtNodes.java
  8. +0 −1 truffle/src/main/java/org/jruby/truffle/core/VMPrimitiveNodes.java
  9. +0 −1 truffle/src/main/java/org/jruby/truffle/core/array/ArrayNodes.java
  10. +0 −1 truffle/src/main/java/org/jruby/truffle/core/basicobject/BasicObjectNodes.java
  11. +0 −1 truffle/src/main/java/org/jruby/truffle/core/binding/TruffleBindingNodes.java
  12. +0 −2 truffle/src/main/java/org/jruby/truffle/core/cast/ToFNode.java
  13. +0 −1 truffle/src/main/java/org/jruby/truffle/core/fiber/FiberNodes.java
  14. +651 −0 truffle/src/main/java/org/jruby/truffle/core/format/pack/PackBaseListener.java
  15. +186 −0 truffle/src/main/java/org/jruby/truffle/core/format/pack/PackLexer.java
  16. +608 −0 truffle/src/main/java/org/jruby/truffle/core/format/pack/PackListener.java
  17. +2,659 −0 truffle/src/main/java/org/jruby/truffle/core/format/pack/PackParser.java
  18. +0 −2 truffle/src/main/java/org/jruby/truffle/core/kernel/KernelNodes.java
  19. +0 −1 truffle/src/main/java/org/jruby/truffle/core/kernel/TraceManager.java
  20. +0 −1 truffle/src/main/java/org/jruby/truffle/core/module/ModuleFields.java
  21. +0 −2 truffle/src/main/java/org/jruby/truffle/core/proc/ProcSignalHandler.java
  22. +0 −1 truffle/src/main/java/org/jruby/truffle/core/regexp/RegexpNodes.java
  23. +0 −1 truffle/src/main/java/org/jruby/truffle/core/thread/ThreadNodes.java
  24. +0 −3 truffle/src/main/java/org/jruby/truffle/core/tracepoint/TracePointNodes.java
  25. +0 −2 truffle/src/main/java/org/jruby/truffle/extra/AttachmentsManager.java
  26. +0 −1 truffle/src/main/java/org/jruby/truffle/interop/RubyMessageResolution.java
  27. +0 −2 truffle/src/main/java/org/jruby/truffle/language/TruffleBootNodes.java
  28. +1 −2 truffle/src/main/java/org/jruby/truffle/language/control/OnceNode.java
  29. +0 −2 truffle/src/main/java/org/jruby/truffle/language/dispatch/UnresolvedDispatchNode.java
  30. +0 −2 truffle/src/main/java/org/jruby/truffle/language/objects/ObjectGraph.java
  31. +0 −1 truffle/src/main/java/org/jruby/truffle/platform/posix/JNRTrufflePosix.java
  32. +0 −2 truffle/src/main/java/org/jruby/truffle/stdlib/CoverageManager.java
  33. +0 −1 truffle/src/main/java/org/jruby/truffle/stdlib/digest/DigestNodes.java
60 changes: 0 additions & 60 deletions mx.jruby/mx_jruby.py
Original file line number Diff line number Diff line change
@@ -65,66 +65,6 @@ class LicensesProject(ArchiveProject):
def getResults(self):
return [join(_suite.dir, f) for f in self.license_files]

class AntlrProject(mx.Project):
def __init__(self, suite, name, deps, workingSets, theLicense, **args):
mx.Project.__init__(self, suite, name, "", [], deps, workingSets, _suite.dir, theLicense)
assert 'outputDir' in args
assert 'sourceDir' in args
assert 'grammars' in args
self.doNotArchive = True

def getBuildTask(self, args):
return AntlrBuildTask(self, args)

class AntlrBuildTask(mx.BuildTask):
def __init__(self, project, args):
mx.BuildTask.__init__(self, project, args, 1)

def __str__(self):
return 'Generate Antlr grammar for {}'.format(self.subject)

def needsBuild(self, newestInput):
sup = mx.BuildTask.needsBuild(self, newestInput)
if sup[0]:
return sup
newestOutput = self.newestOutput()
if not newestOutput:
return (True, "no java files yet")

src = join(_suite.dir, self.subject.sourceDir)
for grammar in self.subject.grammars:
if newestOutput.isOlderThan(join(src, grammar)):
return (True, "%s needs to be regenerated" % (grammar))

return (False, 'all files are up to date')

def newestOutput(self):
out = join(_suite.dir, self.subject.outputDir)
newest = None
for grammar in self.subject.grammars:
parser = join(out, os.path.splitext(grammar)[0] + "Parser.java")
parser = TimeStampFile(parser)
if not newest or parser.isNewerThan(newest):
newest = parser
return newest

def build(self):
antlr4 = None
for lib in _suite.libs:
if lib.name == "ANTLR4_MAIN":
antlr4 = lib
assert antlr4

antlr4jar = antlr4.classpath_repr()
out = join(_suite.dir, self.subject.outputDir)
src = join(_suite.dir, self.subject.sourceDir)
for grammar in self.subject.grammars:
pkg = os.path.dirname(grammar).replace('/', '.')
mx.run_java(['-jar', antlr4jar, '-o', out, '-package', pkg, grammar], cwd=src)

def clean(self, forBuild=False):
pass

def mavenSetup():
buildPack = join(_suite.dir, 'jruby-build-pack/maven')
mavenDir = buildPack if isdir(buildPack) else join(_suite.dir, 'mxbuild/mvn')
16 changes: 1 addition & 15 deletions mx.jruby/suite.py
Original file line number Diff line number Diff line change
@@ -55,11 +55,6 @@ def mavenLib(mavenDep, sha1, sourceSha1):

# ------------- Libraries -------------

"ANTLR4_MAIN": mavenLib(
"org.antlr:antlr4:4.5.1-1",
"a8867c83a73791cf30e30de4cf5d0c9a5f0dfdab",
"0c0dcb94d272b012b33e215d4a61bdf93a48b872"),

"ANTLR4_RUNTIME": mavenLib(
"org.antlr:antlr4-runtime:4.5.1-1",
"66144204f9d6d7d3f3f775622c2dd7e9bd511d97",
@@ -82,20 +77,11 @@ def mavenLib(mavenDep, sha1, sourceSha1):
"jar": "lib/jruby.jar",
},

"jruby-antlr": {
"class": "AntlrProject",
"sourceDir": "truffle/src/main/antlr4",
"outputDir": "truffle/src/main/antlr4",
"grammars": [ "org/jruby/truffle/core/format/pack/Pack.g4" ],
"dependencies": [ "ANTLR4_RUNTIME" ],
},

"jruby-truffle": {
"dir": "truffle/src/main",
"sourceDirs": ["java", "antlr4"],
"sourceDirs": [ "java" ],
"dependencies": [
"jruby-core",
"jruby-antlr",
"truffle:TRUFFLE_API",
"truffle:TRUFFLE_DEBUG",
"ANTLR4_RUNTIME",
4 changes: 0 additions & 4 deletions truffle/pom.rb
Original file line number Diff line number Diff line change
@@ -29,10 +29,6 @@

jar 'junit:junit', :scope => 'test'

plugin 'org.antlr:antlr4-maven-plugin', '4.5.1-1' do
execute_goal :antlr4
end

plugin( :compiler,
'encoding' => 'utf-8',
'debug' => 'true',
12 changes: 0 additions & 12 deletions truffle/pom.xml
Original file line number Diff line number Diff line change
@@ -96,18 +96,6 @@ DO NOT MODIFIY - GENERATED CODE
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId>
<version>4.5.1-1</version>
<executions>
<execution>
<goals>
<goal>antlr4</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
79 changes: 0 additions & 79 deletions truffle/src/main/antlr4/org/jruby/truffle/core/format/pack/Pack.g4

This file was deleted.

5 changes: 0 additions & 5 deletions truffle/src/main/java/org/jruby/truffle/Main.java
Original file line number Diff line number Diff line change
@@ -11,13 +11,8 @@

import org.jruby.Ruby;
import org.jruby.RubyInstanceConfig;
import org.jruby.internal.runtime.GlobalVariable;
import org.jruby.internal.runtime.ValueAccessor;
import org.jruby.runtime.IAccessor;
import org.jruby.runtime.builtin.IRubyObject;

import java.io.InputStream;
import java.util.Map;

public class Main {

Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.frame.FrameInstance;
import com.oracle.truffle.api.frame.FrameInstance.FrameAccess;
import com.oracle.truffle.api.frame.FrameInstanceVisitor;
import com.oracle.truffle.api.frame.MaterializedFrame;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.object.DynamicObject;
Original file line number Diff line number Diff line change
@@ -60,7 +60,6 @@
import org.jruby.truffle.core.kernel.KernelNodesFactory;
import org.jruby.truffle.core.proc.ProcSignalHandler;
import org.jruby.truffle.core.string.StringOperations;
import org.jruby.truffle.core.thread.ThreadManager;
import org.jruby.truffle.language.RubyGuards;
import org.jruby.truffle.language.control.ExitException;
import org.jruby.truffle.language.control.RaiseException;
Original file line number Diff line number Diff line change
@@ -73,7 +73,6 @@
import org.jruby.truffle.language.yield.YieldNode;

import java.util.Arrays;
import java.util.Comparator;

import static org.jruby.truffle.core.array.ArrayHelpers.getSize;
import static org.jruby.truffle.core.array.ArrayHelpers.getStore;
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.frame.FrameInstance;
import com.oracle.truffle.api.frame.FrameInstanceVisitor;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.IndirectCallNode;
import com.oracle.truffle.api.nodes.Node;
Original file line number Diff line number Diff line change
@@ -13,7 +13,6 @@
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.FrameInstance;
import com.oracle.truffle.api.frame.FrameInstanceVisitor;
import com.oracle.truffle.api.frame.MaterializedFrame;
import com.oracle.truffle.api.object.DynamicObject;
import org.jruby.truffle.builtins.CoreClass;
Original file line number Diff line number Diff line change
@@ -17,9 +17,7 @@
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.profiles.BranchProfile;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.Layouts;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.control.RaiseException;
import org.jruby.truffle.language.dispatch.CallDispatchHeadNode;
Original file line number Diff line number Diff line change
@@ -36,7 +36,6 @@
import org.jruby.truffle.language.control.RaiseException;
import org.jruby.truffle.language.control.ReturnException;
import org.jruby.truffle.language.methods.UnsupportedOperationBehavior;
import org.jruby.truffle.parser.BodyTranslator;
import org.jruby.truffle.platform.UnsafeGroup;

import java.util.concurrent.CountDownLatch;
Loading