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

Commits on Nov 5, 2014

  1. Copy the full SHA
    ca5778b View commit details
  2. Copy the full SHA
    2166c9e View commit details
  3. Copy the full SHA
    18395e4 View commit details
  4. Copy the full SHA
    ab56b26 View commit details
24 changes: 22 additions & 2 deletions core/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
Original file line number Diff line number Diff line change
@@ -787,6 +787,26 @@ public Object initializeDup(VirtualFrame frame, RubyObject self, RubyObject othe

}

@CoreMethod(names = "instance_of?", required = 1)
public abstract static class InstanceOfNode extends CoreMethodNode {

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

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

@SlowPath
@Specialization
public boolean instanceOf(Object self, RubyClass rubyClass) {
// TODO(CS): fast path
return getContext().getCoreLibrary().box(self).getLogicalClass() == rubyClass;
}

}

@CoreMethod(names = "instance_variable_defined?", required = 1)
public abstract static class InstanceVariableDefinedNode extends CoreMethodNode {

@@ -942,7 +962,7 @@ public Object integer(VirtualFrame frame, Object value) {

}

@CoreMethod(names = {"is_a?", "instance_of?", "kind_of?"}, required = 1)
@CoreMethod(names = {"is_a?", "kind_of?"}, required = 1)
public abstract static class IsANode extends CoreMethodNode {

public IsANode(RubyContext context, SourceSection sourceSection) {
@@ -962,7 +982,7 @@ public boolean isA(@SuppressWarnings("unused") RubyBasicObject self, @SuppressWa
@Specialization
public boolean isA(Object self, RubyClass rubyClass) {
// TODO(CS): fast path
return ModuleOperations.assignableTo(getContext().getCoreLibrary().box(self).getLogicalClass(), rubyClass);
return ModuleOperations.assignableTo(getContext().getCoreLibrary().box(self).getMetaClass(), rubyClass);
}

}
Original file line number Diff line number Diff line change
@@ -523,7 +523,7 @@ public RubyException nameErrorUninitializedConstant(String name, Node currentNod

public RubyException nameErrorNoMethod(String name, String object, Node currentNode) {
CompilerAsserts.neverPartOfCompilation();
return nameError(String.format("undefined local variable or method `%s' for %s", name, object), currentNode);
return nameError(String.format("undefined method `%s' for %s", name, object), currentNode);
}

public RubyException nameErrorInstanceNameNotAllowable(String name, Node currentNode) {
2 changes: 1 addition & 1 deletion spec/truffle/tags/language/file_tags.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fails:The __FILE__ pseudo-variable equals (eval) inside an eval
fails:The __FILE__ pseudo-variable equals (eval) inside an eval
6 changes: 0 additions & 6 deletions spec/truffle/tags/language/predefined_tags.txt
Original file line number Diff line number Diff line change
@@ -28,22 +28,17 @@ fails(inherited):Predefined global $-0 raises a TypeError if assigned a boolean
fails:Predefined global $, raises TypeError if assigned a non-String
fails:Predefined global $_ is set to the last line read by e.g. StringIO#gets
fails:Predefined global $_ is set at the method-scoped level rather than block-scoped
fails:Predefined global $_ is Thread-local
fails:Execution variable $: is the same object as $LOAD_PATH and $-I
fails:Global variable $-d is an alias of $DEBUG
fails:Global variable $-v is an alias of $VERBOSE
fails:Global variable $-w is an alias of $VERBOSE
fails(inherited):Global variable $0 raises a TypeError when not given an object that can be coerced to a String
fails:The predefined standard objects includes ARGF
fails:The predefined global constants includes TOPLEVEL_BINDING
fails:Processing RUBYOPT sets $DEBUG to true for '-d'
fails:Processing RUBYOPT sets $VERBOSE to true for '-w'
fails:Processing RUBYOPT sets $VERBOSE to true for '-W'
fails:Processing RUBYOPT sets $VERBOSE to nil for '-W0'
fails:Processing RUBYOPT sets $VERBOSE to false for '-W1'
fails:Processing RUBYOPT sets $VERBOSE to true for '-W2'
fails:Processing RUBYOPT requires the file for '-r'
fails:Processing RUBYOPT raises a RuntimeError for '-a'
fails:The predefined global constant STDERR has nil for the external encoding despite Encoding.default_external being changed
fails:The predefined global constant STDERR has the encodings set by #set_encoding
fails:The predefined global constant ARGV contains Strings encoded in locale Encoding
@@ -61,5 +56,4 @@ fails:The predefined global constant STDIN retains the encoding set by #set_enco
fails:The predefined global constant STDIN has the encodings set by #set_encoding
fails:The predefined global constant STDIN has the same external encoding as Encoding.default_external when that encoding is changed
fails:The predefined global constant STDIN has the same external encoding as Encoding.default_external
fails:Processing RUBYOPT prints the version number for '-v'
fails:Processing RUBYOPT adds the -I path to $LOAD_PATH
2 changes: 0 additions & 2 deletions spec/truffle/tags/language/singleton_class_tags.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
fails:A singleton class is a singleton Class instance
fails:A singleton class is a subclass of Class's singleton class
fails(inherited):A singleton class is a subclass of the same level of Class's singleton class
fails(inherited):A singleton class doesn't have singleton class
fails:A constant on a singleton class can be accessed via const_get
fails:Defining instance methods on a singleton class define public methods
fails:Class methods of a singleton class include ones of the object's class
fails:Class methods of a singleton class for a singleton class include instance methods of the singleton class of Class