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: 13595148a7e8^
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c6b5cac30acd
Choose a head ref
  • 4 commits
  • 25 files changed
  • 1 contributor

Commits on Jun 15, 2015

  1. Copy the full SHA
    1359514 View commit details
  2. Copy the full SHA
    29e6820 View commit details
  3. Copy the full SHA
    3a37022 View commit details

Commits on Jun 16, 2015

  1. Copy the full SHA
    c6b5cac View commit details
Showing with 53 additions and 57 deletions.
  1. +27 −13 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/ModulePrimitiveNodes.java
  2. +1 −3 truffle/src/main/java/org/jruby/truffle/runtime/core/CoreLibrary.java
  3. +1 −1 truffle/src/main/ruby/core/rubinius/README.md
  4. +1 −1 truffle/src/main/ruby/core/rubinius/api/shims/rubinius.rb
  5. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/basic_object.rb
  6. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/channel.rb
  7. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/character.rb
  8. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/configuration.rb
  9. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/dir.rb
  10. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/false.rb
  11. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/gc.rb
  12. +2 −2 truffle/src/main/ruby/core/rubinius/bootstrap/io.rb
  13. +1 −9 truffle/src/main/ruby/core/rubinius/bootstrap/kernel.rb
  14. +2 −2 truffle/src/main/ruby/core/rubinius/bootstrap/mirror.rb
  15. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/nil.rb
  16. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/process.rb
  17. +1 −9 truffle/src/main/ruby/core/rubinius/bootstrap/regexp.rb
  18. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/rubinius.rb
  19. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/stat.rb
  20. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/string.rb
  21. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/symbol.rb
  22. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/thread.rb
  23. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/time.rb
  24. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/true.rb
  25. +1 −1 truffle/src/main/ruby/core/rubinius/bootstrap/type.rb
Original file line number Diff line number Diff line change
@@ -9,35 +9,49 @@
*/
package org.jruby.truffle.nodes.rubinius;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.runtime.RubyConstant;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.core.RubyBasicObject;
import org.jruby.truffle.runtime.core.RubyClass;
import org.jruby.truffle.runtime.core.RubyModule;
import org.jruby.truffle.runtime.core.RubyString;


public abstract class ModulePrimitiveNodes {

@RubiniusPrimitive(name = "module_mirror")
public abstract static class ModuleMirrorPrimitiveNode extends RubiniusPrimitiveNode {

@CompilationFinal RubyModule stringMirror;

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

@Specialization(guards = "logicalClass == object.getLogicalClass()")
public Object moduleMirrorCached(RubyBasicObject object,
@Cached("object.getLogicalClass()") RubyClass logicalClass,
@Cached("lookupMirror(object)") Object mirror) {
return mirror;
}

@Specialization
public RubyModule moduleMirror(RubyString string) {
if (stringMirror == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
final RubyModule rubinius = (RubyModule) getContext().getCoreLibrary().getObjectClass().getConstants().get("Rubinius").getValue();
final RubyModule mirror = (RubyModule) rubinius.getConstants().get("Mirror").getValue();
stringMirror = (RubyModule) mirror.getConstants().get("String").getValue();
public Object moduleMirrorUncached(RubyBasicObject object) {
return lookupMirror(object);
}

@TruffleBoundary
protected Object lookupMirror(RubyBasicObject object) {
final RubyModule rubinius = (RubyModule) getContext().getCoreLibrary().getObjectClass().getConstants().get("Rubinius").getValue();
final RubyModule mirror = (RubyModule) rubinius.getConstants().get("Mirror").getValue();
final RubyConstant objectMirrorConstant = mirror.getConstants().get(object.getLogicalClass().getName());

if (objectMirrorConstant == null) {
return nil();
}
return stringMirror;

return objectMirrorConstant.getValue();
}

}
Original file line number Diff line number Diff line change
@@ -220,9 +220,6 @@ public CoreLibrary(RubyContext context) {
// Exception
exceptionClass = defineClass("Exception", new RubyException.ExceptionAllocator());

// FiberError
fiberErrorClass = defineClass(exceptionClass, "FiberError");

// NoMemoryError
defineClass(exceptionClass, "NoMemoryError");

@@ -233,6 +230,7 @@ public CoreLibrary(RubyContext context) {
standardErrorClass = defineClass(exceptionClass, "StandardError");
argumentErrorClass = defineClass(standardErrorClass, "ArgumentError");
encodingErrorClass = defineClass(standardErrorClass, "EncodingError");
fiberErrorClass = defineClass(standardErrorClass, "FiberError");
ioErrorClass = defineClass(standardErrorClass, "IOError");
localJumpErrorClass = defineClass(standardErrorClass, "LocalJumpError");
regexpErrorClass = defineClass(standardErrorClass, "RegexpError");
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
`bootstrap`, `common`, `delta` and `platform` contains the Ruby component of the
Rubinius kernel (core library) implementation, in some cases modified. We have
taken files from version 2.4.1 of Rubinius. This code was written by Evan
taken files from version 2.5.6 of Rubinius. This code was written by Evan
Phoenix, Brian Shirai, et al.

https://github.com/rubinius/rubinius
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/api/shims/rubinius.rb
Original file line number Diff line number Diff line change
@@ -47,5 +47,5 @@ class DynamicLibrary

end

class PrimitiveFailure < StandardError
class PrimitiveFailure < Exception
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/channel.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/character.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/dir.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/false.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/gc.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
4 changes: 2 additions & 2 deletions truffle/src/main/ruby/core/rubinius/bootstrap/io.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015 Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -163,7 +163,7 @@ def close
#
def shutdown(how)
Rubinius.primitive :io_shutdown
raise PrimitiveFailure, "IO#innertShutdown primitive failed"
raise PrimitiveFailure, "IO#shutdown primitive failed"
end

def socket_recv(bytes, flags, type)
10 changes: 1 addition & 9 deletions truffle/src/main/ruby/core/rubinius/bootstrap/kernel.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015 Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
4 changes: 2 additions & 2 deletions truffle/src/main/ruby/core/rubinius/bootstrap/mirror.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,7 @@ def initialize(obj)
end

class Object < Mirror
subject = ::Object
self.subject = ::Object
end

def inspect
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/nil.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/process.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
10 changes: 1 addition & 9 deletions truffle/src/main/ruby/core/rubinius/bootstrap/regexp.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015 Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/rubinius.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/stat.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/string.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/symbol.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/thread.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/time.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/true.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/bootstrap/type.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without