Skip to content

Commit f97442a

Browse files
committed
rename base runtime class
1 parent a0690e8 commit f97442a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+131
-133
lines changed

dev/design/INC_in_jar.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ In ModuleLoader.java, you can modify the findFile method to look inside the jar
3939
// Otherwise, search in INC directories
4040
List<RuntimeScalar> inc = GlobalContext.getGlobalArray("main::INC").elements;
4141

42-
for (RuntimeBaseEntity dir : inc) {
42+
for (RuntimeBase dir : inc) {
4343
Path fullPath = Paths.get(dir.toString(), filename);
4444
if (Files.exists(fullPath)) {
4545
return fullPath;

dev/sandbox/RuntimeArrayAutovivified.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public RuntimeList getSlice(RuntimeList value) {
332332
}
333333

334334
RuntimeList result = new RuntimeList();
335-
List<RuntimeBaseEntity> outElements = result.elements;
335+
List<RuntimeBase> outElements = result.elements;
336336
Iterator<RuntimeScalar> iterator = value.iterator();
337337
while (iterator.hasNext()) {
338338
outElements.add(this.get(iterator.next()));
@@ -462,7 +462,7 @@ public RuntimeScalar chomp() {
462462
@Override
463463
public String toString() {
464464
StringBuilder sb = new StringBuilder();
465-
for (RuntimeBaseEntity element : elements) {
465+
for (RuntimeBase element : elements) {
466466
sb.append(element.toString());
467467
}
468468
return sb.toString();

dev/tools/Overload.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ private static RuntimeScalar handleOverload(
3838
String[] fallbackMethods,
3939
ConversionFunction defaultConversion
4040
) {
41-
if (!(runtimeScalar.value instanceof RuntimeBaseEntity baseEntity)) {
41+
if (!(runtimeScalar.value instanceof RuntimeBase baseEntity)) {
4242
return defaultConversion.apply(runtimeScalar);
4343
}
4444

dev/tools/lazy_list.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import java.util.List;
44
import java.util.NoSuchElementException;
55

6-
public class RuntimeList extends RuntimeBaseEntity implements RuntimeDataProvider {
7-
private List<RuntimeBaseEntity> elements;
6+
public class RuntimeList extends RuntimeBase implements RuntimeDataProvider {
7+
private List<RuntimeBase> elements;
88
private boolean isLazy = false;
99
private Iterator<RuntimeScalar> lazyIterator; // Store the iterator for lazy generation
1010

@@ -77,12 +77,12 @@ public int size() {
7777
return elements.size();
7878
}
7979

80-
public RuntimeBaseEntity get(int index) {
80+
public RuntimeBase get(int index) {
8181
materializeIfNeeded();
8282
return elements.get(index);
8383
}
8484

85-
public void add(RuntimeBaseEntity value) {
85+
public void add(RuntimeBase value) {
8686
materializeIfNeeded();
8787
this.elements.add(value);
8888
}

dev/tools/overloading_bit.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.perlonjava.runtime;
22

3-
public abstract class RuntimeBaseEntity implements RuntimeDataProvider, DynamicState {
3+
public abstract class RuntimeBase implements RuntimeDataProvider, DynamicState {
44
public int blessId;
55

66
// Mask for the highest bit of an int (assuming 32-bit integer)

src/main/java/org/perlonjava/codegen/Dereference.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ static void handleArrowOperator(EmitterVisitor emitterVisitor, BinaryOperatorNod
260260
arguments.accept(emitterVisitor.with(RuntimeContextType.LIST)); // right parameter: parameter list
261261

262262
// Transform the value in the stack to RuntimeArray
263-
emitterVisitor.ctx.mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBaseEntity", "getArrayOfAlias", "()Lorg/perlonjava/runtime/RuntimeArray;", false);
263+
emitterVisitor.ctx.mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBase", "getArrayOfAlias", "()Lorg/perlonjava/runtime/RuntimeArray;", false);
264264
emitterVisitor.ctx.mv.visitLdcInsn(emitterVisitor.ctx.contextType); // push call context to stack
265265
emitterVisitor.ctx.mv.visitMethodInsn(
266266
Opcodes.INVOKESTATIC,

src/main/java/org/perlonjava/codegen/EmitForeach.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static void emitFor1(EmitterVisitor emitterVisitor, For1Node node) {
6565

6666
// Obtain the iterator for the list
6767
node.list.accept(emitterVisitor.with(RuntimeContextType.LIST));
68-
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBaseEntity", "iterator", "()Ljava/util/Iterator;", false);
68+
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBase", "iterator", "()Ljava/util/Iterator;", false);
6969

7070
Local.localRecord localRecord = Local.localSetup(emitterVisitor.ctx, node, mv);
7171

src/main/java/org/perlonjava/codegen/EmitLiteral.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static void emitArrayLiteral(EmitterVisitor emitterVisitor, ArrayLiteralN
8989
}
9090

9191
// Convert the array to a reference (array literals produce references)
92-
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBaseEntity",
92+
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBase",
9393
"createReference", "()Lorg/perlonjava/runtime/RuntimeScalar;", false);
9494

9595
emitterVisitor.ctx.logDebug("visit(ArrayLiteralNode) end");

src/main/java/org/perlonjava/codegen/EmitLogicalOperator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static void emitLogicalAssign(EmitterVisitor emitterVisitor, BinaryOperatorNode
6565
// Stack is [left, left]
6666

6767
// Convert the result to a boolean
68-
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBaseEntity", getBoolean, "()Z", false);
68+
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBase", getBoolean, "()Z", false);
6969
// Stack is [left, boolean]
7070

7171
// If the boolean value is true, jump to endLabel (we keep the left operand)
@@ -77,7 +77,7 @@ static void emitLogicalAssign(EmitterVisitor emitterVisitor, BinaryOperatorNode
7777
mv.visitInsn(Opcodes.SWAP); // Stack becomes [right, left]
7878

7979
// Assign right to left
80-
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBaseEntity", "addToScalar", "(Lorg/perlonjava/runtime/RuntimeScalar;)Lorg/perlonjava/runtime/RuntimeScalar;", false);
80+
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBase", "addToScalar", "(Lorg/perlonjava/runtime/RuntimeScalar;)Lorg/perlonjava/runtime/RuntimeScalar;", false);
8181
// Stack is [right]
8282

8383
// At this point, the stack either has the left (if it was true) or the right (if left was false)
@@ -121,7 +121,7 @@ static void emitLogicalOperator(EmitterVisitor emitterVisitor, BinaryOperatorNod
121121
// Stack is [left, left]
122122

123123
// Convert the result to a boolean
124-
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBaseEntity", getBoolean, "()Z", false);
124+
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBase", getBoolean, "()Z", false);
125125
// Stack is [left, boolean]
126126

127127
// If the left operand boolean value is true, return left operand
@@ -152,7 +152,7 @@ public static void emitTernaryOperator(EmitterVisitor emitterVisitor, TernaryOpe
152152
node.condition.accept(emitterVisitor.with(RuntimeContextType.SCALAR));
153153

154154
// Convert the result to a boolean
155-
emitterVisitor.ctx.mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBaseEntity", "getBoolean", "()Z", false);
155+
emitterVisitor.ctx.mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBase", "getBoolean", "()Z", false);
156156

157157
// Jump to the else label if the condition is false
158158
emitterVisitor.ctx.mv.visitJumpInsn(Opcodes.IFEQ, elseLabel);

src/main/java/org/perlonjava/codegen/EmitOperator.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static void handleReadlineOperator(EmitterVisitor emitterVisitor, BinaryOperator
9393
// Push call context for SCALAR or LIST context.
9494
emitterVisitor.pushCallContext();
9595
// Invoke the static method for the operator.
96-
emitterVisitor.ctx.mv.visitMethodInsn(Opcodes.INVOKESTATIC, "org/perlonjava/operators/Readline", operator, "(Lorg/perlonjava/runtime/RuntimeScalar;I)Lorg/perlonjava/runtime/RuntimeBaseEntity;", false);
96+
emitterVisitor.ctx.mv.visitMethodInsn(Opcodes.INVOKESTATIC, "org/perlonjava/operators/Readline", operator, "(Lorg/perlonjava/runtime/RuntimeScalar;I)Lorg/perlonjava/runtime/RuntimeBase;", false);
9797
} else {
9898
// Invoke the static method for the operator without context.
9999
emitterVisitor.ctx.mv.visitMethodInsn(Opcodes.INVOKESTATIC, "org/perlonjava/operators/Operator", operator, "(Lorg/perlonjava/runtime/RuntimeScalar;)Lorg/perlonjava/runtime/RuntimeScalar;", false);
@@ -253,7 +253,7 @@ static void handleDiamondBuiltin(EmitterVisitor emitterVisitor, OperatorNode nod
253253
mv.visitMethodInsn(Opcodes.INVOKESTATIC,
254254
"org/perlonjava/runtime/DiamondIO",
255255
"readline",
256-
"(Lorg/perlonjava/runtime/RuntimeScalar;I)Lorg/perlonjava/runtime/RuntimeBaseEntity;", false);
256+
"(Lorg/perlonjava/runtime/RuntimeScalar;I)Lorg/perlonjava/runtime/RuntimeBase;", false);
257257
// If the context is VOID, pop the result from the stack.
258258
handleVoidContext(emitterVisitor);
259259
} else {
@@ -270,7 +270,7 @@ static void handleChompBuiltin(EmitterVisitor emitterVisitor, OperatorNode node)
270270
node.operand.accept(emitterVisitor.with(RuntimeContextType.LIST));
271271
// Invoke the interface method for the operator.
272272
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,
273-
"org/perlonjava/runtime/RuntimeBaseEntity",
273+
"org/perlonjava/runtime/RuntimeBase",
274274
node.operator,
275275
"()Lorg/perlonjava/runtime/RuntimeScalar;", false);
276276
// If the context is VOID, pop the result from the stack.
@@ -284,7 +284,7 @@ static void handleGlobBuiltin(EmitterVisitor emitterVisitor, OperatorNode node)
284284
// Generate unique IDs for this glob instance
285285
int globId = ScalarGlobOperator.currentId++;
286286

287-
// public static RuntimeBaseEntity evaluate(id, patternArg, ctx)
287+
// public static RuntimeBase evaluate(id, patternArg, ctx)
288288
mv.visitLdcInsn(globId);
289289
// Accept the operand in SCALAR context.
290290
node.operand.accept(emitterVisitor.with(RuntimeContextType.SCALAR));
@@ -322,7 +322,7 @@ static void handleRepeat(EmitterVisitor emitterVisitor, BinaryOperatorNode node)
322322
// Invoke the static method for the 'repeat' operator.
323323
emitterVisitor.ctx.mv.visitMethodInsn(Opcodes.INVOKESTATIC, "org/perlonjava/operators/Operator",
324324
"repeat",
325-
"(Lorg/perlonjava/runtime/RuntimeDataProvider;Lorg/perlonjava/runtime/RuntimeScalar;I)Lorg/perlonjava/runtime/RuntimeBaseEntity;", false);
325+
"(Lorg/perlonjava/runtime/RuntimeDataProvider;Lorg/perlonjava/runtime/RuntimeScalar;I)Lorg/perlonjava/runtime/RuntimeBase;", false);
326326

327327
if (emitterVisitor.ctx.contextType == RuntimeContextType.SCALAR) {
328328
emitterVisitor.ctx.mv.visitTypeInsn(Opcodes.CHECKCAST, "org/perlonjava/runtime/RuntimeScalar");
@@ -365,7 +365,7 @@ static void handleLocal(EmitterVisitor emitterVisitor, OperatorNode node) {
365365
emitterVisitor.ctx.mv.visitMethodInsn(Opcodes.INVOKESTATIC,
366366
"org/perlonjava/runtime/DynamicVariableManager",
367367
"pushLocalVariable",
368-
"(Lorg/perlonjava/runtime/RuntimeBaseEntity;)Lorg/perlonjava/runtime/RuntimeBaseEntity;",
368+
"(Lorg/perlonjava/runtime/RuntimeBase;)Lorg/perlonjava/runtime/RuntimeBase;",
369369
false);
370370
} else {
371371
emitterVisitor.ctx.mv.visitMethodInsn(Opcodes.INVOKESTATIC,
@@ -411,7 +411,7 @@ public static void handleScalarContext(EmitterVisitor emitterVisitor, Node node)
411411
"scalar", "()" + RuntimeTypeConstants.SCALAR_TYPE, false);
412412
} else {
413413
// For unknown types
414-
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBaseEntity", "scalar", "()Lorg/perlonjava/runtime/RuntimeScalar;", false);
414+
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "org/perlonjava/runtime/RuntimeBase", "scalar", "()Lorg/perlonjava/runtime/RuntimeScalar;", false);
415415
}
416416
}
417417

@@ -661,7 +661,7 @@ static void handleCreateReference(EmitterVisitor emitterVisitor, OperatorNode no
661661
} else {
662662
node.operand.accept(emitterVisitor.with(RuntimeContextType.LIST));
663663
emitterVisitor.ctx.mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,
664-
"org/perlonjava/runtime/RuntimeBaseEntity",
664+
"org/perlonjava/runtime/RuntimeBase",
665665
"createReference",
666666
"()Lorg/perlonjava/runtime/RuntimeScalar;",
667667
false);

0 commit comments

Comments
 (0)