Skip to content

Commit

Permalink
[Truffle] Truffle::Debug.storage_class for Hash
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Jan 26, 2015
1 parent 3cdfc85 commit 667e30f
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -18,6 +18,7 @@
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.backtrace.Backtrace;
import org.jruby.truffle.runtime.core.RubyArray;
import org.jruby.truffle.runtime.core.RubyHash;
import org.jruby.truffle.runtime.core.RubyNilClass;
import org.jruby.truffle.runtime.core.RubyString;

Expand Down Expand Up @@ -119,7 +120,7 @@ public StorageClassNode(StorageClassNode prev) {
}

@Specialization
public RubyString javaClassOf(RubyArray array) {
public RubyString storageClass(RubyArray array) {
notDesignedForCompilation();

if (array.getStore() == null) {
Expand All @@ -129,6 +130,17 @@ public RubyString javaClassOf(RubyArray array) {
}
}

@Specialization
public RubyString storageClass(RubyHash hash) {
notDesignedForCompilation();

if (hash.getStore() == null) {
return getContext().makeString("null");
} else {
return getContext().makeString(hash.getStore().getClass().getName());
}
}

}

@CoreMethod(names = "panic", onSingleton = true)
Expand Down

0 comments on commit 667e30f

Please sign in to comment.