Skip to content

Commit

Permalink
Fix pushsymbolproc to use id vs bytelist to be consistent with new id
Browse files Browse the repository at this point in the history
strategy.
  • Loading branch information
enebo committed Apr 24, 2018
1 parent 135da97 commit 6f74142
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java
Expand Up @@ -1928,12 +1928,12 @@ public static IRubyObject useBindingSelf(Binding binding) {
* Create a new Symbol.to_proc for the given symbol name and encoding.
*
* @param context
* @param symbol
* @param id
* @return
*/
@JIT
public static RubyProc newSymbolProc(ThreadContext context, ByteList symbol) {
return (RubyProc) context.runtime.newSymbol(symbol).to_proc(context);
public static RubyProc newSymbolProc(ThreadContext context, String id) {
return (RubyProc) context.runtime.newSymbol(id).to_proc(context);
}

/**
Expand Down
Expand Up @@ -335,9 +335,9 @@ public org.objectweb.asm.Label newLabel() {
*
* Stack required: none
*
* @param bytes the ByteList for the symbol.
* @param id raw id string for the symbol.
*/
public abstract void pushSymbolProc(ByteList bytes);
public abstract void pushSymbolProc(String id);

/**
* Push the JRuby runtime on the stack.
Expand Down
Expand Up @@ -354,13 +354,13 @@ public void run() {
});
}

public void pushSymbolProc(final ByteList bytes) {
public void pushSymbolProc(final String id) {
cacheValuePermanentlyLoadContext("symbolProc", RubyProc.class, null, new Runnable() {
@Override
public void run() {
loadContext();
pushByteList(bytes);
invokeIRHelper("newSymbolProc", sig(RubyProc.class, ThreadContext.class, ByteList.class));
adapter.ldc(id);
invokeIRHelper("newSymbolProc", sig(RubyProc.class, ThreadContext.class, String.class));
}
});
}
Expand Down
3 changes: 1 addition & 2 deletions core/src/main/java/org/jruby/ir/targets/JVMVisitor.java
Expand Up @@ -2608,8 +2608,7 @@ public void Symbol(Symbol symbol) {

@Override
public void SymbolProc(SymbolProc symbolproc) {
// FIXME: bytelist_love - we can also do getId() is we will just cache lookup for symbol?
jvmMethod().pushSymbolProc(symbolproc.getName().getBytes());
jvmMethod().pushSymbolProc(symbolproc.getId());
}

@Override
Expand Down

0 comments on commit 6f74142

Please sign in to comment.