Skip to content

Commit

Permalink
Update PushCharacter bytecode (fixes #158)
Browse files Browse the repository at this point in the history
and make `SmalltalkImage>>#interpreterVMMakerVersion` work.

See https://lists.squeakfoundation.org/pipermail/squeak-dev/2022-March/219464.html
  • Loading branch information
fniephaus committed May 23, 2022
1 parent 138ffa4 commit a068eca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public final class SqueakSystemAttributes {
private final NativeObject vmVersion;
private final NativeObject windowSystemName;
private final NativeObject vmBuildId;
private final NativeObject graalVMInformation;
private final NativeObject interpreterClass;
private final NativeObject systemProperties;
private final NativeObject vmInformation;
private final NativeObject maxFilenameLength;
Expand Down Expand Up @@ -96,7 +96,12 @@ public SqueakSystemAttributes(final SqueakImageContext image) {
final String date = new SimpleDateFormat("MMM dd yyyy HH:mm:ss zzz", Locale.US).format(new Date(MiscUtils.getStartTime()));
vmBuildId = asByteString(String.format("%s %s (%s) built on %s", osName, osVersion, osArch, date));

graalVMInformation = asByteString(MiscUtils.getGraalVMInformation());
/*
* For SmalltalkImage>>#interpreterVMMakerVersion (see
* https://lists.squeakfoundation.org/pipermail/squeak-dev/2022-March/219464.html).
*/
interpreterClass = asByteString(String.format("TruffleSqueak Interpreter VMMaker.oscog-fn.3184 (%s)", MiscUtils.getGraalVMInformation()));

systemProperties = asByteString(MiscUtils.getSystemProperties());
vmInformation = asByteString(MiscUtils.getVMInformation());
maxFilenameLength = asByteString("255");
Expand Down Expand Up @@ -125,7 +130,7 @@ public AbstractSqueakObject getSystemAttribute(final int index) {
case 1006:
return getVmBuildId();
case 1007:
return getGraalVMInformation();
return getInterpreterClass();
case 1008:
return getSystemProperties();
case 1009:
Expand Down Expand Up @@ -210,8 +215,8 @@ private NativeObject getVmBuildId() {
}

/** Attribute #1007: "Interpreter class (Cog VM only)". */
private NativeObject getGraalVMInformation() {
return graalVMInformation.shallowCopyBytes();
private NativeObject getInterpreterClass() {
return interpreterClass.shallowCopyBytes();
}

/** Attribute #1008: "Cogit class (Cog VM only)". */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private static AbstractBytecodeNode decodeBytecode(final VirtualFrame frame, fin
case 0xE8:
return new PushBytecodes.PushSmallIntegerNode(code, index, 2 + extBytes, Byte.toUnsignedInt(bytecode[indexWithExt + 1]) + (extB << 8));
case 0xE9:
return new PushBytecodes.PushCharacterNode(code, index, 2 + extBytes, Byte.toUnsignedInt(bytecode[indexWithExt + 1]) + (extB << 8));
return new PushBytecodes.PushCharacterNode(code, index, 2 + extBytes, Byte.toUnsignedInt(bytecode[indexWithExt + 1]) + (extA << 8));
case 0xEA: {
final int byte1 = Byte.toUnsignedInt(bytecode[indexWithExt + 1]);
final int literalIndex = (byte1 >> 3) + (extA << 5);
Expand Down

1 comment on commit a068eca

@TruffleSqueak-Bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance Report (a068eca)

Benchmarks ran on graalvm-ce-java17-22.1.0.

Steady (after 50 iterations)

Benchmark Name Min Geomean Median Mean Max Total (ms) Total (min)
Bounce 173 181 174.51 174 174.5 34901 0.58
DeltaBlue 250 559 367.56 372 364.89 73512 1.23
Havlak 1560 1634 1586.62 1585.5 1586.55 317323 5.29
Json 724 734 727.92 728 727.91 145583 2.43
List 897 1062 904.58 898 904.22 180916 3.02
Mandelbrot 145 148 145.25 145 145.25 29050 0.48
NBody 275 364 281.12 280 281.03 56223 0.94
Permute 228 235 229.45 229 229.44 45889 0.76
Queens 257 264 258.37 258 258.36 51673 0.86
Richards 1074 1085 1077.41 1077 1077.4 215481 3.59
Sieve 210 219 211.33 211 211.33 42266 0.7
Storage 272 279 274.53 275 274.52 54906 0.92
Towers 355 364 356.71 356 356.71 71342 1.19
6420 7128 6595.32 6588.5 6592.11 1319065 21.98

a068eca-2-steady.svg

Warmup (first 50 iterations)

a068eca-3-warmup.svg

Please sign in to comment.