mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8325949: Create an internal utility method for creating VarHandle instances
Reviewed-by: rriggs
This commit is contained in:
parent
67448b0eb2
commit
384deda65f
31 changed files with 232 additions and 317 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. 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
|
||||
|
@ -24,6 +24,8 @@
|
|||
*/
|
||||
package java.util.stream;
|
||||
|
||||
import jdk.internal.invoke.MhUtil;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Spliterator;
|
||||
import java.util.concurrent.CountedCompleter;
|
||||
|
@ -370,15 +372,8 @@ final class ForEachOps {
|
|||
private Node<T> node;
|
||||
|
||||
private ForEachOrderedTask<S, T> next;
|
||||
private static final VarHandle NEXT;
|
||||
static {
|
||||
try {
|
||||
MethodHandles.Lookup l = MethodHandles.lookup();
|
||||
NEXT = l.findVarHandle(ForEachOrderedTask.class, "next", ForEachOrderedTask.class);
|
||||
} catch (Exception e) {
|
||||
throw new InternalError(e);
|
||||
}
|
||||
}
|
||||
private static final VarHandle NEXT = MhUtil.findVarHandle(
|
||||
MethodHandles.lookup(), "next", ForEachOrderedTask.class);
|
||||
|
||||
protected ForEachOrderedTask(PipelineHelper<T> helper,
|
||||
Spliterator<S> spliterator,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue