8180437: Remaining renames of CAS misnomer "swap" => "set"

Reviewed-by: martin
This commit is contained in:
Paul Sandoz 2017-11-17 12:09:56 -08:00
parent 4c4d212355
commit eb856a6953
4 changed files with 13 additions and 14 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2017, 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
@ -71,7 +71,7 @@ final class VarForm {
// (Receiver, <Intermediates>, Value, Value)boolean
l.add(value);
methodType_table[VarHandle.AccessType.COMPARE_AND_SWAP.ordinal()] =
methodType_table[VarHandle.AccessType.COMPARE_AND_SET.ordinal()] =
MethodType.methodType(boolean.class, l).erase();
// (Receiver, <Intermediates>, Value, Value)Value

View File

@ -30,7 +30,6 @@ import jdk.internal.util.Preconditions;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.Stable;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -46,7 +45,7 @@ import static java.lang.invoke.MethodHandleStatics.newInternalError;
* non-static fields, array elements, or components of an off-heap data
* structure. Access to such variables is supported under various
* <em>access modes</em>, including plain read/write access, volatile
* read/write access, and compare-and-swap.
* read/write access, and compare-and-set.
*
* <p>VarHandles are immutable and have no visible state. VarHandles cannot be
* subclassed by the user.
@ -1529,7 +1528,7 @@ public abstract class VarHandle {
enum AccessType {
GET(Object.class),
SET(void.class),
COMPARE_AND_SWAP(boolean.class),
COMPARE_AND_SET(boolean.class),
COMPARE_AND_EXCHANGE(Object.class),
GET_AND_UPDATE(Object.class);
@ -1555,7 +1554,7 @@ public abstract class VarHandle {
i = fillParameters(ps, receiver, intermediate);
ps[i] = value;
return MethodType.methodType(void.class, ps);
case COMPARE_AND_SWAP:
case COMPARE_AND_SET:
ps = allocateParameters(2, receiver, intermediate);
i = fillParameters(ps, receiver, intermediate);
ps[i++] = value;
@ -1652,7 +1651,7 @@ public abstract class VarHandle {
* method
* {@link VarHandle#compareAndSet VarHandle.compareAndSet}
*/
COMPARE_AND_SET("compareAndSet", AccessType.COMPARE_AND_SWAP),
COMPARE_AND_SET("compareAndSet", AccessType.COMPARE_AND_SET),
/**
* The access mode whose access is specified by the corresponding
* method
@ -1676,25 +1675,25 @@ public abstract class VarHandle {
* method
* {@link VarHandle#weakCompareAndSetPlain VarHandle.weakCompareAndSetPlain}
*/
WEAK_COMPARE_AND_SET_PLAIN("weakCompareAndSetPlain", AccessType.COMPARE_AND_SWAP),
WEAK_COMPARE_AND_SET_PLAIN("weakCompareAndSetPlain", AccessType.COMPARE_AND_SET),
/**
* The access mode whose access is specified by the corresponding
* method
* {@link VarHandle#weakCompareAndSet VarHandle.weakCompareAndSet}
*/
WEAK_COMPARE_AND_SET("weakCompareAndSet", AccessType.COMPARE_AND_SWAP),
WEAK_COMPARE_AND_SET("weakCompareAndSet", AccessType.COMPARE_AND_SET),
/**
* The access mode whose access is specified by the corresponding
* method
* {@link VarHandle#weakCompareAndSetAcquire VarHandle.weakCompareAndSetAcquire}
*/
WEAK_COMPARE_AND_SET_ACQUIRE("weakCompareAndSetAcquire", AccessType.COMPARE_AND_SWAP),
WEAK_COMPARE_AND_SET_ACQUIRE("weakCompareAndSetAcquire", AccessType.COMPARE_AND_SET),
/**
* The access mode whose access is specified by the corresponding
* method
* {@link VarHandle#weakCompareAndSetRelease VarHandle.weakCompareAndSetRelease}
*/
WEAK_COMPARE_AND_SET_RELEASE("weakCompareAndSetRelease", AccessType.COMPARE_AND_SWAP),
WEAK_COMPARE_AND_SET_RELEASE("weakCompareAndSetRelease", AccessType.COMPARE_AND_SET),
/**
* The access mode whose access is specified by the corresponding
* method

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2017, 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
@ -313,7 +313,7 @@ final class VarHandles {
//
// void set(Object value);
//
// boolean compareAndSwap(Object actualValue, Object expectedValue);
// boolean compareAndSet(Object actualValue, Object expectedValue);
//
// Object compareAndExchange(Object actualValue, Object expectedValue);
//

View File

@ -58,7 +58,7 @@ public interface JavaLangAccess {
ConstantPool getConstantPool(Class<?> klass);
/**
* Compare-And-Swap the AnnotationType instance corresponding to this class.
* Compare-And-Set the AnnotationType instance corresponding to this class.
* (This method only applies to annotation types.)
*/
boolean casAnnotationType(Class<?> klass, AnnotationType oldType, AnnotationType newType);