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: adb04339ce32
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 226d7e63fc28
Choose a head ref

Commits on Jul 19, 2016

  1. Copy the full SHA
    b1fad8d View commit details

Commits on Jul 20, 2016

  1. Merge branch 'master' into truffle-head

    # Conflicts:
    #	ci.hocon
    chrisseaton committed Jul 20, 2016
    Copy the full SHA
    9986af5 View commit details
  2. Copy the full SHA
    c0b754e View commit details
  3. Copy the full SHA
    5b3c74b View commit details

Commits on Jul 23, 2016

  1. Copy the full SHA
    4dfb8c7 View commit details
  2. [Truffle] Update Truffle.

    chrisseaton committed Jul 23, 2016
    Copy the full SHA
    68be02f View commit details
  3. Copy the full SHA
    0d79d02 View commit details
  4. Copy the full SHA
    e65b137 View commit details
  5. Copy the full SHA
    b765f65 View commit details
  6. Copy the full SHA
    01f4d8b View commit details

Commits on Jul 24, 2016

  1. Copy the full SHA
    7e18032 View commit details

Commits on Jul 25, 2016

  1. Copy the full SHA
    4f8c02f View commit details
  2. Copy the full SHA
    941959e View commit details

Commits on Jul 26, 2016

  1. Copy the full SHA
    8369f8a View commit details
  2. Copy the full SHA
    2decc03 View commit details
  3. [Truffle] Do not use the build pack on truffle-head as it won't conta…

    …in the latest truffle.
    eregon committed Jul 26, 2016
    Copy the full SHA
    d2f2fcf View commit details

Commits on Jul 28, 2016

  1. Merge branch 'master' into truffle-head

    # Conflicts:
    #	truffle/src/main/java/org/jruby/truffle/language/loader/SourceLoader.java
    chrisseaton committed Jul 28, 2016
    Copy the full SHA
    fe91143 View commit details
  2. Merge branch 'master' into truffle-head

    # Conflicts:
    #	ci.hocon
    chrisseaton committed Jul 28, 2016
    Copy the full SHA
    65d836b View commit details

Commits on Jul 30, 2016

  1. Copy the full SHA
    6af2b33 View commit details

Commits on Aug 1, 2016

  1. Merge branch 'master' into truffle-head

    # Conflicts:
    #	ci.hocon
    #	truffle/src/main/java/org/jruby/truffle/language/DataNode.java
    chrisseaton committed Aug 1, 2016
    Copy the full SHA
    10c6b6e View commit details

Commits on Aug 3, 2016

  1. Copy the full SHA
    46a84cd View commit details
  2. Copy the full SHA
    6038957 View commit details

Commits on Aug 5, 2016

  1. Copy the full SHA
    9be0bad View commit details
  2. Copy the full SHA
    2bfe445 View commit details
  3. Copy the full SHA
    13c55e2 View commit details
  4. Copy the full SHA
    01540ce View commit details

Commits on Aug 9, 2016

  1. Copy the full SHA
    385b2c5 View commit details

Commits on Aug 10, 2016

  1. Merge branch 'master' into truffle-head

    # Conflicts:
    #	ci.hocon
    chrisseaton committed Aug 10, 2016
    Copy the full SHA
    84edb23 View commit details
  2. Copy the full SHA
    9c12a7f View commit details
  3. Copy the full SHA
    b19cd71 View commit details
  4. Copy the full SHA
    226d7e6 View commit details
Showing with 102 additions and 61 deletions.
  1. +2 −2 ci.hocon
  2. +18 −17 core/src/main/java/org/jruby/RubyClass.java
  3. +9 −4 core/src/main/java/org/jruby/RubyRange.java
  4. +2 −2 core/src/main/java/org/jruby/RubyString.java
  5. +0 −1 core/src/main/java/org/jruby/util/cli/Options.java
  6. +1 −1 mx.jruby/suite.py
  7. +1 −1 tool/jt.rb
  8. +4 −1 truffle/pom.rb
  9. +7 −1 truffle/pom.xml
  10. +2 −8 truffle/src/main/java/org/jruby/truffle/JRubyTruffleImpl.java
  11. +2 −2 truffle/src/main/java/org/jruby/truffle/core/kernel/KernelNodes.java
  12. +1 −1 truffle/src/main/java/org/jruby/truffle/core/thread/ThreadBacktraceLocationNodes.java
  13. +4 −2 truffle/src/main/java/org/jruby/truffle/interop/InteropNodes.java
  14. +1 −1 truffle/src/main/java/org/jruby/truffle/language/DataNode.java
  15. +5 −0 truffle/src/main/java/org/jruby/truffle/language/RubyRootNode.java
  16. +3 −5 truffle/src/main/java/org/jruby/truffle/language/arguments/ReadBlockNode.java
  17. +11 −7 truffle/src/main/java/org/jruby/truffle/language/loader/SourceLoader.java
  18. +2 −0 truffle/src/main/java/org/jruby/truffle/language/methods/ExceptionTranslatingNode.java
  19. +2 −2 truffle/src/main/java/org/jruby/truffle/language/parser/jruby/BodyTranslator.java
  20. +1 −1 truffle/src/main/java/org/jruby/truffle/language/parser/jruby/ReloadArgumentsTranslator.java
  21. +1 −1 truffle/src/main/java/org/jruby/truffle/stdlib/CoverageManager.java
  22. +1 −1 truffle/src/main/java/org/jruby/truffle/stdlib/CoverageNodes.java
  23. +12 −0 truffle/src/test/java/org/jruby/truffle/tck/RubyTckTest.java
  24. +10 −0 truffle/src/test/ruby/tck.rb
4 changes: 2 additions & 2 deletions ci.hocon
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@ clone_graal: [mx, --version-conflict-resolution, ignore, sclone, --kind, git]
common-setup: [
[mx, sclone, --kind, git, "https://github.com/jruby/jruby-build-pack.git", jruby-build-pack],
[cp, bin/jruby.bash, bin/jruby],
[chmod, "+x", bin/jruby],
${jt} [build, --offline]
[chmod, +x, bin/jruby],
${jt} [build] # --offline
]

common: {
35 changes: 18 additions & 17 deletions core/src/main/java/org/jruby/RubyClass.java
Original file line number Diff line number Diff line change
@@ -503,6 +503,10 @@ public IRubyObject invoke(ThreadContext context, IRubyObject self, int methodInd
return invoke(context, self, name, args, callType, block);
}

public boolean notVisibleAndNotMethodMissing(DynamicMethod method, String name, IRubyObject caller, CallType callType) {
return !method.isCallableFrom(caller, callType) && !name.equals("method_missing");
}

public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
CallType callType, Block block) {
DynamicMethod method = searchMethod(name);
@@ -954,19 +958,14 @@ private void generateMethodAnnotations(Map<Class, Map<String, Object>> methodAnn
}
}

private static boolean shouldCallMethodMissing(DynamicMethod method) {
private boolean shouldCallMethodMissing(DynamicMethod method) {
return method.isUndefined();
}

private static boolean shouldCallMethodMissing(DynamicMethod method, String name, IRubyObject caller, CallType callType) {
private boolean shouldCallMethodMissing(DynamicMethod method, String name, IRubyObject caller, CallType callType) {
return method.isUndefined() || notVisibleAndNotMethodMissing(method, name, caller, callType);
}

private static boolean notVisibleAndNotMethodMissing(DynamicMethod method, String name, IRubyObject caller, CallType callType) {
return !method.isCallableFrom(caller, callType) && !name.equals("method_missing");
}

public final IRubyObject invokeInherited(ThreadContext context, IRubyObject self, IRubyObject subclass) {
public IRubyObject invokeInherited(ThreadContext context, IRubyObject self, IRubyObject subclass) {
DynamicMethod method = getMetaClass().searchMethod("inherited");

if (method.isUndefined()) {
@@ -1082,18 +1081,20 @@ protected void setModuleSuperClass(RubyClass superClass) {
setSuperClass(superClass);
}

public final Collection<RubyClass> subclasses(boolean includeDescendants) {
final Set<RubyClass> subclasses = this.subclasses;
if (subclasses != null) {
Collection<RubyClass> classes = new ArrayList<RubyClass>(subclasses);
public Collection<RubyClass> subclasses(boolean includeDescendants) {
Set<RubyClass> mySubclasses = subclasses;
if (mySubclasses != null) {
Collection<RubyClass> mine = new ArrayList<RubyClass>(mySubclasses);
if (includeDescendants) {
for ( RubyClass klass: subclasses ) {
classes.addAll(klass.subclasses(includeDescendants));
for (RubyClass i: mySubclasses) {
mine.addAll(i.subclasses(includeDescendants));
}
}
return classes;

return mine;
} else {
return Collections.EMPTY_LIST;
}
return Collections.EMPTY_LIST;
}

/**
@@ -1144,7 +1145,7 @@ public synchronized void replaceSubclass(RubyClass subclass, RubyClass newSubcla
}

@Override
public final void becomeSynchronized() {
public void becomeSynchronized() {
// make this class and all subclasses sync
synchronized (runtime.getHierarchyLock()) {
super.becomeSynchronized();
13 changes: 9 additions & 4 deletions core/src/main/java/org/jruby/RubyRange.java
Original file line number Diff line number Diff line change
@@ -443,9 +443,13 @@ public IRubyObject to_a(ThreadContext context, final Block block) {
final Ruby runtime = context.runtime;

if (begin instanceof RubyFixnum && end instanceof RubyFixnum) {
long lim = ((RubyFixnum) end).getLongValue();
if (!isExclusive) {
lim++;
}

long base = ((RubyFixnum) begin).getLongValue();
long size = ((RubyFixnum) end).getLongValue() - base;
if (!isExclusive) size++;
long size = lim - base;
if (size > Integer.MAX_VALUE) {
throw runtime.newRangeError("Range size too large for to_a");
}
@@ -456,9 +460,10 @@ public IRubyObject to_a(ThreadContext context, final Block block) {
for (int i = 0; i < size; i++) {
array[i] = RubyFixnum.newFixnum(runtime, base + i);
}
return RubyArray.newArrayNoCopy(runtime, array);
return RubyArray.newArrayMayCopy(runtime, array);
} else {
return RubyEnumerable.to_a(context, this);
}
return RubyEnumerable.to_a(context, this);
}

@Deprecated
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
@@ -3291,8 +3291,8 @@ final IRubyObject uptoCommon(ThreadContext context, IRubyObject arg, boolean exc
RubyArray argsArr = RubyArray.newArray(runtime, RubyFixnum.newFixnum(runtime, value.length()), context.nil);

if (b instanceof RubyFixnum && e instanceof RubyFixnum) {
long bi = RubyNumeric.fix2long(b);
long ei = RubyNumeric.fix2long(e);
int bi = RubyNumeric.fix2int(b);
int ei = RubyNumeric.fix2int(e);

while (bi <= ei) {
if (excl && bi == ei) break;
1 change: 0 additions & 1 deletion core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
@@ -239,7 +239,6 @@ public class Options {
public static final Option<Boolean> TRUFFLE_PLATFORM_USE_JAVA = bool(TRUFFLE, "truffle.platform.use_java", false, "Use a pure-Java platform, so no native POSIX.");

public static final Option<Boolean> TRUFFLE_COVERAGE_GLOBAL = bool(TRUFFLE, "truffle.coverage.global", false, "Run coverage for all code and print results on exit.");
public static final Option<Boolean> TRUFFLE_PROFILER = bool(TRUFFLE, "truffle.profiler", false, "Run the Truffle profiler.");

public static final Option<String> TRUFFLE_CORE_LOAD_PATH = string(TRUFFLE, "truffle.core.load_path", "truffle:/jruby-truffle", "Location to load the Truffle core library from.");
public static final Option<Boolean> TRUFFLE_CORE_PARALLEL_LOAD = bool(TRUFFLE, "truffle.core.parallel_load", true, "Load the Truffle core library in parallel.");
2 changes: 1 addition & 1 deletion mx.jruby/suite.py
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ def mavenLib(mavenDep, sha1):
"suites": [
{
"name": "truffle",
"version": "47033f56665100fd5f7cbafd96d6c3112329f517",
"version": "0f666d1a0c4eabc0d44d1a2ad75cebd3ea6dbadb",
"urls": [
{"url": "https://github.com/graalvm/truffle.git", "kind": "git"},
{"url": "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind": "binary"},
2 changes: 1 addition & 1 deletion tool/jt.rb
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
require 'yaml'
require 'open3'

GRAALVM_VERSION = '0.12'
GRAALVM_VERSION = '0.15'

JRUBY_DIR = File.expand_path('../..', __FILE__)
M2_REPO = File.expand_path('~/.m2/repository')
5 changes: 4 additions & 1 deletion truffle/pom.rb
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@

properties( 'polyglot.dump.pom' => 'pom.xml',
'polyglot.dump.readonly' => true,
'truffle.version' => '0.14',
'truffle.version' => '0.16',
'jruby.basedir' => '${basedir}/..',
'maven.test.skip' => 'true' )

@@ -18,6 +18,9 @@

jar 'org.jruby:jruby-core', '${project.version}', :scope => 'provided'

repository( :url => 'http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/',
:id => 'truffle' )

truffle_version = '${truffle.version}'
jar 'com.oracle.truffle:truffle-api:' + truffle_version
jar 'com.oracle.truffle:truffle-debug:' + truffle_version
8 changes: 7 additions & 1 deletion truffle/pom.xml
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ DO NOT MODIFIY - GENERATED CODE
<jruby.basedir>${basedir}/..</jruby.basedir>
<polyglot.dump.readonly>true</polyglot.dump.readonly>
<polyglot.dump.pom>pom.xml</polyglot.dump.pom>
<truffle.version>0.14</truffle.version>
<truffle.version>0.16</truffle.version>
</properties>
<dependencies>
<dependency>
@@ -68,6 +68,12 @@ DO NOT MODIFIY - GENERATED CODE
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>truffle</id>
<url>http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<build>
<defaultGoal>package</defaultGoal>
<resources>
10 changes: 2 additions & 8 deletions truffle/src/main/java/org/jruby/truffle/JRubyTruffleImpl.java
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@

import com.oracle.truffle.api.source.Source;
import com.oracle.truffle.api.vm.PolyglotEngine;
import com.oracle.truffle.tools.TruffleProfiler;
import java.io.IOException;

import org.jruby.JRubyTruffleInterface;
import org.jruby.Ruby;
import org.jruby.truffle.interop.JRubyContextWrapper;
@@ -32,11 +32,6 @@ public JRubyTruffleImpl(Ruby runtime) {
engine = PolyglotEngine.newBuilder()
.globalSymbol(JRubyTruffleInterface.RUNTIME_SYMBOL, new JRubyContextWrapper(runtime))
.build();

if (Options.TRUFFLE_PROFILER.load()) {
engine.getInstruments().get(TruffleProfiler.ID).setEnabled(true);
}

try {
context = (RubyContext) engine.eval(loadSource("Truffle::Boot.context", "context")).get();
} catch (IOException e) {
@@ -72,8 +67,7 @@ public void dispose() {
}

private Source loadSource(String source, String name) {
return Source.fromText(source, name).withMimeType(RubyLanguage.MIME_TYPE);
//return Source.newBuilder(source).name(name).mimeType(RubyLanguage.MIME_TYPE).build();
return Source.newBuilder(source).name(name).mimeType(RubyLanguage.MIME_TYPE).build();
}

}
Original file line number Diff line number Diff line change
@@ -1463,10 +1463,10 @@ private String getFullPath(final String featureString) {
} else {
final Source source = getContext().getCallStack().getCallerFrameIgnoringSend().getCallNode().getEncapsulatingSourceSection().getSource();
String result;
if (source.getPath() == null) {
if (source.getName() == null) {
result = null;
} else {
result = source.getPath();
result = source.getName();
}
final String sourcePath = result;

Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ public DynamicObject absolutePath(DynamicObject threadBacktraceLocation) {

// TODO CS 30-Apr-15: not absolute - not sure how to solve that

final String path = sourceSection.getSource().getPath();
final String path = sourceSection.getSource().getName();

if (path == null) {
return coreStrings().UNKNOWN.createInstance();
Original file line number Diff line number Diff line change
@@ -48,6 +48,8 @@
import org.jruby.truffle.language.control.RaiseException;
import org.jruby.truffle.util.ByteListUtils;
import org.jruby.util.ByteList;

import java.io.File;
import java.io.IOException;

@CoreClass("Truffle::Interop")
@@ -60,7 +62,7 @@ public abstract static class ImportFileNode extends CoreMethodArrayArgumentsNode
@Specialization(guards = "isRubyString(fileName)")
public Object importFile(DynamicObject fileName) {
try {
final Source sourceObject = Source.fromFileName(fileName.toString());
final Source sourceObject = Source.newBuilder(new File(fileName.toString())).build();
getContext().getEnv().parse(sourceObject).call();
} catch (IOException e) {
throw new JavaException(e);
@@ -644,7 +646,7 @@ public Object evalUncached(VirtualFrame frame, DynamicObject mimeType, DynamicOb
@TruffleBoundary
protected CallTarget parse(DynamicObject mimeType, DynamicObject source) {
final String mimeTypeString = mimeType.toString();
final Source sourceObject = Source.fromText(source.toString(), "(eval)").withMimeType(mimeTypeString);
final Source sourceObject = Source.newBuilder(source.toString()).name("(eval)").mimeType(mimeTypeString).build();

try {
return getContext().getEnv().parse(sourceObject);
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ public Object execute(VirtualFrame frame) {
final Object data = snippetNode.execute(frame,
"Truffle.get_data(file, offset)",
"file", StringOperations.createString(getContext(),
ByteListUtils.create(getEncapsulatingSourceSection().getSource().getPath())),
ByteListUtils.create(getEncapsulatingSourceSection().getSource().getName())),
"offset", endPosition);

Layouts.MODULE.getFields(coreLibrary().getObjectClass()).setConstant(getContext(), null, "DATA", data);
Original file line number Diff line number Diff line change
@@ -71,6 +71,11 @@ public Node copy() {
return cloned;
}

@Override
public String getName() {
return sharedMethodInfo.getName();
}

@Override
public String toString() {
return sharedMethodInfo.toString();
Original file line number Diff line number Diff line change
@@ -34,11 +34,9 @@ public Object execute(VirtualFrame frame) {
if (nullProfile.profile(block == null)) {
return valueIfAbsent;
} else {
if (unusualShapeProfile.profile(block.getShape() != getContext().getCoreLibrary().getProcFactory().getShape())) {
if (!Layouts.PROC.isProc(block)) {
CompilerDirectives.transferToInterpreter();
throw new UnsupportedOperationException("Method passed something that isn't a Proc as a block");
}
if (!Layouts.PROC.isProc(block)) {
CompilerDirectives.transferToInterpreter();
throw new UnsupportedOperationException("Method passed something that isn't a Proc as a block");
}

return block;
Original file line number Diff line number Diff line change
@@ -43,18 +43,23 @@ public Source load(String canonicalPath) throws IOException {
} else if (canonicalPath.startsWith(TRUFFLE_SCHEME) || canonicalPath.startsWith(JRUBY_SCHEME)) {
return loadResource(canonicalPath);
} else {
final File file = new File(canonicalPath);
final File file = new File(canonicalPath).getCanonicalFile();

if (!file.canRead()) {
throw new IOException("Can't read file " + canonicalPath);
}
return Source.fromFileName(canonicalPath);
//return Source.newBuilder(new File(canonicalPath)).build();

if (canonicalPath.toLowerCase().endsWith(".su")) {
return Source.newBuilder(file).name(file.getPath()).build();
} else {
// We need to assume all other files are Ruby, so the file type detection isn't enough
return Source.newBuilder(file).name(file.getPath()).mimeType(RubyLanguage.MIME_TYPE).build();
}
}
}

public Source loadFragment(String fragment, String name) {
return Source.fromText(fragment, name);
//return Source.newBuilder(fragment).name(name).mimeType(RubyLanguage.MIME_TYPE).build();
return Source.newBuilder(fragment).name(name).mimeType(RubyLanguage.MIME_TYPE).build();
}

private Source loadResource(String path) throws IOException {
@@ -82,8 +87,7 @@ private Source loadResource(String path) throws IOException {
throw new FileNotFoundException(path);
}

return Source.fromReader(new InputStreamReader(stream, StandardCharsets.UTF_8), path);
//return Source.newBuilder(new InputStreamReader(stream, StandardCharsets.UTF_8)).name(path).mimeType(RubyLanguage.MIME_TYPE).build();
return Source.newBuilder(new InputStreamReader(stream, StandardCharsets.UTF_8)).name(path).mimeType(RubyLanguage.MIME_TYPE).build();
}

}
Original file line number Diff line number Diff line change
@@ -63,6 +63,8 @@ public Object execute(VirtualFrame frame) {
} catch (StackOverflowError error) {
errorProfile.enter();
throw new RaiseException(translate(error));
} catch (ThreadDeath death) {
throw death;
} catch (Throwable exception) {
errorProfile.enter();
throw new RaiseException(translate(exception));
Original file line number Diff line number Diff line change
@@ -1074,10 +1074,10 @@ private String getSourcePath(SourceSection sourceSection) {
return "(unknown)";
}

final String path = source.getPath();
final String path = source.getName();

if (path == null) {
throw new UnsupportedOperationException();
return source.getName();
}

return path;
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ public RubyNode visitArgsNode(org.jruby.ast.ArgsNode node) {
System.err.println("WARNING: post args in zsuper not yet implemented at " + sourceSection.getShortDescription());
}

if (node.hasKwargs() && !sourceSection.getSource().getPath().endsWith("/language/fixtures/super.rb")) {
if (node.hasKwargs() && !sourceSection.getSource().getName().endsWith("/language/fixtures/super.rb")) {
System.err.println("WARNING: kwargs in zsuper not yet implemented at " + sourceSection.getShortDescription());
}

Original file line number Diff line number Diff line change
@@ -138,7 +138,7 @@ public synchronized void disable() {
}

private synchronized AtomicLongArray getCounters(Source source) {
if (source.getPath() == null) {
if (source.getName() == null) {
return null;
}

Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ public DynamicObject resultArray() {
}

results.add(Layouts.ARRAY.createArray(coreLibrary().getArrayFactory(), new Object[]{
createString(StringOperations.encodeRope(source.getKey().getPath(), UTF8Encoding.INSTANCE)),
createString(StringOperations.encodeRope(source.getKey().getName(), UTF8Encoding.INSTANCE)),
Layouts.ARRAY.createArray(coreLibrary().getArrayFactory(), countsStore, countsStore.length)
}, 2));
}
Loading