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: 54f41fe0b0bc^
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0923cbcb1188
Choose a head ref
  • 8 commits
  • 26 files changed
  • 1 contributor

Commits on Apr 7, 2015

  1. [Truffle] Include all Rubinius files in core.rb, just comment out the…

    … ones not used, so the ordering is there.
    chrisseaton committed Apr 7, 2015
    1
    Copy the full SHA
    54f41fe View commit details
  2. 6
    Copy the full SHA
    4654068 View commit details
  3. 3
    Copy the full SHA
    6c00551 View commit details
  4. 4
    Copy the full SHA
    0666600 View commit details

Commits on Apr 8, 2015

  1. [Truffle] Implement the basics of the Rubinius FFI using Unsafe and u…

    …se it for Process.groups
    chrisseaton committed Apr 8, 2015
    3
    Copy the full SHA
    cc3b75a View commit details
  2. Copy the full SHA
    ab00973 View commit details
  3. Copy the full SHA
    970f300 View commit details
  4. Copy the full SHA
    0923cbc View commit details
Showing with 2,942 additions and 225 deletions.
  1. +0 −9 spec/truffle/tags/core/file/constants_tags.txt
  2. +0 −4 spec/truffle/tags/core/file/delete_tags.txt
  3. +0 −1 spec/truffle/tags/core/file/exist_tags.txt
  4. +0 −1 spec/truffle/tags/core/file/exists_tags.txt
  5. +0 −1 spec/truffle/tags/core/file/file_tags.txt
  6. +0 −4 spec/truffle/tags/core/file/open_tags.txt
  7. +0 −2 spec/truffle/tags/core/file/stat/sticky_tags.txt
  8. +2 −0 truffle/src/main/java/org/jruby/truffle/TruffleBridgeImpl.java
  9. +0 −182 truffle/src/main/java/org/jruby/truffle/nodes/core/FileNodes.java
  10. +99 −0 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/NativeFunctionPrimitiveNodes.java
  11. +210 −0 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/PointerPrimitiveNodes.java
  12. +113 −0 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/PosixNodes.java
  13. +3 −0 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/RubiniusPrimitiveManager.java
  14. +152 −0 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/StatPrimitiveNodes.java
  15. +68 −0 truffle/src/main/java/org/jruby/truffle/runtime/core/CoreLibrary.java
  16. +130 −5 truffle/src/main/ruby/core.rb
  17. +4 −3 truffle/src/main/ruby/core/rubinius/README.md
  18. +0 −13 truffle/src/main/ruby/core/rubinius/api/shims/config.rb
  19. +20 −0 truffle/src/main/ruby/core/rubinius/api/shims/rubinius.rb
  20. +124 −0 truffle/src/main/ruby/core/rubinius/bootstrap/stat.rb
  21. +126 −0 truffle/src/main/ruby/core/rubinius/common/file.rb
  22. +20 −0 truffle/src/main/ruby/core/rubinius/common/process.rb
  23. +249 −0 truffle/src/main/ruby/core/rubinius/common/stat.rb
  24. +287 −0 truffle/src/main/ruby/core/rubinius/platform/ffi.rb
  25. +471 −0 truffle/src/main/ruby/core/rubinius/platform/pointer.rb
  26. +864 −0 truffle/src/main/ruby/core/rubinius/platform/pointer_accessors.rb
9 changes: 0 additions & 9 deletions spec/truffle/tags/core/file/constants_tags.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
fails:File::Constants matches mode constants
fails:File::Constants the open mode constants
fails:File::Constants lock mode constants
fails:File::Constants File::RDONLY
fails:File::Constants File::WRONLY
fails:File::Constants File::CREAT
fails:File::Constants File::RDWR
fails:File::Constants File::APPEND
fails:File::Constants File::TRUNC
fails:File::Constants File::NOCTTY
fails:File::Constants File::NONBLOCK
fails:File::Constants File::LOCK_EX
fails:File::Constants File::LOCK_NB
fails:File::Constants File::LOCK_SH
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/file/delete_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
fails:File.delete returns 0 when called without arguments
fails:File.delete deletes multiple files
fails:File.delete raises an Errno::ENOENT when the given file doesn't exist
fails:File.delete coerces a given parameter into a string if possible
fails:File.delete accepts an object that has a #to_path method
1 change: 0 additions & 1 deletion spec/truffle/tags/core/file/exist_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/file/exists_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/file/file_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
fails:File includes File::Constants
fails:File.file? accepts an object that has a #to_path method
windows:File.file? returns true if the named file exists and is a regular file.
windows:File.file? raises an ArgumentError if not passed one argument
windows:File.file? raises a TypeError if not passed a String type
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/file/open_tags.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
fails:File.open opens the file (basic case)
fails:File.open opens a file when called with a block
fails:File.open opens with mode string
fails:File.open opens a file with mode string and block
fails:File.open opens a file with mode num
fails:File.open opens a file with mode num and block
fails:File.open opens a file with mode and permission as nil
fails:File.open opens the file when passed mode, num and permissions
fails:File.open opens the file when passed mode, num, permissions and block
@@ -28,7 +26,6 @@ fails:File.open raises an IO exception when write in a block opened with 'r' mod
fails:File.open can't write in a block when call open with File::WRONLY||File::RDONLY mode
fails:File.open can't read in a block when call open with File::WRONLY||File::RDONLY mode
fails:File.open can write in a block when call open with WRONLY mode
fails:File.open can write in a block when call open with 'w' mode
fails:File.open raises an IOError when read in a block opened with WRONLY mode
fails:File.open raises an IOError when read in a block opened with 'w' mode
fails:File.open raises an IOError when read in a block opened with 'a' mode
@@ -56,7 +53,6 @@ fails:File.open opens a file for binary read-write starting at the beginning of
fails:File.open opens a file for binary read-write and truncate the file
fails:File.open raises a TypeError if passed a filename that is not a String or Integer type
fails:File.open raises a SystemCallError if passed an invalid Integer type
fails:File.open raises an ArgumentError if passed the wrong number of arguments
fails:File.open raises an ArgumentError if passed an invalid string for mode
fails:File.open defaults external_encoding to ASCII-8BIT for binary modes
fails:File.open uses the second argument as an options Hash
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/file/stat/sticky_tags.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
fails:File::Stat#sticky? returns true if the named file has the sticky bit, otherwise false
fails:File::Stat#sticky? accepts an object that has a #to_path method
fails:File::Stat#sticky? needs to be reviewed for spec completeness
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@
import org.jruby.truffle.nodes.control.SequenceNode;
import org.jruby.truffle.nodes.core.*;
import org.jruby.truffle.nodes.rubinius.ByteArrayNodesFactory;
import org.jruby.truffle.nodes.rubinius.PosixNodesFactory;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.backtrace.Backtrace;
import org.jruby.truffle.runtime.control.RaiseException;
@@ -100,6 +101,7 @@ public void init() {
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, UnboundMethodNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, ByteArrayNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, TimeNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, PosixNodesFactory.getFactories());

// Give the core library manager a chance to tweak some of those methods

182 changes: 0 additions & 182 deletions truffle/src/main/java/org/jruby/truffle/nodes/core/FileNodes.java
Original file line number Diff line number Diff line change
@@ -121,51 +121,6 @@ public RubyNilClass close(RubyFile file) {

}

@CoreMethod(names = { "delete", "unlink" }, onSingleton = true, required = 1)
public abstract static class DeleteNode extends CoreMethodNode {

public DeleteNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public DeleteNode(DeleteNode prev) {
super(prev);
}

@Specialization
public int delete(RubyString file) {
notDesignedForCompilation();

if (!new File(file.toString()).delete()) {
// TODO(CS, 12-Jan-15) handle failure
throw new UnsupportedOperationException();
}

return 1;
}

}

@CoreMethod(names = "directory?", onSingleton = true, required = 1)
public abstract static class DirectoryNode extends CoreMethodNode {

public DirectoryNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public DirectoryNode(DirectoryNode prev) {
super(prev);
}

@Specialization
public boolean directory(RubyString path) {
notDesignedForCompilation();

return new File(path.toString()).isDirectory();
}

}

@CoreMethod(names = "dirname", onSingleton = true, required = 1)
public abstract static class DirnameNode extends CoreMethodNode {

@@ -234,51 +189,6 @@ public RubyNilClass eachLine(VirtualFrame frame, RubyFile file, RubyProc block)

}

@CoreMethod(names = "executable?", onSingleton = true, required = 1)
public abstract static class ExecutableNode extends CoreMethodNode {

public ExecutableNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public ExecutableNode(ExecutableNode prev) {
super(prev);
}

@Specialization
public boolean executable(RubyString path) {
notDesignedForCompilation();

return new File(path.toString()).canExecute();
}

}

@CoreMethod(names = {"exist?", "exists?"}, onSingleton = true, required = 1)
@NodeChild(value = "path")
public abstract static class ExistsNode extends RubyNode {

public ExistsNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public ExistsNode(ExistsNode prev) {
super(prev);
}

@CreateCast("path") public RubyNode coercePathToString(RubyNode path) {
return ToStrNodeFactory.create(getContext(), getSourceSection(), path);
}

@Specialization
public boolean exists(RubyString path) {
notDesignedForCompilation();

return new File(path.toString()).exists();
}

}

@CoreMethod(names = "expand_path", onSingleton = true, required = 1, optional = 1)
public abstract static class ExpandPathNode extends CoreMethodNode {

@@ -304,26 +214,6 @@ public RubyString expandPath(RubyString path, RubyString dir) {

}

@CoreMethod(names = "file?", onSingleton = true, required = 1)
public abstract static class FileNode extends CoreMethodNode {

public FileNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public FileNode(FileNode prev) {
super(prev);
}

@Specialization
public boolean file(RubyString path) {
notDesignedForCompilation();

return new File(path.toString()).isFile();
}

}

@CoreMethod(names = "join", onSingleton = true, argumentsAsArray = true)
public abstract static class JoinNode extends CoreMethodNode {

@@ -399,26 +289,6 @@ public Object open(VirtualFrame frame, RubyString fileName, RubyString mode, Rub

}

@CoreMethod(names = "path", onSingleton = true, required = 1)
public abstract static class PathNode extends CoreMethodNode {

public PathNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public PathNode(PathNode prev) {
super(prev);
}

@Specialization
public RubyString path(RubyString path) {
notDesignedForCompilation();

return getContext().makeString(path.toString());
}

}

@CoreMethod(names = "puts", required = 1)
public abstract static class PutsNode extends CoreMethodNode {

@@ -507,26 +377,6 @@ public RubyString read(RubyFile file) {

}

@CoreMethod(names = "readable?", onSingleton = true, needsSelf = false, required = 1)
public abstract static class ReadableQueryNode extends CoreMethodNode {

public ReadableQueryNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public ReadableQueryNode(ReadableQueryNode prev) {
super(prev);
}

@Specialization
public boolean isReadable(RubyString file) {
notDesignedForCompilation();

return new File(file.toString()).canRead();
}

}

@CoreMethod(names = "realpath", onSingleton = true, required = 1, optional = 1)
public abstract static class RealpathNode extends CoreMethodNode {

@@ -562,38 +412,6 @@ private String realpath(String path, String dir) {

}

@CoreMethod(names = "size?", onSingleton = true, required = 1)
public abstract static class SizeNode extends CoreMethodNode {

public SizeNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public SizeNode(SizeNode prev) {
super(prev);
}

@Specialization
public Object read(RubyString file) {
notDesignedForCompilation();

final File f = new File(file.toString());

if (!f.exists()) {
return nil();
}

final long size = f.length();

if (size == 0) {
return nil();
}

return size;
}

}

@CoreMethod(names = "symlink?", onSingleton = true, required = 1)
public abstract static class SymlinkQueryNode extends CoreMethodNode {

Loading