Skip to content

Commit

Permalink
Support primitiveDoMixedArithmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Nov 7, 2024
1 parent 08801f0 commit 21cd9ed
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.dsl.Idempotent;

public final class SqueakImageFlags {
private static final int PRIMITIVE_DO_MIXED_ARITHMETIC = 0x100;
Expand All @@ -21,7 +22,7 @@ public void initialize(final long oldBaseAddressValue, final long flags, final l
CompilerDirectives.transferToInterpreterAndInvalidate();
oldBaseAddress = oldBaseAddressValue;
// TruffleSqueak only supports mixed arithmetics, unset bit to ensure flag is always true
headerFlags = flags & ~PRIMITIVE_DO_MIXED_ARITHMETIC;
headerFlags = flags; // & ~PRIMITIVE_DO_MIXED_ARITHMETIC;
snapshotScreenSize = screenSize;
maxExternalSemaphoreTableSize = lastMaxExternalSemaphoreTableSize;
}
Expand Down Expand Up @@ -55,4 +56,9 @@ public int getSnapshotScreenHeight() {
public int getMaxExternalSemaphoreTableSize() {
return maxExternalSemaphoreTableSize;
}

@Idempotent
public boolean isPrimitiveDoMixedArithmetic() {
return (headerFlags & PRIMITIVE_DO_MIXED_ARITHMETIC) == 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
package de.hpi.swa.trufflesqueak.nodes;

import com.oracle.truffle.api.dsl.Idempotent;
import com.oracle.truffle.api.dsl.ImportStatic;
import com.oracle.truffle.api.dsl.TypeSystemReference;
import com.oracle.truffle.api.nodes.Node;
Expand Down Expand Up @@ -49,7 +50,13 @@ protected final boolean isPoint(final PointersObject object) {
return getContext().isPointClass(object.getSqueakClass());
}

@Idempotent
protected final boolean isPrimitiveDoMixedArithmetic() {
return getContext().flags.isPrimitiveDoMixedArithmetic();
}

protected final boolean isSemaphore(final PointersObject object) {
return getContext().isSemaphoreClass(object.getSqueakClass());
}

}
Loading

1 comment on commit 21cd9ed

@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 (21cd9ed)

Benchmarks ran on 23.0.1-graal.

Steady (after 100 iterations)

Benchmark Name Min Geomean Median Mean Max Total (ms) Total (min)
Bounce 511 528 515.41 512 515.38 103081 1.72
CD 474 498 480 476 479.94 96000 1.6
DeltaBlue 270 438 392.59 393.5 391.49 78518 1.31
Havlak 1113 1171 1143.03 1143 1142.99 228606 3.81
Json 341 358 344.47 342 344.43 68894 1.15
List 311 339 313.64 312 313.59 62727 1.05
Mandelbrot 129 146 130.53 130 130.5 26105 0.44
NBody 247 273 259.79 258 259.75 51958 0.87
Permute 155 171 156.18 155 156.15 31235 0.52
Queens 220 247 222.34 221 222.28 44468 0.74
Richards 1310 1335 1315.45 1312 1315.44 263089 4.38
Sieve 177 200 178.38 178 178.35 35676 0.59
Storage 141 159 143.9 142 143.83 28779 0.48
Towers 179 210 181.67 180 181.6 36333 0.61
5578 6073 5777.35 5754.5 5775.71 1155469 19.26

21cd9ed-2-steady.svg

Warmup (first 100 iterations)

21cd9ed-3-warmup.svg

Please sign in to comment.