diff --git a/core/src/main/java/org/jruby/ir/instructions/ProcessModuleBodyInstr.java b/core/src/main/java/org/jruby/ir/instructions/ProcessModuleBodyInstr.java index 75ebd71da08..ea4d53febb0 100644 --- a/core/src/main/java/org/jruby/ir/instructions/ProcessModuleBodyInstr.java +++ b/core/src/main/java/org/jruby/ir/instructions/ProcessModuleBodyInstr.java @@ -40,7 +40,7 @@ public Object interpret(ThreadContext context, StaticScope currScope, DynamicSco InterpretedIRBodyMethod bodyMethod = (InterpretedIRBodyMethod) getModuleBody().retrieve(context, self, currScope, currDynScope, temp); RubyModule implClass = bodyMethod.getImplementationClass(); - return bodyMethod.call(context, implClass, implClass, null, Block.NULL_BLOCK); + return bodyMethod.call(context, implClass, implClass, "", Block.NULL_BLOCK); } @Override diff --git a/core/src/main/java/org/jruby/ir/interpreter/Interpreter.java b/core/src/main/java/org/jruby/ir/interpreter/Interpreter.java index b863fcb200b..b599d4fc109 100644 --- a/core/src/main/java/org/jruby/ir/interpreter/Interpreter.java +++ b/core/src/main/java/org/jruby/ir/interpreter/Interpreter.java @@ -127,15 +127,15 @@ public static IRubyObject INTERPRET_BLOCK(ThreadContext context, Block block, IR } public static IRubyObject INTERPRET_CLASS(ThreadContext context, IRScope body, RubyModule clazz) { - return interpretFrameScope(context, null, body, clazz, null, Visibility.PUBLIC, clazz, null, null, Block.NULL_BLOCK); + return interpretFrameScope(context, null, body, clazz, null, Visibility.PUBLIC, clazz, "", null, Block.NULL_BLOCK); } public static IRubyObject INTERPRET_MODULE(ThreadContext context, IRScope body, RubyModule clazz) { - return interpretFrameScope(context, null, body, clazz, null, Visibility.PUBLIC, clazz, null, null, Block.NULL_BLOCK); + return interpretFrameScope(context, null, body, clazz, null, Visibility.PUBLIC, clazz, "", null, Block.NULL_BLOCK); } public static IRubyObject INTERPRET_METACLASS(ThreadContext context, IRScope body, RubyModule clazz, Visibility visibility) { - return interpretFrameScope(context, null, body, clazz, context.getCurrentScope(), visibility, clazz, null, null, Block.NULL_BLOCK); + return interpretFrameScope(context, null, body, clazz, context.getCurrentScope(), visibility, clazz, "", null, Block.NULL_BLOCK); } public static IRubyObject INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, diff --git a/core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java b/core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java index 490878ddf92..55ff1941b8f 100644 --- a/core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java +++ b/core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java @@ -1969,7 +1969,7 @@ public static void defCompiledInstanceMethod(ThreadContext context, MethodHandle public static IRubyObject invokeModuleBody(ThreadContext context, DynamicMethod method) { RubyModule implClass = method.getImplementationClass(); - return method.call(context, implClass, implClass, null, Block.NULL_BLOCK); + return method.call(context, implClass, implClass, "", Block.NULL_BLOCK); } @JIT diff --git a/core/src/main/java/org/jruby/ir/targets/JVMVisitor.java b/core/src/main/java/org/jruby/ir/targets/JVMVisitor.java index bd1d780ada1..44cfebecdca 100644 --- a/core/src/main/java/org/jruby/ir/targets/JVMVisitor.java +++ b/core/src/main/java/org/jruby/ir/targets/JVMVisitor.java @@ -499,7 +499,7 @@ private void defineRunMethod(IRScriptBody script, String scopeName, String scope method.aconst_null(); // args method.getstatic(p(Block.class), "NULL_BLOCK", ci(Block.class)); // block method.aload(4); // self class - method.aconst_null(); // call name + method.ldc(""); // call name method.invokestatic(clsName, scopeName, sig(signature.type().returnType(), signature.type().parameterArray())); method.areturn(); diff --git a/core/src/main/java/org/jruby/runtime/Frame.java b/core/src/main/java/org/jruby/runtime/Frame.java index 2115584753c..8e61f9c484a 100644 --- a/core/src/main/java/org/jruby/runtime/Frame.java +++ b/core/src/main/java/org/jruby/runtime/Frame.java @@ -96,6 +96,7 @@ public final class Frame { * when needed. */ public Frame() { + name = ""; } /** @@ -112,6 +113,7 @@ private Frame(Block nullBlock) { */ private Frame(Frame frame) { assert frame.block != null; + assert frame.name != null; this.self = frame.self; this.name = frame.name; @@ -135,6 +137,7 @@ public void updateFrame() { * @param name The name of the method being called */ public void updateFrame(String name) { + assert name != null; this.name = name; } @@ -147,6 +150,7 @@ public void updateFrame(String name) { public void updateFrame(Frame frame) { Block block = frame.block; assert block != null; + assert frame.name != null; this.self = frame.self; this.name = frame.name; @@ -165,6 +169,7 @@ public void updateFrame(Frame frame) { */ public void updateFrame(RubyModule klazz, IRubyObject self, String name, Block block) { assert block != null; + assert name != null; this.self = self; this.name = name; this.klazz = klazz; @@ -182,6 +187,7 @@ public void updateFrame(RubyModule klazz, IRubyObject self, String name, Block b */ public void updateFrame(RubyModule klazz, IRubyObject self, String name, Visibility visibility, Block block) { assert block != null; + assert name != null; this.self = self; this.name = name; this.klazz = klazz; @@ -196,7 +202,7 @@ public void updateFrame(RubyModule klazz, IRubyObject self, String name, Visibil */ public void updateFrameForEval(IRubyObject self) { this.self = self; - this.name = null; + this.name = ""; this.visibility = Visibility.PRIVATE; } @@ -267,6 +273,7 @@ public void setKlazz(RubyModule klazz) { * @param name the new name */ public void setName(String name) { + assert name != null; this.name = name; }