mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8333334: C2: Make result of Node::dominates
more precise to enhance scalar replacement
Reviewed-by: chagedorn, kvn, thartmann
This commit is contained in:
parent
69bd227e6c
commit
965dd1acd0
6 changed files with 236 additions and 50 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2024, Alibaba Group Holding Limited. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -35,6 +36,7 @@ import org.openjdk.jmh.annotations.State;
|
|||
import org.openjdk.jmh.annotations.Threads;
|
||||
import org.openjdk.jmh.annotations.Warmup;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -127,6 +129,21 @@ public class Maps {
|
|||
return map;
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public int testConcurrentHashMapIterators() {
|
||||
ConcurrentHashMap<Integer, Integer> map = (ConcurrentHashMap<Integer, Integer>) staticMap;
|
||||
int sum = 0;
|
||||
Enumeration it = map.elements();
|
||||
while (it.hasMoreElements()) {
|
||||
sum += (int) it.nextElement();
|
||||
}
|
||||
it = map.keys();
|
||||
while (it.hasMoreElements()) {
|
||||
sum += (int) it.nextElement();
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static class SimpleRandom {
|
||||
private final static long multiplier = 0x5DEECE66DL;
|
||||
private final static long addend = 0xBL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue