From bbcad68dc5e2182d2d217dce6be16a3cfd1bf409 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Wed, 8 May 2024 17:25:24 -0500 Subject: [PATCH] Split concept of frame name and passed name These names are all different and it's driving me batty. --- .../org/jruby/ir/interpreter/Interpreter.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) 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 9e4d9f390eb..23247785a5f 100644 --- a/core/src/main/java/org/jruby/ir/interpreter/Interpreter.java +++ b/core/src/main/java/org/jruby/ir/interpreter/Interpreter.java @@ -127,43 +127,43 @@ public static IRubyObject INTERPRET_BLOCK(ThreadContext context, Block block, IR } public static IRubyObject INTERPRET_CLASS(ThreadContext context, IRScope body, RubyModule clazz, String name) { - return interpretFrameScope(context, null, body, clazz, null, Visibility.PUBLIC, clazz, name, null, Block.NULL_BLOCK); + return interpretFrameScope(context, null, body, clazz, null, Visibility.PUBLIC, clazz, null, name, null, Block.NULL_BLOCK); } public static IRubyObject INTERPRET_MODULE(ThreadContext context, IRScope body, RubyModule clazz, String name) { - return interpretFrameScope(context, null, body, clazz, null, Visibility.PUBLIC, clazz, name, null, Block.NULL_BLOCK); + return interpretFrameScope(context, null, body, clazz, null, Visibility.PUBLIC, clazz, null, name, null, Block.NULL_BLOCK); } public static IRubyObject INTERPRET_METACLASS(ThreadContext context, IRScope body, RubyModule clazz, String name, Visibility visibility) { - return interpretFrameScope(context, null, body, clazz, context.getCurrentScope(), visibility, clazz, name, null, Block.NULL_BLOCK); + return interpretFrameScope(context, null, body, clazz, context.getCurrentScope(), visibility, clazz, null, name, null, Block.NULL_BLOCK); } public static IRubyObject INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, IRubyObject[] args, Block block) { - return interpretFrameScope(context, null, body, implClass, null, Visibility.PUBLIC, self, name, args, block); + return interpretFrameScope(context, null, body, implClass, null, Visibility.PUBLIC, self, name, name, args, block); } public static IRubyObject INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, Block block) { - return interpretFrameScope(context, null, body, implClass, null, Visibility.PUBLIC, self, name, IRubyObject.NULL_ARRAY, block); + return interpretFrameScope(context, null, body, implClass, null, Visibility.PUBLIC, self, name, name, IRubyObject.NULL_ARRAY, block); } public static IRubyObject INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, IRubyObject arg0, Block block) { - return interpretFrameScope(context, null, body, implClass, null, Visibility.PUBLIC, self, name, arrayOf(arg0), block); + return interpretFrameScope(context, null, body, implClass, null, Visibility.PUBLIC, self, name, name, arrayOf(arg0), block); } public static IRubyObject INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, Block block) { - return interpretFrameScope(context, null, body, implClass, null, Visibility.PUBLIC, self, name, arrayOf(arg0, arg1), block); + return interpretFrameScope(context, null, body, implClass, null, Visibility.PUBLIC, self, name, name, arrayOf(arg0, arg1), block); } public static IRubyObject INTERPRET_METHOD(ThreadContext context, IRScope body, RubyModule implClass, IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) { - return interpretFrameScope(context, null, body, implClass, null, Visibility.PUBLIC, self, name, arrayOf(arg0, arg1, arg2), block); + return interpretFrameScope(context, null, body, implClass, null, Visibility.PUBLIC, self, name, name, arrayOf(arg0, arg1, arg2), block); } - private static IRubyObject interpretFrameScope(ThreadContext context, Block selfBlock, IRScope body, RubyModule clazz, DynamicScope parentScope, Visibility visibility, IRubyObject self, String name, IRubyObject[] args, Block block) { + private static IRubyObject interpretFrameScope(ThreadContext context, Block selfBlock, IRScope body, RubyModule clazz, DynamicScope parentScope, Visibility visibility, IRubyObject self, String frameName, String passedName, IRubyObject[] args, Block block) { InterpreterContext ic = body.getInterpreterContext(); String id = body.getId(); boolean hasExplicitCallProtocol = ic.hasExplicitCallProtocol(); @@ -171,10 +171,10 @@ private static IRubyObject interpretFrameScope(ThreadContext context, Block self try { ThreadContext.pushBacktrace(context, id, ic.getFileName(), ic.getLine()); - if (!hasExplicitCallProtocol) preFrameScope(ic, context, self, name, block, clazz, parentScope, visibility); + if (!hasExplicitCallProtocol) preFrameScope(ic, context, self, frameName, block, clazz, parentScope, visibility); try { - return ic.getEngine().interpret(context, selfBlock, self, ic, clazz, name, args, block); + return ic.getEngine().interpret(context, selfBlock, self, ic, clazz, passedName, args, block); } finally { body.cleanupAfterExecution(); if (!hasExplicitCallProtocol) postFrameScope(ic, context);