Skip to content
Permalink
Browse files
[Truffle] Truffle::Debug.storage_class for Hash
  • Loading branch information
chrisseaton committed Jan 26, 2015
1 parent 3cdfc85 commit 667e30f64eb4d73ddd35af1be9ac67fbd8f8de84
Showing with 13 additions and 1 deletion.
  1. +13 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/TruffleDebugNodes.java
@@ -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;

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

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

if (array.getStore() == null) {
@@ -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)

0 comments on commit 667e30f

Please sign in to comment.