File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
src/java.base/share/classes/java/lang Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -550,16 +550,15 @@ protected void initFrameBuffer() {
550
550
protected int batchSize (int lastBatchSize ) {
551
551
if (lastBatchSize == 0 ) {
552
552
// First batch, use estimateDepth if not exceed the large batch size
553
- int initialBatchSize = Math .max (walker .estimateDepth ()+RESERVED_ELEMENTS , MIN_BATCH_SIZE );
554
- return Math .min (initialBatchSize , LARGE_BATCH_SIZE );
553
+ return walker .estimateDepth () == 0
554
+ ? SMALL_BATCH
555
+ : Math .min (walker .estimateDepth () + RESERVED_ELEMENTS , LARGE_BATCH_SIZE );
555
556
} else {
556
557
// expand only if last batch was full and the buffer size <= 32
557
558
// to minimize the number of unneeded frames decoded.
558
- if (lastBatchSize > BATCH_SIZE || !frameBuffer .isFull ()) {
559
- return lastBatchSize ;
560
- } else {
561
- return Math .min (lastBatchSize *2 , BATCH_SIZE );
562
- }
559
+ return (lastBatchSize > BATCH_SIZE || !frameBuffer .isFull ())
560
+ ? lastBatchSize
561
+ : Math .min (lastBatchSize *2 , BATCH_SIZE );
563
562
}
564
563
}
565
564
You can’t perform that action at this time.
0 commit comments