Skip to content

Commit b964096

Browse files
committed
Add system property for shape/key cache limit.
1 parent 5a629b0 commit b964096

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

truffle/src/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/DynamicObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ static Lookup internalLookup() {
346346

347347
// NODES
348348

349-
static final int SHAPE_CACHE_LIMIT = 5;
349+
static final int SHAPE_CACHE_LIMIT = ObjectStorageOptions.CacheLimit;
350350

351351
/**
352352
* Gets the value of a property or returns a default value if no such property exists.

truffle/src/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/ObjectStorageOptions.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ private ObjectStorageOptions() {
7272
/** Number of differing, compatible property locations allowed when merging shapes. */
7373
static final int MaxMergeDiff = Integer.getInteger(OPTION_PREFIX + "MaxMergeDiff", 2);
7474

75+
/** Number of shapes and keys to cache per access node before rewriting to the generic case. */
76+
static final int CacheLimit = Integer.getInteger(OPTION_PREFIX + "CacheLimit", 5);
77+
7578
// Debug options (should be final)
7679
static final boolean TraceReshape = booleanOption(OPTION_PREFIX + "TraceReshape", false);
7780

0 commit comments

Comments
 (0)