Skip to content

Commit 442c4a6

Browse files
committed
Introduce NEW_CACHE_LIMIT and reduce to 4
1 parent 906101f commit 442c4a6

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/CacheLimits.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ public final class CacheLimits {
1111
public static final int INDIRECT_PRIMITIVE_CACHE_LIMIT = 2;
1212
public static final int INLINE_BLOCK_CACHE_LIMIT = 4;
1313
public static final int INLINE_METHOD_CACHE_LIMIT = 4;
14+
public static final int NEW_CACHE_LIMIT = 4;
1415
public static final int PERFORM_SELECTOR_CACHE_LIMIT = 4;
1516
}

src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/primitives/impl/StoragePrimitives.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@
5353
import de.hpi.swa.trufflesqueak.nodes.primitives.AbstractPrimitiveFactoryHolder;
5454
import de.hpi.swa.trufflesqueak.nodes.primitives.AbstractPrimitiveNode;
5555
import de.hpi.swa.trufflesqueak.nodes.primitives.AbstractSingletonPrimitiveNode;
56-
import de.hpi.swa.trufflesqueak.nodes.primitives.Primitive.Primitive1;
57-
import de.hpi.swa.trufflesqueak.nodes.primitives.Primitive.Primitive1WithFallback;
5856
import de.hpi.swa.trufflesqueak.nodes.primitives.Primitive.Primitive0;
5957
import de.hpi.swa.trufflesqueak.nodes.primitives.Primitive.Primitive0WithFallback;
58+
import de.hpi.swa.trufflesqueak.nodes.primitives.Primitive.Primitive1;
59+
import de.hpi.swa.trufflesqueak.nodes.primitives.Primitive.Primitive1WithFallback;
6060
import de.hpi.swa.trufflesqueak.nodes.primitives.Primitive.Primitive2WithFallback;
6161
import de.hpi.swa.trufflesqueak.nodes.primitives.Primitive.Primitive3WithFallback;
6262
import de.hpi.swa.trufflesqueak.nodes.primitives.SqueakPrimitive;
@@ -184,9 +184,7 @@ protected static final Object literalAtPut(final CompiledCodeObject receiver, @S
184184
@GenerateNodeFactory
185185
@SqueakPrimitive(indices = 70)
186186
public abstract static class PrimNewNode extends AbstractPrimitiveNode implements Primitive0WithFallback {
187-
public static final int NEW_CACHE_SIZE = 6;
188-
189-
@Specialization(limit = "NEW_CACHE_SIZE", guards = {"receiver == cachedReceiver"}, assumptions = {"cachedReceiver.getClassFormatStable()"})
187+
@Specialization(limit = "NEW_CACHE_LIMIT", guards = {"receiver == cachedReceiver"}, assumptions = {"cachedReceiver.getClassFormatStable()"})
190188
protected static final AbstractSqueakObjectWithClassAndHash newDirect(@SuppressWarnings("unused") final ClassObject receiver,
191189
@Bind("this") final Node node,
192190
@Cached("receiver.withEnsuredBehaviorHash()") final ClassObject cachedReceiver,
@@ -217,9 +215,7 @@ protected static final AbstractSqueakObjectWithClassAndHash newIndirect(final Cl
217215
@GenerateNodeFactory
218216
@SqueakPrimitive(indices = 71)
219217
protected abstract static class PrimNewWithArgNode extends AbstractPrimitiveNode implements Primitive1 {
220-
public static final int NEW_CACHE_SIZE = 6;
221-
222-
@Specialization(limit = "NEW_CACHE_SIZE", guards = {"receiver == cachedReceiver", "isInstantiable(cachedReceiver, size)"}, assumptions = {"cachedReceiver.getClassFormatStable()"})
218+
@Specialization(limit = "NEW_CACHE_LIMIT", guards = {"receiver == cachedReceiver", "isInstantiable(cachedReceiver, size)"}, assumptions = {"cachedReceiver.getClassFormatStable()"})
223219
protected static final AbstractSqueakObjectWithClassAndHash newWithArgDirect(@SuppressWarnings("unused") final ClassObject receiver, final long size,
224220
@Bind("this") final Node node,
225221
@Cached(value = "createIdentityProfile()", inline = true) final InlinedIntValueProfile sizeProfile,

0 commit comments

Comments
 (0)