Skip to content

Commit

Permalink
Factor out container classes as they are no longer required.
Browse files Browse the repository at this point in the history
  • Loading branch information
aardvark179 committed Dec 29, 2024
1 parent e2c18df commit 2a70a9a
Show file tree
Hide file tree
Showing 6 changed files with 248 additions and 590 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private void createNewSlot(SlotMapOwner owner, Slot newSlot) {
// Check if the table is not too full before inserting.
if (4 * (count + 1) > 3 * slots.length) {
// table size must be a power of 2 -- always grow by x2!
if (count > SlotMapContainer.LARGE_HASH_SIZE) {
if (count > SlotMapOwner.LARGE_HASH_SIZE) {
promoteMap(owner, newSlot);
return;
}
Expand Down
12 changes: 7 additions & 5 deletions rhino/src/main/java/org/mozilla/javascript/LockAwareSlotMap.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package org.mozilla.javascript;

/**
* Extends {@link SlotMap} with a set of "WithLock" methods. which
* will not acquire the lock. These should only be used internally by
* implementation, or by other {@link SlotMap}s which share the same
* lock.
* Extends {@link SlotMap} with a set of "WithLock" methods. which will not acquire the lock. These
* should only be used internally by implementation, or by other {@link SlotMap}s which share the
* same lock.
*/
interface LockAwareSlotMap extends SlotMap {
/** The equivalent of {@link SlotMap#size()}. */
Expand All @@ -19,7 +18,10 @@ interface LockAwareSlotMap extends SlotMap {
/** The equivalent of {@link SlotMap#query(Object, int)}. */
Slot queryWithLock(Object key, int index);

/** The equivalent of {@link SlotMap#compute(SlotMapOwner, Object, int, org.mozilla.javascript.SlotMap.SlotComputer)}. */
/**
* The equivalent of {@link SlotMap#compute(SlotMapOwner, Object, int,
* org.mozilla.javascript.SlotMap.SlotComputer)}.
*/
<S extends Slot> S computeWithLock(
SlotMapOwner owner, Object key, int index, SlotComputer<S> compute);

Expand Down
255 changes: 0 additions & 255 deletions rhino/src/main/java/org/mozilla/javascript/SlotMapContainer.java

This file was deleted.

Loading

0 comments on commit 2a70a9a

Please sign in to comment.