# HG changeset patch # User lana # Date 1472784097 0 # Node ID de9ff562c1129876a63611fc500cda8cb1f153db # Parent b079fff22b3cabf8347a69385eb351d6a93a5b2c# Parent 48879ea67e2a111319492c7e3beb0656ac1b413e Merge diff -r b079fff22b3c -r de9ff562c112 jdk/make/GenerateClasslist.gmk --- a/jdk/make/GenerateClasslist.gmk Thu Sep 01 23:20:11 2016 +0000 +++ b/jdk/make/GenerateClasslist.gmk Fri Sep 02 02:41:37 2016 +0000 @@ -50,6 +50,8 @@ CLASSLIST_FILE := $(SUPPORT_OUTPUTDIR)/classlist/classlist +JLI_TRACE_FILE := $(SUPPORT_OUTPUTDIR)/classlist/jli_trace.out + # If an external buildjdk has been supplied, we don't build a separate interim # image, so just use the external build jdk instead. ifeq ($(EXTERNAL_BUILDJDK), true) @@ -59,13 +61,11 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR) $(call MakeDir, $(@D)) $(call LogInfo, Generating lib/classlist) - $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.tmp \ + $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@ \ + -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \ -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \ - build.tools.classlist.HelloClasslist $(LOG_DEBUG) 2>&1 - # Filter out generated classes, remove after JDK-8149977 - $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@ \ - -Xshare:dump -XX:SharedClassListFile=$@.tmp $(LOG_DEBUG) 2>&1 - $(RM) $@.tmp + build.tools.classlist.HelloClasslist \ + $(LOG_DEBUG) 2>&1 > $(JLI_TRACE_FILE) TARGETS += $(CLASSLIST_FILE) diff -r b079fff22b3c -r de9ff562c112 jdk/make/gensrc/GensrcVarHandles.gmk --- a/jdk/make/gensrc/GensrcVarHandles.gmk Thu Sep 01 23:20:11 2016 +0000 +++ b/jdk/make/gensrc/GensrcVarHandles.gmk Fri Sep 02 02:41:37 2016 +0000 @@ -44,6 +44,10 @@ $1_ARGS += -KAtomicAdd endif + ifneq ($$(findstring $$($1_Type), Boolean Byte Short Char Int Long), ) + $1_ARGS += -KBitwise + endif + ifneq ($$(findstring $$($1_Type), Byte Short Char), ) $1_ARGS += -KShorterThanInt endif @@ -101,6 +105,7 @@ $1_ARGS += -KCAS $1_ARGS += -KAtomicAdd + $1_ARGS += -KBitwise endif ifeq ($$($1_Type), Long) @@ -113,6 +118,7 @@ $1_ARGS += -KCAS $1_ARGS += -KAtomicAdd + $1_ARGS += -KBitwise endif ifeq ($$($1_Type), Float) diff -r b079fff22b3c -r de9ff562c112 jdk/make/mapfiles/libawt/mapfile-mawt-vers --- a/jdk/make/mapfiles/libawt/mapfile-mawt-vers Thu Sep 01 23:20:11 2016 +0000 +++ b/jdk/make/mapfiles/libawt/mapfile-mawt-vers Fri Sep 02 02:41:37 2016 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2001, 2016, 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 @@ -22,259 +22,261 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -# Java_java_awt_KeyboardFocusManager_getGlobalHeavyweightFocusOwner; # Define public interface. # These are the libmawt exports. See mapfile-vers for the libawt exports SUNWprivate_1.1 { - global: - JNI_OnLoad; + global: + JNI_OnLoad; - Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords; - Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse; - Java_java_awt_AWTEvent_nativeSetSource; - Java_java_awt_Checkbox_initIDs; - Java_java_awt_Component_initIDs; - Java_java_awt_Dialog_initIDs; - Java_java_awt_Font_initIDs; - Java_java_awt_KeyboardFocusManager_initIDs; - Java_java_awt_Menu_initIDs; - Java_java_awt_MenuComponent_initIDs; - Java_java_awt_MenuItem_initIDs; - Java_java_awt_Scrollbar_initIDs; - Java_java_awt_ScrollPane_initIDs; - Java_java_awt_TextArea_initIDs; - Java_sun_awt_FontDescriptor_initIDs; - Java_sun_awt_KeyboardFocusManagerPeerImpl_clearNativeGlobalFocusOwner; - Java_sun_awt_KeyboardFocusManagerPeerImpl_getNativeFocusOwner; - Java_sun_awt_KeyboardFocusManagerPeerImpl_getNativeFocusedWindow; - Java_sun_awt_UNIXToolkit_check_1gtk; - Java_sun_awt_UNIXToolkit_load_1gtk; - Java_sun_awt_UNIXToolkit_unload_1gtk; - Java_sun_awt_UNIXToolkit_load_1stock_1icon; - Java_sun_awt_UNIXToolkit_load_1gtk_1icon; - Java_sun_awt_UNIXToolkit_nativeSync; - Java_sun_awt_X11InputMethod_disposeXIC; - Java_sun_awt_X11InputMethod_isCompositionEnabledNative; - Java_sun_awt_X11InputMethod_resetXIC; - Java_sun_awt_X11InputMethod_setCompositionEnabledNative; - Java_sun_awt_X11InputMethod_turnoffStatusWindow; - Java_sun_awt_SunToolkit_closeSplashScreen; - Java_sun_awt_PlatformFont_initIDs; - Java_sun_awt_X11GraphicsConfig_init; - Java_sun_awt_X11GraphicsConfig_dispose; - Java_sun_awt_X11GraphicsConfig_pGetBounds; - Java_sun_awt_X11GraphicsConfig_getNumColors; - Java_sun_awt_X11GraphicsConfig_getXResolution; - Java_sun_awt_X11GraphicsConfig_getYResolution; - Java_sun_awt_X11GraphicsConfig_createBackBuffer; - Java_sun_awt_X11GraphicsConfig_destroyBackBuffer; - Java_sun_awt_X11GraphicsConfig_swapBuffers; - Java_sun_awt_X11GraphicsConfig_isTranslucencyCapable; - Java_sun_awt_X11GraphicsDevice_isDBESupported; - Java_sun_awt_X11GraphicsDevice_getDisplay; - Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals; - Java_sun_awt_X11GraphicsDevice_getNumConfigs; - Java_sun_awt_X11GraphicsDevice_initIDs; - Java_sun_awt_X11GraphicsDevice_initXrandrExtension; - Java_sun_awt_X11GraphicsDevice_enterFullScreenExclusive; - Java_sun_awt_X11GraphicsDevice_exitFullScreenExclusive; - Java_sun_awt_X11GraphicsDevice_getCurrentDisplayMode; - Java_sun_awt_X11GraphicsDevice_enumDisplayModes; - Java_sun_awt_X11GraphicsDevice_configDisplayMode; - Java_sun_awt_X11GraphicsDevice_resetNativeData; - Java_sun_awt_X11GraphicsEnvironment_checkShmExt; - Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum; - Java_sun_awt_X11GraphicsEnvironment_getDisplayString; - Java_sun_awt_X11GraphicsEnvironment_getNumScreens; - Java_sun_awt_X11GraphicsEnvironment_initDisplay; - Java_sun_awt_X11GraphicsEnvironment_initGLX; - Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama; - Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint; - Java_sun_awt_X11GraphicsEnvironment_initXRender; - Java_java_awt_AWTEvent_initIDs; - Java_java_awt_Button_initIDs; - Java_java_awt_Container_initIDs; - Java_java_awt_Cursor_finalizeImpl; - Java_java_awt_Cursor_initIDs; - Java_java_awt_Event_initIDs; - Java_java_awt_event_InputEvent_initIDs; - Java_java_awt_event_KeyEvent_initIDs; - Java_java_awt_FileDialog_initIDs; - Java_java_awt_Frame_initIDs; - Java_java_awt_Insets_initIDs; - Java_java_awt_TextField_initIDs; - Java_java_awt_Window_initIDs; - Java_sun_awt_X11GraphicsConfig_init; - Java_sun_awt_X11GraphicsConfig_initIDs; - Java_sun_awt_X11GraphicsConfig_makeColorModel; - Java_sun_awt_X11GraphicsDevice_getConfigVisualId; - Java_sun_awt_X11GraphicsDevice_getConfigColormap; - Java_sun_awt_X11GraphicsDevice_getConfigDepth; + Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords; + Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse; + Java_java_awt_AWTEvent_nativeSetSource; + Java_java_awt_Checkbox_initIDs; + Java_java_awt_Component_initIDs; + Java_java_awt_Dialog_initIDs; + Java_java_awt_Font_initIDs; + Java_java_awt_KeyboardFocusManager_initIDs; + Java_java_awt_Menu_initIDs; + Java_java_awt_MenuComponent_initIDs; + Java_java_awt_MenuItem_initIDs; + Java_java_awt_Scrollbar_initIDs; + Java_java_awt_ScrollPane_initIDs; + Java_java_awt_TextArea_initIDs; + Java_sun_awt_FontDescriptor_initIDs; + Java_sun_awt_KeyboardFocusManagerPeerImpl_clearNativeGlobalFocusOwner; + Java_sun_awt_KeyboardFocusManagerPeerImpl_getNativeFocusOwner; + Java_sun_awt_KeyboardFocusManagerPeerImpl_getNativeFocusedWindow; + Java_sun_awt_UNIXToolkit_check_1gtk; + Java_sun_awt_UNIXToolkit_load_1gtk; + Java_sun_awt_UNIXToolkit_unload_1gtk; + Java_sun_awt_UNIXToolkit_load_1stock_1icon; + Java_sun_awt_UNIXToolkit_load_1gtk_1icon; + Java_sun_awt_UNIXToolkit_nativeSync; + Java_sun_awt_X11InputMethod_disposeXIC; + Java_sun_awt_X11InputMethod_isCompositionEnabledNative; + Java_sun_awt_X11InputMethod_resetXIC; + Java_sun_awt_X11InputMethod_setCompositionEnabledNative; + Java_sun_awt_X11InputMethod_turnoffStatusWindow; + Java_sun_awt_SunToolkit_closeSplashScreen; + Java_sun_awt_PlatformFont_initIDs; + Java_sun_awt_X11GraphicsConfig_init; + Java_sun_awt_X11GraphicsConfig_dispose; + Java_sun_awt_X11GraphicsConfig_pGetBounds; + Java_sun_awt_X11GraphicsConfig_getNumColors; + Java_sun_awt_X11GraphicsConfig_getXResolution; + Java_sun_awt_X11GraphicsConfig_getYResolution; + Java_sun_awt_X11GraphicsConfig_createBackBuffer; + Java_sun_awt_X11GraphicsConfig_destroyBackBuffer; + Java_sun_awt_X11GraphicsConfig_swapBuffers; + Java_sun_awt_X11GraphicsConfig_isTranslucencyCapable; + Java_sun_awt_X11GraphicsDevice_isDBESupported; + Java_sun_awt_X11GraphicsDevice_getDisplay; + Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals; + Java_sun_awt_X11GraphicsDevice_getNumConfigs; + Java_sun_awt_X11GraphicsDevice_initIDs; + Java_sun_awt_X11GraphicsDevice_initXrandrExtension; + Java_sun_awt_X11GraphicsDevice_enterFullScreenExclusive; + Java_sun_awt_X11GraphicsDevice_exitFullScreenExclusive; + Java_sun_awt_X11GraphicsDevice_getCurrentDisplayMode; + Java_sun_awt_X11GraphicsDevice_enumDisplayModes; + Java_sun_awt_X11GraphicsDevice_configDisplayMode; + Java_sun_awt_X11GraphicsDevice_resetNativeData; + Java_sun_awt_X11GraphicsEnvironment_checkShmExt; + Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum; + Java_sun_awt_X11GraphicsEnvironment_getDisplayString; + Java_sun_awt_X11GraphicsEnvironment_getNumScreens; + Java_sun_awt_X11GraphicsEnvironment_initDisplay; + Java_sun_awt_X11GraphicsEnvironment_initGLX; + Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama; + Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint; + Java_sun_awt_X11GraphicsEnvironment_initXRender; + Java_java_awt_AWTEvent_initIDs; + Java_java_awt_Button_initIDs; + Java_java_awt_Container_initIDs; + Java_java_awt_Cursor_finalizeImpl; + Java_java_awt_Cursor_initIDs; + Java_java_awt_Event_initIDs; + Java_java_awt_event_InputEvent_initIDs; + Java_java_awt_event_KeyEvent_initIDs; + Java_java_awt_FileDialog_initIDs; + Java_java_awt_Frame_initIDs; + Java_java_awt_Insets_initIDs; + Java_java_awt_TextField_initIDs; + Java_java_awt_Window_initIDs; + Java_sun_awt_X11GraphicsConfig_init; + Java_sun_awt_X11GraphicsConfig_initIDs; + Java_sun_awt_X11GraphicsConfig_makeColorModel; + Java_sun_awt_X11GraphicsDevice_getConfigVisualId; + Java_sun_awt_X11GraphicsDevice_getConfigColormap; + Java_sun_awt_X11GraphicsDevice_getConfigDepth; - Java_sun_java2d_x11_X11PMBlitLoops_nativeBlit; - Java_sun_java2d_x11_X11PMBlitLoops_updateBitmask; - Java_sun_java2d_x11_X11PMBlitBgLoops_nativeBlitBg; - Java_sun_java2d_x11_X11Renderer_XFillSpans; - Java_sun_java2d_x11_X11Renderer_XDrawArc; - Java_sun_java2d_x11_X11Renderer_XDrawLine; - Java_sun_java2d_x11_X11Renderer_XDrawOval; - Java_sun_java2d_x11_X11Renderer_XDrawPoly; - Java_sun_java2d_x11_X11Renderer_XDrawRect; - Java_sun_java2d_x11_X11Renderer_XDrawRoundRect; - Java_sun_java2d_x11_X11Renderer_XDoPath; - Java_sun_java2d_x11_X11Renderer_XFillArc; - Java_sun_java2d_x11_X11Renderer_XFillOval; - Java_sun_java2d_x11_X11Renderer_XFillPoly; - Java_sun_java2d_x11_X11Renderer_XFillRect; - Java_sun_java2d_x11_X11Renderer_XFillRoundRect; - Java_sun_java2d_x11_X11Renderer_devCopyArea; - Java_sun_java2d_x11_X11SurfaceData_initIDs; - Java_sun_java2d_x11_X11SurfaceData_initOps; - Java_sun_java2d_x11_X11SurfaceData_initSurface; - Java_sun_java2d_x11_X11SurfaceData_isDgaAvailable; - Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable; - Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode; - Java_sun_java2d_x11_X11SurfaceData_XSetXorMode; - Java_sun_java2d_x11_X11SurfaceData_XSetForeground; + Java_sun_java2d_x11_X11PMBlitLoops_nativeBlit; + Java_sun_java2d_x11_X11PMBlitLoops_updateBitmask; + Java_sun_java2d_x11_X11PMBlitBgLoops_nativeBlitBg; + Java_sun_java2d_x11_X11Renderer_XFillSpans; + Java_sun_java2d_x11_X11Renderer_XDrawArc; + Java_sun_java2d_x11_X11Renderer_XDrawLine; + Java_sun_java2d_x11_X11Renderer_XDrawOval; + Java_sun_java2d_x11_X11Renderer_XDrawPoly; + Java_sun_java2d_x11_X11Renderer_XDrawRect; + Java_sun_java2d_x11_X11Renderer_XDrawRoundRect; + Java_sun_java2d_x11_X11Renderer_XDoPath; + Java_sun_java2d_x11_X11Renderer_XFillArc; + Java_sun_java2d_x11_X11Renderer_XFillOval; + Java_sun_java2d_x11_X11Renderer_XFillPoly; + Java_sun_java2d_x11_X11Renderer_XFillRect; + Java_sun_java2d_x11_X11Renderer_XFillRoundRect; + Java_sun_java2d_x11_X11Renderer_devCopyArea; + Java_sun_java2d_x11_X11SurfaceData_initIDs; + Java_sun_java2d_x11_X11SurfaceData_initOps; + Java_sun_java2d_x11_X11SurfaceData_initSurface; + Java_sun_java2d_x11_X11SurfaceData_isDgaAvailable; + Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable; + Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode; + Java_sun_java2d_x11_X11SurfaceData_XSetXorMode; + Java_sun_java2d_x11_X11SurfaceData_XSetForeground; - Java_sun_java2d_x11_XSurfaceData_initOps; - Java_sun_java2d_x11_XSurfaceData_XCreateGC; - Java_sun_java2d_x11_XSurfaceData_XResetClip; - Java_sun_java2d_x11_XSurfaceData_XSetClip; - Java_sun_java2d_x11_XSurfaceData_flushNativeSurface; - Java_sun_java2d_x11_XSurfaceData_isDrawableValid; - Java_sun_java2d_x11_XSurfaceData_setInvalid; - Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures; - Java_sun_java2d_xr_XRSurfaceData_initXRPicture; - Java_sun_java2d_xr_XRSurfaceData_initIDs; - Java_sun_java2d_xr_XRSurfaceData_XRInitSurface; - Java_sun_java2d_xr_XRSurfaceData_freeXSDOPicture; - Java_sun_java2d_xr_XRBackendNative_initIDs; - Java_sun_java2d_xr_XIDGenerator_bufferXIDs; - Java_sun_java2d_xr_XRBackendNative_freeGC; - Java_sun_java2d_xr_XRBackendNative_createGC; - Java_sun_java2d_xr_XRBackendNative_createPixmap; - Java_sun_java2d_xr_XRBackendNative_createPictureNative; - Java_sun_java2d_xr_XRBackendNative_freePicture; - Java_sun_java2d_xr_XRBackendNative_freePixmap; - Java_sun_java2d_xr_XRBackendNative_setPictureRepeat; - Java_sun_java2d_xr_XRBackendNative_setGCExposures; - Java_sun_java2d_xr_XRBackendNative_setGCForeground; - Java_sun_java2d_xr_XRBackendNative_copyArea; - Java_sun_java2d_xr_XRBackendNative_renderComposite; - Java_sun_java2d_xr_XRBackendNative_renderRectangle; - Java_sun_java2d_xr_XRBackendNative_XRenderRectanglesNative; - Java_sun_java2d_xr_XRBackendNative_XRSetTransformNative; - Java_sun_java2d_xr_XRBackendNative_XRCreateLinearGradientPaintNative; - Java_sun_java2d_xr_XRBackendNative_XRCreateRadialGradientPaintNative; - Java_sun_java2d_xr_XRBackendNative_setFilter; - Java_sun_java2d_xr_XRBackendNative_XRSetClipNative; - Java_sun_java2d_xr_XRBackendNative_putMaskNative; - Java_sun_java2d_xr_XRBackendNative_XRAddGlyphsNative; - Java_sun_java2d_xr_XRBackendNative_XRFreeGlyphsNative; - Java_sun_java2d_xr_XRBackendNative_XRenderCreateGlyphSetNative; - Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative; - Java_sun_java2d_xr_XRBackendNative_setGCMode; - Java_sun_java2d_xr_XRBackendNative_GCRectanglesNative; - Java_sun_java2d_xr_XRUtils_initFormatPtrs; - Java_sun_java2d_xr_XRBackendNative_renderCompositeTrapezoidsNative; - XRT_DrawGlyphList; + Java_sun_java2d_x11_XSurfaceData_initOps; + Java_sun_java2d_x11_XSurfaceData_XCreateGC; + Java_sun_java2d_x11_XSurfaceData_XResetClip; + Java_sun_java2d_x11_XSurfaceData_XSetClip; + Java_sun_java2d_x11_XSurfaceData_flushNativeSurface; + Java_sun_java2d_x11_XSurfaceData_isDrawableValid; + Java_sun_java2d_x11_XSurfaceData_setInvalid; + Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures; + Java_sun_java2d_xr_XRSurfaceData_initXRPicture; + Java_sun_java2d_xr_XRSurfaceData_initIDs; + Java_sun_java2d_xr_XRSurfaceData_XRInitSurface; + Java_sun_java2d_xr_XRSurfaceData_freeXSDOPicture; + Java_sun_java2d_xr_XRBackendNative_initIDs; + Java_sun_java2d_xr_XIDGenerator_bufferXIDs; + Java_sun_java2d_xr_XRBackendNative_freeGC; + Java_sun_java2d_xr_XRBackendNative_createGC; + Java_sun_java2d_xr_XRBackendNative_createPixmap; + Java_sun_java2d_xr_XRBackendNative_createPictureNative; + Java_sun_java2d_xr_XRBackendNative_freePicture; + Java_sun_java2d_xr_XRBackendNative_freePixmap; + Java_sun_java2d_xr_XRBackendNative_setPictureRepeat; + Java_sun_java2d_xr_XRBackendNative_setGCExposures; + Java_sun_java2d_xr_XRBackendNative_setGCForeground; + Java_sun_java2d_xr_XRBackendNative_copyArea; + Java_sun_java2d_xr_XRBackendNative_renderComposite; + Java_sun_java2d_xr_XRBackendNative_renderRectangle; + Java_sun_java2d_xr_XRBackendNative_XRenderRectanglesNative; + Java_sun_java2d_xr_XRBackendNative_XRSetTransformNative; + Java_sun_java2d_xr_XRBackendNative_XRCreateLinearGradientPaintNative; + Java_sun_java2d_xr_XRBackendNative_XRCreateRadialGradientPaintNative; + Java_sun_java2d_xr_XRBackendNative_setFilter; + Java_sun_java2d_xr_XRBackendNative_XRSetClipNative; + Java_sun_java2d_xr_XRBackendNative_putMaskNative; + Java_sun_java2d_xr_XRBackendNative_XRAddGlyphsNative; + Java_sun_java2d_xr_XRBackendNative_XRFreeGlyphsNative; + Java_sun_java2d_xr_XRBackendNative_XRenderCreateGlyphSetNative; + Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative; + Java_sun_java2d_xr_XRBackendNative_setGCMode; + Java_sun_java2d_xr_XRBackendNative_GCRectanglesNative; + Java_sun_java2d_xr_XRUtils_initFormatPtrs; + Java_sun_java2d_xr_XRBackendNative_renderCompositeTrapezoidsNative; + XRT_DrawGlyphList; - Java_sun_java2d_opengl_OGLContext_getOGLIdString; - Java_sun_java2d_opengl_OGLMaskFill_maskFill; - Java_sun_java2d_opengl_OGLRenderer_drawPoly; - Java_sun_java2d_opengl_OGLRenderQueue_flushBuffer; - Java_sun_java2d_opengl_OGLSurfaceData_initTexture; - Java_sun_java2d_opengl_OGLSurfaceData_initFBObject; - Java_sun_java2d_opengl_OGLSurfaceData_initFlipBackbuffer; - Java_sun_java2d_opengl_OGLSurfaceData_getTextureID; - Java_sun_java2d_opengl_OGLSurfaceData_getTextureTarget; - Java_sun_java2d_opengl_OGLTextRenderer_drawGlyphList; - Java_sun_java2d_opengl_GLXGraphicsConfig_getGLXConfigInfo; - Java_sun_java2d_opengl_GLXGraphicsConfig_initConfig; - Java_sun_java2d_opengl_GLXGraphicsConfig_getOGLCapabilities; - Java_sun_java2d_opengl_GLXSurfaceData_initOps; + Java_sun_java2d_opengl_OGLContext_getOGLIdString; + Java_sun_java2d_opengl_OGLMaskFill_maskFill; + Java_sun_java2d_opengl_OGLRenderer_drawPoly; + Java_sun_java2d_opengl_OGLRenderQueue_flushBuffer; + Java_sun_java2d_opengl_OGLSurfaceData_initTexture; + Java_sun_java2d_opengl_OGLSurfaceData_initFBObject; + Java_sun_java2d_opengl_OGLSurfaceData_initFlipBackbuffer; + Java_sun_java2d_opengl_OGLSurfaceData_getTextureID; + Java_sun_java2d_opengl_OGLSurfaceData_getTextureTarget; + Java_sun_java2d_opengl_OGLTextRenderer_drawGlyphList; + Java_sun_java2d_opengl_GLXGraphicsConfig_getGLXConfigInfo; + Java_sun_java2d_opengl_GLXGraphicsConfig_initConfig; + Java_sun_java2d_opengl_GLXGraphicsConfig_getOGLCapabilities; + Java_sun_java2d_opengl_GLXSurfaceData_initOps; - Java_sun_print_CUPSPrinter_initIDs; - Java_sun_print_CUPSPrinter_getCupsServer; - Java_sun_print_CUPSPrinter_getCupsPort; - Java_sun_print_CUPSPrinter_getCupsDefaultPrinter; - Java_sun_print_CUPSPrinter_canConnect; - Java_sun_print_CUPSPrinter_getMedia; - Java_sun_print_CUPSPrinter_getPageSizes; - Java_sun_print_CUPSPrinter_getResolutions; + Java_sun_print_CUPSPrinter_initIDs; + Java_sun_print_CUPSPrinter_getCupsServer; + Java_sun_print_CUPSPrinter_getCupsPort; + Java_sun_print_CUPSPrinter_getCupsDefaultPrinter; + Java_sun_print_CUPSPrinter_canConnect; + Java_sun_print_CUPSPrinter_getMedia; + Java_sun_print_CUPSPrinter_getPageSizes; + Java_sun_print_CUPSPrinter_getResolutions; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1arrow; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1box; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1box_1gap; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1check; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1expander; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1extension; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1flat_1box; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1focus; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1handle; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1hline; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1option; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1shadow; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1slider; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1vline; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1background; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_nativeStartPainting; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_nativeFinishPainting; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1switch_1theme; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1get_1gtk_1setting; - Java_com_sun_java_swing_plaf_gtk_GTKEngine_nativeSetRangeValue; - Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetXThickness; - Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetYThickness; - Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetColorForState; - Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetClassValue; - Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetPangoFontName; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1arrow; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1box; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1box_1gap; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1check; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1expander; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1extension; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1flat_1box; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1focus; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1handle; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1hline; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1option; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1shadow; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1slider; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1vline; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1background; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_nativeStartPainting; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_nativeFinishPainting; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1switch_1theme; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1get_1gtk_1setting; + Java_com_sun_java_swing_plaf_gtk_GTKEngine_nativeSetRangeValue; + Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetXThickness; + Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetYThickness; + Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetColorForState; + Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetClassValue; + Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetPangoFontName; - awt_display; - awt_Lock; - awt_Unlock; - awt_GetDrawingSurface; - awt_FreeDrawingSurface; - awt_GetComponent; + awt_display; + awt_Lock; + awt_Unlock; + awt_GetDrawingSurface; + awt_FreeDrawingSurface; + awt_GetComponent; + awt_CreateEmbeddedFrame; + awt_SetBounds; + awt_SynthesizeWindowActivation; - X11SurfaceData_GetOps; - getDefaultConfig; - Java_sun_font_FontConfigManager_getFontConfig; - Java_sun_font_FontConfigManager_getFontConfigAASettings; - Java_sun_awt_FcFontManager_getFontPathNative; - Java_sun_font_SunFontManager_populateFontFileNameMap; + X11SurfaceData_GetOps; + getDefaultConfig; + Java_sun_font_FontConfigManager_getFontConfig; + Java_sun_font_FontConfigManager_getFontConfigAASettings; + Java_sun_awt_FcFontManager_getFontPathNative; + Java_sun_font_SunFontManager_populateFontFileNameMap; - # CDE private entry point - Java_sun_awt_motif_XsessionWMcommand; - Java_sun_awt_motif_XsessionWMcommand_New; + # CDE private entry point + Java_sun_awt_motif_XsessionWMcommand; + Java_sun_awt_motif_XsessionWMcommand_New; - # libfontmanager entry points - AWTIsHeadless; - AWTCountFonts; - AWTLoadFont; - AWTFreeFont; - AWTFontAscent; - AWTFontDescent; - AWTFontMinByte1; - AWTFontMaxByte1; - AWTFontMinCharOrByte2; - AWTFontMaxCharOrByte2; - AWTFontDefaultChar; - AWTFontPerChar; - AWTFontMaxBounds; - AWTFontTextExtents16; - AWTFreeChar; - AWTFontGenerateImage; - AWTCharAdvance; - AWTCharLBearing; - AWTCharRBearing; - AWTCharAscent; - AWTCharDescent; - AWTDrawGlyphList; - AccelGlyphCache_RemoveAllCellInfos; + # libfontmanager entry points + AWTIsHeadless; + AWTCountFonts; + AWTLoadFont; + AWTFreeFont; + AWTFontAscent; + AWTFontDescent; + AWTFontMinByte1; + AWTFontMaxByte1; + AWTFontMinCharOrByte2; + AWTFontMaxCharOrByte2; + AWTFontDefaultChar; + AWTFontPerChar; + AWTFontMaxBounds; + AWTFontTextExtents16; + AWTFreeChar; + AWTFontGenerateImage; + AWTCharAdvance; + AWTCharLBearing; + AWTCharRBearing; + AWTCharAscent; + AWTCharDescent; + AWTDrawGlyphList; + AccelGlyphCache_RemoveAllCellInfos; - local: - *; + local: + *; }; diff -r b079fff22b3c -r de9ff562c112 jdk/make/mapfiles/libawt/mapfile-vers --- a/jdk/make/mapfiles/libawt/mapfile-vers Thu Sep 01 23:20:11 2016 +0000 +++ b/jdk/make/mapfiles/libawt/mapfile-vers Fri Sep 02 02:41:37 2016 +0000 @@ -27,163 +27,163 @@ # These are the libawt exports, mapfile-mawt-vers contains the libmawt exports. SUNWprivate_1.1 { - global: - JNI_OnLoad; + global: + JNI_OnLoad; - Java_java_awt_CheckboxMenuItem_initIDs; - Java_java_awt_Color_initIDs; - Java_java_awt_FontMetrics_initIDs; - Java_java_awt_image_BufferedImage_initIDs; - Java_sun_awt_image_DataBufferNative_getElem; - Java_sun_awt_image_DataBufferNative_setElem; - Java_java_awt_image_ColorModel_initIDs; - Java_java_awt_image_IndexColorModel_initIDs; - Java_java_awt_image_Kernel_initIDs; - Java_java_awt_image_Raster_initIDs; - Java_java_awt_image_SampleModel_initIDs; - Java_java_awt_Label_initIDs; - Java_java_awt_MenuBar_initIDs; - Java_java_awt_ScrollPaneAdjustable_initIDs; - Java_java_awt_Toolkit_initIDs; - Java_sun_awt_DebugSettings_setCTracingOn__Z; - Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2; - Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2I; - Java_sun_awt_image_ByteComponentRaster_initIDs; - Java_sun_awt_image_GifImageDecoder_initIDs; - Java_sun_awt_image_GifImageDecoder_parseImage; - Java_sun_awt_image_ImageRepresentation_initIDs; - Java_sun_awt_image_ImageRepresentation_setDiffICM; - Java_sun_awt_image_ImageRepresentation_setICMpixels; - Java_sun_awt_image_ImagingLib_convolveBI; - Java_sun_awt_image_ImagingLib_convolveRaster; - Java_sun_awt_image_ImagingLib_init; - Java_sun_awt_image_ImagingLib_transformBI; - Java_sun_awt_image_ImagingLib_transformRaster; - Java_sun_awt_image_IntegerComponentRaster_initIDs; - Java_sun_awt_image_ShortComponentRaster_initIDs; - Java_sun_java2d_pipe_BufferedMaskBlit_enqueueTile; - Java_sun_java2d_pipe_BufferedRenderPipe_fillSpans; - Java_sun_java2d_pipe_SpanClipRenderer_eraseTile; - Java_sun_java2d_pipe_SpanClipRenderer_fillTile; - Java_sun_java2d_pipe_ShapeSpanIterator_addSegment; - Java_sun_java2d_pipe_ShapeSpanIterator_moveTo; - Java_sun_java2d_pipe_ShapeSpanIterator_lineTo; - Java_sun_java2d_pipe_ShapeSpanIterator_quadTo; - Java_sun_java2d_pipe_ShapeSpanIterator_curveTo; - Java_sun_java2d_pipe_ShapeSpanIterator_closePath; - Java_sun_java2d_pipe_ShapeSpanIterator_pathDone; - Java_sun_java2d_pipe_ShapeSpanIterator_getNativeConsumer; - Java_sun_java2d_pipe_ShapeSpanIterator_appendPoly; - Java_sun_java2d_pipe_ShapeSpanIterator_dispose; - Java_sun_java2d_pipe_ShapeSpanIterator_getNativeIterator; - Java_sun_java2d_pipe_ShapeSpanIterator_getPathBox; - Java_sun_java2d_pipe_ShapeSpanIterator_initIDs; - Java_sun_java2d_pipe_ShapeSpanIterator_intersectClipBox; - Java_sun_java2d_pipe_ShapeSpanIterator_nextSpan; - Java_sun_java2d_pipe_ShapeSpanIterator_setNormalize; - Java_sun_java2d_pipe_ShapeSpanIterator_setOutputAreaXYXY; - Java_sun_java2d_pipe_ShapeSpanIterator_setRule; - Java_sun_java2d_pipe_ShapeSpanIterator_skipDownTo; + Java_java_awt_CheckboxMenuItem_initIDs; + Java_java_awt_Color_initIDs; + Java_java_awt_FontMetrics_initIDs; + Java_java_awt_image_BufferedImage_initIDs; + Java_sun_awt_image_DataBufferNative_getElem; + Java_sun_awt_image_DataBufferNative_setElem; + Java_java_awt_image_ColorModel_initIDs; + Java_java_awt_image_IndexColorModel_initIDs; + Java_java_awt_image_Kernel_initIDs; + Java_java_awt_image_Raster_initIDs; + Java_java_awt_image_SampleModel_initIDs; + Java_java_awt_Label_initIDs; + Java_java_awt_MenuBar_initIDs; + Java_java_awt_ScrollPaneAdjustable_initIDs; + Java_java_awt_Toolkit_initIDs; + Java_sun_awt_DebugSettings_setCTracingOn__Z; + Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2; + Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2I; + Java_sun_awt_image_ByteComponentRaster_initIDs; + Java_sun_awt_image_GifImageDecoder_initIDs; + Java_sun_awt_image_GifImageDecoder_parseImage; + Java_sun_awt_image_ImageRepresentation_initIDs; + Java_sun_awt_image_ImageRepresentation_setDiffICM; + Java_sun_awt_image_ImageRepresentation_setICMpixels; + Java_sun_awt_image_ImagingLib_convolveBI; + Java_sun_awt_image_ImagingLib_convolveRaster; + Java_sun_awt_image_ImagingLib_init; + Java_sun_awt_image_ImagingLib_transformBI; + Java_sun_awt_image_ImagingLib_transformRaster; + Java_sun_awt_image_IntegerComponentRaster_initIDs; + Java_sun_awt_image_ShortComponentRaster_initIDs; + Java_sun_java2d_pipe_BufferedMaskBlit_enqueueTile; + Java_sun_java2d_pipe_BufferedRenderPipe_fillSpans; + Java_sun_java2d_pipe_SpanClipRenderer_eraseTile; + Java_sun_java2d_pipe_SpanClipRenderer_fillTile; + Java_sun_java2d_pipe_ShapeSpanIterator_addSegment; + Java_sun_java2d_pipe_ShapeSpanIterator_moveTo; + Java_sun_java2d_pipe_ShapeSpanIterator_lineTo; + Java_sun_java2d_pipe_ShapeSpanIterator_quadTo; + Java_sun_java2d_pipe_ShapeSpanIterator_curveTo; + Java_sun_java2d_pipe_ShapeSpanIterator_closePath; + Java_sun_java2d_pipe_ShapeSpanIterator_pathDone; + Java_sun_java2d_pipe_ShapeSpanIterator_getNativeConsumer; + Java_sun_java2d_pipe_ShapeSpanIterator_appendPoly; + Java_sun_java2d_pipe_ShapeSpanIterator_dispose; + Java_sun_java2d_pipe_ShapeSpanIterator_getNativeIterator; + Java_sun_java2d_pipe_ShapeSpanIterator_getPathBox; + Java_sun_java2d_pipe_ShapeSpanIterator_initIDs; + Java_sun_java2d_pipe_ShapeSpanIterator_intersectClipBox; + Java_sun_java2d_pipe_ShapeSpanIterator_nextSpan; + Java_sun_java2d_pipe_ShapeSpanIterator_setNormalize; + Java_sun_java2d_pipe_ShapeSpanIterator_setOutputAreaXYXY; + Java_sun_java2d_pipe_ShapeSpanIterator_setRule; + Java_sun_java2d_pipe_ShapeSpanIterator_skipDownTo; - Java_java_awt_Choice_initIDs; - Java_java_awt_Dimension_initIDs; - Java_java_awt_event_MouseEvent_initIDs; - Java_java_awt_image_SinglePixelPackedSampleModel_initIDs; - Java_java_awt_Rectangle_initIDs; - Java_sun_awt_image_BufImgSurfaceData_initIDs; - Java_sun_awt_image_BufImgSurfaceData_initRaster; - Java_sun_awt_image_BufImgSurfaceData_freeNativeICMData; - Java_sun_awt_image_BytePackedRaster_initIDs; - Java_sun_awt_image_ImagingLib_lookupByteBI; - Java_sun_awt_image_ImagingLib_lookupByteRaster; - Java_sun_java2d_SurfaceData_initIDs; - Java_sun_java2d_SurfaceData_isOpaqueGray; - Java_sun_java2d_Disposer_initIDs; - Java_sun_java2d_DefaultDisposerRecord_invokeNativeDispose; - Java_sun_java2d_loops_BlitBg_BlitBg; - Java_sun_java2d_loops_Blit_Blit; - Java_sun_java2d_loops_ScaledBlit_Scale; - Java_sun_java2d_loops_DrawLine_DrawLine; - Java_sun_java2d_loops_DrawPolygons_DrawPolygons; - Java_sun_java2d_loops_DrawPath_DrawPath; - Java_sun_java2d_loops_FillPath_FillPath; + Java_java_awt_Choice_initIDs; + Java_java_awt_Dimension_initIDs; + Java_java_awt_event_MouseEvent_initIDs; + Java_java_awt_image_SinglePixelPackedSampleModel_initIDs; + Java_java_awt_Rectangle_initIDs; + Java_sun_awt_image_BufImgSurfaceData_initIDs; + Java_sun_awt_image_BufImgSurfaceData_initRaster; + Java_sun_awt_image_BufImgSurfaceData_freeNativeICMData; + Java_sun_awt_image_BytePackedRaster_initIDs; + Java_sun_awt_image_ImagingLib_lookupByteBI; + Java_sun_awt_image_ImagingLib_lookupByteRaster; + Java_sun_java2d_SurfaceData_initIDs; + Java_sun_java2d_SurfaceData_isOpaqueGray; + Java_sun_java2d_Disposer_initIDs; + Java_sun_java2d_DefaultDisposerRecord_invokeNativeDispose; + Java_sun_java2d_loops_BlitBg_BlitBg; + Java_sun_java2d_loops_Blit_Blit; + Java_sun_java2d_loops_ScaledBlit_Scale; + Java_sun_java2d_loops_DrawLine_DrawLine; + Java_sun_java2d_loops_DrawPolygons_DrawPolygons; + Java_sun_java2d_loops_DrawPath_DrawPath; + Java_sun_java2d_loops_FillPath_FillPath; - Java_sun_java2d_loops_DrawRect_DrawRect; - Java_sun_java2d_loops_FillRect_FillRect; - Java_sun_java2d_loops_FillSpans_FillSpans; - Java_sun_java2d_loops_FillParallelogram_FillParallelogram; - Java_sun_java2d_loops_DrawParallelogram_DrawParallelogram; - Java_sun_java2d_loops_GraphicsPrimitiveMgr_initIDs; - Java_sun_java2d_loops_GraphicsPrimitiveMgr_registerNativeLoops; - Java_sun_java2d_loops_MaskBlit_MaskBlit; - Java_sun_java2d_loops_MaskFill_MaskFill; - Java_sun_java2d_loops_MaskFill_FillAAPgram; - Java_sun_java2d_loops_MaskFill_DrawAAPgram; - Java_sun_java2d_loops_TransformHelper_Transform; - Java_sun_java2d_pipe_Region_initIDs; - Java_sun_java2d_pipe_SpanClipRenderer_initIDs; - sun_awt_image_GifImageDecoder_initIDs; + Java_sun_java2d_loops_DrawRect_DrawRect; + Java_sun_java2d_loops_FillRect_FillRect; + Java_sun_java2d_loops_FillSpans_FillSpans; + Java_sun_java2d_loops_FillParallelogram_FillParallelogram; + Java_sun_java2d_loops_DrawParallelogram_DrawParallelogram; + Java_sun_java2d_loops_GraphicsPrimitiveMgr_initIDs; + Java_sun_java2d_loops_GraphicsPrimitiveMgr_registerNativeLoops; + Java_sun_java2d_loops_MaskBlit_MaskBlit; + Java_sun_java2d_loops_MaskFill_MaskFill; + Java_sun_java2d_loops_MaskFill_FillAAPgram; + Java_sun_java2d_loops_MaskFill_DrawAAPgram; + Java_sun_java2d_loops_TransformHelper_Transform; + Java_sun_java2d_pipe_Region_initIDs; + Java_sun_java2d_pipe_SpanClipRenderer_initIDs; + sun_awt_image_GifImageDecoder_initIDs; - # libmawt entry points - SurfaceData_InitOps; - SurfaceData_ThrowInvalidPipeException; - SurfaceData_IntersectBlitBounds; - SurfaceData_IntersectBoundsXYXY; - Region_GetBounds; - Region_GetInfo; - Region_StartIteration; - Region_CountIterationRects; - Region_NextIteration; - Region_EndIteration; - RegionToYXBandedRectangles; - GrPrim_CompGetXorInfo; - GrPrim_CompGetAlphaInfo; - J2dTraceImpl; - J2dTraceInit; - img_makePalette; - initInverseGrayLut; - make_dither_arrays; - make_uns_ordered_dither_array; + # libmawt entry points + SurfaceData_InitOps; + SurfaceData_ThrowInvalidPipeException; + SurfaceData_IntersectBlitBounds; + SurfaceData_IntersectBoundsXYXY; + Region_GetBounds; + Region_GetInfo; + Region_StartIteration; + Region_CountIterationRects; + Region_NextIteration; + Region_EndIteration; + RegionToYXBandedRectangles; + GrPrim_CompGetXorInfo; + GrPrim_CompGetAlphaInfo; + J2dTraceImpl; + J2dTraceInit; + img_makePalette; + initInverseGrayLut; + make_dither_arrays; + make_uns_ordered_dither_array; - # variables exported to libmawt - std_img_oda_red; - std_img_oda_blue; - std_img_oda_green; - std_odas_computed; - g_CMpDataID; - colorValueID; - mul8table; - div8table; - jvm; + # variables exported to libmawt + std_img_oda_red; + std_img_oda_blue; + std_img_oda_green; + std_odas_computed; + g_CMpDataID; + colorValueID; + mul8table; + div8table; + jvm; - # ProcessPath entry points and data - doDrawPath; - doFillPath; - path2DNumTypesID; - path2DTypesID; - path2DWindingRuleID; - path2DFloatCoordsID; - sg2dStrokeHintID; - sunHints_INTVAL_STROKE_PURE; + # ProcessPath entry points and data + doDrawPath; + doFillPath; + path2DNumTypesID; + path2DTypesID; + path2DWindingRuleID; + path2DFloatCoordsID; + sg2dStrokeHintID; + sunHints_INTVAL_STROKE_PURE; - # CDE private entry points - # These are in awt_LoadLibrary.c and falls through to libmawt. - # Evidently CDE needs this for backward compatability. - Java_sun_awt_motif_XsessionWMcommand; - Java_sun_awt_motif_XsessionWMcommand_New; + # CDE private entry points + # These are in awt_LoadLibrary.c and falls through to libmawt. + # Evidently CDE needs this for backward compatability. + Java_sun_awt_motif_XsessionWMcommand; + Java_sun_awt_motif_XsessionWMcommand_New; - # libfontmanager entry points - AWTIsHeadless; - GrPrim_Sg2dGetCompInfo; - GrPrim_Sg2dGetClip; - GetNativePrim; - SurfaceData_IntersectBounds; - SurfaceData_GetOps; - Disposer_AddRecord; - GrPrim_Sg2dGetEaRGB; - GrPrim_Sg2dGetPixel; - GrPrim_Sg2dGetLCDTextContrast; + # libfontmanager entry points + AWTIsHeadless; + GrPrim_Sg2dGetCompInfo; + GrPrim_Sg2dGetClip; + GetNativePrim; + SurfaceData_IntersectBounds; + SurfaceData_GetOps; + Disposer_AddRecord; + GrPrim_Sg2dGetEaRGB; + GrPrim_Sg2dGetPixel; + GrPrim_Sg2dGetLCDTextContrast; - local: - *; + local: + *; }; diff -r b079fff22b3c -r de9ff562c112 jdk/make/mapfiles/libawt/mapfile-vers-linux --- a/jdk/make/mapfiles/libawt/mapfile-vers-linux Thu Sep 01 23:20:11 2016 +0000 +++ b/jdk/make/mapfiles/libawt/mapfile-vers-linux Fri Sep 02 02:41:37 2016 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2016, 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 @@ -27,277 +27,278 @@ # Linux port does not use mawt, all public symbols are in libawt.so SUNWprivate_1.1 { - global: - JNI_OnLoad; + global: + JNI_OnLoad; - Java_java_awt_CheckboxMenuItem_initIDs; - Java_java_awt_Color_initIDs; - Java_java_awt_FontMetrics_initIDs; - Java_java_awt_image_BufferedImage_initIDs; - Java_sun_awt_image_DataBufferNative_getElem; - Java_sun_awt_image_DataBufferNative_setElem; - Java_java_awt_image_ColorModel_initIDs; - Java_java_awt_image_IndexColorModel_initIDs; - Java_java_awt_image_Kernel_initIDs; - Java_java_awt_image_Raster_initIDs; - Java_java_awt_image_SampleModel_initIDs; - Java_java_awt_Label_initIDs; - Java_java_awt_MenuBar_initIDs; - Java_java_awt_ScrollPaneAdjustable_initIDs; - Java_java_awt_Toolkit_initIDs; - Java_java_awt_TrayIcon_initIDs; - Java_sun_awt_DebugSettings_setCTracingOn__Z; - Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2; - Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2I; - Java_sun_awt_image_ByteComponentRaster_initIDs; - Java_sun_awt_image_GifImageDecoder_initIDs; - Java_sun_awt_image_GifImageDecoder_parseImage; - Java_sun_awt_image_Image_initIDs; - Java_sun_awt_image_ImageRepresentation_initIDs; - Java_sun_awt_image_ImageRepresentation_setDiffICM; - Java_sun_awt_image_ImageRepresentation_setICMpixels; - Java_sun_awt_image_ImagingLib_convolveBI; - Java_sun_awt_image_ImagingLib_convolveRaster; - Java_sun_awt_image_ImagingLib_init; - Java_sun_awt_image_ImagingLib_transformBI; - Java_sun_awt_image_ImagingLib_transformRaster; - Java_sun_awt_image_IntegerComponentRaster_initIDs; - Java_sun_awt_image_ShortComponentRaster_initIDs; - Java_sun_java2d_pipe_SpanClipRenderer_eraseTile; - Java_sun_java2d_pipe_SpanClipRenderer_fillTile; - Java_sun_java2d_pipe_ShapeSpanIterator_addSegment; - Java_sun_java2d_pipe_ShapeSpanIterator_moveTo; - Java_sun_java2d_pipe_ShapeSpanIterator_lineTo; - Java_sun_java2d_pipe_ShapeSpanIterator_quadTo; - Java_sun_java2d_pipe_ShapeSpanIterator_curveTo; - Java_sun_java2d_pipe_ShapeSpanIterator_closePath; - Java_sun_java2d_pipe_ShapeSpanIterator_pathDone; - Java_sun_java2d_pipe_ShapeSpanIterator_getNativeConsumer; - Java_sun_java2d_pipe_ShapeSpanIterator_appendPoly; - Java_sun_java2d_pipe_ShapeSpanIterator_dispose; - Java_sun_java2d_pipe_ShapeSpanIterator_getNativeIterator; - Java_sun_java2d_pipe_ShapeSpanIterator_getPathBox; - Java_sun_java2d_pipe_ShapeSpanIterator_initIDs; - Java_sun_java2d_pipe_ShapeSpanIterator_intersectClipBox; - Java_sun_java2d_pipe_ShapeSpanIterator_nextSpan; - Java_sun_java2d_pipe_ShapeSpanIterator_setNormalize; - Java_sun_java2d_pipe_ShapeSpanIterator_setOutputAreaXYXY; - Java_sun_java2d_pipe_ShapeSpanIterator_setRule; - Java_sun_java2d_pipe_ShapeSpanIterator_skipDownTo; + Java_java_awt_CheckboxMenuItem_initIDs; + Java_java_awt_Color_initIDs; + Java_java_awt_FontMetrics_initIDs; + Java_java_awt_image_BufferedImage_initIDs; + Java_sun_awt_image_DataBufferNative_getElem; + Java_sun_awt_image_DataBufferNative_setElem; + Java_java_awt_image_ColorModel_initIDs; + Java_java_awt_image_IndexColorModel_initIDs; + Java_java_awt_image_Kernel_initIDs; + Java_java_awt_image_Raster_initIDs; + Java_java_awt_image_SampleModel_initIDs; + Java_java_awt_Label_initIDs; + Java_java_awt_MenuBar_initIDs; + Java_java_awt_ScrollPaneAdjustable_initIDs; + Java_java_awt_Toolkit_initIDs; + Java_java_awt_TrayIcon_initIDs; + Java_sun_awt_DebugSettings_setCTracingOn__Z; + Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2; + Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2I; + Java_sun_awt_image_ByteComponentRaster_initIDs; + Java_sun_awt_image_GifImageDecoder_initIDs; + Java_sun_awt_image_GifImageDecoder_parseImage; + Java_sun_awt_image_Image_initIDs; + Java_sun_awt_image_ImageRepresentation_initIDs; + Java_sun_awt_image_ImageRepresentation_setDiffICM; + Java_sun_awt_image_ImageRepresentation_setICMpixels; + Java_sun_awt_image_ImagingLib_convolveBI; + Java_sun_awt_image_ImagingLib_convolveRaster; + Java_sun_awt_image_ImagingLib_init; + Java_sun_awt_image_ImagingLib_transformBI; + Java_sun_awt_image_ImagingLib_transformRaster; + Java_sun_awt_image_IntegerComponentRaster_initIDs; + Java_sun_awt_image_ShortComponentRaster_initIDs; + Java_sun_java2d_pipe_SpanClipRenderer_eraseTile; + Java_sun_java2d_pipe_SpanClipRenderer_fillTile; + Java_sun_java2d_pipe_ShapeSpanIterator_addSegment; + Java_sun_java2d_pipe_ShapeSpanIterator_moveTo; + Java_sun_java2d_pipe_ShapeSpanIterator_lineTo; + Java_sun_java2d_pipe_ShapeSpanIterator_quadTo; + Java_sun_java2d_pipe_ShapeSpanIterator_curveTo; + Java_sun_java2d_pipe_ShapeSpanIterator_closePath; + Java_sun_java2d_pipe_ShapeSpanIterator_pathDone; + Java_sun_java2d_pipe_ShapeSpanIterator_getNativeConsumer; + Java_sun_java2d_pipe_ShapeSpanIterator_appendPoly; + Java_sun_java2d_pipe_ShapeSpanIterator_dispose; + Java_sun_java2d_pipe_ShapeSpanIterator_getNativeIterator; + Java_sun_java2d_pipe_ShapeSpanIterator_getPathBox; + Java_sun_java2d_pipe_ShapeSpanIterator_initIDs; + Java_sun_java2d_pipe_ShapeSpanIterator_intersectClipBox; + Java_sun_java2d_pipe_ShapeSpanIterator_nextSpan; + Java_sun_java2d_pipe_ShapeSpanIterator_setNormalize; + Java_sun_java2d_pipe_ShapeSpanIterator_setOutputAreaXYXY; + Java_sun_java2d_pipe_ShapeSpanIterator_setRule; + Java_sun_java2d_pipe_ShapeSpanIterator_skipDownTo; - Java_java_awt_Choice_initIDs; - Java_java_awt_Dimension_initIDs; - Java_java_awt_event_MouseEvent_initIDs; - Java_java_awt_image_SinglePixelPackedSampleModel_initIDs; - Java_java_awt_Rectangle_initIDs; - Java_sun_awt_image_BufImgSurfaceData_getSurfaceData; - Java_sun_awt_image_BufImgSurfaceData_initIDs; - Java_sun_awt_image_BufImgSurfaceData_initRaster; - Java_sun_awt_image_BufImgSurfaceData_setSurfaceData; - Java_sun_awt_image_BufImgSurfaceData_freeNativeICMData; - Java_sun_awt_image_BytePackedRaster_initIDs; - Java_sun_awt_image_ImagingLib_lookupByteBI; - Java_sun_awt_image_ImagingLib_lookupByteRaster; - Java_sun_java2d_SurfaceData_initIDs; - Java_sun_java2d_SurfaceData_isOpaqueGray; - Java_sun_java2d_Disposer_initIDs; - Java_sun_java2d_DefaultDisposerRecord_invokeNativeDispose; - Java_sun_java2d_loops_BlitBg_BlitBg; - Java_sun_java2d_loops_Blit_Blit; - Java_sun_java2d_loops_ScaledBlit_Scale; - Java_sun_java2d_loops_DrawLine_DrawLine; - Java_sun_java2d_loops_DrawPolygons_DrawPolygons; - Java_sun_java2d_loops_DrawRect_DrawRect; - Java_sun_java2d_loops_FillRect_FillRect; - Java_sun_java2d_loops_FillSpans_FillSpans; - Java_sun_java2d_loops_GraphicsPrimitiveMgr_initIDs; - Java_sun_java2d_loops_GraphicsPrimitiveMgr_registerNativeLoops; - Java_sun_java2d_loops_MaskBlit_MaskBlit; - Java_sun_java2d_loops_MaskFill_MaskFill; - Java_sun_java2d_loops_MaskFill_FillAAPgram; - Java_sun_java2d_loops_MaskFill_DrawAAPgram; - Java_sun_java2d_pipe_BufferedRenderPipe_fillSpans; - Java_sun_java2d_pipe_SpanClipRenderer_initIDs; - sun_awt_image_GifImageDecoder_initIDs; + Java_java_awt_Choice_initIDs; + Java_java_awt_Dimension_initIDs; + Java_java_awt_event_MouseEvent_initIDs; + Java_java_awt_image_SinglePixelPackedSampleModel_initIDs; + Java_java_awt_Rectangle_initIDs; + Java_sun_awt_image_BufImgSurfaceData_getSurfaceData; + Java_sun_awt_image_BufImgSurfaceData_initIDs; + Java_sun_awt_image_BufImgSurfaceData_initRaster; + Java_sun_awt_image_BufImgSurfaceData_setSurfaceData; + Java_sun_awt_image_BufImgSurfaceData_freeNativeICMData; + Java_sun_awt_image_BytePackedRaster_initIDs; + Java_sun_awt_image_ImagingLib_lookupByteBI; + Java_sun_awt_image_ImagingLib_lookupByteRaster; + Java_sun_java2d_SurfaceData_initIDs; + Java_sun_java2d_SurfaceData_isOpaqueGray; + Java_sun_java2d_Disposer_initIDs; + Java_sun_java2d_DefaultDisposerRecord_invokeNativeDispose; + Java_sun_java2d_loops_BlitBg_BlitBg; + Java_sun_java2d_loops_Blit_Blit; + Java_sun_java2d_loops_ScaledBlit_Scale; + Java_sun_java2d_loops_DrawLine_DrawLine; + Java_sun_java2d_loops_DrawPolygons_DrawPolygons; + Java_sun_java2d_loops_DrawRect_DrawRect; + Java_sun_java2d_loops_FillRect_FillRect; + Java_sun_java2d_loops_FillSpans_FillSpans; + Java_sun_java2d_loops_GraphicsPrimitiveMgr_initIDs; + Java_sun_java2d_loops_GraphicsPrimitiveMgr_registerNativeLoops; + Java_sun_java2d_loops_MaskBlit_MaskBlit; + Java_sun_java2d_loops_MaskFill_MaskFill; + Java_sun_java2d_loops_MaskFill_FillAAPgram; + Java_sun_java2d_loops_MaskFill_DrawAAPgram; + Java_sun_java2d_pipe_BufferedRenderPipe_fillSpans; + Java_sun_java2d_pipe_SpanClipRenderer_initIDs; + sun_awt_image_GifImageDecoder_initIDs; - # libmawt entry points - SurfaceData_InitOps; - SurfaceData_ThrowInvalidPipeException; - Region_GetBounds; - Region_GetInfo; - Region_StartIteration; - Region_CountIterationRects; - Region_NextIteration; - Region_EndIteration; - GrPrim_CompGetXorInfo; - GrPrim_CompGetAlphaInfo; - img_makePalette; - initInverseGrayLut; - make_dither_arrays; - make_uns_ordered_dither_array; + # libmawt entry points + SurfaceData_InitOps; + SurfaceData_ThrowInvalidPipeException; + Region_GetBounds; + Region_GetInfo; + Region_StartIteration; + Region_CountIterationRects; + Region_NextIteration; + Region_EndIteration; + GrPrim_CompGetXorInfo; + GrPrim_CompGetAlphaInfo; + img_makePalette; + initInverseGrayLut; + make_dither_arrays; + make_uns_ordered_dither_array; - # variables exported to libmawt - std_img_oda_red; - std_img_oda_blue; - std_img_oda_green; - std_odas_computed; - g_CMpDataID; - colorValueID; - jvm; + # variables exported to libmawt + std_img_oda_red; + std_img_oda_blue; + std_img_oda_green; + std_odas_computed; + g_CMpDataID; + colorValueID; + jvm; - # CDE private entry point - # This is in awt_LoadLibrary.c and falls through to libmawt. - # Evidently CDE needs this for backward compatability. - Java_sun_awt_motif_XsessionWMcommand; + # CDE private entry point + # This is in awt_LoadLibrary.c and falls through to libmawt. + # Evidently CDE needs this for backward compatability. + Java_sun_awt_motif_XsessionWMcommand; - # libfontmanager entry points - AWTIsHeadless; - GrPrim_Sg2dGetCompInfo; - GrPrim_Sg2dGetClip; - GetNativePrim; - SurfaceData_IntersectBounds; - SurfaceData_GetOps; - Disposer_AddRecord; - GrPrim_Sg2dGetEaRGB; - GrPrim_Sg2dGetPixel; - GrPrim_Sg2dGetLCDTextContrast; + # libfontmanager entry points + AWTIsHeadless; + GrPrim_Sg2dGetCompInfo; + GrPrim_Sg2dGetClip; + GetNativePrim; + SurfaceData_IntersectBounds; + SurfaceData_GetOps; + Disposer_AddRecord; + GrPrim_Sg2dGetEaRGB; + GrPrim_Sg2dGetPixel; + GrPrim_Sg2dGetLCDTextContrast; - Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords; - Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse; - Java_java_awt_AWTEvent_nativeSetSource; - Java_java_awt_Checkbox_initIDs; - Java_java_awt_Component_initIDs; - Java_java_awt_Dialog_initIDs; - Java_java_awt_Font_initIDs; - Java_sun_awt_KeyboardFocusManagerPeerImpl_clearNativeGlobalFocusOwner; - Java_sun_awt_KeyboardFocusManagerPeerImpl_getNativeFocusOwner; - Java_sun_awt_KeyboardFocusManagerPeerImpl_getNativeFocusedWindow; - Java_java_awt_KeyboardFocusManager_initIDs; - Java_java_awt_Menu_initIDs; - Java_java_awt_MenuComponent_initIDs; - Java_java_awt_MenuItem_initIDs; - Java_java_awt_Scrollbar_initIDs; - Java_java_awt_ScrollPane_initIDs; - Java_java_awt_TextArea_initIDs; - Java_sun_awt_FontDescriptor_initIDs; - Java_sun_awt_X11InputMethod_disposeXIC; - Java_sun_awt_X11InputMethod_isCompositionEnabledNative; - Java_sun_awt_X11InputMethod_resetXIC; - Java_sun_awt_X11InputMethod_setCompositionEnabledNative; - Java_sun_awt_X11InputMethod_turnoffStatusWindow; - Java_sun_awt_SunToolkit_closeSplashScreen; - Java_sun_awt_PlatformFont_initIDs; - Java_sun_awt_X11GraphicsConfig_init; - Java_sun_awt_X11GraphicsConfig_dispose; - Java_sun_awt_X11GraphicsConfig_pGetBounds; - Java_sun_awt_X11GraphicsConfig_getNumColors; - Java_sun_awt_X11GraphicsConfig_getXResolution; - Java_sun_awt_X11GraphicsConfig_getYResolution; - Java_sun_awt_X11GraphicsConfig_isTranslucencyCapable; - Java_sun_awt_X11GraphicsDevice_isDBESupported; - Java_sun_awt_X11GraphicsDevice_getDisplay; - Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals; - Java_sun_awt_X11GraphicsDevice_getNumConfigs; - Java_sun_awt_X11GraphicsDevice_initIDs; - Java_sun_awt_X11GraphicsDevice_initXrandrExtension; - Java_sun_awt_X11GraphicsDevice_enterFullScreenExclusive; - Java_sun_awt_X11GraphicsDevice_exitFullScreenExclusive; - Java_sun_awt_X11GraphicsDevice_getCurrentDisplayMode; - Java_sun_awt_X11GraphicsDevice_enumDisplayModes; - Java_sun_awt_X11GraphicsDevice_configDisplayMode; - Java_sun_awt_X11GraphicsDevice_resetNativeData; - Java_sun_awt_X11GraphicsDevice_getNativeScaleFactor; - Java_sun_awt_X11GraphicsEnvironment_checkShmExt; - Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum; - Java_sun_awt_X11GraphicsEnvironment_getDisplayString; - Java_sun_awt_X11GraphicsEnvironment_getNumScreens; - Java_sun_awt_X11GraphicsEnvironment_initDisplay; - Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama; - Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint; - Java_sun_awt_X11GraphicsEnvironment_initXRender; - - + Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords; + Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse; + Java_java_awt_AWTEvent_nativeSetSource; + Java_java_awt_Checkbox_initIDs; + Java_java_awt_Component_initIDs; + Java_java_awt_Dialog_initIDs; + Java_java_awt_Font_initIDs; + Java_sun_awt_KeyboardFocusManagerPeerImpl_clearNativeGlobalFocusOwner; + Java_sun_awt_KeyboardFocusManagerPeerImpl_getNativeFocusOwner; + Java_sun_awt_KeyboardFocusManagerPeerImpl_getNativeFocusedWindow; + Java_java_awt_KeyboardFocusManager_initIDs; + Java_java_awt_Menu_initIDs; + Java_java_awt_MenuComponent_initIDs; + Java_java_awt_MenuItem_initIDs; + Java_java_awt_Scrollbar_initIDs; + Java_java_awt_ScrollPane_initIDs; + Java_java_awt_TextArea_initIDs; + Java_sun_awt_FontDescriptor_initIDs; + Java_sun_awt_X11InputMethod_disposeXIC; + Java_sun_awt_X11InputMethod_isCompositionEnabledNative; + Java_sun_awt_X11InputMethod_resetXIC; + Java_sun_awt_X11InputMethod_setCompositionEnabledNative; + Java_sun_awt_X11InputMethod_turnoffStatusWindow; + Java_sun_awt_SunToolkit_closeSplashScreen; + Java_sun_awt_PlatformFont_initIDs; + Java_sun_awt_X11GraphicsConfig_init; + Java_sun_awt_X11GraphicsConfig_dispose; + Java_sun_awt_X11GraphicsConfig_pGetBounds; + Java_sun_awt_X11GraphicsConfig_getNumColors; + Java_sun_awt_X11GraphicsConfig_getXResolution; + Java_sun_awt_X11GraphicsConfig_getYResolution; + Java_sun_awt_X11GraphicsConfig_isTranslucencyCapable; + Java_sun_awt_X11GraphicsDevice_isDBESupported; + Java_sun_awt_X11GraphicsDevice_getDisplay; + Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals; + Java_sun_awt_X11GraphicsDevice_getNumConfigs; + Java_sun_awt_X11GraphicsDevice_initIDs; + Java_sun_awt_X11GraphicsDevice_initXrandrExtension; + Java_sun_awt_X11GraphicsDevice_enterFullScreenExclusive; + Java_sun_awt_X11GraphicsDevice_exitFullScreenExclusive; + Java_sun_awt_X11GraphicsDevice_getCurrentDisplayMode; + Java_sun_awt_X11GraphicsDevice_enumDisplayModes; + Java_sun_awt_X11GraphicsDevice_configDisplayMode; + Java_sun_awt_X11GraphicsDevice_resetNativeData; + Java_sun_awt_X11GraphicsDevice_getNativeScaleFactor; + Java_sun_awt_X11GraphicsEnvironment_checkShmExt; + Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum; + Java_sun_awt_X11GraphicsEnvironment_getDisplayString; + Java_sun_awt_X11GraphicsEnvironment_getNumScreens; + Java_sun_awt_X11GraphicsEnvironment_initDisplay; + Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama; + Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint; + Java_sun_awt_X11GraphicsEnvironment_initXRender; - Java_java_awt_AWTEvent_initIDs; - Java_java_awt_Button_initIDs; - Java_java_awt_Container_initIDs; - Java_java_awt_Cursor_finalizeImpl; - Java_java_awt_Cursor_initIDs; - Java_java_awt_Event_initIDs; - Java_java_awt_event_InputEvent_initIDs; - Java_java_awt_event_KeyEvent_initIDs; - Java_java_awt_FileDialog_initIDs; - Java_java_awt_Frame_initIDs; - Java_java_awt_Insets_initIDs; - Java_java_awt_TextField_initIDs; - Java_java_awt_Window_initIDs; - Java_sun_awt_motif_X11OffScreenImage_updateBitmask; - Java_sun_awt_X11GraphicsConfig_init; - Java_sun_awt_X11GraphicsConfig_initIDs; - Java_sun_awt_X11GraphicsConfig_makeColorModel; - Java_sun_awt_X11GraphicsDevice_getConfigVisualId; - Java_sun_awt_X11PMBlitLoops_Blit; - Java_sun_awt_X11PMBlitBgLoops_nativeBlitBg; - Java_sun_awt_X11Renderer_devFillSpans; - Java_sun_awt_X11Renderer_doDrawArc; - Java_sun_awt_X11Renderer_doDrawLine; - Java_sun_awt_X11Renderer_doDrawOval; - Java_sun_awt_X11Renderer_doDrawPoly; - Java_sun_awt_X11Renderer_doDrawRect; - Java_sun_awt_X11Renderer_doDrawRoundRect; - Java_sun_awt_X11Renderer_doFillArc; - Java_sun_awt_X11Renderer_doFillOval; - Java_sun_awt_X11Renderer_doFillPoly; - Java_sun_awt_X11Renderer_doFillRect; - Java_sun_awt_X11Renderer_doFillRoundRect; - Java_sun_awt_X11Renderer_devCopyArea; - Java_sun_awt_X11SurfaceData_initIDs; - Java_sun_awt_X11SurfaceData_initOps; - Java_sun_awt_X11SurfaceData_initSurface; - Java_sun_awt_X11SurfaceData_isDgaAvailable; - Java_sun_awt_X11SurfaceData_setInvalid; - Java_sun_awt_X11SurfaceData_flushNativeSurface; - awt_display; - awt_lock; - awt_Lock; - awt_Unlock; - awt_GetDrawingSurface; - awt_FreeDrawingSurface; - awt_GetComponent; + Java_java_awt_AWTEvent_initIDs; + Java_java_awt_Button_initIDs; + Java_java_awt_Container_initIDs; + Java_java_awt_Cursor_finalizeImpl; + Java_java_awt_Cursor_initIDs; + Java_java_awt_Event_initIDs; + Java_java_awt_event_InputEvent_initIDs; + Java_java_awt_event_KeyEvent_initIDs; + Java_java_awt_FileDialog_initIDs; + Java_java_awt_Frame_initIDs; + Java_java_awt_Insets_initIDs; + Java_java_awt_TextField_initIDs; + Java_java_awt_Window_initIDs; + Java_sun_awt_motif_X11OffScreenImage_updateBitmask; + Java_sun_awt_X11GraphicsConfig_init; + Java_sun_awt_X11GraphicsConfig_initIDs; + Java_sun_awt_X11GraphicsConfig_makeColorModel; + Java_sun_awt_X11GraphicsDevice_getConfigVisualId; + Java_sun_awt_X11PMBlitLoops_Blit; + Java_sun_awt_X11PMBlitBgLoops_nativeBlitBg; + Java_sun_awt_X11Renderer_devFillSpans; + Java_sun_awt_X11Renderer_doDrawArc; + Java_sun_awt_X11Renderer_doDrawLine; + Java_sun_awt_X11Renderer_doDrawOval; + Java_sun_awt_X11Renderer_doDrawPoly; + Java_sun_awt_X11Renderer_doDrawRect; + Java_sun_awt_X11Renderer_doDrawRoundRect; + Java_sun_awt_X11Renderer_doFillArc; + Java_sun_awt_X11Renderer_doFillOval; + Java_sun_awt_X11Renderer_doFillPoly; + Java_sun_awt_X11Renderer_doFillRect; + Java_sun_awt_X11Renderer_doFillRoundRect; + Java_sun_awt_X11Renderer_devCopyArea; + Java_sun_awt_X11SurfaceData_initIDs; + Java_sun_awt_X11SurfaceData_initOps; + Java_sun_awt_X11SurfaceData_initSurface; + Java_sun_awt_X11SurfaceData_isDgaAvailable; + Java_sun_awt_X11SurfaceData_setInvalid; + Java_sun_awt_X11SurfaceData_flushNativeSurface; + awt_display; + awt_lock; + awt_Lock; + awt_Unlock; + awt_GetDrawingSurface; + awt_FreeDrawingSurface; + awt_GetComponent; + awt_CreateEmbeddedFrame; + awt_SetBounds; + awt_SynthesizeWindowActivation; - X11SurfaceData_GetOps; - getDefaultConfig; - Java_sun_font_FontConfigManager_getFontConfig; - Java_sun_font_FontConfigManager_getFontConfigAASettings; - Java_sun_awt_FcFontManager_getFontPathNative; - Java_sun_font_SunFontManager_populateFontFileNameMap; + X11SurfaceData_GetOps; + getDefaultConfig; + Java_sun_font_FontConfigManager_getFontConfig; + Java_sun_font_FontConfigManager_getFontConfigAASettings; + Java_sun_awt_FcFontManager_getFontPathNative; + Java_sun_font_SunFontManager_populateFontFileNameMap; - # CDE private entry point - Java_sun_awt_motif_XsessionWMcommand; + # CDE private entry point + Java_sun_awt_motif_XsessionWMcommand; - # libfontmanager entry points - AWTIsHeadless; - AWTCountFonts; - AWTLoadFont; - AWTFreeFont; - AWTFontMinByte1; - AWTFontMaxByte1; - AWTFontMinCharOrByte2; - AWTFontMaxCharOrByte2; - AWTFontDefaultChar; - AWTFontPerChar; - AWTFontMaxBounds; - AWTFontTextExtents16; - AWTFreeChar; - AWTFontGenerateImage; - AWTCharAdvance; - AWTCharLBearing; - AWTCharRBearing; - AWTCharAscent; - AWTCharDescent; - AWTDrawGlyphList; - AccelGlyphCache_RemoveAllCellInfos; + # libfontmanager entry points + AWTIsHeadless; + AWTCountFonts; + AWTLoadFont; + AWTFreeFont; + AWTFontMinByte1; + AWTFontMaxByte1; + AWTFontMinCharOrByte2; + AWTFontMaxCharOrByte2; + AWTFontDefaultChar; + AWTFontPerChar; + AWTFontMaxBounds; + AWTFontTextExtents16; + AWTFreeChar; + AWTFontGenerateImage; + AWTCharAdvance; + AWTCharLBearing; + AWTCharRBearing; + AWTCharAscent; + AWTCharDescent; + AWTDrawGlyphList; + AccelGlyphCache_RemoveAllCellInfos; - local: - *; + local: + *; }; diff -r b079fff22b3c -r de9ff562c112 jdk/make/mapfiles/libawt_headless/mapfile-vers --- a/jdk/make/mapfiles/libawt_headless/mapfile-vers Thu Sep 01 23:20:11 2016 +0000 +++ b/jdk/make/mapfiles/libawt_headless/mapfile-vers Fri Sep 02 02:41:37 2016 +0000 @@ -26,85 +26,84 @@ # Define public interface. SUNWprivate_1.1 { - global: - JNI_OnLoad; + global: + JNI_OnLoad; - Java_sun_java2d_x11_X11PMBlitLoops_nativeBlit; - Java_sun_java2d_x11_X11PMBlitBgLoops_nativeBlitBg; - Java_sun_java2d_x11_X11Renderer_XFillSpans; - Java_sun_java2d_x11_X11Renderer_XDrawArc; - Java_sun_java2d_x11_X11Renderer_XDrawLine; - Java_sun_java2d_x11_X11Renderer_XDrawOval; - Java_sun_java2d_x11_X11Renderer_XDrawPoly; - Java_sun_java2d_x11_X11Renderer_XDrawRect; - Java_sun_java2d_x11_X11Renderer_XDrawRoundRect; - Java_sun_java2d_x11_X11Renderer_XDoPath; - Java_sun_java2d_x11_X11Renderer_XFillArc; - Java_sun_java2d_x11_X11Renderer_XFillOval; - Java_sun_java2d_x11_X11Renderer_XFillPoly; - Java_sun_java2d_x11_X11Renderer_XFillRect; - Java_sun_java2d_x11_X11Renderer_XFillRoundRect; - Java_sun_java2d_x11_X11Renderer_devCopyArea; - Java_sun_java2d_x11_X11SurfaceData_initIDs; - Java_sun_java2d_x11_X11SurfaceData_initSurface; - Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode; - Java_sun_java2d_x11_X11SurfaceData_XSetXorMode; - Java_sun_java2d_x11_X11SurfaceData_XSetForeground; + Java_sun_java2d_x11_X11PMBlitLoops_nativeBlit; + Java_sun_java2d_x11_X11PMBlitBgLoops_nativeBlitBg; + Java_sun_java2d_x11_X11Renderer_XFillSpans; + Java_sun_java2d_x11_X11Renderer_XDrawArc; + Java_sun_java2d_x11_X11Renderer_XDrawLine; + Java_sun_java2d_x11_X11Renderer_XDrawOval; + Java_sun_java2d_x11_X11Renderer_XDrawPoly; + Java_sun_java2d_x11_X11Renderer_XDrawRect; + Java_sun_java2d_x11_X11Renderer_XDrawRoundRect; + Java_sun_java2d_x11_X11Renderer_XDoPath; + Java_sun_java2d_x11_X11Renderer_XFillArc; + Java_sun_java2d_x11_X11Renderer_XFillOval; + Java_sun_java2d_x11_X11Renderer_XFillPoly; + Java_sun_java2d_x11_X11Renderer_XFillRect; + Java_sun_java2d_x11_X11Renderer_XFillRoundRect; + Java_sun_java2d_x11_X11Renderer_devCopyArea; + Java_sun_java2d_x11_X11SurfaceData_initIDs; + Java_sun_java2d_x11_X11SurfaceData_initSurface; + Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode; + Java_sun_java2d_x11_X11SurfaceData_XSetXorMode; + Java_sun_java2d_x11_X11SurfaceData_XSetForeground; - Java_sun_java2d_x11_XSurfaceData_initOps; - Java_sun_java2d_x11_XSurfaceData_XCreateGC; - Java_sun_java2d_x11_XSurfaceData_XResetClip; - Java_sun_java2d_x11_XSurfaceData_XSetClip; - Java_sun_java2d_x11_XSurfaceData_flushNativeSurface; - Java_sun_java2d_x11_XSurfaceData_isDrawableValid; - Java_sun_java2d_x11_XSurfaceData_setInvalid; - Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures; + Java_sun_java2d_x11_XSurfaceData_initOps; + Java_sun_java2d_x11_XSurfaceData_XCreateGC; + Java_sun_java2d_x11_XSurfaceData_XResetClip; + Java_sun_java2d_x11_XSurfaceData_XSetClip; + Java_sun_java2d_x11_XSurfaceData_flushNativeSurface; + Java_sun_java2d_x11_XSurfaceData_isDrawableValid; + Java_sun_java2d_x11_XSurfaceData_setInvalid; + Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures; - X11SurfaceData_GetOps; - Java_java_awt_Font_initIDs; - Java_sun_font_FontConfigManager_getFontConfig; - Java_sun_font_FontConfigManager_getFontConfigAASettings; - Java_sun_font_FontConfigManager_getFontConfigVersion; - Java_sun_awt_FcFontManager_getFontPathNative; + X11SurfaceData_GetOps; + Java_java_awt_Font_initIDs; + Java_sun_font_FontConfigManager_getFontConfig; + Java_sun_font_FontConfigManager_getFontConfigAASettings; + Java_sun_font_FontConfigManager_getFontConfigVersion; + Java_sun_awt_FcFontManager_getFontPathNative; - Java_sun_awt_FontDescriptor_initIDs; - Java_sun_awt_PlatformFont_initIDs; + Java_sun_awt_FontDescriptor_initIDs; + Java_sun_awt_PlatformFont_initIDs; - Java_sun_print_CUPSPrinter_initIDs; - Java_sun_print_CUPSPrinter_getCupsServer; - Java_sun_print_CUPSPrinter_getCupsPort; - Java_sun_print_CUPSPrinter_getCupsDefaultPrinter; - Java_sun_print_CUPSPrinter_canConnect; - Java_sun_print_CUPSPrinter_getMedia; - Java_sun_print_CUPSPrinter_getPageSizes; - Java_sun_print_CUPSPrinter_getResolutions; + Java_sun_print_CUPSPrinter_initIDs; + Java_sun_print_CUPSPrinter_getCupsServer; + Java_sun_print_CUPSPrinter_getCupsPort; + Java_sun_print_CUPSPrinter_getCupsDefaultPrinter; + Java_sun_print_CUPSPrinter_canConnect; + Java_sun_print_CUPSPrinter_getMedia; + Java_sun_print_CUPSPrinter_getPageSizes; + Java_sun_print_CUPSPrinter_getResolutions; - # libfontmanager entry points - AWTIsHeadless; - AWTCountFonts; - AWTLoadFont; - AWTFreeFont; - AWTFontAscent; - AWTFontDescent; - AWTFontMinByte1; - AWTFontMaxByte1; - AWTFontMinCharOrByte2; - AWTFontMaxCharOrByte2; - AWTFontDefaultChar; - AWTFontPerChar; - AWTFontMaxBounds; - AWTFontTextExtents16; - AWTFreeChar; - AWTFontGenerateImage; - AWTCharAdvance; - AWTCharLBearing; - AWTCharRBearing; - AWTCharAscent; - AWTCharDescent; - AWTDrawGlyphList; - AccelGlyphCache_RemoveAllCellInfos; + # libfontmanager entry points + AWTIsHeadless; + AWTCountFonts; + AWTLoadFont; + AWTFreeFont; + AWTFontAscent; + AWTFontDescent; + AWTFontMinByte1; + AWTFontMaxByte1; + AWTFontMinCharOrByte2; + AWTFontMaxCharOrByte2; + AWTFontDefaultChar; + AWTFontPerChar; + AWTFontMaxBounds; + AWTFontTextExtents16; + AWTFreeChar; + AWTFontGenerateImage; + AWTCharAdvance; + AWTCharLBearing; + AWTCharRBearing; + AWTCharAscent; + AWTCharDescent; + AWTDrawGlyphList; + AccelGlyphCache_RemoveAllCellInfos; - - local: - *; + local: + *; }; diff -r b079fff22b3c -r de9ff562c112 jdk/make/mapfiles/libawt_xawt/mapfile-vers --- a/jdk/make/mapfiles/libawt_xawt/mapfile-vers Thu Sep 01 23:20:11 2016 +0000 +++ b/jdk/make/mapfiles/libawt_xawt/mapfile-vers Fri Sep 02 02:41:37 2016 +0000 @@ -26,7 +26,7 @@ # Define public interface. SUNWprivate_1.1 { - global: + global: JNI_OnLoad; Java_sun_awt_X11_XlibWrapper_copyIntArray; Java_sun_awt_X11_XlibWrapper_copyLongArray; @@ -58,8 +58,8 @@ Java_sun_awt_X11_XlibWrapper_XSetLocaleModifiers; Java_sun_awt_X11_XlibWrapper_XPeekEvent; Java_sun_awt_X11_XlibWrapper_DefaultScreen; - Java_sun_awt_X11_XlibWrapper_ScreenOfDisplay; - Java_sun_awt_X11_XlibWrapper_DoesBackingStore; + Java_sun_awt_X11_XlibWrapper_ScreenOfDisplay; + Java_sun_awt_X11_XlibWrapper_DoesBackingStore; Java_sun_awt_X11_XlibWrapper_RootWindow; Java_sun_awt_X11_XlibWrapper_DisplayHeight; Java_sun_awt_X11_XlibWrapper_DisplayWidthMM; @@ -172,7 +172,7 @@ Java_java_awt_Scrollbar_initIDs; Java_java_awt_Window_initIDs; Java_java_awt_Frame_initIDs; - Java_sun_awt_SunToolkit_closeSplashScreen; + Java_sun_awt_SunToolkit_closeSplashScreen; Java_sun_awt_UNIXToolkit_check_1gtk; Java_sun_awt_UNIXToolkit_load_1gtk; Java_sun_awt_UNIXToolkit_unload_1gtk; @@ -196,17 +196,16 @@ Java_sun_font_FontConfigManager_getFontConfig; Java_sun_font_FontConfigManager_getFontConfigAASettings; Java_sun_font_FontConfigManager_getFontConfigVersion; - Java_sun_awt_FcFontManager_getFontPathNative; + Java_sun_awt_FcFontManager_getFontPathNative; Java_sun_awt_X11GraphicsEnvironment_initDisplay; Java_sun_awt_X11GraphicsEnvironment_initGLX; - Java_sun_awt_X11GraphicsEnvironment_initXRender; + Java_sun_awt_X11GraphicsEnvironment_initXRender; Java_sun_awt_X11GraphicsEnvironment_checkShmExt; Java_sun_awt_X11GraphicsEnvironment_getNumScreens; Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum; Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama; Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint; Java_sun_awt_X11GraphicsEnvironment_getDisplayString; -# Java_sun_awt_X11GraphicsEnvironment_getNativeFonts; Java_sun_awt_X11GraphicsDevice_initIDs; Java_sun_awt_X11GraphicsDevice_getConfigVisualId; Java_sun_awt_X11GraphicsDevice_getConfigDepth; @@ -231,16 +230,16 @@ Java_sun_awt_X11GraphicsConfig_makeColorModel; Java_sun_awt_X11GraphicsConfig_pGetBounds; Java_sun_awt_X11GraphicsConfig_createBackBuffer; - Java_sun_awt_X11GraphicsConfig_destroyBackBuffer; - Java_sun_awt_X11GraphicsConfig_swapBuffers; - Java_sun_awt_X11GraphicsConfig_isTranslucencyCapable; + Java_sun_awt_X11GraphicsConfig_destroyBackBuffer; + Java_sun_awt_X11GraphicsConfig_swapBuffers; + Java_sun_awt_X11GraphicsConfig_isTranslucencyCapable; Java_sun_awt_X11_XToolkit_getTrayIconDisplayTimeout; Java_java_awt_Insets_initIDs; Java_java_awt_KeyboardFocusManager_initIDs; Java_java_awt_Font_initIDs; # libfontmanager entry points AWTIsHeadless; - AWTCountFonts; + AWTCountFonts; AWTLoadFont; AWTFreeFont; AWTFontAscent; @@ -303,7 +302,7 @@ Java_sun_awt_X11_XlibWrapper_XGetIconSizes; Java_sun_awt_X11_XlibWrapper_XKeycodeToKeysym; Java_sun_awt_X11_XlibWrapper_XKeysymToKeycode; - Java_sun_awt_X11_XlibWrapper_XQueryKeymap; + Java_sun_awt_X11_XlibWrapper_XQueryKeymap; Java_sun_awt_X11_XlibWrapper_XkbGetEffectiveGroup; Java_sun_awt_X11_XlibWrapper_XkbSelectEvents; Java_sun_awt_X11_XlibWrapper_XkbSelectEventDetails; @@ -350,23 +349,23 @@ Java_sun_java2d_x11_X11PMBlitBgLoops_nativeBlitBg; Java_sun_java2d_x11_X11PMBlitLoops_nativeBlit; Java_sun_java2d_x11_X11PMBlitLoops_updateBitmask; - Java_sun_java2d_x11_X11Renderer_XFillSpans; - Java_sun_java2d_x11_X11Renderer_XDrawArc; - Java_sun_java2d_x11_X11Renderer_XDrawLine; - Java_sun_java2d_x11_X11Renderer_XDrawOval; - Java_sun_java2d_x11_X11Renderer_XDrawPoly; - Java_sun_java2d_x11_X11Renderer_XDrawRect; - Java_sun_java2d_x11_X11Renderer_XDrawRoundRect; + Java_sun_java2d_x11_X11Renderer_XFillSpans; + Java_sun_java2d_x11_X11Renderer_XDrawArc; + Java_sun_java2d_x11_X11Renderer_XDrawLine; + Java_sun_java2d_x11_X11Renderer_XDrawOval; + Java_sun_java2d_x11_X11Renderer_XDrawPoly; + Java_sun_java2d_x11_X11Renderer_XDrawRect; + Java_sun_java2d_x11_X11Renderer_XDrawRoundRect; Java_sun_java2d_x11_X11Renderer_XDoPath; - Java_sun_java2d_x11_X11Renderer_XFillArc; - Java_sun_java2d_x11_X11Renderer_XFillOval; - Java_sun_java2d_x11_X11Renderer_XFillPoly; - Java_sun_java2d_x11_X11Renderer_XFillRect; - Java_sun_java2d_x11_X11Renderer_XFillRoundRect; + Java_sun_java2d_x11_X11Renderer_XFillArc; + Java_sun_java2d_x11_X11Renderer_XFillOval; + Java_sun_java2d_x11_X11Renderer_XFillPoly; + Java_sun_java2d_x11_X11Renderer_XFillRect; + Java_sun_java2d_x11_X11Renderer_XFillRoundRect; Java_sun_java2d_x11_X11Renderer_devCopyArea; Java_sun_java2d_x11_X11SurfaceData_initIDs; Java_sun_java2d_x11_X11SurfaceData_isDgaAvailable; - Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable; + Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable; Java_sun_java2d_x11_X11SurfaceData_initSurface; Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode; Java_sun_java2d_x11_X11SurfaceData_XSetXorMode; @@ -377,40 +376,40 @@ Java_sun_java2d_x11_XSurfaceData_XResetClip; Java_sun_java2d_x11_XSurfaceData_XSetClip; Java_sun_java2d_x11_XSurfaceData_flushNativeSurface; - Java_sun_java2d_x11_XSurfaceData_isDrawableValid; + Java_sun_java2d_x11_XSurfaceData_isDrawableValid; Java_sun_java2d_x11_XSurfaceData_setInvalid; Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures; Java_sun_java2d_xr_XRSurfaceData_initXRPicture; Java_sun_java2d_xr_XRSurfaceData_initIDs; Java_sun_java2d_xr_XRSurfaceData_XRInitSurface; - Java_sun_java2d_xr_XRSurfaceData_freeXSDOPicture; - Java_sun_java2d_xr_XRBackendNative_initIDs; - Java_sun_java2d_xr_XRBackendNative_freeGC; - Java_sun_java2d_xr_XRBackendNative_createGC; - Java_sun_java2d_xr_XRBackendNative_createPixmap; - Java_sun_java2d_xr_XRBackendNative_createPictureNative; - Java_sun_java2d_xr_XRBackendNative_freePicture; - Java_sun_java2d_xr_XRBackendNative_freePixmap; - Java_sun_java2d_xr_XRBackendNative_setPictureRepeat; - Java_sun_java2d_xr_XRBackendNative_setGCExposures; - Java_sun_java2d_xr_XRBackendNative_setGCForeground; - Java_sun_java2d_xr_XRBackendNative_copyArea; - Java_sun_java2d_xr_XRBackendNative_renderComposite; - Java_sun_java2d_xr_XRBackendNative_renderRectangle; - Java_sun_java2d_xr_XRBackendNative_XRenderRectanglesNative; - Java_sun_java2d_xr_XRBackendNative_XRSetTransformNative; - Java_sun_java2d_xr_XRBackendNative_XRCreateLinearGradientPaintNative; - Java_sun_java2d_xr_XRBackendNative_XRCreateRadialGradientPaintNative; - Java_sun_java2d_xr_XRBackendNative_setFilter; - Java_sun_java2d_xr_XRBackendNative_XRSetClipNative; - Java_sun_java2d_xr_XRBackendNative_putMaskNative; - Java_sun_java2d_xr_XRBackendNative_XRAddGlyphsNative; - Java_sun_java2d_xr_XRBackendNative_XRFreeGlyphsNative; - Java_sun_java2d_xr_XRBackendNative_XRenderCreateGlyphSetNative; - Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative; - Java_sun_java2d_xr_XRBackendNative_setGCMode; - Java_sun_java2d_xr_XRBackendNative_GCRectanglesNative; - Java_sun_java2d_xr_XRBackendNative_renderCompositeTrapezoidsNative; + Java_sun_java2d_xr_XRSurfaceData_freeXSDOPicture; + Java_sun_java2d_xr_XRBackendNative_initIDs; + Java_sun_java2d_xr_XRBackendNative_freeGC; + Java_sun_java2d_xr_XRBackendNative_createGC; + Java_sun_java2d_xr_XRBackendNative_createPixmap; + Java_sun_java2d_xr_XRBackendNative_createPictureNative; + Java_sun_java2d_xr_XRBackendNative_freePicture; + Java_sun_java2d_xr_XRBackendNative_freePixmap; + Java_sun_java2d_xr_XRBackendNative_setPictureRepeat; + Java_sun_java2d_xr_XRBackendNative_setGCExposures; + Java_sun_java2d_xr_XRBackendNative_setGCForeground; + Java_sun_java2d_xr_XRBackendNative_copyArea; + Java_sun_java2d_xr_XRBackendNative_renderComposite; + Java_sun_java2d_xr_XRBackendNative_renderRectangle; + Java_sun_java2d_xr_XRBackendNative_XRenderRectanglesNative; + Java_sun_java2d_xr_XRBackendNative_XRSetTransformNative; + Java_sun_java2d_xr_XRBackendNative_XRCreateLinearGradientPaintNative; + Java_sun_java2d_xr_XRBackendNative_XRCreateRadialGradientPaintNative; + Java_sun_java2d_xr_XRBackendNative_setFilter; + Java_sun_java2d_xr_XRBackendNative_XRSetClipNative; + Java_sun_java2d_xr_XRBackendNative_putMaskNative; + Java_sun_java2d_xr_XRBackendNative_XRAddGlyphsNative; + Java_sun_java2d_xr_XRBackendNative_XRFreeGlyphsNative; + Java_sun_java2d_xr_XRBackendNative_XRenderCreateGlyphSetNative; + Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative; + Java_sun_java2d_xr_XRBackendNative_setGCMode; + Java_sun_java2d_xr_XRBackendNative_GCRectanglesNative; + Java_sun_java2d_xr_XRBackendNative_renderCompositeTrapezoidsNative; Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1arrow; Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1box; @@ -444,25 +443,28 @@ Java_sun_awt_X11_GtkFileDialogPeer_toFront; Java_sun_awt_X11_GtkFileDialogPeer_setBounds; - Java_sun_print_CUPSPrinter_initIDs; - Java_sun_print_CUPSPrinter_getCupsServer; - Java_sun_print_CUPSPrinter_getCupsPort; - Java_sun_print_CUPSPrinter_getCupsDefaultPrinter; - Java_sun_print_CUPSPrinter_canConnect; - Java_sun_print_CUPSPrinter_getMedia; - Java_sun_print_CUPSPrinter_getPageSizes; - Java_sun_print_CUPSPrinter_getResolutions; + Java_sun_print_CUPSPrinter_initIDs; + Java_sun_print_CUPSPrinter_getCupsServer; + Java_sun_print_CUPSPrinter_getCupsPort; + Java_sun_print_CUPSPrinter_getCupsDefaultPrinter; + Java_sun_print_CUPSPrinter_canConnect; + Java_sun_print_CUPSPrinter_getMedia; + Java_sun_print_CUPSPrinter_getPageSizes; + Java_sun_print_CUPSPrinter_getResolutions; awt_GetDrawingSurface; awt_FreeDrawingSurface; awt_Unlock; awt_Lock; awt_GetComponent; + awt_CreateEmbeddedFrame; + awt_SetBounds; + awt_SynthesizeWindowActivation; #XAWT entry point for CDE Java_sun_awt_motif_XsessionWMcommand; Java_sun_awt_motif_XsessionWMcommand_New; - local: - *; + local: + *; }; diff -r b079fff22b3c -r de9ff562c112 jdk/make/mapfiles/libjawt/mapfile-vers --- a/jdk/make/mapfiles/libjawt/mapfile-vers Thu Sep 01 23:20:11 2016 +0000 +++ b/jdk/make/mapfiles/libjawt/mapfile-vers Fri Sep 02 02:41:37 2016 +0000 @@ -26,8 +26,8 @@ # Define library interface. SUNWprivate_1.1 { - global: - JAWT_GetAWT; - local: - *; + global: + JAWT_GetAWT; + local: + *; }; diff -r b079fff22b3c -r de9ff562c112 jdk/make/mapfiles/libjpeg/mapfile-vers --- a/jdk/make/mapfiles/libjpeg/mapfile-vers Thu Sep 01 23:20:11 2016 +0000 +++ b/jdk/make/mapfiles/libjpeg/mapfile-vers Fri Sep 02 02:41:37 2016 +0000 @@ -26,30 +26,30 @@ # Define public interface. SUNWprivate_1.1 { - global: - JNI_OnLoad; + global: + JNI_OnLoad; - Java_sun_awt_image_JPEGImageDecoder_initIDs; - Java_sun_awt_image_JPEGImageDecoder_readImage; + Java_sun_awt_image_JPEGImageDecoder_initIDs; + Java_sun_awt_image_JPEGImageDecoder_readImage; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initReaderIDs; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_setSource; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImageHeader; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_setOutColorSpace; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_abortRead; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_resetReader; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_disposeReader; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_resetLibraryState; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_initWriterIDs; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_initJPEGImageWriter; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_setDest; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeTables; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_abortWrite; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_resetWriter; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_disposeWriter; - local: - *; + Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initReaderIDs; + Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader; + Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_setSource; + Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImageHeader; + Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_setOutColorSpace; + Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage; + Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_abortRead; + Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_resetReader; + Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_disposeReader; + Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_resetLibraryState; + Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_initWriterIDs; + Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_initJPEGImageWriter; + Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_setDest; + Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeTables; + Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage; + Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_abortWrite; + Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_resetWriter; + Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_disposeWriter; + local: + *; }; diff -r b079fff22b3c -r de9ff562c112 jdk/make/mapfiles/libjsound/mapfile-vers --- a/jdk/make/mapfiles/libjsound/mapfile-vers Thu Sep 01 23:20:11 2016 +0000 +++ b/jdk/make/mapfiles/libjsound/mapfile-vers Fri Sep 02 02:41:37 2016 +0000 @@ -26,60 +26,60 @@ # Define library interface. SUNWprivate_1.1 { - global: - Java_com_sun_media_sound_DirectAudioDevice_nAvailable; - Java_com_sun_media_sound_DirectAudioDevice_nClose; - Java_com_sun_media_sound_DirectAudioDevice_nFlush; - Java_com_sun_media_sound_DirectAudioDevice_nGetBufferSize; - Java_com_sun_media_sound_DirectAudioDevice_nGetBytePosition; - Java_com_sun_media_sound_DirectAudioDevice_nGetFormats; - Java_com_sun_media_sound_DirectAudioDevice_nIsStillDraining; - Java_com_sun_media_sound_DirectAudioDevice_nOpen; - Java_com_sun_media_sound_DirectAudioDevice_nRead; - Java_com_sun_media_sound_DirectAudioDevice_nRequiresServicing; - Java_com_sun_media_sound_DirectAudioDevice_nService; - Java_com_sun_media_sound_DirectAudioDevice_nSetBytePosition; - Java_com_sun_media_sound_DirectAudioDevice_nStart; - Java_com_sun_media_sound_DirectAudioDevice_nStop; - Java_com_sun_media_sound_DirectAudioDevice_nWrite; - Java_com_sun_media_sound_DirectAudioDeviceProvider_nGetNumDevices; - Java_com_sun_media_sound_DirectAudioDeviceProvider_nNewDirectAudioDeviceInfo; - Java_com_sun_media_sound_MidiInDevice_nClose; - Java_com_sun_media_sound_MidiInDevice_nGetMessages; - Java_com_sun_media_sound_MidiInDevice_nGetTimeStamp; - Java_com_sun_media_sound_MidiInDevice_nOpen; - Java_com_sun_media_sound_MidiInDevice_nStart; - Java_com_sun_media_sound_MidiInDevice_nStop; - Java_com_sun_media_sound_MidiInDeviceProvider_nGetDescription; - Java_com_sun_media_sound_MidiInDeviceProvider_nGetName; - Java_com_sun_media_sound_MidiInDeviceProvider_nGetNumDevices; - Java_com_sun_media_sound_MidiInDeviceProvider_nGetVendor; - Java_com_sun_media_sound_MidiInDeviceProvider_nGetVersion; - Java_com_sun_media_sound_MidiOutDevice_nClose; - Java_com_sun_media_sound_MidiOutDevice_nGetTimeStamp; - Java_com_sun_media_sound_MidiOutDevice_nOpen; - Java_com_sun_media_sound_MidiOutDevice_nSendLongMessage; - Java_com_sun_media_sound_MidiOutDevice_nSendShortMessage; - Java_com_sun_media_sound_MidiOutDeviceProvider_nGetDescription; - Java_com_sun_media_sound_MidiOutDeviceProvider_nGetName; - Java_com_sun_media_sound_MidiOutDeviceProvider_nGetNumDevices; - Java_com_sun_media_sound_MidiOutDeviceProvider_nGetVendor; - Java_com_sun_media_sound_MidiOutDeviceProvider_nGetVersion; - Java_com_sun_media_sound_Platform_nGetExtraLibraries; - Java_com_sun_media_sound_Platform_nGetLibraryForFeature; - Java_com_sun_media_sound_Platform_nIsBigEndian; - Java_com_sun_media_sound_PortMixer_nClose; - Java_com_sun_media_sound_PortMixer_nControlGetFloatValue; - Java_com_sun_media_sound_PortMixer_nControlGetIntValue; - Java_com_sun_media_sound_PortMixer_nControlSetFloatValue; - Java_com_sun_media_sound_PortMixer_nControlSetIntValue; - Java_com_sun_media_sound_PortMixer_nGetControls; - Java_com_sun_media_sound_PortMixer_nGetPortCount; - Java_com_sun_media_sound_PortMixer_nGetPortName; - Java_com_sun_media_sound_PortMixer_nGetPortType; - Java_com_sun_media_sound_PortMixer_nOpen; - Java_com_sun_media_sound_PortMixerProvider_nGetNumDevices; - Java_com_sun_media_sound_PortMixerProvider_nNewPortMixerInfo; - local: - *; + global: + Java_com_sun_media_sound_DirectAudioDevice_nAvailable; + Java_com_sun_media_sound_DirectAudioDevice_nClose; + Java_com_sun_media_sound_DirectAudioDevice_nFlush; + Java_com_sun_media_sound_DirectAudioDevice_nGetBufferSize; + Java_com_sun_media_sound_DirectAudioDevice_nGetBytePosition; + Java_com_sun_media_sound_DirectAudioDevice_nGetFormats; + Java_com_sun_media_sound_DirectAudioDevice_nIsStillDraining; + Java_com_sun_media_sound_DirectAudioDevice_nOpen; + Java_com_sun_media_sound_DirectAudioDevice_nRead; + Java_com_sun_media_sound_DirectAudioDevice_nRequiresServicing; + Java_com_sun_media_sound_DirectAudioDevice_nService; + Java_com_sun_media_sound_DirectAudioDevice_nSetBytePosition; + Java_com_sun_media_sound_DirectAudioDevice_nStart; + Java_com_sun_media_sound_DirectAudioDevice_nStop; + Java_com_sun_media_sound_DirectAudioDevice_nWrite; + Java_com_sun_media_sound_DirectAudioDeviceProvider_nGetNumDevices; + Java_com_sun_media_sound_DirectAudioDeviceProvider_nNewDirectAudioDeviceInfo; + Java_com_sun_media_sound_MidiInDevice_nClose; + Java_com_sun_media_sound_MidiInDevice_nGetMessages; + Java_com_sun_media_sound_MidiInDevice_nGetTimeStamp; + Java_com_sun_media_sound_MidiInDevice_nOpen; + Java_com_sun_media_sound_MidiInDevice_nStart; + Java_com_sun_media_sound_MidiInDevice_nStop; + Java_com_sun_media_sound_MidiInDeviceProvider_nGetDescription; + Java_com_sun_media_sound_MidiInDeviceProvider_nGetName; + Java_com_sun_media_sound_MidiInDeviceProvider_nGetNumDevices; + Java_com_sun_media_sound_MidiInDeviceProvider_nGetVendor; + Java_com_sun_media_sound_MidiInDeviceProvider_nGetVersion; + Java_com_sun_media_sound_MidiOutDevice_nClose; + Java_com_sun_media_sound_MidiOutDevice_nGetTimeStamp; + Java_com_sun_media_sound_MidiOutDevice_nOpen; + Java_com_sun_media_sound_MidiOutDevice_nSendLongMessage; + Java_com_sun_media_sound_MidiOutDevice_nSendShortMessage; + Java_com_sun_media_sound_MidiOutDeviceProvider_nGetDescription; + Java_com_sun_media_sound_MidiOutDeviceProvider_nGetName; + Java_com_sun_media_sound_MidiOutDeviceProvider_nGetNumDevices; + Java_com_sun_media_sound_MidiOutDeviceProvider_nGetVendor; + Java_com_sun_media_sound_MidiOutDeviceProvider_nGetVersion; + Java_com_sun_media_sound_Platform_nGetExtraLibraries; + Java_com_sun_media_sound_Platform_nGetLibraryForFeature; + Java_com_sun_media_sound_Platform_nIsBigEndian; + Java_com_sun_media_sound_PortMixer_nClose; + Java_com_sun_media_sound_PortMixer_nControlGetFloatValue; + Java_com_sun_media_sound_PortMixer_nControlGetIntValue; + Java_com_sun_media_sound_PortMixer_nControlSetFloatValue; + Java_com_sun_media_sound_PortMixer_nControlSetIntValue; + Java_com_sun_media_sound_PortMixer_nGetControls; + Java_com_sun_media_sound_PortMixer_nGetPortCount; + Java_com_sun_media_sound_PortMixer_nGetPortName; + Java_com_sun_media_sound_PortMixer_nGetPortType; + Java_com_sun_media_sound_PortMixer_nOpen; + Java_com_sun_media_sound_PortMixerProvider_nGetNumDevices; + Java_com_sun_media_sound_PortMixerProvider_nNewPortMixerInfo; + local: + *; }; diff -r b079fff22b3c -r de9ff562c112 jdk/make/mapfiles/libjsoundalsa/mapfile-vers --- a/jdk/make/mapfiles/libjsoundalsa/mapfile-vers Thu Sep 01 23:20:11 2016 +0000 +++ b/jdk/make/mapfiles/libjsoundalsa/mapfile-vers Fri Sep 02 02:41:37 2016 +0000 @@ -26,57 +26,57 @@ # Define library interface. SUNWprivate_1.1 { - global: - Java_com_sun_media_sound_DirectAudioDeviceProvider_nGetNumDevices; - Java_com_sun_media_sound_DirectAudioDeviceProvider_nNewDirectAudioDeviceInfo; - Java_com_sun_media_sound_DirectAudioDevice_nAvailable; - Java_com_sun_media_sound_DirectAudioDevice_nClose; - Java_com_sun_media_sound_DirectAudioDevice_nFlush; - Java_com_sun_media_sound_DirectAudioDevice_nGetBufferSize; - Java_com_sun_media_sound_DirectAudioDevice_nGetBytePosition; - Java_com_sun_media_sound_DirectAudioDevice_nGetFormats; - Java_com_sun_media_sound_DirectAudioDevice_nIsStillDraining; - Java_com_sun_media_sound_DirectAudioDevice_nOpen; - Java_com_sun_media_sound_DirectAudioDevice_nRead; - Java_com_sun_media_sound_DirectAudioDevice_nRequiresServicing; - Java_com_sun_media_sound_DirectAudioDevice_nService; - Java_com_sun_media_sound_DirectAudioDevice_nSetBytePosition; - Java_com_sun_media_sound_DirectAudioDevice_nStart; - Java_com_sun_media_sound_DirectAudioDevice_nStop; - Java_com_sun_media_sound_DirectAudioDevice_nWrite; - Java_com_sun_media_sound_MidiInDeviceProvider_nGetDescription; - Java_com_sun_media_sound_MidiInDeviceProvider_nGetName; - Java_com_sun_media_sound_MidiInDeviceProvider_nGetNumDevices; - Java_com_sun_media_sound_MidiInDeviceProvider_nGetVendor; - Java_com_sun_media_sound_MidiInDeviceProvider_nGetVersion; - Java_com_sun_media_sound_MidiInDevice_nClose; - Java_com_sun_media_sound_MidiInDevice_nGetMessages; - Java_com_sun_media_sound_MidiInDevice_nGetTimeStamp; - Java_com_sun_media_sound_MidiInDevice_nOpen; - Java_com_sun_media_sound_MidiInDevice_nStart; - Java_com_sun_media_sound_MidiInDevice_nStop; - Java_com_sun_media_sound_MidiOutDeviceProvider_nGetDescription; - Java_com_sun_media_sound_MidiOutDeviceProvider_nGetName; - Java_com_sun_media_sound_MidiOutDeviceProvider_nGetNumDevices; - Java_com_sun_media_sound_MidiOutDeviceProvider_nGetVendor; - Java_com_sun_media_sound_MidiOutDeviceProvider_nGetVersion; - Java_com_sun_media_sound_MidiOutDevice_nClose; - Java_com_sun_media_sound_MidiOutDevice_nGetTimeStamp; - Java_com_sun_media_sound_MidiOutDevice_nOpen; - Java_com_sun_media_sound_MidiOutDevice_nSendLongMessage; - Java_com_sun_media_sound_MidiOutDevice_nSendShortMessage; - Java_com_sun_media_sound_PortMixerProvider_nGetNumDevices; - Java_com_sun_media_sound_PortMixerProvider_nNewPortMixerInfo; - Java_com_sun_media_sound_PortMixer_nClose; - Java_com_sun_media_sound_PortMixer_nControlGetFloatValue; - Java_com_sun_media_sound_PortMixer_nControlGetIntValue; - Java_com_sun_media_sound_PortMixer_nControlSetFloatValue; - Java_com_sun_media_sound_PortMixer_nControlSetIntValue; - Java_com_sun_media_sound_PortMixer_nGetControls; - Java_com_sun_media_sound_PortMixer_nGetPortCount; - Java_com_sun_media_sound_PortMixer_nGetPortName; - Java_com_sun_media_sound_PortMixer_nGetPortType; - Java_com_sun_media_sound_PortMixer_nOpen; - local: - *; + global: + Java_com_sun_media_sound_DirectAudioDeviceProvider_nGetNumDevices; + Java_com_sun_media_sound_DirectAudioDeviceProvider_nNewDirectAudioDeviceInfo; + Java_com_sun_media_sound_DirectAudioDevice_nAvailable; + Java_com_sun_media_sound_DirectAudioDevice_nClose; + Java_com_sun_media_sound_DirectAudioDevice_nFlush; + Java_com_sun_media_sound_DirectAudioDevice_nGetBufferSize; + Java_com_sun_media_sound_DirectAudioDevice_nGetBytePosition; + Java_com_sun_media_sound_DirectAudioDevice_nGetFormats; + Java_com_sun_media_sound_DirectAudioDevice_nIsStillDraining; + Java_com_sun_media_sound_DirectAudioDevice_nOpen; + Java_com_sun_media_sound_DirectAudioDevice_nRead; + Java_com_sun_media_sound_DirectAudioDevice_nRequiresServicing; + Java_com_sun_media_sound_DirectAudioDevice_nService; + Java_com_sun_media_sound_DirectAudioDevice_nSetBytePosition; + Java_com_sun_media_sound_DirectAudioDevice_nStart; + Java_com_sun_media_sound_DirectAudioDevice_nStop; + Java_com_sun_media_sound_DirectAudioDevice_nWrite; + Java_com_sun_media_sound_MidiInDeviceProvider_nGetDescription; + Java_com_sun_media_sound_MidiInDeviceProvider_nGetName; + Java_com_sun_media_sound_MidiInDeviceProvider_nGetNumDevices; + Java_com_sun_media_sound_MidiInDeviceProvider_nGetVendor; + Java_com_sun_media_sound_MidiInDeviceProvider_nGetVersion; + Java_com_sun_media_sound_MidiInDevice_nClose; + Java_com_sun_media_sound_MidiInDevice_nGetMessages; + Java_com_sun_media_sound_MidiInDevice_nGetTimeStamp; + Java_com_sun_media_sound_MidiInDevice_nOpen; + Java_com_sun_media_sound_MidiInDevice_nStart; + Java_com_sun_media_sound_MidiInDevice_nStop; + Java_com_sun_media_sound_MidiOutDeviceProvider_nGetDescription; + Java_com_sun_media_sound_MidiOutDeviceProvider_nGetName; + Java_com_sun_media_sound_MidiOutDeviceProvider_nGetNumDevices; + Java_com_sun_media_sound_MidiOutDeviceProvider_nGetVendor; + Java_com_sun_media_sound_MidiOutDeviceProvider_nGetVersion; + Java_com_sun_media_sound_MidiOutDevice_nClose; + Java_com_sun_media_sound_MidiOutDevice_nGetTimeStamp; + Java_com_sun_media_sound_MidiOutDevice_nOpen; + Java_com_sun_media_sound_MidiOutDevice_nSendLongMessage; + Java_com_sun_media_sound_MidiOutDevice_nSendShortMessage; + Java_com_sun_media_sound_PortMixerProvider_nGetNumDevices; + Java_com_sun_media_sound_PortMixerProvider_nNewPortMixerInfo; + Java_com_sun_media_sound_PortMixer_nClose; + Java_com_sun_media_sound_PortMixer_nControlGetFloatValue; + Java_com_sun_media_sound_PortMixer_nControlGetIntValue; + Java_com_sun_media_sound_PortMixer_nControlSetFloatValue; + Java_com_sun_media_sound_PortMixer_nControlSetIntValue; + Java_com_sun_media_sound_PortMixer_nGetControls; + Java_com_sun_media_sound_PortMixer_nGetPortCount; + Java_com_sun_media_sound_PortMixer_nGetPortName; + Java_com_sun_media_sound_PortMixer_nGetPortType; + Java_com_sun_media_sound_PortMixer_nOpen; + local: + *; }; diff -r b079fff22b3c -r de9ff562c112 jdk/make/mapfiles/libsplashscreen/mapfile-vers --- a/jdk/make/mapfiles/libsplashscreen/mapfile-vers Thu Sep 01 23:20:11 2016 +0000 +++ b/jdk/make/mapfiles/libsplashscreen/mapfile-vers Fri Sep 02 02:41:37 2016 +0000 @@ -26,24 +26,24 @@ # Define public interface. SUNWprivate_1.1 { - global: - Java_java_awt_SplashScreen__1update; - Java_java_awt_SplashScreen__1isVisible; - Java_java_awt_SplashScreen__1getBounds; - Java_java_awt_SplashScreen__1getInstance; - Java_java_awt_SplashScreen__1close; - Java_java_awt_SplashScreen__1getImageFileName; - Java_java_awt_SplashScreen__1getImageJarName; - Java_java_awt_SplashScreen__1setImageData; - Java_java_awt_SplashScreen__1getScaleFactor; + global: + Java_java_awt_SplashScreen__1update; + Java_java_awt_SplashScreen__1isVisible; + Java_java_awt_SplashScreen__1getBounds; + Java_java_awt_SplashScreen__1getInstance; + Java_java_awt_SplashScreen__1close; + Java_java_awt_SplashScreen__1getImageFileName; + Java_java_awt_SplashScreen__1getImageJarName; + Java_java_awt_SplashScreen__1setImageData; + Java_java_awt_SplashScreen__1getScaleFactor; - SplashLoadMemory; - SplashLoadFile; - SplashInit; - SplashClose; - SplashSetFileJarName; - SplashSetScaleFactor; - SplashGetScaledImageName; - local: - *; + SplashLoadMemory; + SplashLoadFile; + SplashInit; + SplashClose; + SplashSetFileJarName; + SplashSetScaleFactor; + SplashGetScaledImageName; + local: + *; }; diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java Thu Sep 01 23:20:11 2016 +0000 +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java Fri Sep 02 02:41:37 2016 +0000 @@ -1207,11 +1207,16 @@ * the following conditions: *
* If the field is declared {@code volatile} then the returned VarHandle @@ -1326,11 +1331,16 @@ * the following conditions: *
* If the field is declared {@code volatile} then the returned VarHandle @@ -1631,11 +1641,16 @@ * the following conditions: *
* If the field is declared {@code volatile} then the returned VarHandle @@ -2353,9 +2368,13 @@ * the following conditions: *
* If the component type is {@code float} or {@code double} then numeric @@ -2426,7 +2445,9 @@ * If access is aligned then following access modes are supported and are * guaranteed to support atomic access: *
* Misaligned access, and therefore atomicity guarantees, may be determined @@ -2508,7 +2532,9 @@ * If access is aligned then following access modes are supported and are * guaranteed to support atomic access: *
* Misaligned access, and therefore atomicity guarantees, may be determined diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java --- a/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java Thu Sep 01 23:20:11 2016 +0000 +++ b/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java Fri Sep 02 02:41:37 2016 +0000 @@ -134,21 +134,39 @@ * The set of corresponding access mode methods belonging to this group * consists of the methods * {@link #compareAndSet compareAndSet}, + * {@link #weakCompareAndSetPlain weakCompareAndSetPlain}, * {@link #weakCompareAndSet weakCompareAndSet}, - * {@link #weakCompareAndSetVolatile weakCompareAndSetVolatile}, * {@link #weakCompareAndSetAcquire weakCompareAndSetAcquire}, * {@link #weakCompareAndSetRelease weakCompareAndSetRelease}, * {@link #compareAndExchangeAcquire compareAndExchangeAcquire}, * {@link #compareAndExchange compareAndExchange}, * {@link #compareAndExchangeRelease compareAndExchangeRelease}, - * {@link #getAndSet getAndSet}. + * {@link #getAndSet getAndSet}, + * {@link #getAndSetAcquire getAndSetAcquire}, + * {@link #getAndSetRelease getAndSetRelease}. *
Factory methods that produce or {@link java.lang.invoke.MethodHandles.Lookup @@ -163,8 +181,8 @@ * VarHandle instances and the corresponding method never throws * {@code UnsupportedOperationException}. * If a VarHandle references a read-only variable (for example a {@code final} - * field) then write, atomic update and numeric atomic update access modes are - * not supported and corresponding methods throw + * field) then write, atomic update, numeric atomic update, and bitwise atomic + * update access modes are not supported and corresponding methods throw * {@code UnsupportedOperationException}. * Read/write access modes (if supported), with the exception of * {@code get} and {@code set}, provide atomic access for @@ -816,8 +834,8 @@ *
The method signature is of the form {@code (CT, T expectedValue, T newValue)boolean}. * *
The symbolic type descriptor at the call site of {@code - * weakCompareAndSet} must match the access mode type that is the result of - * calling {@code accessModeType(VarHandle.AccessMode.WEAK_COMPARE_AND_SET)} + * weakCompareAndSetPlain} must match the access mode type that is the result of + * calling {@code accessModeType(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN)} * on this VarHandle. * * @param args the signature-polymorphic parameter list of the form @@ -838,7 +856,7 @@ public final native @MethodHandle.PolymorphicSignature @HotSpotIntrinsicCandidate - boolean weakCompareAndSet(Object... args); + boolean weakCompareAndSetPlain(Object... args); /** * Possibly atomically sets the value of a variable to the {@code newValue} @@ -853,8 +871,8 @@ *
The method signature is of the form {@code (CT, T expectedValue, T newValue)boolean}. * *
The symbolic type descriptor at the call site of {@code - * weakCompareAndSetVolatile} must match the access mode type that is the - * result of calling {@code accessModeType(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE)} + * weakCompareAndSet} must match the access mode type that is the + * result of calling {@code accessModeType(VarHandle.AccessMode.WEAK_COMPARE_AND_SET)} * on this VarHandle. * * @param args the signature-polymorphic parameter list of the form @@ -875,7 +893,7 @@ public final native @MethodHandle.PolymorphicSignature @HotSpotIntrinsicCandidate - boolean weakCompareAndSetVolatile(Object... args); + boolean weakCompareAndSet(Object... args); /** * Possibly atomically sets the value of a variable to the {@code newValue} @@ -986,6 +1004,71 @@ @HotSpotIntrinsicCandidate Object getAndSet(Object... args); + /** + * Atomically sets the value of a variable to the {@code newValue} with the + * memory semantics of {@link #set} and returns the variable's + * previous value, as accessed with the memory semantics of + * {@link #getAcquire}. + * + *
The method signature is of the form {@code (CT, T newValue)T}. + * + *
The symbolic type descriptor at the call site of {@code getAndSetAcquire} + * must match the access mode type that is the result of calling + * {@code accessModeType(VarHandle.AccessMode.GET_AND_SET_ACQUIRE)} on this + * VarHandle. + * + * @param args the signature-polymorphic parameter list of the form + * {@code (CT, T newValue)} + * , statically represented using varargs. + * @return the signature-polymorphic result that is the previous value of + * the variable + * , statically represented using {@code Object}. + * @throws UnsupportedOperationException if the access mode is unsupported + * for this VarHandle. + * @throws WrongMethodTypeException if the access mode type is not + * compatible with the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type is compatible with the + * caller's symbolic type descriptor, but a reference cast fails. + * @see #setVolatile(Object...) + * @see #getVolatile(Object...) + */ + public final native + @MethodHandle.PolymorphicSignature + @HotSpotIntrinsicCandidate + Object getAndSetAcquire(Object... args); + + /** + * Atomically sets the value of a variable to the {@code newValue} with the + * memory semantics of {@link #setRelease} and returns the variable's + * previous value, as accessed with the memory semantics of + * {@link #get}. + * + *
The method signature is of the form {@code (CT, T newValue)T}. + * + *
The symbolic type descriptor at the call site of {@code getAndSetRelease} + * must match the access mode type that is the result of calling + * {@code accessModeType(VarHandle.AccessMode.GET_AND_SET_RELEASE)} on this + * VarHandle. + * + * @param args the signature-polymorphic parameter list of the form + * {@code (CT, T newValue)} + * , statically represented using varargs. + * @return the signature-polymorphic result that is the previous value of + * the variable + * , statically represented using {@code Object}. + * @throws UnsupportedOperationException if the access mode is unsupported + * for this VarHandle. + * @throws WrongMethodTypeException if the access mode type is not + * compatible with the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type is compatible with the + * caller's symbolic type descriptor, but a reference cast fails. + * @see #setVolatile(Object...) + * @see #getVolatile(Object...) + */ + public final native + @MethodHandle.PolymorphicSignature + @HotSpotIntrinsicCandidate + Object getAndSetRelease(Object... args); // Primitive adders // Throw UnsupportedOperationException for refs @@ -1025,21 +1108,95 @@ /** * Atomically adds the {@code value} to the current value of a variable with - * the memory semantics of {@link #setVolatile}, and returns the variable's - * current (updated) value, as accessed with the memory semantics of - * {@link #getVolatile}. + * the memory semantics of {@link #set}, and returns the variable's + * previous value, as accessed with the memory semantics of + * {@link #getAcquire}. * *
The method signature is of the form {@code (CT, T value)T}. * - *
The symbolic type descriptor at the call site of {@code addAndGet} + *
The symbolic type descriptor at the call site of {@code getAndAddAcquire} * must match the access mode type that is the result of calling - * {@code accessModeType(VarHandle.AccessMode.ADD_AND_GET)} on this + * {@code accessModeType(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE)} on this * VarHandle. * * @param args the signature-polymorphic parameter list of the form * {@code (CT, T value)} * , statically represented using varargs. - * @return the signature-polymorphic result that is the current value of + * @return the signature-polymorphic result that is the previous value of + * the variable + * , statically represented using {@code Object}. + * @throws UnsupportedOperationException if the access mode is unsupported + * for this VarHandle. + * @throws WrongMethodTypeException if the access mode type is not + * compatible with the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type is compatible with the + * caller's symbolic type descriptor, but a reference cast fails. + * @see #setVolatile(Object...) + * @see #getVolatile(Object...) + */ + public final native + @MethodHandle.PolymorphicSignature + @HotSpotIntrinsicCandidate + Object getAndAddAcquire(Object... args); + + /** + * Atomically adds the {@code value} to the current value of a variable with + * the memory semantics of {@link #setRelease}, and returns the variable's + * previous value, as accessed with the memory semantics of + * {@link #get}. + * + *
The method signature is of the form {@code (CT, T value)T}. + * + *
The symbolic type descriptor at the call site of {@code getAndAddRelease} + * must match the access mode type that is the result of calling + * {@code accessModeType(VarHandle.AccessMode.GET_AND_ADD_RELEASE)} on this + * VarHandle. + * + * @param args the signature-polymorphic parameter list of the form + * {@code (CT, T value)} + * , statically represented using varargs. + * @return the signature-polymorphic result that is the previous value of + * the variable + * , statically represented using {@code Object}. + * @throws UnsupportedOperationException if the access mode is unsupported + * for this VarHandle. + * @throws WrongMethodTypeException if the access mode type is not + * compatible with the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type is compatible with the + * caller's symbolic type descriptor, but a reference cast fails. + * @see #setVolatile(Object...) + * @see #getVolatile(Object...) + */ + public final native + @MethodHandle.PolymorphicSignature + @HotSpotIntrinsicCandidate + Object getAndAddRelease(Object... args); + + + // Bitwise operations + // Throw UnsupportedOperationException for refs + + /** + * Atomically sets the value of a variable to the result of + * bitwise OR between the variable's current value and the {@code mask} + * with the memory semantics of {@link #setVolatile} and returns the + * variable's previous value, as accessed with the memory semantics of + * {@link #getVolatile}. + * + *
If the variable type is the non-integral {@code boolean} type then a + * logical OR is performed instead of a bitwise OR. + * + *
The method signature is of the form {@code (CT, T mask)T}. + * + *
The symbolic type descriptor at the call site of {@code getAndBitwiseOr} + * must match the access mode type that is the result of calling + * {@code accessModeType(VarHandle.AccessMode.GET_AND_BITWISE_OR)} on this + * VarHandle. + * + * @param args the signature-polymorphic parameter list of the form + * {@code (CT, T mask)} + * , statically represented using varargs. + * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported @@ -1054,7 +1211,304 @@ public final native @MethodHandle.PolymorphicSignature @HotSpotIntrinsicCandidate - Object addAndGet(Object... args); + Object getAndBitwiseOr(Object... args); + + /** + * Atomically sets the value of a variable to the result of + * bitwise OR between the variable's current value and the {@code mask} + * with the memory semantics of {@link #set} and returns the + * variable's previous value, as accessed with the memory semantics of + * {@link #getAcquire}. + * + *
If the variable type is the non-integral {@code boolean} type then a + * logical OR is performed instead of a bitwise OR. + * + *
The method signature is of the form {@code (CT, T mask)T}. + * + *
The symbolic type descriptor at the call site of {@code getAndBitwiseOrAcquire} + * must match the access mode type that is the result of calling + * {@code accessModeType(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE)} on this + * VarHandle. + * + * @param args the signature-polymorphic parameter list of the form + * {@code (CT, T mask)} + * , statically represented using varargs. + * @return the signature-polymorphic result that is the previous value of + * the variable + * , statically represented using {@code Object}. + * @throws UnsupportedOperationException if the access mode is unsupported + * for this VarHandle. + * @throws WrongMethodTypeException if the access mode type is not + * compatible with the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type is compatible with the + * caller's symbolic type descriptor, but a reference cast fails. + * @see #set(Object...) + * @see #getAcquire(Object...) + */ + public final native + @MethodHandle.PolymorphicSignature + @HotSpotIntrinsicCandidate + Object getAndBitwiseOrAcquire(Object... args); + + /** + * Atomically sets the value of a variable to the result of + * bitwise OR between the variable's current value and the {@code mask} + * with the memory semantics of {@link #setRelease} and returns the + * variable's previous value, as accessed with the memory semantics of + * {@link #get}. + * + *
If the variable type is the non-integral {@code boolean} type then a + * logical OR is performed instead of a bitwise OR. + * + *
The method signature is of the form {@code (CT, T mask)T}. + * + *
The symbolic type descriptor at the call site of {@code getAndBitwiseOrRelease} + * must match the access mode type that is the result of calling + * {@code accessModeType(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE)} on this + * VarHandle. + * + * @param args the signature-polymorphic parameter list of the form + * {@code (CT, T mask)} + * , statically represented using varargs. + * @return the signature-polymorphic result that is the previous value of + * the variable + * , statically represented using {@code Object}. + * @throws UnsupportedOperationException if the access mode is unsupported + * for this VarHandle. + * @throws WrongMethodTypeException if the access mode type is not + * compatible with the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type is compatible with the + * caller's symbolic type descriptor, but a reference cast fails. + * @see #setRelease(Object...) + * @see #get(Object...) + */ + public final native + @MethodHandle.PolymorphicSignature + @HotSpotIntrinsicCandidate + Object getAndBitwiseOrRelease(Object... args); + + /** + * Atomically sets the value of a variable to the result of + * bitwise AND between the variable's current value and the {@code mask} + * with the memory semantics of {@link #setVolatile} and returns the + * variable's previous value, as accessed with the memory semantics of + * {@link #getVolatile}. + * + *
If the variable type is the non-integral {@code boolean} type then a + * logical AND is performed instead of a bitwise AND. + * + *
The method signature is of the form {@code (CT, T mask)T}. + * + *
The symbolic type descriptor at the call site of {@code getAndBitwiseAnd} + * must match the access mode type that is the result of calling + * {@code accessModeType(VarHandle.AccessMode.GET_AND_BITWISE_AND)} on this + * VarHandle. + * + * @param args the signature-polymorphic parameter list of the form + * {@code (CT, T mask)} + * , statically represented using varargs. + * @return the signature-polymorphic result that is the previous value of + * the variable + * , statically represented using {@code Object}. + * @throws UnsupportedOperationException if the access mode is unsupported + * for this VarHandle. + * @throws WrongMethodTypeException if the access mode type is not + * compatible with the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type is compatible with the + * caller's symbolic type descriptor, but a reference cast fails. + * @see #setVolatile(Object...) + * @see #getVolatile(Object...) + */ + public final native + @MethodHandle.PolymorphicSignature + @HotSpotIntrinsicCandidate + Object getAndBitwiseAnd(Object... args); + + /** + * Atomically sets the value of a variable to the result of + * bitwise AND between the variable's current value and the {@code mask} + * with the memory semantics of {@link #set} and returns the + * variable's previous value, as accessed with the memory semantics of + * {@link #getAcquire}. + * + *
If the variable type is the non-integral {@code boolean} type then a + * logical AND is performed instead of a bitwise AND. + * + *
The method signature is of the form {@code (CT, T mask)T}. + * + *
The symbolic type descriptor at the call site of {@code getAndBitwiseAndAcquire} + * must match the access mode type that is the result of calling + * {@code accessModeType(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE)} on this + * VarHandle. + * + * @param args the signature-polymorphic parameter list of the form + * {@code (CT, T mask)} + * , statically represented using varargs. + * @return the signature-polymorphic result that is the previous value of + * the variable + * , statically represented using {@code Object}. + * @throws UnsupportedOperationException if the access mode is unsupported + * for this VarHandle. + * @throws WrongMethodTypeException if the access mode type is not + * compatible with the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type is compatible with the + * caller's symbolic type descriptor, but a reference cast fails. + * @see #set(Object...) + * @see #getAcquire(Object...) + */ + public final native + @MethodHandle.PolymorphicSignature + @HotSpotIntrinsicCandidate + Object getAndBitwiseAndAcquire(Object... args); + + /** + * Atomically sets the value of a variable to the result of + * bitwise AND between the variable's current value and the {@code mask} + * with the memory semantics of {@link #setRelease} and returns the + * variable's previous value, as accessed with the memory semantics of + * {@link #get}. + * + *
If the variable type is the non-integral {@code boolean} type then a + * logical AND is performed instead of a bitwise AND. + * + *
The method signature is of the form {@code (CT, T mask)T}. + * + *
The symbolic type descriptor at the call site of {@code getAndBitwiseAndRelease} + * must match the access mode type that is the result of calling + * {@code accessModeType(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE)} on this + * VarHandle. + * + * @param args the signature-polymorphic parameter list of the form + * {@code (CT, T mask)} + * , statically represented using varargs. + * @return the signature-polymorphic result that is the previous value of + * the variable + * , statically represented using {@code Object}. + * @throws UnsupportedOperationException if the access mode is unsupported + * for this VarHandle. + * @throws WrongMethodTypeException if the access mode type is not + * compatible with the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type is compatible with the + * caller's symbolic type descriptor, but a reference cast fails. + * @see #setRelease(Object...) + * @see #get(Object...) + */ + public final native + @MethodHandle.PolymorphicSignature + @HotSpotIntrinsicCandidate + Object getAndBitwiseAndRelease(Object... args); + + /** + * Atomically sets the value of a variable to the result of + * bitwise XOR between the variable's current value and the {@code mask} + * with the memory semantics of {@link #setVolatile} and returns the + * variable's previous value, as accessed with the memory semantics of + * {@link #getVolatile}. + * + *
If the variable type is the non-integral {@code boolean} type then a + * logical XOR is performed instead of a bitwise XOR. + * + *
The method signature is of the form {@code (CT, T mask)T}. + * + *
The symbolic type descriptor at the call site of {@code getAndBitwiseXor} + * must match the access mode type that is the result of calling + * {@code accessModeType(VarHandle.AccessMode.GET_AND_BITWISE_XOR)} on this + * VarHandle. + * + * @param args the signature-polymorphic parameter list of the form + * {@code (CT, T mask)} + * , statically represented using varargs. + * @return the signature-polymorphic result that is the previous value of + * the variable + * , statically represented using {@code Object}. + * @throws UnsupportedOperationException if the access mode is unsupported + * for this VarHandle. + * @throws WrongMethodTypeException if the access mode type is not + * compatible with the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type is compatible with the + * caller's symbolic type descriptor, but a reference cast fails. + * @see #setVolatile(Object...) + * @see #getVolatile(Object...) + */ + public final native + @MethodHandle.PolymorphicSignature + @HotSpotIntrinsicCandidate + Object getAndBitwiseXor(Object... args); + + /** + * Atomically sets the value of a variable to the result of + * bitwise XOR between the variable's current value and the {@code mask} + * with the memory semantics of {@link #set} and returns the + * variable's previous value, as accessed with the memory semantics of + * {@link #getAcquire}. + * + *
If the variable type is the non-integral {@code boolean} type then a + * logical XOR is performed instead of a bitwise XOR. + * + *
The method signature is of the form {@code (CT, T mask)T}. + * + *
The symbolic type descriptor at the call site of {@code getAndBitwiseXorAcquire} + * must match the access mode type that is the result of calling + * {@code accessModeType(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE)} on this + * VarHandle. + * + * @param args the signature-polymorphic parameter list of the form + * {@code (CT, T mask)} + * , statically represented using varargs. + * @return the signature-polymorphic result that is the previous value of + * the variable + * , statically represented using {@code Object}. + * @throws UnsupportedOperationException if the access mode is unsupported + * for this VarHandle. + * @throws WrongMethodTypeException if the access mode type is not + * compatible with the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type is compatible with the + * caller's symbolic type descriptor, but a reference cast fails. + * @see #set(Object...) + * @see #getAcquire(Object...) + */ + public final native + @MethodHandle.PolymorphicSignature + @HotSpotIntrinsicCandidate + Object getAndBitwiseXorAcquire(Object... args); + + /** + * Atomically sets the value of a variable to the result of + * bitwise XOR between the variable's current value and the {@code mask} + * with the memory semantics of {@link #setRelease} and returns the + * variable's previous value, as accessed with the memory semantics of + * {@link #get}. + * + *
If the variable type is the non-integral {@code boolean} type then a + * logical XOR is performed instead of a bitwise XOR. + * + *
The method signature is of the form {@code (CT, T mask)T}. + * + *
The symbolic type descriptor at the call site of {@code getAndBitwiseXorRelease}
+ * must match the access mode type that is the result of calling
+ * {@code accessModeType(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE)} on this
+ * VarHandle.
+ *
+ * @param args the signature-polymorphic parameter list of the form
+ * {@code (CT, T mask)}
+ * , statically represented using varargs.
+ * @return the signature-polymorphic result that is the previous value of
+ * the variable
+ * , statically represented using {@code Object}.
+ * @throws UnsupportedOperationException if the access mode is unsupported
+ * for this VarHandle.
+ * @throws WrongMethodTypeException if the access mode type is not
+ * compatible with the caller's symbolic type descriptor.
+ * @throws ClassCastException if the access mode type is compatible with the
+ * caller's symbolic type descriptor, but a reference cast fails.
+ * @see #setRelease(Object...)
+ * @see #get(Object...)
+ */
+ public final native
+ @MethodHandle.PolymorphicSignature
+ @HotSpotIntrinsicCandidate
+ Object getAndBitwiseXorRelease(Object... args);
+
enum AccessType {
GET(Object.class),
@@ -1204,18 +1658,18 @@
/**
* The access mode whose access is specified by the corresponding
* method
+ * {@link VarHandle#weakCompareAndSetPlain VarHandle.weakCompareAndSetPlain}
+ */
+ WEAK_COMPARE_AND_SET_PLAIN("weakCompareAndSetPlain", AccessType.COMPARE_AND_SWAP),
+ /**
+ * 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),
/**
* The access mode whose access is specified by the corresponding
* method
- * {@link VarHandle#weakCompareAndSetVolatile VarHandle.weakCompareAndSetVolatile}
- */
- WEAK_COMPARE_AND_SET_VOLATILE("weakCompareAndSetVolatile", AccessType.COMPARE_AND_SWAP),
- /**
- * 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),
@@ -1234,15 +1688,87 @@
/**
* The access mode whose access is specified by the corresponding
* method
+ * {@link VarHandle#getAndSetAcquire VarHandle.getAndSetAcquire}
+ */
+ GET_AND_SET_ACQUIRE("getAndSetAcquire", AccessType.GET_AND_UPDATE),
+ /**
+ * The access mode whose access is specified by the corresponding
+ * method
+ * {@link VarHandle#getAndSetRelease VarHandle.getAndSetRelease}
+ */
+ GET_AND_SET_RELEASE("getAndSetRelease", AccessType.GET_AND_UPDATE),
+ /**
+ * The access mode whose access is specified by the corresponding
+ * method
* {@link VarHandle#getAndAdd VarHandle.getAndAdd}
*/
GET_AND_ADD("getAndAdd", AccessType.GET_AND_UPDATE),
/**
* The access mode whose access is specified by the corresponding
* method
- * {@link VarHandle#addAndGet VarHandle.addAndGet}
+ * {@link VarHandle#getAndAddAcquire VarHandle.getAndAddAcquire}
+ */
+ GET_AND_ADD_ACQUIRE("getAndAddAcquire", AccessType.GET_AND_UPDATE),
+ /**
+ * The access mode whose access is specified by the corresponding
+ * method
+ * {@link VarHandle#getAndAddRelease VarHandle.getAndAddRelease}
+ */
+ GET_AND_ADD_RELEASE("getAndAddRelease", AccessType.GET_AND_UPDATE),
+ /**
+ * The access mode whose access is specified by the corresponding
+ * method
+ * {@link VarHandle#getAndBitwiseOr VarHandle.getAndBitwiseOr}
+ */
+ GET_AND_BITWISE_OR("getAndBitwiseOr", AccessType.GET_AND_UPDATE),
+ /**
+ * The access mode whose access is specified by the corresponding
+ * method
+ * {@link VarHandle#getAndBitwiseOrRelease VarHandle.getAndBitwiseOrRelease}
+ */
+ GET_AND_BITWISE_OR_RELEASE("getAndBitwiseOrRelease", AccessType.GET_AND_UPDATE),
+ /**
+ * The access mode whose access is specified by the corresponding
+ * method
+ * {@link VarHandle#getAndBitwiseOrAcquire VarHandle.getAndBitwiseOrAcquire}
+ */
+ GET_AND_BITWISE_OR_ACQUIRE("getAndBitwiseOrAcquire", AccessType.GET_AND_UPDATE),
+ /**
+ * The access mode whose access is specified by the corresponding
+ * method
+ * {@link VarHandle#getAndBitwiseAnd VarHandle.getAndBitwiseAnd}
*/
- ADD_AND_GET("addAndGet", AccessType.GET_AND_UPDATE),
+ GET_AND_BITWISE_AND("getAndBitwiseAnd", AccessType.GET_AND_UPDATE),
+ /**
+ * The access mode whose access is specified by the corresponding
+ * method
+ * {@link VarHandle#getAndBitwiseAndRelease VarHandle.getAndBitwiseAndRelease}
+ */
+ GET_AND_BITWISE_AND_RELEASE("getAndBitwiseAndRelease", AccessType.GET_AND_UPDATE),
+ /**
+ * The access mode whose access is specified by the corresponding
+ * method
+ * {@link VarHandle#getAndBitwiseAndAcquire VarHandle.getAndBitwiseAndAcquire}
+ */
+ GET_AND_BITWISE_AND_ACQUIRE("getAndBitwiseAndAcquire", AccessType.GET_AND_UPDATE),
+ /**
+ * The access mode whose access is specified by the corresponding
+ * method
+ * {@link VarHandle#getAndBitwiseXor VarHandle.getAndBitwiseXor}
+ */
+ GET_AND_BITWISE_XOR("getAndBitwiseXor", AccessType.GET_AND_UPDATE),
+ /**
+ * The access mode whose access is specified by the corresponding
+ * method
+ * {@link VarHandle#getAndBitwiseXorRelease VarHandle.getAndBitwiseXorRelease}
+ */
+ GET_AND_BITWISE_XOR_RELEASE("getAndBitwiseXorRelease", AccessType.GET_AND_UPDATE),
+ /**
+ * The access mode whose access is specified by the corresponding
+ * method
+ * {@link VarHandle#getAndBitwiseXorAcquire VarHandle.getAndBitwiseXorAcquire}
+ */
+ GET_AND_BITWISE_XOR_ACQUIRE("getAndBitwiseXorAcquire", AccessType.GET_AND_UPDATE),
;
static final Map Equivalent to {@code addAndGet(i, 1)}.
*
@@ -208,12 +208,12 @@
* @return the updated value
*/
public final int incrementAndGet(int i) {
- return (int)AA.addAndGet(array, i, 1);
+ return (int)AA.getAndAdd(array, i, 1) + 1;
}
/**
* Atomically decrements the value of the element at index {@code i},
- * with memory effects as specified by {@link VarHandle#addAndGet}.
+ * with memory effects as specified by {@link VarHandle#getAndAdd}.
*
* Equivalent to {@code addAndGet(i, -1)}.
*
@@ -221,19 +221,19 @@
* @return the updated value
*/
public final int decrementAndGet(int i) {
- return (int)AA.addAndGet(array, i, -1);
+ return (int)AA.getAndAdd(array, i, -1) - 1;
}
/**
* Atomically adds the given value to the element at index {@code i},
- * with memory effects as specified by {@link VarHandle#addAndGet}.
+ * with memory effects as specified by {@link VarHandle#getAndAdd}.
*
* @param i the index
* @param delta the value to add
* @return the updated value
*/
public final int addAndGet(int i, int delta) {
- return (int)AA.addAndGet(array, i, delta);
+ return (int)AA.getAndAdd(array, i, delta) + delta;
}
/**
@@ -489,7 +489,7 @@
* Possibly atomically sets the element at index {@code i} to
* {@code newValue} if the element's current value {@code == expectedValue},
* with memory effects as specified by
- * {@link VarHandle#weakCompareAndSetVolatile}.
+ * {@link VarHandle#weakCompareAndSet}.
*
* @param i the index
* @param expectedValue the expected value
@@ -498,7 +498,7 @@
* @since 9
*/
public final boolean weakCompareAndSetVolatile(int i, int expectedValue, int newValue) {
- return AA.weakCompareAndSetVolatile(array, i, expectedValue, newValue);
+ return AA.weakCompareAndSet(array, i, expectedValue, newValue);
}
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java Fri Sep 02 02:41:37 2016 +0000
@@ -162,7 +162,7 @@
/**
* Possibly atomically sets the value to {@code newValue}
* if the current value {@code == expectedValue},
- * with memory effects as specified by {@link VarHandle#weakCompareAndSet}.
+ * with memory effects as specified by {@link VarHandle#weakCompareAndSetPlain}.
*
* @param expectedValue the expected value
* @param newValue the new value
@@ -209,7 +209,7 @@
/**
* Atomically increments the current value,
- * with memory effects as specified by {@link VarHandle#addAndGet}.
+ * with memory effects as specified by {@link VarHandle#getAndAdd}.
*
* Equivalent to {@code addAndGet(1)}.
*
@@ -221,7 +221,7 @@
/**
* Atomically decrements the current value,
- * with memory effects as specified by {@link VarHandle#addAndGet}.
+ * with memory effects as specified by {@link VarHandle#getAndAdd}.
*
* Equivalent to {@code addAndGet(-1)}.
*
@@ -233,7 +233,7 @@
/**
* Atomically adds the given value to the current value,
- * with memory effects as specified by {@link VarHandle#addAndGet}.
+ * with memory effects as specified by {@link VarHandle#getAndAdd}.
*
* @param delta the value to add
* @return the updated value
@@ -504,7 +504,7 @@
* Possibly atomically sets the value to {@code newValue}
* if the current value {@code == expectedValue},
* with memory effects as specified by
- * {@link VarHandle#weakCompareAndSetVolatile}.
+ * {@link VarHandle#weakCompareAndSet}.
*
* @param expectedValue the expected value
* @param newValue the new value
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java Fri Sep 02 02:41:37 2016 +0000
@@ -149,7 +149,7 @@
/**
* Possibly atomically sets the element at index {@code i} to
* {@code newValue} if the element's current value {@code == expectedValue},
- * with memory effects as specified by {@link VarHandle#weakCompareAndSet}.
+ * with memory effects as specified by {@link VarHandle#weakCompareAndSetPlain}.
*
* @param i the index
* @param expectedValue the expected value
@@ -157,7 +157,7 @@
* @return {@code true} if successful
*/
public final boolean weakCompareAndSet(int i, long expectedValue, long newValue) {
- return AA.weakCompareAndSet(array, i, expectedValue, newValue);
+ return AA.weakCompareAndSetPlain(array, i, expectedValue, newValue);
}
/**
@@ -200,7 +200,7 @@
/**
* Atomically increments the value of the element at index {@code i},
- * with memory effects as specified by {@link VarHandle#addAndGet}.
+ * with memory effects as specified by {@link VarHandle#getAndAdd}.
*
* Equivalent to {@code addAndGet(i, 1)}.
*
@@ -208,12 +208,12 @@
* @return the updated value
*/
public final long incrementAndGet(int i) {
- return (long)AA.addAndGet(array, i, 1L);
+ return (long)AA.getAndAdd(array, i, 1L) + 1L;
}
/**
* Atomically decrements the value of the element at index {@code i},
- * with memory effects as specified by {@link VarHandle#addAndGet}.
+ * with memory effects as specified by {@link VarHandle#getAndAdd}.
*
* Equivalent to {@code addAndGet(i, -1)}.
*
@@ -221,19 +221,19 @@
* @return the updated value
*/
public final long decrementAndGet(int i) {
- return (long)AA.addAndGet(array, i, -1L);
+ return (long)AA.getAndAdd(array, i, -1L) - 1L;
}
/**
* Atomically adds the given value to the element at index {@code i},
- * with memory effects as specified by {@link VarHandle#addAndGet}.
+ * with memory effects as specified by {@link VarHandle#getAndAdd}.
*
* @param i the index
* @param delta the value to add
* @return the updated value
*/
public long addAndGet(int i, long delta) {
- return (long)AA.addAndGet(array, i, delta);
+ return (long)AA.getAndAdd(array, i, delta) + delta;
}
/**
@@ -489,7 +489,7 @@
* Possibly atomically sets the element at index {@code i} to
* {@code newValue} if the element's current value {@code == expectedValue},
* with memory effects as specified by
- * {@link VarHandle#weakCompareAndSetVolatile}.
+ * {@link VarHandle#weakCompareAndSet}.
*
* @param i the index
* @param expectedValue the expected value
@@ -498,7 +498,7 @@
* @since 9
*/
public final boolean weakCompareAndSetVolatile(int i, long expectedValue, long newValue) {
- return AA.weakCompareAndSetVolatile(array, i, expectedValue, newValue);
+ return AA.weakCompareAndSet(array, i, expectedValue, newValue);
}
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java Fri Sep 02 02:41:37 2016 +0000
@@ -125,14 +125,14 @@
/**
* Possibly atomically sets the value to {@code newValue}
* if the current value {@code == expectedValue},
- * with memory effects as specified by {@link VarHandle#weakCompareAndSet}.
+ * with memory effects as specified by {@link VarHandle#weakCompareAndSetPlain}.
*
* @param expectedValue the expected value
* @param newValue the new value
* @return {@code true} if successful
*/
public final boolean weakCompareAndSet(V expectedValue, V newValue) {
- return VALUE.weakCompareAndSet(this, expectedValue, newValue);
+ return VALUE.weakCompareAndSetPlain(this, expectedValue, newValue);
}
/**
@@ -370,7 +370,7 @@
* Possibly atomically sets the value to {@code newValue}
* if the current value {@code == expectedValue},
* with memory effects as specified by
- * {@link VarHandle#weakCompareAndSetVolatile}.
+ * {@link VarHandle#weakCompareAndSet}.
*
* @param expectedValue the expected value
* @param newValue the new value
@@ -378,7 +378,7 @@
* @since 9
*/
public final boolean weakCompareAndSetVolatile(V expectedValue, V newValue) {
- return VALUE.weakCompareAndSetVolatile(this, expectedValue, newValue);
+ return VALUE.weakCompareAndSet(this, expectedValue, newValue);
}
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java Fri Sep 02 02:41:37 2016 +0000
@@ -155,7 +155,7 @@
/**
* Possibly atomically sets the element at index {@code i} to
* {@code newValue} if the element's current value {@code == expectedValue},
- * with memory effects as specified by {@link VarHandle#weakCompareAndSet}.
+ * with memory effects as specified by {@link VarHandle#weakCompareAndSetPlain}.
*
* @param i the index
* @param expectedValue the expected value
@@ -163,7 +163,7 @@
* @return {@code true} if successful
*/
public final boolean weakCompareAndSet(int i, E expectedValue, E newValue) {
- return AA.weakCompareAndSet(array, i, expectedValue, newValue);
+ return AA.weakCompareAndSetPlain(array, i, expectedValue, newValue);
}
/**
@@ -451,7 +451,7 @@
* Possibly atomically sets the element at index {@code i} to
* {@code newValue} if the element's current value {@code == expectedValue},
* with memory effects as specified by
- * {@link VarHandle#weakCompareAndSetVolatile}.
+ * {@link VarHandle#weakCompareAndSet}.
*
* @param i the index
* @param expectedValue the expected value
@@ -460,7 +460,7 @@
* @since 9
*/
public final boolean weakCompareAndSetVolatile(int i, E expectedValue, E newValue) {
- return AA.weakCompareAndSetVolatile(array, i, expectedValue, newValue);
+ return AA.weakCompareAndSet(array, i, expectedValue, newValue);
}
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.base/share/classes/java/util/concurrent/locks/StampedLock.java
--- a/jdk/src/java.base/share/classes/java/util/concurrent/locks/StampedLock.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/locks/StampedLock.java Fri Sep 02 02:41:37 2016 +0000
@@ -1123,14 +1123,14 @@
}
else if ((p = wtail) == null) { // initialize queue
WNode hd = new WNode(WMODE, null);
- if (WHEAD.weakCompareAndSetVolatile(this, null, hd))
+ if (WHEAD.weakCompareAndSet(this, null, hd))
wtail = hd;
}
else if (node == null)
node = new WNode(WMODE, p);
else if (node.prev != p)
node.prev = p;
- else if (WTAIL.weakCompareAndSetVolatile(this, p, node)) {
+ else if (WTAIL.weakCompareAndSet(this, p, node)) {
p.next = node;
break;
}
@@ -1162,7 +1162,7 @@
else if (h != null) { // help release stale waiters
WNode c; Thread w;
while ((c = h.cowait) != null) {
- if (WCOWAIT.weakCompareAndSetVolatile(h, c, c.cowait) &&
+ if (WCOWAIT.weakCompareAndSet(h, c, c.cowait) &&
(w = c.thread) != null)
LockSupport.unpark(w);
}
@@ -1247,7 +1247,7 @@
}
if (p == null) { // initialize queue
WNode hd = new WNode(WMODE, null);
- if (WHEAD.weakCompareAndSetVolatile(this, null, hd))
+ if (WHEAD.weakCompareAndSet(this, null, hd))
wtail = hd;
}
else if (node == null)
@@ -1255,7 +1255,7 @@
else if (h == p || p.mode != RMODE) {
if (node.prev != p)
node.prev = p;
- else if (WTAIL.weakCompareAndSetVolatile(this, p, node)) {
+ else if (WTAIL.weakCompareAndSet(this, p, node)) {
p.next = node;
break;
}
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.base/share/classes/jdk/internal/misc/JavaNetSocketAccess.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaNetSocketAccess.java Fri Sep 02 02:41:37 2016 +0000
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2016, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.internal.misc;
+
+import java.net.ServerSocket;
+import java.net.SocketImpl;
+
+public interface JavaNetSocketAccess {
+ /**
+ * Creates a ServerSocket associated with the given SocketImpl.
+ */
+ ServerSocket newServerSocket(SocketImpl impl);
+
+ /*
+ * Constructs a SocketImpl instance of the given class.
+ */
+ SocketImpl newSocketImpl(Class extends SocketImpl> implClass);
+}
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java Fri Sep 02 02:41:37 2016 +0000
@@ -55,6 +55,7 @@
private static JavaNetAccess javaNetAccess;
private static JavaNetInetAddressAccess javaNetInetAddressAccess;
private static JavaNetHttpCookieAccess javaNetHttpCookieAccess;
+ private static JavaNetSocketAccess javaNetSocketAccess;
private static JavaNioAccess javaNioAccess;
private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
private static JavaSecurityProtectionDomainAccess javaSecurityProtectionDomainAccess;
@@ -161,6 +162,16 @@
return javaNetHttpCookieAccess;
}
+ public static void setJavaNetSocketAccess(JavaNetSocketAccess jnsa) {
+ javaNetSocketAccess = jnsa;
+ }
+
+ public static JavaNetSocketAccess getJavaNetSocketAccess() {
+ if (javaNetSocketAccess == null)
+ unsafe.ensureClassInitialized(java.net.ServerSocket.class);
+ return javaNetSocketAccess;
+ }
+
public static void setJavaNioAccess(JavaNioAccess jna) {
javaNioAccess = jna;
}
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java Fri Sep 02 02:41:37 2016 +0000
@@ -2278,6 +2278,24 @@
return v;
}
+ @ForceInline
+ public final int getAndAddIntRelease(Object o, long offset, int delta) {
+ int v;
+ do {
+ v = getInt(o, offset);
+ } while (!weakCompareAndSwapIntRelease(o, offset, v, v + delta));
+ return v;
+ }
+
+ @ForceInline
+ public final int getAndAddIntAcquire(Object o, long offset, int delta) {
+ int v;
+ do {
+ v = getIntAcquire(o, offset);
+ } while (!weakCompareAndSwapIntAcquire(o, offset, v, v + delta));
+ return v;
+ }
+
/**
* Atomically adds the given value to the current value of a field
* or array element within the given object {@code o}
@@ -2298,6 +2316,24 @@
return v;
}
+ @ForceInline
+ public final long getAndAddLongRelease(Object o, long offset, long delta) {
+ long v;
+ do {
+ v = getLong(o, offset);
+ } while (!weakCompareAndSwapLongRelease(o, offset, v, v + delta));
+ return v;
+ }
+
+ @ForceInline
+ public final long getAndAddLongAcquire(Object o, long offset, long delta) {
+ long v;
+ do {
+ v = getLongAcquire(o, offset);
+ } while (!weakCompareAndSwapLongAcquire(o, offset, v, v + delta));
+ return v;
+ }
+
@HotSpotIntrinsicCandidate
public final byte getAndAddByte(Object o, long offset, byte delta) {
byte v;
@@ -2307,6 +2343,24 @@
return v;
}
+ @ForceInline
+ public final byte getAndAddByteRelease(Object o, long offset, byte delta) {
+ byte v;
+ do {
+ v = getByte(o, offset);
+ } while (!weakCompareAndSwapByteRelease(o, offset, v, (byte) (v + delta)));
+ return v;
+ }
+
+ @ForceInline
+ public final byte getAndAddByteAcquire(Object o, long offset, byte delta) {
+ byte v;
+ do {
+ v = getByteAcquire(o, offset);
+ } while (!weakCompareAndSwapByteAcquire(o, offset, v, (byte) (v + delta)));
+ return v;
+ }
+
@HotSpotIntrinsicCandidate
public final short getAndAddShort(Object o, long offset, short delta) {
short v;
@@ -2317,11 +2371,39 @@
}
@ForceInline
+ public final short getAndAddShortRelease(Object o, long offset, short delta) {
+ short v;
+ do {
+ v = getShort(o, offset);
+ } while (!weakCompareAndSwapShortRelease(o, offset, v, (short) (v + delta)));
+ return v;
+ }
+
+ @ForceInline
+ public final short getAndAddShortAcquire(Object o, long offset, short delta) {
+ short v;
+ do {
+ v = getShortAcquire(o, offset);
+ } while (!weakCompareAndSwapShortAcquire(o, offset, v, (short) (v + delta)));
+ return v;
+ }
+
+ @ForceInline
public final char getAndAddChar(Object o, long offset, char delta) {
return (char) getAndAddShort(o, offset, (short) delta);
}
@ForceInline
+ public final char getAndAddCharRelease(Object o, long offset, char delta) {
+ return (char) getAndAddShortRelease(o, offset, (short) delta);
+ }
+
+ @ForceInline
+ public final char getAndAddCharAcquire(Object o, long offset, char delta) {
+ return (char) getAndAddShortAcquire(o, offset, (short) delta);
+ }
+
+ @ForceInline
public final float getAndAddFloat(Object o, long offset, float delta) {
int expectedBits;
float v;
@@ -2337,6 +2419,36 @@
}
@ForceInline
+ public final float getAndAddFloatRelease(Object o, long offset, float delta) {
+ int expectedBits;
+ float v;
+ do {
+ // Load and CAS with the raw bits to avoid issues with NaNs and
+ // possible bit conversion from signaling NaNs to quiet NaNs that
+ // may result in the loop not terminating.
+ expectedBits = getInt(o, offset);
+ v = Float.intBitsToFloat(expectedBits);
+ } while (!weakCompareAndSwapIntRelease(o, offset,
+ expectedBits, Float.floatToRawIntBits(v + delta)));
+ return v;
+ }
+
+ @ForceInline
+ public final float getAndAddFloatAcquire(Object o, long offset, float delta) {
+ int expectedBits;
+ float v;
+ do {
+ // Load and CAS with the raw bits to avoid issues with NaNs and
+ // possible bit conversion from signaling NaNs to quiet NaNs that
+ // may result in the loop not terminating.
+ expectedBits = getIntAcquire(o, offset);
+ v = Float.intBitsToFloat(expectedBits);
+ } while (!weakCompareAndSwapIntAcquire(o, offset,
+ expectedBits, Float.floatToRawIntBits(v + delta)));
+ return v;
+ }
+
+ @ForceInline
public final double getAndAddDouble(Object o, long offset, double delta) {
long expectedBits;
double v;
@@ -2351,6 +2463,36 @@
return v;
}
+ @ForceInline
+ public final double getAndAddDoubleRelease(Object o, long offset, double delta) {
+ long expectedBits;
+ double v;
+ do {
+ // Load and CAS with the raw bits to avoid issues with NaNs and
+ // possible bit conversion from signaling NaNs to quiet NaNs that
+ // may result in the loop not terminating.
+ expectedBits = getLong(o, offset);
+ v = Double.longBitsToDouble(expectedBits);
+ } while (!weakCompareAndSwapLongRelease(o, offset,
+ expectedBits, Double.doubleToRawLongBits(v + delta)));
+ return v;
+ }
+
+ @ForceInline
+ public final double getAndAddDoubleAcquire(Object o, long offset, double delta) {
+ long expectedBits;
+ double v;
+ do {
+ // Load and CAS with the raw bits to avoid issues with NaNs and
+ // possible bit conversion from signaling NaNs to quiet NaNs that
+ // may result in the loop not terminating.
+ expectedBits = getLongAcquire(o, offset);
+ v = Double.longBitsToDouble(expectedBits);
+ } while (!weakCompareAndSwapLongAcquire(o, offset,
+ expectedBits, Double.doubleToRawLongBits(v + delta)));
+ return v;
+ }
+
/**
* Atomically exchanges the given value with the current value of
* a field or array element within the given object {@code o}
@@ -2371,6 +2513,24 @@
return v;
}
+ @ForceInline
+ public final int getAndSetIntRelease(Object o, long offset, int newValue) {
+ int v;
+ do {
+ v = getInt(o, offset);
+ } while (!weakCompareAndSwapIntRelease(o, offset, v, newValue));
+ return v;
+ }
+
+ @ForceInline
+ public final int getAndSetIntAcquire(Object o, long offset, int newValue) {
+ int v;
+ do {
+ v = getIntAcquire(o, offset);
+ } while (!weakCompareAndSwapIntAcquire(o, offset, v, newValue));
+ return v;
+ }
+
/**
* Atomically exchanges the given value with the current value of
* a field or array element within the given object {@code o}
@@ -2391,6 +2551,24 @@
return v;
}
+ @ForceInline
+ public final long getAndSetLongRelease(Object o, long offset, long newValue) {
+ long v;
+ do {
+ v = getLong(o, offset);
+ } while (!weakCompareAndSwapLongRelease(o, offset, v, newValue));
+ return v;
+ }
+
+ @ForceInline
+ public final long getAndSetLongAcquire(Object o, long offset, long newValue) {
+ long v;
+ do {
+ v = getLongAcquire(o, offset);
+ } while (!weakCompareAndSwapLongAcquire(o, offset, v, newValue));
+ return v;
+ }
+
/**
* Atomically exchanges the given reference value with the current
* reference value of a field or array element within the given
@@ -2411,6 +2589,24 @@
return v;
}
+ @ForceInline
+ public final Object getAndSetObjectRelease(Object o, long offset, Object newValue) {
+ Object v;
+ do {
+ v = getObject(o, offset);
+ } while (!weakCompareAndSwapObjectRelease(o, offset, v, newValue));
+ return v;
+ }
+
+ @ForceInline
+ public final Object getAndSetObjectAcquire(Object o, long offset, Object newValue) {
+ Object v;
+ do {
+ v = getObjectAcquire(o, offset);
+ } while (!weakCompareAndSwapObjectAcquire(o, offset, v, newValue));
+ return v;
+ }
+
@HotSpotIntrinsicCandidate
public final byte getAndSetByte(Object o, long offset, byte newValue) {
byte v;
@@ -2421,10 +2617,38 @@
}
@ForceInline
+ public final byte getAndSetByteRelease(Object o, long offset, byte newValue) {
+ byte v;
+ do {
+ v = getByte(o, offset);
+ } while (!weakCompareAndSwapByteRelease(o, offset, v, newValue));
+ return v;
+ }
+
+ @ForceInline
+ public final byte getAndSetByteAcquire(Object o, long offset, byte newValue) {
+ byte v;
+ do {
+ v = getByteAcquire(o, offset);
+ } while (!weakCompareAndSwapByteAcquire(o, offset, v, newValue));
+ return v;
+ }
+
+ @ForceInline
public final boolean getAndSetBoolean(Object o, long offset, boolean newValue) {
return byte2bool(getAndSetByte(o, offset, bool2byte(newValue)));
}
+ @ForceInline
+ public final boolean getAndSetBooleanRelease(Object o, long offset, boolean newValue) {
+ return byte2bool(getAndSetByteRelease(o, offset, bool2byte(newValue)));
+ }
+
+ @ForceInline
+ public final boolean getAndSetBooleanAcquire(Object o, long offset, boolean newValue) {
+ return byte2bool(getAndSetByteAcquire(o, offset, bool2byte(newValue)));
+ }
+
@HotSpotIntrinsicCandidate
public final short getAndSetShort(Object o, long offset, short newValue) {
short v;
@@ -2435,22 +2659,558 @@
}
@ForceInline
+ public final short getAndSetShortRelease(Object o, long offset, short newValue) {
+ short v;
+ do {
+ v = getShort(o, offset);
+ } while (!weakCompareAndSwapShortRelease(o, offset, v, newValue));
+ return v;
+ }
+
+ @ForceInline
+ public final short getAndSetShortAcquire(Object o, long offset, short newValue) {
+ short v;
+ do {
+ v = getShortAcquire(o, offset);
+ } while (!weakCompareAndSwapShortAcquire(o, offset, v, newValue));
+ return v;
+ }
+
+ @ForceInline
public final char getAndSetChar(Object o, long offset, char newValue) {
return s2c(getAndSetShort(o, offset, c2s(newValue)));
}
@ForceInline
+ public final char getAndSetCharRelease(Object o, long offset, char newValue) {
+ return s2c(getAndSetShortRelease(o, offset, c2s(newValue)));
+ }
+
+ @ForceInline
+ public final char getAndSetCharAcquire(Object o, long offset, char newValue) {
+ return s2c(getAndSetShortAcquire(o, offset, c2s(newValue)));
+ }
+
+ @ForceInline
public final float getAndSetFloat(Object o, long offset, float newValue) {
int v = getAndSetInt(o, offset, Float.floatToRawIntBits(newValue));
return Float.intBitsToFloat(v);
}
@ForceInline
+ public final float getAndSetFloatRelease(Object o, long offset, float newValue) {
+ int v = getAndSetIntRelease(o, offset, Float.floatToRawIntBits(newValue));
+ return Float.intBitsToFloat(v);
+ }
+
+ @ForceInline
+ public final float getAndSetFloatAcquire(Object o, long offset, float newValue) {
+ int v = getAndSetIntAcquire(o, offset, Float.floatToRawIntBits(newValue));
+ return Float.intBitsToFloat(v);
+ }
+
+ @ForceInline
public final double getAndSetDouble(Object o, long offset, double newValue) {
long v = getAndSetLong(o, offset, Double.doubleToRawLongBits(newValue));
return Double.longBitsToDouble(v);
}
+ @ForceInline
+ public final double getAndSetDoubleRelease(Object o, long offset, double newValue) {
+ long v = getAndSetLongRelease(o, offset, Double.doubleToRawLongBits(newValue));
+ return Double.longBitsToDouble(v);
+ }
+
+ @ForceInline
+ public final double getAndSetDoubleAcquire(Object o, long offset, double newValue) {
+ long v = getAndSetLongAcquire(o, offset, Double.doubleToRawLongBits(newValue));
+ return Double.longBitsToDouble(v);
+ }
+
+
+ // The following contain CAS-based Java implementations used on
+ // platforms not supporting native instructions
+
+ @ForceInline
+ public final boolean getAndBitwiseOrBoolean(Object o, long offset, boolean mask) {
+ return byte2bool(getAndBitwiseOrByte(o, offset, bool2byte(mask)));
+ }
+
+ @ForceInline
+ public final boolean getAndBitwiseOrBooleanRelease(Object o, long offset, boolean mask) {
+ return byte2bool(getAndBitwiseOrByteRelease(o, offset, bool2byte(mask)));
+ }
+
+ @ForceInline
+ public final boolean getAndBitwiseOrBooleanAcquire(Object o, long offset, boolean mask) {
+ return byte2bool(getAndBitwiseOrByteAcquire(o, offset, bool2byte(mask)));
+ }
+
+ @ForceInline
+ public final boolean getAndBitwiseAndBoolean(Object o, long offset, boolean mask) {
+ return byte2bool(getAndBitwiseAndByte(o, offset, bool2byte(mask)));
+ }
+
+ @ForceInline
+ public final boolean getAndBitwiseAndBooleanRelease(Object o, long offset, boolean mask) {
+ return byte2bool(getAndBitwiseAndByteRelease(o, offset, bool2byte(mask)));
+ }
+
+ @ForceInline
+ public final boolean getAndBitwiseAndBooleanAcquire(Object o, long offset, boolean mask) {
+ return byte2bool(getAndBitwiseAndByteAcquire(o, offset, bool2byte(mask)));
+ }
+
+ @ForceInline
+ public final boolean getAndBitwiseXorBoolean(Object o, long offset, boolean mask) {
+ return byte2bool(getAndBitwiseXorByte(o, offset, bool2byte(mask)));
+ }
+
+ @ForceInline
+ public final boolean getAndBitwiseXorBooleanRelease(Object o, long offset, boolean mask) {
+ return byte2bool(getAndBitwiseXorByteRelease(o, offset, bool2byte(mask)));
+ }
+
+ @ForceInline
+ public final boolean getAndBitwiseXorBooleanAcquire(Object o, long offset, boolean mask) {
+ return byte2bool(getAndBitwiseXorByteAcquire(o, offset, bool2byte(mask)));
+ }
+
+
+ @ForceInline
+ public final byte getAndBitwiseOrByte(Object o, long offset, byte mask) {
+ byte current;
+ do {
+ current = getByteVolatile(o, offset);
+ } while (!weakCompareAndSwapByteVolatile(o, offset,
+ current, (byte) (current | mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final byte getAndBitwiseOrByteRelease(Object o, long offset, byte mask) {
+ byte current;
+ do {
+ current = getByte(o, offset);
+ } while (!weakCompareAndSwapByteRelease(o, offset,
+ current, (byte) (current | mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final byte getAndBitwiseOrByteAcquire(Object o, long offset, byte mask) {
+ byte current;
+ do {
+ // Plain read, the value is a hint, the acquire CAS does the work
+ current = getByte(o, offset);
+ } while (!weakCompareAndSwapByteAcquire(o, offset,
+ current, (byte) (current | mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final byte getAndBitwiseAndByte(Object o, long offset, byte mask) {
+ byte current;
+ do {
+ current = getByteVolatile(o, offset);
+ } while (!weakCompareAndSwapByteVolatile(o, offset,
+ current, (byte) (current & mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final byte getAndBitwiseAndByteRelease(Object o, long offset, byte mask) {
+ byte current;
+ do {
+ current = getByte(o, offset);
+ } while (!weakCompareAndSwapByteRelease(o, offset,
+ current, (byte) (current & mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final byte getAndBitwiseAndByteAcquire(Object o, long offset, byte mask) {
+ byte current;
+ do {
+ // Plain read, the value is a hint, the acquire CAS does the work
+ current = getByte(o, offset);
+ } while (!weakCompareAndSwapByteAcquire(o, offset,
+ current, (byte) (current & mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final byte getAndBitwiseXorByte(Object o, long offset, byte mask) {
+ byte current;
+ do {
+ current = getByteVolatile(o, offset);
+ } while (!weakCompareAndSwapByteVolatile(o, offset,
+ current, (byte) (current ^ mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final byte getAndBitwiseXorByteRelease(Object o, long offset, byte mask) {
+ byte current;
+ do {
+ current = getByte(o, offset);
+ } while (!weakCompareAndSwapByteRelease(o, offset,
+ current, (byte) (current ^ mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final byte getAndBitwiseXorByteAcquire(Object o, long offset, byte mask) {
+ byte current;
+ do {
+ // Plain read, the value is a hint, the acquire CAS does the work
+ current = getByte(o, offset);
+ } while (!weakCompareAndSwapByteAcquire(o, offset,
+ current, (byte) (current ^ mask)));
+ return current;
+ }
+
+
+ @ForceInline
+ public final char getAndBitwiseOrChar(Object o, long offset, char mask) {
+ return s2c(getAndBitwiseOrShort(o, offset, c2s(mask)));
+ }
+
+ @ForceInline
+ public final char getAndBitwiseOrCharRelease(Object o, long offset, char mask) {
+ return s2c(getAndBitwiseOrShortRelease(o, offset, c2s(mask)));
+ }
+
+ @ForceInline
+ public final char getAndBitwiseOrCharAcquire(Object o, long offset, char mask) {
+ return s2c(getAndBitwiseOrShortAcquire(o, offset, c2s(mask)));
+ }
+
+ @ForceInline
+ public final char getAndBitwiseAndChar(Object o, long offset, char mask) {
+ return s2c(getAndBitwiseAndShort(o, offset, c2s(mask)));
+ }
+
+ @ForceInline
+ public final char getAndBitwiseAndCharRelease(Object o, long offset, char mask) {
+ return s2c(getAndBitwiseAndShortRelease(o, offset, c2s(mask)));
+ }
+
+ @ForceInline
+ public final char getAndBitwiseAndCharAcquire(Object o, long offset, char mask) {
+ return s2c(getAndBitwiseAndShortAcquire(o, offset, c2s(mask)));
+ }
+
+ @ForceInline
+ public final char getAndBitwiseXorChar(Object o, long offset, char mask) {
+ return s2c(getAndBitwiseXorShort(o, offset, c2s(mask)));
+ }
+
+ @ForceInline
+ public final char getAndBitwiseXorCharRelease(Object o, long offset, char mask) {
+ return s2c(getAndBitwiseXorShortRelease(o, offset, c2s(mask)));
+ }
+
+ @ForceInline
+ public final char getAndBitwiseXorCharAcquire(Object o, long offset, char mask) {
+ return s2c(getAndBitwiseXorShortAcquire(o, offset, c2s(mask)));
+ }
+
+
+ @ForceInline
+ public final short getAndBitwiseOrShort(Object o, long offset, short mask) {
+ short current;
+ do {
+ current = getShortVolatile(o, offset);
+ } while (!weakCompareAndSwapShortVolatile(o, offset,
+ current, (short) (current | mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final short getAndBitwiseOrShortRelease(Object o, long offset, short mask) {
+ short current;
+ do {
+ current = getShort(o, offset);
+ } while (!weakCompareAndSwapShortRelease(o, offset,
+ current, (short) (current | mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final short getAndBitwiseOrShortAcquire(Object o, long offset, short mask) {
+ short current;
+ do {
+ // Plain read, the value is a hint, the acquire CAS does the work
+ current = getShort(o, offset);
+ } while (!weakCompareAndSwapShortAcquire(o, offset,
+ current, (short) (current | mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final short getAndBitwiseAndShort(Object o, long offset, short mask) {
+ short current;
+ do {
+ current = getShortVolatile(o, offset);
+ } while (!weakCompareAndSwapShortVolatile(o, offset,
+ current, (short) (current & mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final short getAndBitwiseAndShortRelease(Object o, long offset, short mask) {
+ short current;
+ do {
+ current = getShort(o, offset);
+ } while (!weakCompareAndSwapShortRelease(o, offset,
+ current, (short) (current & mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final short getAndBitwiseAndShortAcquire(Object o, long offset, short mask) {
+ short current;
+ do {
+ // Plain read, the value is a hint, the acquire CAS does the work
+ current = getShort(o, offset);
+ } while (!weakCompareAndSwapShortAcquire(o, offset,
+ current, (short) (current & mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final short getAndBitwiseXorShort(Object o, long offset, short mask) {
+ short current;
+ do {
+ current = getShortVolatile(o, offset);
+ } while (!weakCompareAndSwapShortVolatile(o, offset,
+ current, (short) (current ^ mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final short getAndBitwiseXorShortRelease(Object o, long offset, short mask) {
+ short current;
+ do {
+ current = getShort(o, offset);
+ } while (!weakCompareAndSwapShortRelease(o, offset,
+ current, (short) (current ^ mask)));
+ return current;
+ }
+
+ @ForceInline
+ public final short getAndBitwiseXorShortAcquire(Object o, long offset, short mask) {
+ short current;
+ do {
+ // Plain read, the value is a hint, the acquire CAS does the work
+ current = getShort(o, offset);
+ } while (!weakCompareAndSwapShortAcquire(o, offset,
+ current, (short) (current ^ mask)));
+ return current;
+ }
+
+
+ @ForceInline
+ public final int getAndBitwiseOrInt(Object o, long offset, int mask) {
+ int current;
+ do {
+ current = getIntVolatile(o, offset);
+ } while (!weakCompareAndSwapIntVolatile(o, offset,
+ current, current | mask));
+ return current;
+ }
+
+ @ForceInline
+ public final int getAndBitwiseOrIntRelease(Object o, long offset, int mask) {
+ int current;
+ do {
+ current = getInt(o, offset);
+ } while (!weakCompareAndSwapIntRelease(o, offset,
+ current, current | mask));
+ return current;
+ }
+
+ @ForceInline
+ public final int getAndBitwiseOrIntAcquire(Object o, long offset, int mask) {
+ int current;
+ do {
+ // Plain read, the value is a hint, the acquire CAS does the work
+ current = getInt(o, offset);
+ } while (!weakCompareAndSwapIntAcquire(o, offset,
+ current, current | mask));
+ return current;
+ }
+
+ /**
+ * Atomically replaces the current value of a field or array element within
+ * the given object with the result of bitwise AND between the current value
+ * and mask.
+ *
+ * @param o object/array to update the field/element in
+ * @param offset field/element offset
+ * @param mask the mask value
+ * @return the previous value
+ * @since 1.9
+ */
+ @ForceInline
+ public final int getAndBitwiseAndInt(Object o, long offset, int mask) {
+ int current;
+ do {
+ current = getIntVolatile(o, offset);
+ } while (!weakCompareAndSwapIntVolatile(o, offset,
+ current, current & mask));
+ return current;
+ }
+
+ @ForceInline
+ public final int getAndBitwiseAndIntRelease(Object o, long offset, int mask) {
+ int current;
+ do {
+ current = getInt(o, offset);
+ } while (!weakCompareAndSwapIntRelease(o, offset,
+ current, current & mask));
+ return current;
+ }
+
+ @ForceInline
+ public final int getAndBitwiseAndIntAcquire(Object o, long offset, int mask) {
+ int current;
+ do {
+ // Plain read, the value is a hint, the acquire CAS does the work
+ current = getInt(o, offset);
+ } while (!weakCompareAndSwapIntAcquire(o, offset,
+ current, current & mask));
+ return current;
+ }
+
+ @ForceInline
+ public final int getAndBitwiseXorInt(Object o, long offset, int mask) {
+ int current;
+ do {
+ current = getIntVolatile(o, offset);
+ } while (!weakCompareAndSwapIntVolatile(o, offset,
+ current, current ^ mask));
+ return current;
+ }
+
+ @ForceInline
+ public final int getAndBitwiseXorIntRelease(Object o, long offset, int mask) {
+ int current;
+ do {
+ current = getInt(o, offset);
+ } while (!weakCompareAndSwapIntRelease(o, offset,
+ current, current ^ mask));
+ return current;
+ }
+
+ @ForceInline
+ public final int getAndBitwiseXorIntAcquire(Object o, long offset, int mask) {
+ int current;
+ do {
+ // Plain read, the value is a hint, the acquire CAS does the work
+ current = getInt(o, offset);
+ } while (!weakCompareAndSwapIntAcquire(o, offset,
+ current, current ^ mask));
+ return current;
+ }
+
+
+ @ForceInline
+ public final long getAndBitwiseOrLong(Object o, long offset, long mask) {
+ long current;
+ do {
+ current = getLongVolatile(o, offset);
+ } while (!weakCompareAndSwapLongVolatile(o, offset,
+ current, current | mask));
+ return current;
+ }
+
+ @ForceInline
+ public final long getAndBitwiseOrLongRelease(Object o, long offset, long mask) {
+ long current;
+ do {
+ current = getLong(o, offset);
+ } while (!weakCompareAndSwapLongRelease(o, offset,
+ current, current | mask));
+ return current;
+ }
+
+ @ForceInline
+ public final long getAndBitwiseOrLongAcquire(Object o, long offset, long mask) {
+ long current;
+ do {
+ // Plain read, the value is a hint, the acquire CAS does the work
+ current = getLong(o, offset);
+ } while (!weakCompareAndSwapLongAcquire(o, offset,
+ current, current | mask));
+ return current;
+ }
+
+ @ForceInline
+ public final long getAndBitwiseAndLong(Object o, long offset, long mask) {
+ long current;
+ do {
+ current = getLongVolatile(o, offset);
+ } while (!weakCompareAndSwapLongVolatile(o, offset,
+ current, current & mask));
+ return current;
+ }
+
+ @ForceInline
+ public final long getAndBitwiseAndLongRelease(Object o, long offset, long mask) {
+ long current;
+ do {
+ current = getLong(o, offset);
+ } while (!weakCompareAndSwapLongRelease(o, offset,
+ current, current & mask));
+ return current;
+ }
+
+ @ForceInline
+ public final long getAndBitwiseAndLongAcquire(Object o, long offset, long mask) {
+ long current;
+ do {
+ // Plain read, the value is a hint, the acquire CAS does the work
+ current = getLong(o, offset);
+ } while (!weakCompareAndSwapLongAcquire(o, offset,
+ current, current & mask));
+ return current;
+ }
+
+ @ForceInline
+ public final long getAndBitwiseXorLong(Object o, long offset, long mask) {
+ long current;
+ do {
+ current = getLongVolatile(o, offset);
+ } while (!weakCompareAndSwapLongVolatile(o, offset,
+ current, current ^ mask));
+ return current;
+ }
+
+ @ForceInline
+ public final long getAndBitwiseXorLongRelease(Object o, long offset, long mask) {
+ long current;
+ do {
+ current = getLong(o, offset);
+ } while (!weakCompareAndSwapLongRelease(o, offset,
+ current, current ^ mask));
+ return current;
+ }
+
+ @ForceInline
+ public final long getAndBitwiseXorLongAcquire(Object o, long offset, long mask) {
+ long current;
+ do {
+ // Plain read, the value is a hint, the acquire CAS does the work
+ current = getLong(o, offset);
+ } while (!weakCompareAndSwapLongAcquire(o, offset,
+ current, current ^ mask));
+ return current;
+ }
+
+
+
/**
* Ensures that loads before the fence will not be reordered with loads and
* stores after the fence; a "LoadLoad plus LoadStore barrier".
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java Fri Sep 02 02:41:37 2016 +0000
@@ -1496,7 +1496,7 @@
}
} catch (CertPathValidatorException cpve) {
throw new CertificateException(
- "Certificates does not conform to algorithm constraints");
+ "Certificates do not conform to algorithm constraints", cpve);
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.base/share/native/libjli/java.c
--- a/jdk/src/java.base/share/native/libjli/java.c Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.base/share/native/libjli/java.c Fri Sep 02 02:41:37 2016 +0000
@@ -556,20 +556,6 @@
JLI_StrCmp(name, "--list-modules") == 0;
}
-#ifndef OLD_MODULE_OPTIONS
-/*
- * Old module options for transition
- */
-static jboolean
-IsOldModuleOption(const char* name) {
- return JLI_StrCmp(name, "-modulepath") == 0 ||
- JLI_StrCmp(name, "-mp") == 0 ||
- JLI_StrCmp(name, "-upgrademodulepath") == 0 ||
- JLI_StrCmp(name, "-addmods") == 0 ||
- JLI_StrCmp(name, "-limitmods") == 0;
-}
-#endif
-
/*
* Test if the given name is a module-system white-space option that
* will be passed to the VM with its corresponding long-form option
@@ -584,8 +570,7 @@
JLI_StrCmp(name, "--limit-modules") == 0 ||
JLI_StrCmp(name, "--add-exports") == 0 ||
JLI_StrCmp(name, "--add-reads") == 0 ||
- JLI_StrCmp(name, "--patch-module") == 0 ||
- IsOldModuleOption(name);
+ JLI_StrCmp(name, "--patch-module") == 0;
}
/*
@@ -1224,32 +1209,6 @@
}
}
-#ifndef OLD_MODULE_OPTIONS
- // for transition to support both old and new syntax
- if (JLI_StrCmp(arg, "-modulepath") == 0 ||
- JLI_StrCmp(arg, "-mp") == 0) {
- option = "--module-path";
- } else if (JLI_StrCmp(arg, "-upgrademodulepath") == 0) {
- option = "--upgrade-module-path";
- } else if (JLI_StrCmp(arg, "-addmods") == 0) {
- option = "--add-modules";
- } else if (JLI_StrCmp(arg, "-limitmods") == 0) {
- option = "--limit-modules";
- } else if (JLI_StrCCmp(arg, "-XaddExports:") == 0) {
- option = "--add-exports";
- value = arg + 13;
- kind = VM_LONG_OPTION_WITH_ARGUMENT;
- } else if (JLI_StrCCmp(arg, "-XaddReads:") == 0) {
- option = "--add-reads";
- value = arg + 11;
- kind = VM_LONG_OPTION_WITH_ARGUMENT;
- } else if (JLI_StrCCmp(arg, "-Xpatch:") == 0) {
- option = "--patch-module";
- value = arg + 8;
- kind = VM_LONG_OPTION_WITH_ARGUMENT;
- }
-#endif
-
*pargc = argc;
*pargv = argv;
*poption = option;
@@ -1340,16 +1299,6 @@
JLI_StrCmp(arg, "--patch-module") == 0) {
REPORT_ERROR (has_arg, ARG_ERROR6, arg);
}
-#ifndef OLD_MODULE_OPTIONS
- else if (JLI_StrCmp(arg, "-modulepath") == 0 ||
- JLI_StrCmp(arg, "-mp") == 0 ||
- JLI_StrCmp(arg, "-upgrademodulepath") == 0) {
- REPORT_ERROR (has_arg, ARG_ERROR4, arg);
- } else if (JLI_StrCmp(arg, "-addmods") == 0 ||
- JLI_StrCmp(arg, "-limitmods") == 0) {
- REPORT_ERROR (has_arg, ARG_ERROR6, arg);
- }
-#endif
/*
* The following cases will cause the argument parsing to stop
*/
@@ -1548,6 +1497,7 @@
NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String"));
NULL_CHECK0(ary = (*env)->NewObjectArray(env, strc, cls, 0));
+ CHECK_EXCEPTION_RETURN_VALUE(0);
for (i = 0; i < strc; i++) {
jstring str = NewPlatformString(env, *strv++);
NULL_CHECK0(str);
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.base/share/native/libjli/java.h
--- a/jdk/src/java.base/share/native/libjli/java.h Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.base/share/native/libjli/java.h Fri Sep 02 02:41:37 2016 +0000
@@ -253,6 +253,13 @@
#define NULL_CHECK(NC_check_pointer) \
NULL_CHECK_RETURN_VALUE(NC_check_pointer, )
+#define CHECK_EXCEPTION_RETURN_VALUE(CER_value) \
+ do { \
+ if ((*env)->ExceptionOccurred(env)) { \
+ return CER_value; \
+ } \
+ } while (JNI_FALSE)
+
#define CHECK_EXCEPTION_RETURN() \
do { \
if ((*env)->ExceptionOccurred(env)) { \
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.desktop/macosx/classes/apple/laf/JRSUIConstants.java
--- a/jdk/src/java.desktop/macosx/classes/apple/laf/JRSUIConstants.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/apple/laf/JRSUIConstants.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,7 +25,6 @@
package apple.laf;
-import java.lang.reflect.Field;
import java.nio.ByteBuffer;
import java.lang.annotation.Native;
@@ -70,6 +69,21 @@
throw new RuntimeException("Constant not implemented in native: " + this);
}
+ private String getConstantName(Key hit) {
+ if (hit == VALUE) {
+ return "VALUE";
+ } else if (hit == THUMB_PROPORTION) {
+ return "THUMB_PROPORTION";
+ } else if (hit == THUMB_START) {
+ return "THUMB_START";
+ } else if (hit == WINDOW_TITLE_BAR_HEIGHT) {
+ return "WINDOW_TITLE_BAR_HEIGHT";
+ } else if (hit == THUMB_START) {
+ return "ANIMATION_FRAME";
+ }
+ return getClass().getSimpleName();
+ }
+
public String toString() {
return getConstantName(this) + (ptr == 0 ? "(unlinked)" : "");
}
@@ -138,7 +152,7 @@
}
public String toString() {
- return getConstantName(this);
+ return getClass().getSimpleName();
}
}
@@ -779,6 +793,17 @@
return hit > 0;
}
+ private String getConstantName(Hit hit) {
+ if (hit == UNKNOWN) {
+ return "UNKNOWN";
+ } else if (hit == NONE) {
+ return "NONE";
+ } else if (hit == HIT) {
+ return "HIT";
+ }
+ return getClass().getSimpleName();
+ }
+
public String toString() {
return getConstantName(this);
}
@@ -829,16 +854,4 @@
}
return Hit.UNKNOWN;
}
-
- static String getConstantName(final Object object) {
- final Class extends Object> clazz = object.getClass();
- try {
- for (final Field field : clazz.getFields()) {
- if (field.get(null) == object) {
- return field.getName();
- }
- }
- } catch (final Exception e) {}
- return clazz.getSimpleName();
- }
}
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppDockIconHandler.java
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppDockIconHandler.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppDockIconHandler.java Fri Sep 02 02:41:37 2016 +0000
@@ -72,7 +72,7 @@
public void setDockIconImage(final Image image) {
try {
- final CImage cImage = getCImageCreator().createFromImage(image);
+ final CImage cImage = CImage.createFromImage(image);
final long nsImagePtr = getNSImagePtrFrom(cImage);
nativeSetDockIconImage(nsImagePtr);
} catch (final Throwable e) {
@@ -84,7 +84,11 @@
try {
final long dockNSImage = nativeGetDockIconImage();
if (dockNSImage == 0) return null;
- return getCImageCreator().createImageUsingNativeSize(dockNSImage);
+ final Method getCreatorMethod = CImage.class.getDeclaredMethod(
+ "getCreator", new Class>[]{});
+ getCreatorMethod.setAccessible(true);
+ Creator imageCreator = (Creator) getCreatorMethod.invoke(null, new Object[]{});
+ return imageCreator.createImageUsingNativeSize(dockNSImage);
} catch (final Throwable e) {
throw new RuntimeException(e);
}
@@ -98,16 +102,6 @@
nativeSetDockIconProgress(value);
}
- static Creator getCImageCreator() {
- try {
- final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class>[] {});
- getCreatorMethod.setAccessible(true);
- return (Creator)getCreatorMethod.invoke(null, new Object[] {});
- } catch (final Throwable e) {
- throw new RuntimeException(e);
- }
- }
-
static long getNSImagePtrFrom(final CImage cImage) {
if (cImage == null) return 0;
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java Fri Sep 02 02:41:37 2016 +0000
@@ -171,7 +171,8 @@
currentQuitResponse = null;
try {
- if (defaultQuitAction == QuitStrategy.NORMAL_EXIT) System.exit(0);
+ if (defaultQuitAction == QuitStrategy.NORMAL_EXIT
+ || _AppMiscHandlers.isSuddenTerminationEnbaled()) System.exit(0);
if (defaultQuitAction != QuitStrategy.CLOSE_ALL_WINDOWS) {
throw new RuntimeException("Unknown quit action");
@@ -422,6 +423,10 @@
}
void performUsing(final QuitHandler handler, final _NativeEvent event) {
+ if (_AppMiscHandlers.isSuddenTerminationEnbaled()) {
+ performDefaultAction(event);
+ return;
+ }
final MacQuitResponse response = obtainQuitResponse(); // obtains the "current" quit response
handler.handleQuitRequestWith(new QuitEvent(), response);
}
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppMiscHandlers.java
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppMiscHandlers.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppMiscHandlers.java Fri Sep 02 02:41:37 2016 +0000
@@ -26,6 +26,8 @@
package com.apple.eawt;
class _AppMiscHandlers {
+ private static boolean isSuddenTerminationEnabled;
+
private static native void nativeOpenHelpViewer();
private static native void nativeRequestActivation(final boolean allWindows);
@@ -47,10 +49,16 @@
}
static void enableSuddenTermination() {
+ isSuddenTerminationEnabled = true;
nativeEnableSuddenTermination();
}
static void disableSuddenTermination() {
+ isSuddenTerminationEnabled = false;
nativeDisableSuddenTermination();
}
+
+ public static boolean isSuddenTerminationEnbaled() {
+ return isSuddenTerminationEnabled;
+ }
}
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaIcon.java
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaIcon.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaIcon.java Fri Sep 02 02:41:37 2016 +0000
@@ -37,6 +37,7 @@
import com.apple.laf.AquaUtilControlSize.*;
import com.apple.laf.AquaUtils.RecyclableSingleton;
+import sun.lwawt.macosx.CImage;
public class AquaIcon {
interface InvertableIcon extends Icon {
@@ -226,7 +227,7 @@
}
Image createImage() {
- return AquaUtils.getCImageCreator().createImageOfFile(file.getAbsolutePath(), getIconWidth(), getIconHeight());
+ return CImage.createImageOfFile(file.getAbsolutePath(), getIconWidth(), getIconHeight());
}
}
@@ -299,7 +300,7 @@
}
Image createImage() {
- return AquaUtils.getCImageCreator().createSystemImageFromSelector(
+ return CImage.createSystemImageFromSelector(
selector, getIconWidth(), getIconHeight());
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaImageFactory.java
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaImageFactory.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaImageFactory.java Fri Sep 02 02:41:37 2016 +0000
@@ -46,8 +46,8 @@
import com.apple.laf.AquaIcon.SystemIcon;
import com.apple.laf.AquaUtils.RecyclableObject;
import com.apple.laf.AquaUtils.RecyclableSingleton;
-import java.awt.image.MultiResolutionImage;
import sun.awt.image.MultiResolutionCachedImage;
+import sun.lwawt.macosx.CImage;
public class AquaImageFactory {
public static IconUIResource getConfirmImageIcon() {
@@ -73,7 +73,7 @@
public static IconUIResource getLockImageIcon() {
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
if (JRSUIUtils.Images.shouldUseLegacySecurityUIPath()) {
- final Image lockIcon = AquaUtils.getCImageCreator().createImageFromFile("/System/Library/CoreServices/SecurityAgent.app/Contents/Resources/Security.icns", kAlertIconSize, kAlertIconSize);
+ final Image lockIcon = CImage.createImageFromFile("/System/Library/CoreServices/SecurityAgent.app/Contents/Resources/Security.icns", kAlertIconSize, kAlertIconSize);
return getAppIconCompositedOn(lockIcon);
}
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtils.java
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtils.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtils.java Fri Sep 02 02:41:37 2016 +0000
@@ -41,8 +41,6 @@
import sun.awt.AppContext;
-import sun.lwawt.macosx.CImage;
-import sun.lwawt.macosx.CImage.Creator;
import sun.lwawt.macosx.CPlatformWindow;
import sun.reflect.misc.ReflectUtil;
import sun.security.action.GetPropertyAction;
@@ -50,6 +48,7 @@
import com.apple.laf.AquaImageFactory.SlicedImageControl;
import sun.awt.image.MultiResolutionCachedImage;
+import sun.swing.SwingAccessor;
final class AquaUtils {
@@ -78,63 +77,43 @@
}
}
- private static Creator getCImageCreatorInternal() {
- return AccessController.doPrivileged(new PrivilegedAction Base class used to maintain a strongly typed enumeration. This is
@@ -53,6 +54,17 @@
private final String defaultResourceBundleName
= "com.sun.accessibility.internal.resources.accessibility";
+ static {
+ AWTAccessor.setAccessibleBundleAccessor(
+ new AWTAccessor.AccessibleBundleAccessor() {
+
+ @Override
+ public String getKey(AccessibleBundle accessibleBundle) {
+ return accessibleBundle.key;
+ }
+ });
+ }
+
/**
* Construct an {@code AccessibleBundle}.
*/
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleContext.java
--- a/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleContext.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleContext.java Fri Sep 02 02:41:37 2016 +0000
@@ -99,6 +99,16 @@
public AppContext getAppContext(AccessibleContext accessibleContext) {
return accessibleContext.targetAppContext;
}
+
+ @Override
+ public Object getNativeAXResource(AccessibleContext accessibleContext) {
+ return accessibleContext.nativeAXResource;
+ }
+
+ @Override
+ public void setNativeAXResource(AccessibleContext accessibleContext, Object value) {
+ accessibleContext.nativeAXResource = value;
+ }
});
}
diff -r b079fff22b3c -r de9ff562c112 jdk/src/java.desktop/share/classes/javax/imageio/ImageIO.java
--- a/jdk/src/java.desktop/share/classes/javax/imageio/ImageIO.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/ImageIO.java Fri Sep 02 02:41:37 2016 +0000
@@ -462,10 +462,13 @@
return new String[0];
}
- HashSet
"
- + "Check if test button and unity icons are both blue with yellow border.
"
+ + "Check if test button icon and unity icon are both "
+ + "blue with green border.
"
+ "If Icon color is blue press pass"
+ " else press fail.
";
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/awt/print/PrinterJob/TestMediaTraySelection.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/print/PrinterJob/TestMediaTraySelection.java Fri Sep 02 02:41:37 2016 +0000
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2016, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ * @test
+ * @bug 6357887
+ * @summary Verifies if selected printertray is used
+ * @requires (os.family == "linux" | os.family == "solaris")
+ * @run main/manual TestMediaTraySelection
+ */
+
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.awt.Graphics;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.print.PageFormat;
+import java.awt.print.Printable;
+import java.awt.print.PrinterException;
+import java.awt.print.PrinterJob;
+import javax.print.DocFlavor;
+import javax.print.PrintService;
+import javax.print.PrintServiceLookup;
+import javax.print.attribute.HashPrintRequestAttributeSet;
+import javax.print.attribute.PrintRequestAttributeSet;
+import javax.print.attribute.standard.Media;
+import javax.print.attribute.standard.MediaTray;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+
+public class TestMediaTraySelection implements Printable {
+
+ private static Thread mainThread;
+ private static boolean testPassed;
+ private static boolean testGeneratedInterrupt;
+ private static PrintService prservices;
+
+ public static void main(String[] args) throws Exception {
+ prservices = PrintServiceLookup.lookupDefaultPrintService();
+ if (prservices == null) {
+ System.out.println("No print service found");
+ return;
+ }
+ System.out.println(" Print service " + prservices);
+ SwingUtilities.invokeAndWait(() -> {
+ doTest(TestMediaTraySelection::printTest);
+ });
+ mainThread = Thread.currentThread();
+ try {
+ Thread.sleep(90000);
+ } catch (InterruptedException e) {
+ if (!testPassed && testGeneratedInterrupt) {
+ throw new RuntimeException("Banner page did not print");
+ }
+ }
+ if (!testGeneratedInterrupt) {
+ throw new RuntimeException("user has not executed the test");
+ }
+ }
+
+ private static void printTest() {
+
+ MediaTray tray = null;
+ //tray = getMediaTray( prservices, "Bypass Tray" );
+ tray = getMediaTray( prservices, "Tray 4" );
+ PrintRequestAttributeSet atrset = new HashPrintRequestAttributeSet();
+ //atrset.add( MediaSizeName.ISO_A4 );
+ atrset.add(tray);
+ PrinterJob pjob = PrinterJob.getPrinterJob();
+ pjob.setPrintable(new TestMediaTraySelection());
+ try {
+ pjob.print(atrset);
+ } catch (PrinterException e) {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ static MediaTray getMediaTray( PrintService ps, String name) {
+ Media[] media = (Media[])ps.getSupportedAttributeValues( Media.class,
+ DocFlavor.SERVICE_FORMATTED.PAGEABLE, null);
+
+ for (Media m : media) {
+ if ( m instanceof MediaTray) {
+ System.out.println("MediaTray=" + m.toString() );
+ if ( m.toString().trim().indexOf( name ) > -1 ) {
+ return (MediaTray)m;
+ }
+ }
+ }
+ return null;
+ }
+
+ public static synchronized void pass() {
+ testPassed = true;
+ testGeneratedInterrupt = true;
+ mainThread.interrupt();
+ }
+
+ public static synchronized void fail() {
+ testPassed = false;
+ testGeneratedInterrupt = true;
+ mainThread.interrupt();
+ }
+
+ private static void doTest(Runnable action) {
+ String description
+ = " Please verify the \"Tray 4\" of printer is used for printout\n"
+ + " and not standard/auto tray. If yes, press PASS else press FAIL";
+
+ final JDialog dialog = new JDialog();
+ dialog.setTitle("printBannerTest");
+ JTextArea textArea = new JTextArea(description);
+ textArea.setEditable(false);
+ final JButton testButton = new JButton("Start Test");
+ final JButton passButton = new JButton("PASS");
+ passButton.setEnabled(false);
+ passButton.addActionListener((e) -> {
+ dialog.dispose();
+ pass();
+ });
+ final JButton failButton = new JButton("FAIL");
+ failButton.setEnabled(false);
+ failButton.addActionListener((e) -> {
+ dialog.dispose();
+ fail();
+ });
+ testButton.addActionListener((e) -> {
+ testButton.setEnabled(false);
+ action.run();
+ passButton.setEnabled(true);
+ failButton.setEnabled(true);
+ });
+ JPanel mainPanel = new JPanel(new BorderLayout());
+ mainPanel.add(textArea, BorderLayout.CENTER);
+ JPanel buttonPanel = new JPanel(new FlowLayout());
+ buttonPanel.add(testButton);
+ buttonPanel.add(passButton);
+ buttonPanel.add(failButton);
+ mainPanel.add(buttonPanel, BorderLayout.SOUTH);
+ dialog.add(mainPanel);
+ dialog.pack();
+ dialog.setVisible(true);
+ dialog.addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent e) {
+ System.out.println("main dialog closing");
+ testGeneratedInterrupt = false;
+ mainThread.interrupt();
+ }
+ });
+ }
+
+ @Override
+ public int print(Graphics g, PageFormat pf, int pi) {
+ System.out.println("pi = " + pi);
+ if (pi > 0) {
+ return NO_SUCH_PAGE;
+ }
+ g.drawString("Testing : " , 200, 200);
+ return PAGE_EXISTS;
+ }
+}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/beans/Introspector/Test8027905.java
--- a/jdk/test/java/beans/Introspector/Test8027905.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/beans/Introspector/Test8027905.java Fri Sep 02 02:41:37 2016 +0000
@@ -28,6 +28,7 @@
* @bug 8027905
* @summary Tests that GC does not affect a property type
* @author Sergey Malenkov
+ * @run main/othervm -mx16m Test8027905
*/
public class Test8027905 {
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/Class/GetModuleTest.java
--- a/jdk/test/java/lang/Class/GetModuleTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/Class/GetModuleTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/Class/GetPackageTest.java
--- a/jdk/test/java/lang/Class/GetPackageTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/Class/GetPackageTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/ClassLoader/GetSystemPackage.java
--- a/jdk/test/java/lang/ClassLoader/GetSystemPackage.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/ClassLoader/GetSystemPackage.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/ClassLoader/deadlock/GetResource.java
--- a/jdk/test/java/lang/ClassLoader/deadlock/GetResource.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/ClassLoader/deadlock/GetResource.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2016, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/ProcessBuilder/CloseRace.java
--- a/jdk/test/java/lang/ProcessBuilder/CloseRace.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/ProcessBuilder/CloseRace.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/ProcessBuilder/PipelineTest.java
--- a/jdk/test/java/lang/ProcessBuilder/PipelineTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/ProcessBuilder/PipelineTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
import java.io.File;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/ProcessBuilder/Zombies.java
--- a/jdk/test/java/lang/ProcessBuilder/Zombies.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/ProcessBuilder/Zombies.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,7 +25,6 @@
* @test
* @run main/othervm Zombies
* @bug 6474073 6180151
- * @key intermittent
* @summary Make sure zombies don't get created on Unix
* @author Martin Buchholz
*/
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/ProcessHandle/Basic.java
--- a/jdk/test/java/lang/ProcessHandle/Basic.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/ProcessHandle/Basic.java Fri Sep 02 02:41:37 2016 +0000
@@ -36,7 +36,7 @@
/*
* @test
- * @library /test/lib/share/classes
+ * @library /test/lib
* @modules java.base/jdk.internal.misc
* jdk.management
* @run testng Basic
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/ProcessHandle/InfoTest.java
--- a/jdk/test/java/lang/ProcessHandle/InfoTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/ProcessHandle/InfoTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -48,7 +48,7 @@
/*
* @test
* @bug 8077350 8081566 8081567 8098852 8136597
- * @library /test/lib/share/classes
+ * @library /test/lib
* @modules java.base/jdk.internal.misc
* jdk.management
* @build jdk.test.lib.Platform jdk.test.lib.Utils
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/ProcessHandle/OnExitTest.java
--- a/jdk/test/java/lang/ProcessHandle/OnExitTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/ProcessHandle/OnExitTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -38,7 +38,7 @@
/*
* @test
- * @library /test/lib/share/classes
+ * @library /test/lib
* @modules java.base/jdk.internal.misc
* jdk.management
* @build jdk.test.lib.Platform jdk.test.lib.Utils
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/ProcessHandle/TreeTest.java
--- a/jdk/test/java/lang/ProcessHandle/TreeTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/ProcessHandle/TreeTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -44,7 +44,7 @@
/*
* @test
- * @library /test/lib/share/classes
+ * @library /test/lib
* @modules java.base/jdk.internal.misc
* jdk.management
* @build jdk.test.lib.Utils
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/StackWalker/CountLocalSlots.java
--- a/jdk/test/java/lang/StackWalker/CountLocalSlots.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/StackWalker/CountLocalSlots.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/StackWalker/LocalsAndOperands.java
--- a/jdk/test/java/lang/StackWalker/LocalsAndOperands.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/StackWalker/LocalsAndOperands.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/StackWalker/LocalsCrash.java
--- a/jdk/test/java/lang/StackWalker/LocalsCrash.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/StackWalker/LocalsCrash.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/String/concat/CompactStringsInitialCoder.java
--- a/jdk/test/java/lang/String/concat/CompactStringsInitialCoder.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/String/concat/CompactStringsInitialCoder.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/String/concat/StringConcatFactoryEmptyMethods.java
--- a/jdk/test/java/lang/String/concat/StringConcatFactoryEmptyMethods.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/String/concat/StringConcatFactoryEmptyMethods.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/String/concat/WithSecurityManager.java
--- a/jdk/test/java/lang/String/concat/WithSecurityManager.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/String/concat/WithSecurityManager.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/Thread/ThreadStateController.java
--- a/jdk/test/java/lang/Thread/ThreadStateController.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/Thread/ThreadStateController.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/annotation/typeAnnotations/GetAnnotatedReceiverType.java
--- a/jdk/test/java/lang/annotation/typeAnnotations/GetAnnotatedReceiverType.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/annotation/typeAnnotations/GetAnnotatedReceiverType.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/instrument/NMTHelper.java
--- a/jdk/test/java/lang/instrument/NMTHelper.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/instrument/NMTHelper.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/instrument/NativeMethodPrefixAgent.java
--- a/jdk/test/java/lang/instrument/NativeMethodPrefixAgent.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/instrument/NativeMethodPrefixAgent.java Fri Sep 02 02:41:37 2016 +0000
@@ -24,6 +24,7 @@
/**
* @test
* @bug 6263319
+ * @requires ((vm.opt.StartFlightRecording == null) | (vm.opt.StartFlightRecording == false)) & ((vm.opt.FlightRecorder == null) | (vm.opt.FlightRecorder == false))
* @summary test setNativeMethodPrefix
* @author Robert Field, Sun Microsystems
*
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/instrument/RedefineBigClass.sh
--- a/jdk/test/java/lang/instrument/RedefineBigClass.sh Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/instrument/RedefineBigClass.sh Fri Sep 02 02:41:37 2016 +0000
@@ -70,7 +70,7 @@
fi
"${JAVA}" ${TESTVMOPTS} \
- -XX:TraceRedefineClasses=3 ${NMT} \
+ -Xlog:redefine+class+load=debug,redefine+class+load+exceptions=info ${NMT} \
-javaagent:RedefineBigClassAgent.jar=BigClass.class \
-classpath "${TESTCLASSES}" RedefineBigClassApp \
> output.log 2>&1
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh
--- a/jdk/test/java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh Fri Sep 02 02:41:37 2016 +0000
@@ -87,23 +87,8 @@
echo "INFO: launching RedefineSubclassWithTwoInterfacesApp"
-# TraceRedefineClasses options:
-#
-# 0x00000001 | 1 - name each target class before loading, after
-# loading and after redefinition is completed
-# 0x00000002 | 2 - print info if parsing, linking or
-# verification throws an exception
-# 0x00000004 | 4 - print timer info for the VM operation
-# 0x00001000 | 4096 - detect calls to obsolete methods
-# 0x00002000 | 8192 - fail a guarantee() in addition to detection
-# 0x00004000 | 16384 - detect old/obsolete methods in metadata
-# 0x00100000 | 1048576 - impl details: vtable updates
-# 0x00200000 | 2097152 - impl details: itable updates
-#
-# 1+2+4+4096+8192+16384+1048576+2097152 == 3174407
-
"${JAVA}" ${TESTVMOPTS} \
- -XX:TraceRedefineClasses=3174407 \
+ -Xlog:redefine+class+load=trace,redefine+class+load+exceptions=trace,redefine+class+timer=trace,redefine+class+obsolete=trace,redefine+class+obsolete+metadata=trace,redefine+class+constantpool=trace \
-javaagent:RedefineSubclassWithTwoInterfacesAgent.jar \
-classpath "${TESTCLASSES}" \
RedefineSubclassWithTwoInterfacesApp > output.log 2>&1
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/instrument/RetransformBigClass.sh
--- a/jdk/test/java/lang/instrument/RetransformBigClass.sh Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/instrument/RetransformBigClass.sh Fri Sep 02 02:41:37 2016 +0000
@@ -70,7 +70,7 @@
fi
"${JAVA}" ${TESTVMOPTS} \
- -XX:TraceRedefineClasses=3 ${NMT} \
+ -Xlog:redefine+class+load=debug,redefine+class+load+exceptions=info ${NMT} \
-javaagent:RetransformBigClassAgent.jar=BigClass.class \
-classpath "${TESTCLASSES}" RetransformBigClassApp \
> output.log 2>&1
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/6987555/Test6987555.java
--- a/jdk/test/java/lang/invoke/6987555/Test6987555.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/6987555/Test6987555.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/6991596/Test6991596.java
--- a/jdk/test/java/lang/invoke/6991596/Test6991596.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/6991596/Test6991596.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/6998541/Test6998541.java
--- a/jdk/test/java/lang/invoke/6998541/Test6998541.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/6998541/Test6998541.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/7087570/Test7087570.java
--- a/jdk/test/java/lang/invoke/7087570/Test7087570.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/7087570/Test7087570.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
/* @test
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/7157574/Test7157574.java
--- a/jdk/test/java/lang/invoke/7157574/Test7157574.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/7157574/Test7157574.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
/*
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/7196190/ClassForNameTest.java
--- a/jdk/test/java/lang/invoke/7196190/ClassForNameTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/7196190/ClassForNameTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/7196190/GetUnsafeTest.java
--- a/jdk/test/java/lang/invoke/7196190/GetUnsafeTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/7196190/GetUnsafeTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/8009222/Test8009222.java
--- a/jdk/test/java/lang/invoke/8009222/Test8009222.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/8009222/Test8009222.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/8022701/BogoLoader.java
--- a/jdk/test/java/lang/invoke/8022701/BogoLoader.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/8022701/BogoLoader.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
import java.io.BufferedInputStream;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/8022701/InvokeSeveralWays.java
--- a/jdk/test/java/lang/invoke/8022701/InvokeSeveralWays.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/8022701/InvokeSeveralWays.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
import java.lang.reflect.InvocationTargetException;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/8022701/Invoker.java
--- a/jdk/test/java/lang/invoke/8022701/Invoker.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/8022701/Invoker.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
public class Invoker {
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/8022701/MHIllegalAccess.java
--- a/jdk/test/java/lang/invoke/8022701/MHIllegalAccess.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/8022701/MHIllegalAccess.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/8022701/MethodSupplier.java
--- a/jdk/test/java/lang/invoke/8022701/MethodSupplier.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/8022701/MethodSupplier.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
/*
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/CallSiteTest.java
--- a/jdk/test/java/lang/invoke/CallSiteTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/CallSiteTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/CallStaticInitOrder.java
--- a/jdk/test/java/lang/invoke/CallStaticInitOrder.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/CallStaticInitOrder.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/Test.java
--- a/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/Test.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/Test.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/p1/T2.java
--- a/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/p1/T2.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/p1/T2.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,8 +19,8 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
+
package p1;
import p2.T3;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/p2/T3.java
--- a/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/p2/T3.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/ProtectedMemberDifferentPackage/p2/T3.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,8 +19,8 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
+
package p2;
import p1.T2;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleBaseTest.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleBaseTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleBaseTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -132,7 +132,8 @@
COMPARE_AND_SET,
COMPARE_AND_EXCHANGE,
GET_AND_SET,
- GET_AND_ADD;
+ GET_AND_ADD,
+ GET_AND_BITWISE;
}
enum TestAccessMode {
@@ -148,13 +149,26 @@
COMPARE_AND_EXCHANGE(TestAccessType.COMPARE_AND_EXCHANGE),
COMPARE_AND_EXCHANGE_ACQUIRE(TestAccessType.COMPARE_AND_EXCHANGE),
COMPARE_AND_EXCHANGE_RELEASE(TestAccessType.COMPARE_AND_EXCHANGE),
+ WEAK_COMPARE_AND_SET_PLAIN(TestAccessType.COMPARE_AND_SET),
WEAK_COMPARE_AND_SET(TestAccessType.COMPARE_AND_SET),
- WEAK_COMPARE_AND_SET_VOLATILE(TestAccessType.COMPARE_AND_SET),
WEAK_COMPARE_AND_SET_ACQUIRE(TestAccessType.COMPARE_AND_SET),
WEAK_COMPARE_AND_SET_RELEASE(TestAccessType.COMPARE_AND_SET),
GET_AND_SET(TestAccessType.GET_AND_SET),
+ GET_AND_SET_ACQUIRE(TestAccessType.GET_AND_SET),
+ GET_AND_SET_RELEASE(TestAccessType.GET_AND_SET),
GET_AND_ADD(TestAccessType.GET_AND_ADD),
- ADD_AND_GET(TestAccessType.GET_AND_ADD),;
+ GET_AND_ADD_ACQUIRE(TestAccessType.GET_AND_ADD),
+ GET_AND_ADD_RELEASE(TestAccessType.GET_AND_ADD),
+ GET_AND_BITWISE_OR(TestAccessType.GET_AND_BITWISE),
+ GET_AND_BITWISE_OR_ACQUIRE(TestAccessType.GET_AND_BITWISE),
+ GET_AND_BITWISE_OR_RELEASE(TestAccessType.GET_AND_BITWISE),
+ GET_AND_BITWISE_AND(TestAccessType.GET_AND_BITWISE),
+ GET_AND_BITWISE_AND_ACQUIRE(TestAccessType.GET_AND_BITWISE),
+ GET_AND_BITWISE_AND_RELEASE(TestAccessType.GET_AND_BITWISE),
+ GET_AND_BITWISE_XOR(TestAccessType.GET_AND_BITWISE),
+ GET_AND_BITWISE_XOR_ACQUIRE(TestAccessType.GET_AND_BITWISE),
+ GET_AND_BITWISE_XOR_RELEASE(TestAccessType.GET_AND_BITWISE),
+ ;
final TestAccessType at;
final boolean isPolyMorphicInReturnType;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java Fri Sep 02 02:41:37 2016 +0000
@@ -103,14 +103,27 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@@ -266,8 +279,13 @@
});
checkUOE(() -> {
- boolean o = (boolean) vh.addAndGet(recv, true);
+ boolean o = (boolean) vh.getAndAddAcquire(recv, true);
});
+
+ checkUOE(() -> {
+ boolean o = (boolean) vh.getAndAddRelease(recv, true);
+ });
+
}
@@ -321,8 +339,13 @@
});
checkUOE(() -> {
- boolean o = (boolean) vh.addAndGet(true);
+ boolean o = (boolean) vh.getAndAddAcquire(true);
});
+
+ checkUOE(() -> {
+ boolean o = (boolean) vh.getAndAddRelease(true);
+ });
+
}
@@ -418,11 +441,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(recv, true, false);
+ success = vh.weakCompareAndSetPlain(recv, true, false);
}
- assertEquals(success, true, "weakCompareAndSet boolean");
+ assertEquals(success, true, "weakCompareAndSetPlain boolean");
boolean x = (boolean) vh.get(recv);
- assertEquals(x, false, "weakCompareAndSet boolean value");
+ assertEquals(x, false, "weakCompareAndSetPlain boolean value");
}
{
@@ -448,21 +471,125 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(recv, false, true);
+ success = vh.weakCompareAndSet(recv, false, true);
}
- assertEquals(success, true, "weakCompareAndSetVolatile boolean");
+ assertEquals(success, true, "weakCompareAndSet boolean");
boolean x = (boolean) vh.get(recv);
- assertEquals(x, true, "weakCompareAndSetVolatile boolean value");
+ assertEquals(x, true, "weakCompareAndSet boolean value");
}
// Compare set and get
{
+ vh.set(recv, true);
+
boolean o = (boolean) vh.getAndSet(recv, false);
assertEquals(o, true, "getAndSet boolean");
boolean x = (boolean) vh.get(recv);
assertEquals(x, false, "getAndSet boolean value");
}
+ {
+ vh.set(recv, true);
+
+ boolean o = (boolean) vh.getAndSetAcquire(recv, false);
+ assertEquals(o, true, "getAndSetAcquire boolean");
+ boolean x = (boolean) vh.get(recv);
+ assertEquals(x, false, "getAndSetAcquire boolean value");
+ }
+
+ {
+ vh.set(recv, true);
+
+ boolean o = (boolean) vh.getAndSetRelease(recv, false);
+ assertEquals(o, true, "getAndSetRelease boolean");
+ boolean x = (boolean) vh.get(recv);
+ assertEquals(x, false, "getAndSetRelease boolean value");
+ }
+
+
+ // get and bitwise or
+ {
+ vh.set(recv, true);
+
+ boolean o = (boolean) vh.getAndBitwiseOr(recv, false);
+ assertEquals(o, true, "getAndBitwiseOr boolean");
+ boolean x = (boolean) vh.get(recv);
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOr boolean value");
+ }
+
+ {
+ vh.set(recv, true);
+
+ boolean o = (boolean) vh.getAndBitwiseOrAcquire(recv, false);
+ assertEquals(o, true, "getAndBitwiseOrAcquire boolean");
+ boolean x = (boolean) vh.get(recv);
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOrAcquire boolean value");
+ }
+
+ {
+ vh.set(recv, true);
+
+ boolean o = (boolean) vh.getAndBitwiseOrRelease(recv, false);
+ assertEquals(o, true, "getAndBitwiseOrRelease boolean");
+ boolean x = (boolean) vh.get(recv);
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOrRelease boolean value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(recv, true);
+
+ boolean o = (boolean) vh.getAndBitwiseAnd(recv, false);
+ assertEquals(o, true, "getAndBitwiseAnd boolean");
+ boolean x = (boolean) vh.get(recv);
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAnd boolean value");
+ }
+
+ {
+ vh.set(recv, true);
+
+ boolean o = (boolean) vh.getAndBitwiseAndAcquire(recv, false);
+ assertEquals(o, true, "getAndBitwiseAndAcquire boolean");
+ boolean x = (boolean) vh.get(recv);
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAndAcquire boolean value");
+ }
+
+ {
+ vh.set(recv, true);
+
+ boolean o = (boolean) vh.getAndBitwiseAndRelease(recv, false);
+ assertEquals(o, true, "getAndBitwiseAndRelease boolean");
+ boolean x = (boolean) vh.get(recv);
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAndRelease boolean value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(recv, true);
+
+ boolean o = (boolean) vh.getAndBitwiseXor(recv, false);
+ assertEquals(o, true, "getAndBitwiseXor boolean");
+ boolean x = (boolean) vh.get(recv);
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXor boolean value");
+ }
+
+ {
+ vh.set(recv, true);
+
+ boolean o = (boolean) vh.getAndBitwiseXorAcquire(recv, false);
+ assertEquals(o, true, "getAndBitwiseXorAcquire boolean");
+ boolean x = (boolean) vh.get(recv);
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXorAcquire boolean value");
+ }
+
+ {
+ vh.set(recv, true);
+
+ boolean o = (boolean) vh.getAndBitwiseXorRelease(recv, false);
+ assertEquals(o, true, "getAndBitwiseXorRelease boolean");
+ boolean x = (boolean) vh.get(recv);
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXorRelease boolean value");
+ }
}
static void testInstanceFieldUnsupported(VarHandleTestAccessBoolean recv, VarHandle vh) {
@@ -472,8 +599,13 @@
});
checkUOE(() -> {
- boolean o = (boolean) vh.addAndGet(recv, true);
+ boolean o = (boolean) vh.getAndAddAcquire(recv, true);
});
+
+ checkUOE(() -> {
+ boolean o = (boolean) vh.getAndAddRelease(recv, true);
+ });
+
}
@@ -569,11 +701,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(true, false);
+ success = vh.weakCompareAndSetPlain(true, false);
}
- assertEquals(success, true, "weakCompareAndSet boolean");
+ assertEquals(success, true, "weakCompareAndSetPlain boolean");
boolean x = (boolean) vh.get();
- assertEquals(x, false, "weakCompareAndSet boolean value");
+ assertEquals(x, false, "weakCompareAndSetPlain boolean value");
}
{
@@ -599,21 +731,125 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetRelease(false, true);
+ success = vh.weakCompareAndSet(false, true);
}
- assertEquals(success, true, "weakCompareAndSetVolatile boolean");
+ assertEquals(success, true, "weakCompareAndSet boolean");
boolean x = (boolean) vh.get();
- assertEquals(x, true, "weakCompareAndSetVolatile boolean");
+ assertEquals(x, true, "weakCompareAndSet boolean");
}
// Compare set and get
{
+ vh.set(true);
+
boolean o = (boolean) vh.getAndSet(false);
assertEquals(o, true, "getAndSet boolean");
boolean x = (boolean) vh.get();
assertEquals(x, false, "getAndSet boolean value");
}
+ {
+ vh.set(true);
+
+ boolean o = (boolean) vh.getAndSetAcquire(false);
+ assertEquals(o, true, "getAndSetAcquire boolean");
+ boolean x = (boolean) vh.get();
+ assertEquals(x, false, "getAndSetAcquire boolean value");
+ }
+
+ {
+ vh.set(true);
+
+ boolean o = (boolean) vh.getAndSetRelease(false);
+ assertEquals(o, true, "getAndSetRelease boolean");
+ boolean x = (boolean) vh.get();
+ assertEquals(x, false, "getAndSetRelease boolean value");
+ }
+
+
+ // get and bitwise or
+ {
+ vh.set(true);
+
+ boolean o = (boolean) vh.getAndBitwiseOr(false);
+ assertEquals(o, true, "getAndBitwiseOr boolean");
+ boolean x = (boolean) vh.get();
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOr boolean value");
+ }
+
+ {
+ vh.set(true);
+
+ boolean o = (boolean) vh.getAndBitwiseOrAcquire(false);
+ assertEquals(o, true, "getAndBitwiseOrAcquire boolean");
+ boolean x = (boolean) vh.get();
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOrAcquire boolean value");
+ }
+
+ {
+ vh.set(true);
+
+ boolean o = (boolean) vh.getAndBitwiseOrRelease(false);
+ assertEquals(o, true, "getAndBitwiseOrRelease boolean");
+ boolean x = (boolean) vh.get();
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOrRelease boolean value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(true);
+
+ boolean o = (boolean) vh.getAndBitwiseAnd(false);
+ assertEquals(o, true, "getAndBitwiseAnd boolean");
+ boolean x = (boolean) vh.get();
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAnd boolean value");
+ }
+
+ {
+ vh.set(true);
+
+ boolean o = (boolean) vh.getAndBitwiseAndAcquire(false);
+ assertEquals(o, true, "getAndBitwiseAndAcquire boolean");
+ boolean x = (boolean) vh.get();
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAndAcquire boolean value");
+ }
+
+ {
+ vh.set(true);
+
+ boolean o = (boolean) vh.getAndBitwiseAndRelease(false);
+ assertEquals(o, true, "getAndBitwiseAndRelease boolean");
+ boolean x = (boolean) vh.get();
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAndRelease boolean value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(true);
+
+ boolean o = (boolean) vh.getAndBitwiseXor(false);
+ assertEquals(o, true, "getAndBitwiseXor boolean");
+ boolean x = (boolean) vh.get();
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXor boolean value");
+ }
+
+ {
+ vh.set(true);
+
+ boolean o = (boolean) vh.getAndBitwiseXorAcquire(false);
+ assertEquals(o, true, "getAndBitwiseXorAcquire boolean");
+ boolean x = (boolean) vh.get();
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXorAcquire boolean value");
+ }
+
+ {
+ vh.set(true);
+
+ boolean o = (boolean) vh.getAndBitwiseXorRelease(false);
+ assertEquals(o, true, "getAndBitwiseXorRelease boolean");
+ boolean x = (boolean) vh.get();
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXorRelease boolean value");
+ }
}
static void testStaticFieldUnsupported(VarHandle vh) {
@@ -623,8 +859,13 @@
});
checkUOE(() -> {
- boolean o = (boolean) vh.addAndGet(true);
+ boolean o = (boolean) vh.getAndAddAcquire(true);
});
+
+ checkUOE(() -> {
+ boolean o = (boolean) vh.getAndAddRelease(true);
+ });
+
}
@@ -723,11 +964,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, true, false);
+ success = vh.weakCompareAndSetPlain(array, i, true, false);
}
- assertEquals(success, true, "weakCompareAndSet boolean");
+ assertEquals(success, true, "weakCompareAndSetPlain boolean");
boolean x = (boolean) vh.get(array, i);
- assertEquals(x, false, "weakCompareAndSet boolean value");
+ assertEquals(x, false, "weakCompareAndSetPlain boolean value");
}
{
@@ -753,21 +994,125 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(array, i, false, true);
+ success = vh.weakCompareAndSet(array, i, false, true);
}
- assertEquals(success, true, "weakCompareAndSetVolatile boolean");
+ assertEquals(success, true, "weakCompareAndSet boolean");
boolean x = (boolean) vh.get(array, i);
- assertEquals(x, true, "weakCompareAndSetVolatile boolean");
+ assertEquals(x, true, "weakCompareAndSet boolean");
}
// Compare set and get
{
+ vh.set(array, i, true);
+
boolean o = (boolean) vh.getAndSet(array, i, false);
assertEquals(o, true, "getAndSet boolean");
boolean x = (boolean) vh.get(array, i);
assertEquals(x, false, "getAndSet boolean value");
}
+ {
+ vh.set(array, i, true);
+
+ boolean o = (boolean) vh.getAndSetAcquire(array, i, false);
+ assertEquals(o, true, "getAndSetAcquire boolean");
+ boolean x = (boolean) vh.get(array, i);
+ assertEquals(x, false, "getAndSetAcquire boolean value");
+ }
+
+ {
+ vh.set(array, i, true);
+
+ boolean o = (boolean) vh.getAndSetRelease(array, i, false);
+ assertEquals(o, true, "getAndSetRelease boolean");
+ boolean x = (boolean) vh.get(array, i);
+ assertEquals(x, false, "getAndSetRelease boolean value");
+ }
+
+
+ // get and bitwise or
+ {
+ vh.set(array, i, true);
+
+ boolean o = (boolean) vh.getAndBitwiseOr(array, i, false);
+ assertEquals(o, true, "getAndBitwiseOr boolean");
+ boolean x = (boolean) vh.get(array, i);
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOr boolean value");
+ }
+
+ {
+ vh.set(array, i, true);
+
+ boolean o = (boolean) vh.getAndBitwiseOrAcquire(array, i, false);
+ assertEquals(o, true, "getAndBitwiseOrAcquire boolean");
+ boolean x = (boolean) vh.get(array, i);
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOrAcquire boolean value");
+ }
+
+ {
+ vh.set(array, i, true);
+
+ boolean o = (boolean) vh.getAndBitwiseOrRelease(array, i, false);
+ assertEquals(o, true, "getAndBitwiseOrRelease boolean");
+ boolean x = (boolean) vh.get(array, i);
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOrRelease boolean value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(array, i, true);
+
+ boolean o = (boolean) vh.getAndBitwiseAnd(array, i, false);
+ assertEquals(o, true, "getAndBitwiseAnd boolean");
+ boolean x = (boolean) vh.get(array, i);
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAnd boolean value");
+ }
+
+ {
+ vh.set(array, i, true);
+
+ boolean o = (boolean) vh.getAndBitwiseAndAcquire(array, i, false);
+ assertEquals(o, true, "getAndBitwiseAndAcquire boolean");
+ boolean x = (boolean) vh.get(array, i);
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAndAcquire boolean value");
+ }
+
+ {
+ vh.set(array, i, true);
+
+ boolean o = (boolean) vh.getAndBitwiseAndRelease(array, i, false);
+ assertEquals(o, true, "getAndBitwiseAndRelease boolean");
+ boolean x = (boolean) vh.get(array, i);
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAndRelease boolean value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(array, i, true);
+
+ boolean o = (boolean) vh.getAndBitwiseXor(array, i, false);
+ assertEquals(o, true, "getAndBitwiseXor boolean");
+ boolean x = (boolean) vh.get(array, i);
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXor boolean value");
+ }
+
+ {
+ vh.set(array, i, true);
+
+ boolean o = (boolean) vh.getAndBitwiseXorAcquire(array, i, false);
+ assertEquals(o, true, "getAndBitwiseXorAcquire boolean");
+ boolean x = (boolean) vh.get(array, i);
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXorAcquire boolean value");
+ }
+
+ {
+ vh.set(array, i, true);
+
+ boolean o = (boolean) vh.getAndBitwiseXorRelease(array, i, false);
+ assertEquals(o, true, "getAndBitwiseXorRelease boolean");
+ boolean x = (boolean) vh.get(array, i);
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXorRelease boolean value");
+ }
}
}
@@ -781,8 +1126,13 @@
});
checkUOE(() -> {
- boolean o = (boolean) vh.addAndGet(array, i, true);
+ boolean o = (boolean) vh.getAndAddAcquire(array, i, true);
});
+
+ checkUOE(() -> {
+ boolean o = (boolean) vh.getAndAddRelease(array, i, true);
+ });
+
}
static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
@@ -840,11 +1190,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, true, false);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, true, false);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, true, false);
+ boolean r = vh.weakCompareAndSet(array, ci, true, false);
});
checkIOOBE(() -> {
@@ -859,6 +1209,50 @@
boolean o = (boolean) vh.getAndSet(array, ci, true);
});
+ checkIOOBE(() -> {
+ boolean o = (boolean) vh.getAndSetAcquire(array, ci, true);
+ });
+
+ checkIOOBE(() -> {
+ boolean o = (boolean) vh.getAndSetRelease(array, ci, true);
+ });
+
+
+ checkIOOBE(() -> {
+ boolean o = (boolean) vh.getAndBitwiseOr(array, ci, true);
+ });
+
+ checkIOOBE(() -> {
+ boolean o = (boolean) vh.getAndBitwiseOrAcquire(array, ci, true);
+ });
+
+ checkIOOBE(() -> {
+ boolean o = (boolean) vh.getAndBitwiseOrRelease(array, ci, true);
+ });
+
+ checkIOOBE(() -> {
+ boolean o = (boolean) vh.getAndBitwiseAnd(array, ci, true);
+ });
+
+ checkIOOBE(() -> {
+ boolean o = (boolean) vh.getAndBitwiseAndAcquire(array, ci, true);
+ });
+
+ checkIOOBE(() -> {
+ boolean o = (boolean) vh.getAndBitwiseAndRelease(array, ci, true);
+ });
+
+ checkIOOBE(() -> {
+ boolean o = (boolean) vh.getAndBitwiseXor(array, ci, true);
+ });
+
+ checkIOOBE(() -> {
+ boolean o = (boolean) vh.getAndBitwiseXorAcquire(array, ci, true);
+ });
+
+ checkIOOBE(() -> {
+ boolean o = (boolean) vh.getAndBitwiseXorRelease(array, ci, true);
+ });
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessByte.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessByte.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessByte.java Fri Sep 02 02:41:37 2016 +0000
@@ -103,14 +103,27 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@@ -261,6 +274,7 @@
});
+
}
@@ -309,6 +323,7 @@
});
+
}
@@ -404,11 +419,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(recv, (byte)0x01, (byte)0x23);
+ success = vh.weakCompareAndSetPlain(recv, (byte)0x01, (byte)0x23);
}
- assertEquals(success, true, "weakCompareAndSet byte");
+ assertEquals(success, true, "weakCompareAndSetPlain byte");
byte x = (byte) vh.get(recv);
- assertEquals(x, (byte)0x23, "weakCompareAndSet byte value");
+ assertEquals(x, (byte)0x23, "weakCompareAndSetPlain byte value");
}
{
@@ -434,34 +449,157 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(recv, (byte)0x23, (byte)0x01);
+ success = vh.weakCompareAndSet(recv, (byte)0x23, (byte)0x01);
}
- assertEquals(success, true, "weakCompareAndSetVolatile byte");
+ assertEquals(success, true, "weakCompareAndSet byte");
byte x = (byte) vh.get(recv);
- assertEquals(x, (byte)0x01, "weakCompareAndSetVolatile byte value");
+ assertEquals(x, (byte)0x01, "weakCompareAndSet byte value");
}
// Compare set and get
{
+ vh.set(recv, (byte)0x01);
+
byte o = (byte) vh.getAndSet(recv, (byte)0x23);
assertEquals(o, (byte)0x01, "getAndSet byte");
byte x = (byte) vh.get(recv);
assertEquals(x, (byte)0x23, "getAndSet byte value");
}
- vh.set(recv, (byte)0x01);
+ {
+ vh.set(recv, (byte)0x01);
+
+ byte o = (byte) vh.getAndSetAcquire(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndSetAcquire byte");
+ byte x = (byte) vh.get(recv);
+ assertEquals(x, (byte)0x23, "getAndSetAcquire byte value");
+ }
+
+ {
+ vh.set(recv, (byte)0x01);
+
+ byte o = (byte) vh.getAndSetRelease(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndSetRelease byte");
+ byte x = (byte) vh.get(recv);
+ assertEquals(x, (byte)0x23, "getAndSetRelease byte value");
+ }
// get and add, add and get
{
- byte o = (byte) vh.getAndAdd(recv, (byte)0x45);
+ vh.set(recv, (byte)0x01);
+
+ byte o = (byte) vh.getAndAdd(recv, (byte)0x23);
assertEquals(o, (byte)0x01, "getAndAdd byte");
- byte c = (byte) vh.addAndGet(recv, (byte)0x45);
- assertEquals(c, (byte)((byte)0x01 + (byte)0x45 + (byte)0x45), "getAndAdd byte value");
+ byte x = (byte) vh.get(recv);
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAdd byte value");
+ }
+
+ {
+ vh.set(recv, (byte)0x01);
+
+ byte o = (byte) vh.getAndAddAcquire(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndAddAcquire byte");
+ byte x = (byte) vh.get(recv);
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAddAcquire byte value");
+ }
+
+ {
+ vh.set(recv, (byte)0x01);
+
+ byte o = (byte) vh.getAndAddRelease(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndAddReleasebyte");
+ byte x = (byte) vh.get(recv);
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAddRelease byte value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(recv, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseOr(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOr byte");
+ byte x = (byte) vh.get(recv);
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOr byte value");
+ }
+
+ {
+ vh.set(recv, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseOrAcquire(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOrAcquire byte");
+ byte x = (byte) vh.get(recv);
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOrAcquire byte value");
+ }
+
+ {
+ vh.set(recv, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseOrRelease(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOrRelease byte");
+ byte x = (byte) vh.get(recv);
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOrRelease byte value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(recv, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseAnd(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAnd byte");
+ byte x = (byte) vh.get(recv);
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAnd byte value");
+ }
+
+ {
+ vh.set(recv, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseAndAcquire(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAndAcquire byte");
+ byte x = (byte) vh.get(recv);
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAndAcquire byte value");
+ }
+
+ {
+ vh.set(recv, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseAndRelease(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAndRelease byte");
+ byte x = (byte) vh.get(recv);
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAndRelease byte value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(recv, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseXor(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXor byte");
+ byte x = (byte) vh.get(recv);
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXor byte value");
+ }
+
+ {
+ vh.set(recv, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseXorAcquire(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXorAcquire byte");
+ byte x = (byte) vh.get(recv);
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXorAcquire byte value");
+ }
+
+ {
+ vh.set(recv, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseXorRelease(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXorRelease byte");
+ byte x = (byte) vh.get(recv);
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXorRelease byte value");
}
}
static void testInstanceFieldUnsupported(VarHandleTestAccessByte recv, VarHandle vh) {
+
}
@@ -557,11 +695,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet((byte)0x01, (byte)0x23);
+ success = vh.weakCompareAndSetPlain((byte)0x01, (byte)0x23);
}
- assertEquals(success, true, "weakCompareAndSet byte");
+ assertEquals(success, true, "weakCompareAndSetPlain byte");
byte x = (byte) vh.get();
- assertEquals(x, (byte)0x23, "weakCompareAndSet byte value");
+ assertEquals(x, (byte)0x23, "weakCompareAndSetPlain byte value");
}
{
@@ -587,34 +725,157 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetRelease((byte)0x23, (byte)0x01);
+ success = vh.weakCompareAndSet((byte)0x23, (byte)0x01);
}
- assertEquals(success, true, "weakCompareAndSetVolatile byte");
+ assertEquals(success, true, "weakCompareAndSet byte");
byte x = (byte) vh.get();
- assertEquals(x, (byte)0x01, "weakCompareAndSetVolatile byte");
+ assertEquals(x, (byte)0x01, "weakCompareAndSet byte");
}
// Compare set and get
{
+ vh.set((byte)0x01);
+
byte o = (byte) vh.getAndSet((byte)0x23);
assertEquals(o, (byte)0x01, "getAndSet byte");
byte x = (byte) vh.get();
assertEquals(x, (byte)0x23, "getAndSet byte value");
}
- vh.set((byte)0x01);
+ {
+ vh.set((byte)0x01);
+
+ byte o = (byte) vh.getAndSetAcquire((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndSetAcquire byte");
+ byte x = (byte) vh.get();
+ assertEquals(x, (byte)0x23, "getAndSetAcquire byte value");
+ }
+
+ {
+ vh.set((byte)0x01);
+
+ byte o = (byte) vh.getAndSetRelease((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndSetRelease byte");
+ byte x = (byte) vh.get();
+ assertEquals(x, (byte)0x23, "getAndSetRelease byte value");
+ }
// get and add, add and get
{
- byte o = (byte) vh.getAndAdd( (byte)0x45);
+ vh.set((byte)0x01);
+
+ byte o = (byte) vh.getAndAdd((byte)0x23);
assertEquals(o, (byte)0x01, "getAndAdd byte");
- byte c = (byte) vh.addAndGet((byte)0x45);
- assertEquals(c, (byte)((byte)0x01 + (byte)0x45 + (byte)0x45), "getAndAdd byte value");
+ byte x = (byte) vh.get();
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAdd byte value");
+ }
+
+ {
+ vh.set((byte)0x01);
+
+ byte o = (byte) vh.getAndAddAcquire((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndAddAcquire byte");
+ byte x = (byte) vh.get();
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAddAcquire byte value");
+ }
+
+ {
+ vh.set((byte)0x01);
+
+ byte o = (byte) vh.getAndAddRelease((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndAddReleasebyte");
+ byte x = (byte) vh.get();
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAddRelease byte value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set((byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseOr((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOr byte");
+ byte x = (byte) vh.get();
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOr byte value");
+ }
+
+ {
+ vh.set((byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseOrAcquire((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOrAcquire byte");
+ byte x = (byte) vh.get();
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOrAcquire byte value");
+ }
+
+ {
+ vh.set((byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseOrRelease((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOrRelease byte");
+ byte x = (byte) vh.get();
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOrRelease byte value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set((byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseAnd((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAnd byte");
+ byte x = (byte) vh.get();
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAnd byte value");
+ }
+
+ {
+ vh.set((byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseAndAcquire((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAndAcquire byte");
+ byte x = (byte) vh.get();
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAndAcquire byte value");
+ }
+
+ {
+ vh.set((byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseAndRelease((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAndRelease byte");
+ byte x = (byte) vh.get();
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAndRelease byte value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set((byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseXor((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXor byte");
+ byte x = (byte) vh.get();
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXor byte value");
+ }
+
+ {
+ vh.set((byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseXorAcquire((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXorAcquire byte");
+ byte x = (byte) vh.get();
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXorAcquire byte value");
+ }
+
+ {
+ vh.set((byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseXorRelease((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXorRelease byte");
+ byte x = (byte) vh.get();
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXorRelease byte value");
}
}
static void testStaticFieldUnsupported(VarHandle vh) {
+
}
@@ -713,11 +974,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, (byte)0x01, (byte)0x23);
+ success = vh.weakCompareAndSetPlain(array, i, (byte)0x01, (byte)0x23);
}
- assertEquals(success, true, "weakCompareAndSet byte");
+ assertEquals(success, true, "weakCompareAndSetPlain byte");
byte x = (byte) vh.get(array, i);
- assertEquals(x, (byte)0x23, "weakCompareAndSet byte value");
+ assertEquals(x, (byte)0x23, "weakCompareAndSetPlain byte value");
}
{
@@ -743,29 +1004,151 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(array, i, (byte)0x23, (byte)0x01);
+ success = vh.weakCompareAndSet(array, i, (byte)0x23, (byte)0x01);
}
- assertEquals(success, true, "weakCompareAndSetVolatile byte");
+ assertEquals(success, true, "weakCompareAndSet byte");
byte x = (byte) vh.get(array, i);
- assertEquals(x, (byte)0x01, "weakCompareAndSetVolatile byte");
+ assertEquals(x, (byte)0x01, "weakCompareAndSet byte");
}
// Compare set and get
{
+ vh.set(array, i, (byte)0x01);
+
byte o = (byte) vh.getAndSet(array, i, (byte)0x23);
assertEquals(o, (byte)0x01, "getAndSet byte");
byte x = (byte) vh.get(array, i);
assertEquals(x, (byte)0x23, "getAndSet byte value");
}
- vh.set(array, i, (byte)0x01);
+ {
+ vh.set(array, i, (byte)0x01);
+
+ byte o = (byte) vh.getAndSetAcquire(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndSetAcquire byte");
+ byte x = (byte) vh.get(array, i);
+ assertEquals(x, (byte)0x23, "getAndSetAcquire byte value");
+ }
+
+ {
+ vh.set(array, i, (byte)0x01);
+
+ byte o = (byte) vh.getAndSetRelease(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndSetRelease byte");
+ byte x = (byte) vh.get(array, i);
+ assertEquals(x, (byte)0x23, "getAndSetRelease byte value");
+ }
// get and add, add and get
{
- byte o = (byte) vh.getAndAdd(array, i, (byte)0x45);
+ vh.set(array, i, (byte)0x01);
+
+ byte o = (byte) vh.getAndAdd(array, i, (byte)0x23);
assertEquals(o, (byte)0x01, "getAndAdd byte");
- byte c = (byte) vh.addAndGet(array, i, (byte)0x45);
- assertEquals(c, (byte)((byte)0x01 + (byte)0x45 + (byte)0x45), "getAndAdd byte value");
+ byte x = (byte) vh.get(array, i);
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAdd byte value");
+ }
+
+ {
+ vh.set(array, i, (byte)0x01);
+
+ byte o = (byte) vh.getAndAddAcquire(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndAddAcquire byte");
+ byte x = (byte) vh.get(array, i);
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAddAcquire byte value");
+ }
+
+ {
+ vh.set(array, i, (byte)0x01);
+
+ byte o = (byte) vh.getAndAddRelease(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndAddReleasebyte");
+ byte x = (byte) vh.get(array, i);
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAddRelease byte value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(array, i, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseOr(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOr byte");
+ byte x = (byte) vh.get(array, i);
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOr byte value");
+ }
+
+ {
+ vh.set(array, i, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseOrAcquire(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOrAcquire byte");
+ byte x = (byte) vh.get(array, i);
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOrAcquire byte value");
+ }
+
+ {
+ vh.set(array, i, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseOrRelease(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOrRelease byte");
+ byte x = (byte) vh.get(array, i);
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOrRelease byte value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(array, i, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseAnd(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAnd byte");
+ byte x = (byte) vh.get(array, i);
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAnd byte value");
+ }
+
+ {
+ vh.set(array, i, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseAndAcquire(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAndAcquire byte");
+ byte x = (byte) vh.get(array, i);
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAndAcquire byte value");
+ }
+
+ {
+ vh.set(array, i, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseAndRelease(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAndRelease byte");
+ byte x = (byte) vh.get(array, i);
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAndRelease byte value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(array, i, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseXor(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXor byte");
+ byte x = (byte) vh.get(array, i);
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXor byte value");
+ }
+
+ {
+ vh.set(array, i, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseXorAcquire(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXorAcquire byte");
+ byte x = (byte) vh.get(array, i);
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXorAcquire byte value");
+ }
+
+ {
+ vh.set(array, i, (byte)0x01);
+
+ byte o = (byte) vh.getAndBitwiseXorRelease(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXorRelease byte");
+ byte x = (byte) vh.get(array, i);
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXorRelease byte value");
}
}
}
@@ -775,6 +1158,7 @@
int i = 0;
+
}
static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
@@ -832,11 +1216,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, (byte)0x01, (byte)0x23);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, (byte)0x01, (byte)0x23);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, (byte)0x01, (byte)0x23);
+ boolean r = vh.weakCompareAndSet(array, ci, (byte)0x01, (byte)0x23);
});
checkIOOBE(() -> {
@@ -852,11 +1236,59 @@
});
checkIOOBE(() -> {
- byte o = (byte) vh.getAndAdd(array, ci, (byte)0x45);
+ byte o = (byte) vh.getAndSetAcquire(array, ci, (byte)0x01);
+ });
+
+ checkIOOBE(() -> {
+ byte o = (byte) vh.getAndSetRelease(array, ci, (byte)0x01);
+ });
+
+ checkIOOBE(() -> {
+ byte o = (byte) vh.getAndAdd(array, ci, (byte)0x01);
+ });
+
+ checkIOOBE(() -> {
+ byte o = (byte) vh.getAndAddAcquire(array, ci, (byte)0x01);
+ });
+
+ checkIOOBE(() -> {
+ byte o = (byte) vh.getAndAddRelease(array, ci, (byte)0x01);
+ });
+
+ checkIOOBE(() -> {
+ byte o = (byte) vh.getAndBitwiseOr(array, ci, (byte)0x01);
});
checkIOOBE(() -> {
- byte o = (byte) vh.addAndGet(array, ci, (byte)0x45);
+ byte o = (byte) vh.getAndBitwiseOrAcquire(array, ci, (byte)0x01);
+ });
+
+ checkIOOBE(() -> {
+ byte o = (byte) vh.getAndBitwiseOrRelease(array, ci, (byte)0x01);
+ });
+
+ checkIOOBE(() -> {
+ byte o = (byte) vh.getAndBitwiseAnd(array, ci, (byte)0x01);
+ });
+
+ checkIOOBE(() -> {
+ byte o = (byte) vh.getAndBitwiseAndAcquire(array, ci, (byte)0x01);
+ });
+
+ checkIOOBE(() -> {
+ byte o = (byte) vh.getAndBitwiseAndRelease(array, ci, (byte)0x01);
+ });
+
+ checkIOOBE(() -> {
+ byte o = (byte) vh.getAndBitwiseXor(array, ci, (byte)0x01);
+ });
+
+ checkIOOBE(() -> {
+ byte o = (byte) vh.getAndBitwiseXorAcquire(array, ci, (byte)0x01);
+ });
+
+ checkIOOBE(() -> {
+ byte o = (byte) vh.getAndBitwiseXorRelease(array, ci, (byte)0x01);
});
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessChar.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessChar.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessChar.java Fri Sep 02 02:41:37 2016 +0000
@@ -103,14 +103,27 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@@ -261,6 +274,7 @@
});
+
}
@@ -309,6 +323,7 @@
});
+
}
@@ -404,11 +419,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(recv, '\u0123', '\u4567');
+ success = vh.weakCompareAndSetPlain(recv, '\u0123', '\u4567');
}
- assertEquals(success, true, "weakCompareAndSet char");
+ assertEquals(success, true, "weakCompareAndSetPlain char");
char x = (char) vh.get(recv);
- assertEquals(x, '\u4567', "weakCompareAndSet char value");
+ assertEquals(x, '\u4567', "weakCompareAndSetPlain char value");
}
{
@@ -434,34 +449,157 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(recv, '\u4567', '\u0123');
+ success = vh.weakCompareAndSet(recv, '\u4567', '\u0123');
}
- assertEquals(success, true, "weakCompareAndSetVolatile char");
+ assertEquals(success, true, "weakCompareAndSet char");
char x = (char) vh.get(recv);
- assertEquals(x, '\u0123', "weakCompareAndSetVolatile char value");
+ assertEquals(x, '\u0123', "weakCompareAndSet char value");
}
// Compare set and get
{
+ vh.set(recv, '\u0123');
+
char o = (char) vh.getAndSet(recv, '\u4567');
assertEquals(o, '\u0123', "getAndSet char");
char x = (char) vh.get(recv);
assertEquals(x, '\u4567', "getAndSet char value");
}
- vh.set(recv, '\u0123');
+ {
+ vh.set(recv, '\u0123');
+
+ char o = (char) vh.getAndSetAcquire(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndSetAcquire char");
+ char x = (char) vh.get(recv);
+ assertEquals(x, '\u4567', "getAndSetAcquire char value");
+ }
+
+ {
+ vh.set(recv, '\u0123');
+
+ char o = (char) vh.getAndSetRelease(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndSetRelease char");
+ char x = (char) vh.get(recv);
+ assertEquals(x, '\u4567', "getAndSetRelease char value");
+ }
// get and add, add and get
{
- char o = (char) vh.getAndAdd(recv, '\u89AB');
+ vh.set(recv, '\u0123');
+
+ char o = (char) vh.getAndAdd(recv, '\u4567');
assertEquals(o, '\u0123', "getAndAdd char");
- char c = (char) vh.addAndGet(recv, '\u89AB');
- assertEquals(c, (char)('\u0123' + '\u89AB' + '\u89AB'), "getAndAdd char value");
+ char x = (char) vh.get(recv);
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAdd char value");
+ }
+
+ {
+ vh.set(recv, '\u0123');
+
+ char o = (char) vh.getAndAddAcquire(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndAddAcquire char");
+ char x = (char) vh.get(recv);
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAddAcquire char value");
+ }
+
+ {
+ vh.set(recv, '\u0123');
+
+ char o = (char) vh.getAndAddRelease(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndAddReleasechar");
+ char x = (char) vh.get(recv);
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAddRelease char value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(recv, '\u0123');
+
+ char o = (char) vh.getAndBitwiseOr(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOr char");
+ char x = (char) vh.get(recv);
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOr char value");
+ }
+
+ {
+ vh.set(recv, '\u0123');
+
+ char o = (char) vh.getAndBitwiseOrAcquire(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOrAcquire char");
+ char x = (char) vh.get(recv);
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOrAcquire char value");
+ }
+
+ {
+ vh.set(recv, '\u0123');
+
+ char o = (char) vh.getAndBitwiseOrRelease(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOrRelease char");
+ char x = (char) vh.get(recv);
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOrRelease char value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(recv, '\u0123');
+
+ char o = (char) vh.getAndBitwiseAnd(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAnd char");
+ char x = (char) vh.get(recv);
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAnd char value");
+ }
+
+ {
+ vh.set(recv, '\u0123');
+
+ char o = (char) vh.getAndBitwiseAndAcquire(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAndAcquire char");
+ char x = (char) vh.get(recv);
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAndAcquire char value");
+ }
+
+ {
+ vh.set(recv, '\u0123');
+
+ char o = (char) vh.getAndBitwiseAndRelease(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAndRelease char");
+ char x = (char) vh.get(recv);
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAndRelease char value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(recv, '\u0123');
+
+ char o = (char) vh.getAndBitwiseXor(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXor char");
+ char x = (char) vh.get(recv);
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXor char value");
+ }
+
+ {
+ vh.set(recv, '\u0123');
+
+ char o = (char) vh.getAndBitwiseXorAcquire(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXorAcquire char");
+ char x = (char) vh.get(recv);
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXorAcquire char value");
+ }
+
+ {
+ vh.set(recv, '\u0123');
+
+ char o = (char) vh.getAndBitwiseXorRelease(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXorRelease char");
+ char x = (char) vh.get(recv);
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXorRelease char value");
}
}
static void testInstanceFieldUnsupported(VarHandleTestAccessChar recv, VarHandle vh) {
+
}
@@ -557,11 +695,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet('\u0123', '\u4567');
+ success = vh.weakCompareAndSetPlain('\u0123', '\u4567');
}
- assertEquals(success, true, "weakCompareAndSet char");
+ assertEquals(success, true, "weakCompareAndSetPlain char");
char x = (char) vh.get();
- assertEquals(x, '\u4567', "weakCompareAndSet char value");
+ assertEquals(x, '\u4567', "weakCompareAndSetPlain char value");
}
{
@@ -587,34 +725,157 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetRelease('\u4567', '\u0123');
+ success = vh.weakCompareAndSet('\u4567', '\u0123');
}
- assertEquals(success, true, "weakCompareAndSetVolatile char");
+ assertEquals(success, true, "weakCompareAndSet char");
char x = (char) vh.get();
- assertEquals(x, '\u0123', "weakCompareAndSetVolatile char");
+ assertEquals(x, '\u0123', "weakCompareAndSet char");
}
// Compare set and get
{
+ vh.set('\u0123');
+
char o = (char) vh.getAndSet('\u4567');
assertEquals(o, '\u0123', "getAndSet char");
char x = (char) vh.get();
assertEquals(x, '\u4567', "getAndSet char value");
}
- vh.set('\u0123');
+ {
+ vh.set('\u0123');
+
+ char o = (char) vh.getAndSetAcquire('\u4567');
+ assertEquals(o, '\u0123', "getAndSetAcquire char");
+ char x = (char) vh.get();
+ assertEquals(x, '\u4567', "getAndSetAcquire char value");
+ }
+
+ {
+ vh.set('\u0123');
+
+ char o = (char) vh.getAndSetRelease('\u4567');
+ assertEquals(o, '\u0123', "getAndSetRelease char");
+ char x = (char) vh.get();
+ assertEquals(x, '\u4567', "getAndSetRelease char value");
+ }
// get and add, add and get
{
- char o = (char) vh.getAndAdd( '\u89AB');
+ vh.set('\u0123');
+
+ char o = (char) vh.getAndAdd('\u4567');
assertEquals(o, '\u0123', "getAndAdd char");
- char c = (char) vh.addAndGet('\u89AB');
- assertEquals(c, (char)('\u0123' + '\u89AB' + '\u89AB'), "getAndAdd char value");
+ char x = (char) vh.get();
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAdd char value");
+ }
+
+ {
+ vh.set('\u0123');
+
+ char o = (char) vh.getAndAddAcquire('\u4567');
+ assertEquals(o, '\u0123', "getAndAddAcquire char");
+ char x = (char) vh.get();
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAddAcquire char value");
+ }
+
+ {
+ vh.set('\u0123');
+
+ char o = (char) vh.getAndAddRelease('\u4567');
+ assertEquals(o, '\u0123', "getAndAddReleasechar");
+ char x = (char) vh.get();
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAddRelease char value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set('\u0123');
+
+ char o = (char) vh.getAndBitwiseOr('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOr char");
+ char x = (char) vh.get();
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOr char value");
+ }
+
+ {
+ vh.set('\u0123');
+
+ char o = (char) vh.getAndBitwiseOrAcquire('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOrAcquire char");
+ char x = (char) vh.get();
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOrAcquire char value");
+ }
+
+ {
+ vh.set('\u0123');
+
+ char o = (char) vh.getAndBitwiseOrRelease('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOrRelease char");
+ char x = (char) vh.get();
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOrRelease char value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set('\u0123');
+
+ char o = (char) vh.getAndBitwiseAnd('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAnd char");
+ char x = (char) vh.get();
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAnd char value");
+ }
+
+ {
+ vh.set('\u0123');
+
+ char o = (char) vh.getAndBitwiseAndAcquire('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAndAcquire char");
+ char x = (char) vh.get();
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAndAcquire char value");
+ }
+
+ {
+ vh.set('\u0123');
+
+ char o = (char) vh.getAndBitwiseAndRelease('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAndRelease char");
+ char x = (char) vh.get();
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAndRelease char value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set('\u0123');
+
+ char o = (char) vh.getAndBitwiseXor('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXor char");
+ char x = (char) vh.get();
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXor char value");
+ }
+
+ {
+ vh.set('\u0123');
+
+ char o = (char) vh.getAndBitwiseXorAcquire('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXorAcquire char");
+ char x = (char) vh.get();
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXorAcquire char value");
+ }
+
+ {
+ vh.set('\u0123');
+
+ char o = (char) vh.getAndBitwiseXorRelease('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXorRelease char");
+ char x = (char) vh.get();
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXorRelease char value");
}
}
static void testStaticFieldUnsupported(VarHandle vh) {
+
}
@@ -713,11 +974,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, '\u0123', '\u4567');
+ success = vh.weakCompareAndSetPlain(array, i, '\u0123', '\u4567');
}
- assertEquals(success, true, "weakCompareAndSet char");
+ assertEquals(success, true, "weakCompareAndSetPlain char");
char x = (char) vh.get(array, i);
- assertEquals(x, '\u4567', "weakCompareAndSet char value");
+ assertEquals(x, '\u4567', "weakCompareAndSetPlain char value");
}
{
@@ -743,29 +1004,151 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(array, i, '\u4567', '\u0123');
+ success = vh.weakCompareAndSet(array, i, '\u4567', '\u0123');
}
- assertEquals(success, true, "weakCompareAndSetVolatile char");
+ assertEquals(success, true, "weakCompareAndSet char");
char x = (char) vh.get(array, i);
- assertEquals(x, '\u0123', "weakCompareAndSetVolatile char");
+ assertEquals(x, '\u0123', "weakCompareAndSet char");
}
// Compare set and get
{
+ vh.set(array, i, '\u0123');
+
char o = (char) vh.getAndSet(array, i, '\u4567');
assertEquals(o, '\u0123', "getAndSet char");
char x = (char) vh.get(array, i);
assertEquals(x, '\u4567', "getAndSet char value");
}
- vh.set(array, i, '\u0123');
+ {
+ vh.set(array, i, '\u0123');
+
+ char o = (char) vh.getAndSetAcquire(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndSetAcquire char");
+ char x = (char) vh.get(array, i);
+ assertEquals(x, '\u4567', "getAndSetAcquire char value");
+ }
+
+ {
+ vh.set(array, i, '\u0123');
+
+ char o = (char) vh.getAndSetRelease(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndSetRelease char");
+ char x = (char) vh.get(array, i);
+ assertEquals(x, '\u4567', "getAndSetRelease char value");
+ }
// get and add, add and get
{
- char o = (char) vh.getAndAdd(array, i, '\u89AB');
+ vh.set(array, i, '\u0123');
+
+ char o = (char) vh.getAndAdd(array, i, '\u4567');
assertEquals(o, '\u0123', "getAndAdd char");
- char c = (char) vh.addAndGet(array, i, '\u89AB');
- assertEquals(c, (char)('\u0123' + '\u89AB' + '\u89AB'), "getAndAdd char value");
+ char x = (char) vh.get(array, i);
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAdd char value");
+ }
+
+ {
+ vh.set(array, i, '\u0123');
+
+ char o = (char) vh.getAndAddAcquire(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndAddAcquire char");
+ char x = (char) vh.get(array, i);
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAddAcquire char value");
+ }
+
+ {
+ vh.set(array, i, '\u0123');
+
+ char o = (char) vh.getAndAddRelease(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndAddReleasechar");
+ char x = (char) vh.get(array, i);
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAddRelease char value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(array, i, '\u0123');
+
+ char o = (char) vh.getAndBitwiseOr(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOr char");
+ char x = (char) vh.get(array, i);
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOr char value");
+ }
+
+ {
+ vh.set(array, i, '\u0123');
+
+ char o = (char) vh.getAndBitwiseOrAcquire(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOrAcquire char");
+ char x = (char) vh.get(array, i);
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOrAcquire char value");
+ }
+
+ {
+ vh.set(array, i, '\u0123');
+
+ char o = (char) vh.getAndBitwiseOrRelease(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOrRelease char");
+ char x = (char) vh.get(array, i);
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOrRelease char value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(array, i, '\u0123');
+
+ char o = (char) vh.getAndBitwiseAnd(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAnd char");
+ char x = (char) vh.get(array, i);
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAnd char value");
+ }
+
+ {
+ vh.set(array, i, '\u0123');
+
+ char o = (char) vh.getAndBitwiseAndAcquire(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAndAcquire char");
+ char x = (char) vh.get(array, i);
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAndAcquire char value");
+ }
+
+ {
+ vh.set(array, i, '\u0123');
+
+ char o = (char) vh.getAndBitwiseAndRelease(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAndRelease char");
+ char x = (char) vh.get(array, i);
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAndRelease char value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(array, i, '\u0123');
+
+ char o = (char) vh.getAndBitwiseXor(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXor char");
+ char x = (char) vh.get(array, i);
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXor char value");
+ }
+
+ {
+ vh.set(array, i, '\u0123');
+
+ char o = (char) vh.getAndBitwiseXorAcquire(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXorAcquire char");
+ char x = (char) vh.get(array, i);
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXorAcquire char value");
+ }
+
+ {
+ vh.set(array, i, '\u0123');
+
+ char o = (char) vh.getAndBitwiseXorRelease(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXorRelease char");
+ char x = (char) vh.get(array, i);
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXorRelease char value");
}
}
}
@@ -775,6 +1158,7 @@
int i = 0;
+
}
static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
@@ -832,11 +1216,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, '\u0123', '\u4567');
+ boolean r = vh.weakCompareAndSetPlain(array, ci, '\u0123', '\u4567');
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, '\u0123', '\u4567');
+ boolean r = vh.weakCompareAndSet(array, ci, '\u0123', '\u4567');
});
checkIOOBE(() -> {
@@ -852,11 +1236,59 @@
});
checkIOOBE(() -> {
- char o = (char) vh.getAndAdd(array, ci, '\u89AB');
+ char o = (char) vh.getAndSetAcquire(array, ci, '\u0123');
+ });
+
+ checkIOOBE(() -> {
+ char o = (char) vh.getAndSetRelease(array, ci, '\u0123');
+ });
+
+ checkIOOBE(() -> {
+ char o = (char) vh.getAndAdd(array, ci, '\u0123');
+ });
+
+ checkIOOBE(() -> {
+ char o = (char) vh.getAndAddAcquire(array, ci, '\u0123');
+ });
+
+ checkIOOBE(() -> {
+ char o = (char) vh.getAndAddRelease(array, ci, '\u0123');
+ });
+
+ checkIOOBE(() -> {
+ char o = (char) vh.getAndBitwiseOr(array, ci, '\u0123');
});
checkIOOBE(() -> {
- char o = (char) vh.addAndGet(array, ci, '\u89AB');
+ char o = (char) vh.getAndBitwiseOrAcquire(array, ci, '\u0123');
+ });
+
+ checkIOOBE(() -> {
+ char o = (char) vh.getAndBitwiseOrRelease(array, ci, '\u0123');
+ });
+
+ checkIOOBE(() -> {
+ char o = (char) vh.getAndBitwiseAnd(array, ci, '\u0123');
+ });
+
+ checkIOOBE(() -> {
+ char o = (char) vh.getAndBitwiseAndAcquire(array, ci, '\u0123');
+ });
+
+ checkIOOBE(() -> {
+ char o = (char) vh.getAndBitwiseAndRelease(array, ci, '\u0123');
+ });
+
+ checkIOOBE(() -> {
+ char o = (char) vh.getAndBitwiseXor(array, ci, '\u0123');
+ });
+
+ checkIOOBE(() -> {
+ char o = (char) vh.getAndBitwiseXorAcquire(array, ci, '\u0123');
+ });
+
+ checkIOOBE(() -> {
+ char o = (char) vh.getAndBitwiseXorRelease(array, ci, '\u0123');
});
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessDouble.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessDouble.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessDouble.java Fri Sep 02 02:41:37 2016 +0000
@@ -103,14 +103,27 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@@ -261,6 +274,42 @@
});
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOr(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrAcquire(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrRelease(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAnd(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndAcquire(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndRelease(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXor(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorAcquire(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorRelease(recv, 1.0d);
+ });
}
@@ -309,6 +358,42 @@
});
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOr(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrAcquire(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrRelease(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAnd(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndAcquire(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndRelease(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXor(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorAcquire(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorRelease(1.0d);
+ });
}
@@ -404,11 +489,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(recv, 1.0d, 2.0d);
+ success = vh.weakCompareAndSetPlain(recv, 1.0d, 2.0d);
}
- assertEquals(success, true, "weakCompareAndSet double");
+ assertEquals(success, true, "weakCompareAndSetPlain double");
double x = (double) vh.get(recv);
- assertEquals(x, 2.0d, "weakCompareAndSet double value");
+ assertEquals(x, 2.0d, "weakCompareAndSetPlain double value");
}
{
@@ -434,34 +519,109 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(recv, 2.0d, 1.0d);
+ success = vh.weakCompareAndSet(recv, 2.0d, 1.0d);
}
- assertEquals(success, true, "weakCompareAndSetVolatile double");
+ assertEquals(success, true, "weakCompareAndSet double");
double x = (double) vh.get(recv);
- assertEquals(x, 1.0d, "weakCompareAndSetVolatile double value");
+ assertEquals(x, 1.0d, "weakCompareAndSet double value");
}
// Compare set and get
{
+ vh.set(recv, 1.0d);
+
double o = (double) vh.getAndSet(recv, 2.0d);
assertEquals(o, 1.0d, "getAndSet double");
double x = (double) vh.get(recv);
assertEquals(x, 2.0d, "getAndSet double value");
}
- vh.set(recv, 1.0d);
+ {
+ vh.set(recv, 1.0d);
+
+ double o = (double) vh.getAndSetAcquire(recv, 2.0d);
+ assertEquals(o, 1.0d, "getAndSetAcquire double");
+ double x = (double) vh.get(recv);
+ assertEquals(x, 2.0d, "getAndSetAcquire double value");
+ }
+
+ {
+ vh.set(recv, 1.0d);
+
+ double o = (double) vh.getAndSetRelease(recv, 2.0d);
+ assertEquals(o, 1.0d, "getAndSetRelease double");
+ double x = (double) vh.get(recv);
+ assertEquals(x, 2.0d, "getAndSetRelease double value");
+ }
// get and add, add and get
{
- double o = (double) vh.getAndAdd(recv, 3.0d);
+ vh.set(recv, 1.0d);
+
+ double o = (double) vh.getAndAdd(recv, 2.0d);
assertEquals(o, 1.0d, "getAndAdd double");
- double c = (double) vh.addAndGet(recv, 3.0d);
- assertEquals(c, (double)(1.0d + 3.0d + 3.0d), "getAndAdd double value");
+ double x = (double) vh.get(recv);
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAdd double value");
}
+
+ {
+ vh.set(recv, 1.0d);
+
+ double o = (double) vh.getAndAddAcquire(recv, 2.0d);
+ assertEquals(o, 1.0d, "getAndAddAcquire double");
+ double x = (double) vh.get(recv);
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAddAcquire double value");
+ }
+
+ {
+ vh.set(recv, 1.0d);
+
+ double o = (double) vh.getAndAddRelease(recv, 2.0d);
+ assertEquals(o, 1.0d, "getAndAddReleasedouble");
+ double x = (double) vh.get(recv);
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAddRelease double value");
+ }
+
}
static void testInstanceFieldUnsupported(VarHandleTestAccessDouble recv, VarHandle vh) {
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOr(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrAcquire(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrRelease(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAnd(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndAcquire(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndRelease(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXor(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorAcquire(recv, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorRelease(recv, 1.0d);
+ });
}
@@ -557,11 +717,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(1.0d, 2.0d);
+ success = vh.weakCompareAndSetPlain(1.0d, 2.0d);
}
- assertEquals(success, true, "weakCompareAndSet double");
+ assertEquals(success, true, "weakCompareAndSetPlain double");
double x = (double) vh.get();
- assertEquals(x, 2.0d, "weakCompareAndSet double value");
+ assertEquals(x, 2.0d, "weakCompareAndSetPlain double value");
}
{
@@ -587,34 +747,109 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetRelease(2.0d, 1.0d);
+ success = vh.weakCompareAndSet(2.0d, 1.0d);
}
- assertEquals(success, true, "weakCompareAndSetVolatile double");
+ assertEquals(success, true, "weakCompareAndSet double");
double x = (double) vh.get();
- assertEquals(x, 1.0d, "weakCompareAndSetVolatile double");
+ assertEquals(x, 1.0d, "weakCompareAndSet double");
}
// Compare set and get
{
+ vh.set(1.0d);
+
double o = (double) vh.getAndSet(2.0d);
assertEquals(o, 1.0d, "getAndSet double");
double x = (double) vh.get();
assertEquals(x, 2.0d, "getAndSet double value");
}
- vh.set(1.0d);
+ {
+ vh.set(1.0d);
+
+ double o = (double) vh.getAndSetAcquire(2.0d);
+ assertEquals(o, 1.0d, "getAndSetAcquire double");
+ double x = (double) vh.get();
+ assertEquals(x, 2.0d, "getAndSetAcquire double value");
+ }
+
+ {
+ vh.set(1.0d);
+
+ double o = (double) vh.getAndSetRelease(2.0d);
+ assertEquals(o, 1.0d, "getAndSetRelease double");
+ double x = (double) vh.get();
+ assertEquals(x, 2.0d, "getAndSetRelease double value");
+ }
// get and add, add and get
{
- double o = (double) vh.getAndAdd( 3.0d);
+ vh.set(1.0d);
+
+ double o = (double) vh.getAndAdd(2.0d);
assertEquals(o, 1.0d, "getAndAdd double");
- double c = (double) vh.addAndGet(3.0d);
- assertEquals(c, (double)(1.0d + 3.0d + 3.0d), "getAndAdd double value");
+ double x = (double) vh.get();
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAdd double value");
}
+
+ {
+ vh.set(1.0d);
+
+ double o = (double) vh.getAndAddAcquire(2.0d);
+ assertEquals(o, 1.0d, "getAndAddAcquire double");
+ double x = (double) vh.get();
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAddAcquire double value");
+ }
+
+ {
+ vh.set(1.0d);
+
+ double o = (double) vh.getAndAddRelease(2.0d);
+ assertEquals(o, 1.0d, "getAndAddReleasedouble");
+ double x = (double) vh.get();
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAddRelease double value");
+ }
+
}
static void testStaticFieldUnsupported(VarHandle vh) {
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOr(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrAcquire(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrRelease(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAnd(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndAcquire(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndRelease(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXor(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorAcquire(1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorRelease(1.0d);
+ });
}
@@ -713,11 +948,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, 1.0d, 2.0d);
+ success = vh.weakCompareAndSetPlain(array, i, 1.0d, 2.0d);
}
- assertEquals(success, true, "weakCompareAndSet double");
+ assertEquals(success, true, "weakCompareAndSetPlain double");
double x = (double) vh.get(array, i);
- assertEquals(x, 2.0d, "weakCompareAndSet double value");
+ assertEquals(x, 2.0d, "weakCompareAndSetPlain double value");
}
{
@@ -743,30 +978,69 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(array, i, 2.0d, 1.0d);
+ success = vh.weakCompareAndSet(array, i, 2.0d, 1.0d);
}
- assertEquals(success, true, "weakCompareAndSetVolatile double");
+ assertEquals(success, true, "weakCompareAndSet double");
double x = (double) vh.get(array, i);
- assertEquals(x, 1.0d, "weakCompareAndSetVolatile double");
+ assertEquals(x, 1.0d, "weakCompareAndSet double");
}
// Compare set and get
{
+ vh.set(array, i, 1.0d);
+
double o = (double) vh.getAndSet(array, i, 2.0d);
assertEquals(o, 1.0d, "getAndSet double");
double x = (double) vh.get(array, i);
assertEquals(x, 2.0d, "getAndSet double value");
}
- vh.set(array, i, 1.0d);
+ {
+ vh.set(array, i, 1.0d);
+
+ double o = (double) vh.getAndSetAcquire(array, i, 2.0d);
+ assertEquals(o, 1.0d, "getAndSetAcquire double");
+ double x = (double) vh.get(array, i);
+ assertEquals(x, 2.0d, "getAndSetAcquire double value");
+ }
+
+ {
+ vh.set(array, i, 1.0d);
+
+ double o = (double) vh.getAndSetRelease(array, i, 2.0d);
+ assertEquals(o, 1.0d, "getAndSetRelease double");
+ double x = (double) vh.get(array, i);
+ assertEquals(x, 2.0d, "getAndSetRelease double value");
+ }
// get and add, add and get
{
- double o = (double) vh.getAndAdd(array, i, 3.0d);
+ vh.set(array, i, 1.0d);
+
+ double o = (double) vh.getAndAdd(array, i, 2.0d);
assertEquals(o, 1.0d, "getAndAdd double");
- double c = (double) vh.addAndGet(array, i, 3.0d);
- assertEquals(c, (double)(1.0d + 3.0d + 3.0d), "getAndAdd double value");
+ double x = (double) vh.get(array, i);
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAdd double value");
}
+
+ {
+ vh.set(array, i, 1.0d);
+
+ double o = (double) vh.getAndAddAcquire(array, i, 2.0d);
+ assertEquals(o, 1.0d, "getAndAddAcquire double");
+ double x = (double) vh.get(array, i);
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAddAcquire double value");
+ }
+
+ {
+ vh.set(array, i, 1.0d);
+
+ double o = (double) vh.getAndAddRelease(array, i, 2.0d);
+ assertEquals(o, 1.0d, "getAndAddReleasedouble");
+ double x = (double) vh.get(array, i);
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAddRelease double value");
+ }
+
}
}
@@ -775,6 +1049,42 @@
int i = 0;
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOr(array, i, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrAcquire(array, i, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrRelease(array, i, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAnd(array, i, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndAcquire(array, i, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndRelease(array, i, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXor(array, i, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorAcquire(array, i, 1.0d);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorRelease(array, i, 1.0d);
+ });
}
static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
@@ -832,11 +1142,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, 1.0d, 2.0d);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, 1.0d, 2.0d);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, 1.0d, 2.0d);
+ boolean r = vh.weakCompareAndSet(array, ci, 1.0d, 2.0d);
});
checkIOOBE(() -> {
@@ -852,12 +1162,25 @@
});
checkIOOBE(() -> {
- double o = (double) vh.getAndAdd(array, ci, 3.0d);
+ double o = (double) vh.getAndSetAcquire(array, ci, 1.0d);
+ });
+
+ checkIOOBE(() -> {
+ double o = (double) vh.getAndSetRelease(array, ci, 1.0d);
});
checkIOOBE(() -> {
- double o = (double) vh.addAndGet(array, ci, 3.0d);
+ double o = (double) vh.getAndAdd(array, ci, 1.0d);
+ });
+
+ checkIOOBE(() -> {
+ double o = (double) vh.getAndAddAcquire(array, ci, 1.0d);
});
+
+ checkIOOBE(() -> {
+ double o = (double) vh.getAndAddRelease(array, ci, 1.0d);
+ });
+
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessFloat.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessFloat.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessFloat.java Fri Sep 02 02:41:37 2016 +0000
@@ -103,14 +103,27 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@@ -261,6 +274,42 @@
});
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOr(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrAcquire(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrRelease(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAnd(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndAcquire(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndRelease(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXor(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorAcquire(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorRelease(recv, 1.0f);
+ });
}
@@ -309,6 +358,42 @@
});
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOr(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrAcquire(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrRelease(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAnd(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndAcquire(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndRelease(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXor(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorAcquire(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorRelease(1.0f);
+ });
}
@@ -404,11 +489,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(recv, 1.0f, 2.0f);
+ success = vh.weakCompareAndSetPlain(recv, 1.0f, 2.0f);
}
- assertEquals(success, true, "weakCompareAndSet float");
+ assertEquals(success, true, "weakCompareAndSetPlain float");
float x = (float) vh.get(recv);
- assertEquals(x, 2.0f, "weakCompareAndSet float value");
+ assertEquals(x, 2.0f, "weakCompareAndSetPlain float value");
}
{
@@ -434,34 +519,109 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(recv, 2.0f, 1.0f);
+ success = vh.weakCompareAndSet(recv, 2.0f, 1.0f);
}
- assertEquals(success, true, "weakCompareAndSetVolatile float");
+ assertEquals(success, true, "weakCompareAndSet float");
float x = (float) vh.get(recv);
- assertEquals(x, 1.0f, "weakCompareAndSetVolatile float value");
+ assertEquals(x, 1.0f, "weakCompareAndSet float value");
}
// Compare set and get
{
+ vh.set(recv, 1.0f);
+
float o = (float) vh.getAndSet(recv, 2.0f);
assertEquals(o, 1.0f, "getAndSet float");
float x = (float) vh.get(recv);
assertEquals(x, 2.0f, "getAndSet float value");
}
- vh.set(recv, 1.0f);
+ {
+ vh.set(recv, 1.0f);
+
+ float o = (float) vh.getAndSetAcquire(recv, 2.0f);
+ assertEquals(o, 1.0f, "getAndSetAcquire float");
+ float x = (float) vh.get(recv);
+ assertEquals(x, 2.0f, "getAndSetAcquire float value");
+ }
+
+ {
+ vh.set(recv, 1.0f);
+
+ float o = (float) vh.getAndSetRelease(recv, 2.0f);
+ assertEquals(o, 1.0f, "getAndSetRelease float");
+ float x = (float) vh.get(recv);
+ assertEquals(x, 2.0f, "getAndSetRelease float value");
+ }
// get and add, add and get
{
- float o = (float) vh.getAndAdd(recv, 3.0f);
+ vh.set(recv, 1.0f);
+
+ float o = (float) vh.getAndAdd(recv, 2.0f);
assertEquals(o, 1.0f, "getAndAdd float");
- float c = (float) vh.addAndGet(recv, 3.0f);
- assertEquals(c, (float)(1.0f + 3.0f + 3.0f), "getAndAdd float value");
+ float x = (float) vh.get(recv);
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAdd float value");
}
+
+ {
+ vh.set(recv, 1.0f);
+
+ float o = (float) vh.getAndAddAcquire(recv, 2.0f);
+ assertEquals(o, 1.0f, "getAndAddAcquire float");
+ float x = (float) vh.get(recv);
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAddAcquire float value");
+ }
+
+ {
+ vh.set(recv, 1.0f);
+
+ float o = (float) vh.getAndAddRelease(recv, 2.0f);
+ assertEquals(o, 1.0f, "getAndAddReleasefloat");
+ float x = (float) vh.get(recv);
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAddRelease float value");
+ }
+
}
static void testInstanceFieldUnsupported(VarHandleTestAccessFloat recv, VarHandle vh) {
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOr(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrAcquire(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrRelease(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAnd(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndAcquire(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndRelease(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXor(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorAcquire(recv, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorRelease(recv, 1.0f);
+ });
}
@@ -557,11 +717,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(1.0f, 2.0f);
+ success = vh.weakCompareAndSetPlain(1.0f, 2.0f);
}
- assertEquals(success, true, "weakCompareAndSet float");
+ assertEquals(success, true, "weakCompareAndSetPlain float");
float x = (float) vh.get();
- assertEquals(x, 2.0f, "weakCompareAndSet float value");
+ assertEquals(x, 2.0f, "weakCompareAndSetPlain float value");
}
{
@@ -587,34 +747,109 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetRelease(2.0f, 1.0f);
+ success = vh.weakCompareAndSet(2.0f, 1.0f);
}
- assertEquals(success, true, "weakCompareAndSetVolatile float");
+ assertEquals(success, true, "weakCompareAndSet float");
float x = (float) vh.get();
- assertEquals(x, 1.0f, "weakCompareAndSetVolatile float");
+ assertEquals(x, 1.0f, "weakCompareAndSet float");
}
// Compare set and get
{
+ vh.set(1.0f);
+
float o = (float) vh.getAndSet(2.0f);
assertEquals(o, 1.0f, "getAndSet float");
float x = (float) vh.get();
assertEquals(x, 2.0f, "getAndSet float value");
}
- vh.set(1.0f);
+ {
+ vh.set(1.0f);
+
+ float o = (float) vh.getAndSetAcquire(2.0f);
+ assertEquals(o, 1.0f, "getAndSetAcquire float");
+ float x = (float) vh.get();
+ assertEquals(x, 2.0f, "getAndSetAcquire float value");
+ }
+
+ {
+ vh.set(1.0f);
+
+ float o = (float) vh.getAndSetRelease(2.0f);
+ assertEquals(o, 1.0f, "getAndSetRelease float");
+ float x = (float) vh.get();
+ assertEquals(x, 2.0f, "getAndSetRelease float value");
+ }
// get and add, add and get
{
- float o = (float) vh.getAndAdd( 3.0f);
+ vh.set(1.0f);
+
+ float o = (float) vh.getAndAdd(2.0f);
assertEquals(o, 1.0f, "getAndAdd float");
- float c = (float) vh.addAndGet(3.0f);
- assertEquals(c, (float)(1.0f + 3.0f + 3.0f), "getAndAdd float value");
+ float x = (float) vh.get();
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAdd float value");
}
+
+ {
+ vh.set(1.0f);
+
+ float o = (float) vh.getAndAddAcquire(2.0f);
+ assertEquals(o, 1.0f, "getAndAddAcquire float");
+ float x = (float) vh.get();
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAddAcquire float value");
+ }
+
+ {
+ vh.set(1.0f);
+
+ float o = (float) vh.getAndAddRelease(2.0f);
+ assertEquals(o, 1.0f, "getAndAddReleasefloat");
+ float x = (float) vh.get();
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAddRelease float value");
+ }
+
}
static void testStaticFieldUnsupported(VarHandle vh) {
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOr(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrAcquire(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrRelease(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAnd(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndAcquire(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndRelease(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXor(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorAcquire(1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorRelease(1.0f);
+ });
}
@@ -713,11 +948,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, 1.0f, 2.0f);
+ success = vh.weakCompareAndSetPlain(array, i, 1.0f, 2.0f);
}
- assertEquals(success, true, "weakCompareAndSet float");
+ assertEquals(success, true, "weakCompareAndSetPlain float");
float x = (float) vh.get(array, i);
- assertEquals(x, 2.0f, "weakCompareAndSet float value");
+ assertEquals(x, 2.0f, "weakCompareAndSetPlain float value");
}
{
@@ -743,30 +978,69 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(array, i, 2.0f, 1.0f);
+ success = vh.weakCompareAndSet(array, i, 2.0f, 1.0f);
}
- assertEquals(success, true, "weakCompareAndSetVolatile float");
+ assertEquals(success, true, "weakCompareAndSet float");
float x = (float) vh.get(array, i);
- assertEquals(x, 1.0f, "weakCompareAndSetVolatile float");
+ assertEquals(x, 1.0f, "weakCompareAndSet float");
}
// Compare set and get
{
+ vh.set(array, i, 1.0f);
+
float o = (float) vh.getAndSet(array, i, 2.0f);
assertEquals(o, 1.0f, "getAndSet float");
float x = (float) vh.get(array, i);
assertEquals(x, 2.0f, "getAndSet float value");
}
- vh.set(array, i, 1.0f);
+ {
+ vh.set(array, i, 1.0f);
+
+ float o = (float) vh.getAndSetAcquire(array, i, 2.0f);
+ assertEquals(o, 1.0f, "getAndSetAcquire float");
+ float x = (float) vh.get(array, i);
+ assertEquals(x, 2.0f, "getAndSetAcquire float value");
+ }
+
+ {
+ vh.set(array, i, 1.0f);
+
+ float o = (float) vh.getAndSetRelease(array, i, 2.0f);
+ assertEquals(o, 1.0f, "getAndSetRelease float");
+ float x = (float) vh.get(array, i);
+ assertEquals(x, 2.0f, "getAndSetRelease float value");
+ }
// get and add, add and get
{
- float o = (float) vh.getAndAdd(array, i, 3.0f);
+ vh.set(array, i, 1.0f);
+
+ float o = (float) vh.getAndAdd(array, i, 2.0f);
assertEquals(o, 1.0f, "getAndAdd float");
- float c = (float) vh.addAndGet(array, i, 3.0f);
- assertEquals(c, (float)(1.0f + 3.0f + 3.0f), "getAndAdd float value");
+ float x = (float) vh.get(array, i);
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAdd float value");
}
+
+ {
+ vh.set(array, i, 1.0f);
+
+ float o = (float) vh.getAndAddAcquire(array, i, 2.0f);
+ assertEquals(o, 1.0f, "getAndAddAcquire float");
+ float x = (float) vh.get(array, i);
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAddAcquire float value");
+ }
+
+ {
+ vh.set(array, i, 1.0f);
+
+ float o = (float) vh.getAndAddRelease(array, i, 2.0f);
+ assertEquals(o, 1.0f, "getAndAddReleasefloat");
+ float x = (float) vh.get(array, i);
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAddRelease float value");
+ }
+
}
}
@@ -775,6 +1049,42 @@
int i = 0;
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOr(array, i, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrAcquire(array, i, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrRelease(array, i, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAnd(array, i, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndAcquire(array, i, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndRelease(array, i, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXor(array, i, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorAcquire(array, i, 1.0f);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorRelease(array, i, 1.0f);
+ });
}
static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
@@ -832,11 +1142,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, 1.0f, 2.0f);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, 1.0f, 2.0f);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, 1.0f, 2.0f);
+ boolean r = vh.weakCompareAndSet(array, ci, 1.0f, 2.0f);
});
checkIOOBE(() -> {
@@ -852,12 +1162,25 @@
});
checkIOOBE(() -> {
- float o = (float) vh.getAndAdd(array, ci, 3.0f);
+ float o = (float) vh.getAndSetAcquire(array, ci, 1.0f);
+ });
+
+ checkIOOBE(() -> {
+ float o = (float) vh.getAndSetRelease(array, ci, 1.0f);
});
checkIOOBE(() -> {
- float o = (float) vh.addAndGet(array, ci, 3.0f);
+ float o = (float) vh.getAndAdd(array, ci, 1.0f);
+ });
+
+ checkIOOBE(() -> {
+ float o = (float) vh.getAndAddAcquire(array, ci, 1.0f);
});
+
+ checkIOOBE(() -> {
+ float o = (float) vh.getAndAddRelease(array, ci, 1.0f);
+ });
+
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java Fri Sep 02 02:41:37 2016 +0000
@@ -103,14 +103,27 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@@ -261,6 +274,7 @@
});
+
}
@@ -309,6 +323,7 @@
});
+
}
@@ -404,11 +419,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(recv, 0x01234567, 0x89ABCDEF);
+ success = vh.weakCompareAndSetPlain(recv, 0x01234567, 0x89ABCDEF);
}
- assertEquals(success, true, "weakCompareAndSet int");
+ assertEquals(success, true, "weakCompareAndSetPlain int");
int x = (int) vh.get(recv);
- assertEquals(x, 0x89ABCDEF, "weakCompareAndSet int value");
+ assertEquals(x, 0x89ABCDEF, "weakCompareAndSetPlain int value");
}
{
@@ -434,34 +449,157 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(recv, 0x89ABCDEF, 0x01234567);
+ success = vh.weakCompareAndSet(recv, 0x89ABCDEF, 0x01234567);
}
- assertEquals(success, true, "weakCompareAndSetVolatile int");
+ assertEquals(success, true, "weakCompareAndSet int");
int x = (int) vh.get(recv);
- assertEquals(x, 0x01234567, "weakCompareAndSetVolatile int value");
+ assertEquals(x, 0x01234567, "weakCompareAndSet int value");
}
// Compare set and get
{
+ vh.set(recv, 0x01234567);
+
int o = (int) vh.getAndSet(recv, 0x89ABCDEF);
assertEquals(o, 0x01234567, "getAndSet int");
int x = (int) vh.get(recv);
assertEquals(x, 0x89ABCDEF, "getAndSet int value");
}
- vh.set(recv, 0x01234567);
+ {
+ vh.set(recv, 0x01234567);
+
+ int o = (int) vh.getAndSetAcquire(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndSetAcquire int");
+ int x = (int) vh.get(recv);
+ assertEquals(x, 0x89ABCDEF, "getAndSetAcquire int value");
+ }
+
+ {
+ vh.set(recv, 0x01234567);
+
+ int o = (int) vh.getAndSetRelease(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndSetRelease int");
+ int x = (int) vh.get(recv);
+ assertEquals(x, 0x89ABCDEF, "getAndSetRelease int value");
+ }
// get and add, add and get
{
- int o = (int) vh.getAndAdd(recv, 0xCAFEBABE);
+ vh.set(recv, 0x01234567);
+
+ int o = (int) vh.getAndAdd(recv, 0x89ABCDEF);
assertEquals(o, 0x01234567, "getAndAdd int");
- int c = (int) vh.addAndGet(recv, 0xCAFEBABE);
- assertEquals(c, (int)(0x01234567 + 0xCAFEBABE + 0xCAFEBABE), "getAndAdd int value");
+ int x = (int) vh.get(recv);
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAdd int value");
+ }
+
+ {
+ vh.set(recv, 0x01234567);
+
+ int o = (int) vh.getAndAddAcquire(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndAddAcquire int");
+ int x = (int) vh.get(recv);
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAddAcquire int value");
+ }
+
+ {
+ vh.set(recv, 0x01234567);
+
+ int o = (int) vh.getAndAddRelease(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndAddReleaseint");
+ int x = (int) vh.get(recv);
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAddRelease int value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(recv, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseOr(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOr int");
+ int x = (int) vh.get(recv);
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOr int value");
+ }
+
+ {
+ vh.set(recv, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseOrAcquire(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOrAcquire int");
+ int x = (int) vh.get(recv);
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOrAcquire int value");
+ }
+
+ {
+ vh.set(recv, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseOrRelease(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOrRelease int");
+ int x = (int) vh.get(recv);
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOrRelease int value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(recv, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseAnd(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAnd int");
+ int x = (int) vh.get(recv);
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAnd int value");
+ }
+
+ {
+ vh.set(recv, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseAndAcquire(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAndAcquire int");
+ int x = (int) vh.get(recv);
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAndAcquire int value");
+ }
+
+ {
+ vh.set(recv, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseAndRelease(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAndRelease int");
+ int x = (int) vh.get(recv);
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAndRelease int value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(recv, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseXor(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXor int");
+ int x = (int) vh.get(recv);
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXor int value");
+ }
+
+ {
+ vh.set(recv, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseXorAcquire(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXorAcquire int");
+ int x = (int) vh.get(recv);
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXorAcquire int value");
+ }
+
+ {
+ vh.set(recv, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseXorRelease(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXorRelease int");
+ int x = (int) vh.get(recv);
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXorRelease int value");
}
}
static void testInstanceFieldUnsupported(VarHandleTestAccessInt recv, VarHandle vh) {
+
}
@@ -557,11 +695,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(0x01234567, 0x89ABCDEF);
+ success = vh.weakCompareAndSetPlain(0x01234567, 0x89ABCDEF);
}
- assertEquals(success, true, "weakCompareAndSet int");
+ assertEquals(success, true, "weakCompareAndSetPlain int");
int x = (int) vh.get();
- assertEquals(x, 0x89ABCDEF, "weakCompareAndSet int value");
+ assertEquals(x, 0x89ABCDEF, "weakCompareAndSetPlain int value");
}
{
@@ -587,34 +725,157 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetRelease(0x89ABCDEF, 0x01234567);
+ success = vh.weakCompareAndSet(0x89ABCDEF, 0x01234567);
}
- assertEquals(success, true, "weakCompareAndSetVolatile int");
+ assertEquals(success, true, "weakCompareAndSet int");
int x = (int) vh.get();
- assertEquals(x, 0x01234567, "weakCompareAndSetVolatile int");
+ assertEquals(x, 0x01234567, "weakCompareAndSet int");
}
// Compare set and get
{
+ vh.set(0x01234567);
+
int o = (int) vh.getAndSet(0x89ABCDEF);
assertEquals(o, 0x01234567, "getAndSet int");
int x = (int) vh.get();
assertEquals(x, 0x89ABCDEF, "getAndSet int value");
}
- vh.set(0x01234567);
+ {
+ vh.set(0x01234567);
+
+ int o = (int) vh.getAndSetAcquire(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndSetAcquire int");
+ int x = (int) vh.get();
+ assertEquals(x, 0x89ABCDEF, "getAndSetAcquire int value");
+ }
+
+ {
+ vh.set(0x01234567);
+
+ int o = (int) vh.getAndSetRelease(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndSetRelease int");
+ int x = (int) vh.get();
+ assertEquals(x, 0x89ABCDEF, "getAndSetRelease int value");
+ }
// get and add, add and get
{
- int o = (int) vh.getAndAdd( 0xCAFEBABE);
+ vh.set(0x01234567);
+
+ int o = (int) vh.getAndAdd(0x89ABCDEF);
assertEquals(o, 0x01234567, "getAndAdd int");
- int c = (int) vh.addAndGet(0xCAFEBABE);
- assertEquals(c, (int)(0x01234567 + 0xCAFEBABE + 0xCAFEBABE), "getAndAdd int value");
+ int x = (int) vh.get();
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAdd int value");
+ }
+
+ {
+ vh.set(0x01234567);
+
+ int o = (int) vh.getAndAddAcquire(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndAddAcquire int");
+ int x = (int) vh.get();
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAddAcquire int value");
+ }
+
+ {
+ vh.set(0x01234567);
+
+ int o = (int) vh.getAndAddRelease(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndAddReleaseint");
+ int x = (int) vh.get();
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAddRelease int value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(0x01234567);
+
+ int o = (int) vh.getAndBitwiseOr(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOr int");
+ int x = (int) vh.get();
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOr int value");
+ }
+
+ {
+ vh.set(0x01234567);
+
+ int o = (int) vh.getAndBitwiseOrAcquire(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOrAcquire int");
+ int x = (int) vh.get();
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOrAcquire int value");
+ }
+
+ {
+ vh.set(0x01234567);
+
+ int o = (int) vh.getAndBitwiseOrRelease(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOrRelease int");
+ int x = (int) vh.get();
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOrRelease int value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(0x01234567);
+
+ int o = (int) vh.getAndBitwiseAnd(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAnd int");
+ int x = (int) vh.get();
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAnd int value");
+ }
+
+ {
+ vh.set(0x01234567);
+
+ int o = (int) vh.getAndBitwiseAndAcquire(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAndAcquire int");
+ int x = (int) vh.get();
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAndAcquire int value");
+ }
+
+ {
+ vh.set(0x01234567);
+
+ int o = (int) vh.getAndBitwiseAndRelease(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAndRelease int");
+ int x = (int) vh.get();
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAndRelease int value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(0x01234567);
+
+ int o = (int) vh.getAndBitwiseXor(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXor int");
+ int x = (int) vh.get();
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXor int value");
+ }
+
+ {
+ vh.set(0x01234567);
+
+ int o = (int) vh.getAndBitwiseXorAcquire(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXorAcquire int");
+ int x = (int) vh.get();
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXorAcquire int value");
+ }
+
+ {
+ vh.set(0x01234567);
+
+ int o = (int) vh.getAndBitwiseXorRelease(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXorRelease int");
+ int x = (int) vh.get();
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXorRelease int value");
}
}
static void testStaticFieldUnsupported(VarHandle vh) {
+
}
@@ -713,11 +974,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, 0x01234567, 0x89ABCDEF);
+ success = vh.weakCompareAndSetPlain(array, i, 0x01234567, 0x89ABCDEF);
}
- assertEquals(success, true, "weakCompareAndSet int");
+ assertEquals(success, true, "weakCompareAndSetPlain int");
int x = (int) vh.get(array, i);
- assertEquals(x, 0x89ABCDEF, "weakCompareAndSet int value");
+ assertEquals(x, 0x89ABCDEF, "weakCompareAndSetPlain int value");
}
{
@@ -743,29 +1004,151 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(array, i, 0x89ABCDEF, 0x01234567);
+ success = vh.weakCompareAndSet(array, i, 0x89ABCDEF, 0x01234567);
}
- assertEquals(success, true, "weakCompareAndSetVolatile int");
+ assertEquals(success, true, "weakCompareAndSet int");
int x = (int) vh.get(array, i);
- assertEquals(x, 0x01234567, "weakCompareAndSetVolatile int");
+ assertEquals(x, 0x01234567, "weakCompareAndSet int");
}
// Compare set and get
{
+ vh.set(array, i, 0x01234567);
+
int o = (int) vh.getAndSet(array, i, 0x89ABCDEF);
assertEquals(o, 0x01234567, "getAndSet int");
int x = (int) vh.get(array, i);
assertEquals(x, 0x89ABCDEF, "getAndSet int value");
}
- vh.set(array, i, 0x01234567);
+ {
+ vh.set(array, i, 0x01234567);
+
+ int o = (int) vh.getAndSetAcquire(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndSetAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, 0x89ABCDEF, "getAndSetAcquire int value");
+ }
+
+ {
+ vh.set(array, i, 0x01234567);
+
+ int o = (int) vh.getAndSetRelease(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndSetRelease int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, 0x89ABCDEF, "getAndSetRelease int value");
+ }
// get and add, add and get
{
- int o = (int) vh.getAndAdd(array, i, 0xCAFEBABE);
+ vh.set(array, i, 0x01234567);
+
+ int o = (int) vh.getAndAdd(array, i, 0x89ABCDEF);
assertEquals(o, 0x01234567, "getAndAdd int");
- int c = (int) vh.addAndGet(array, i, 0xCAFEBABE);
- assertEquals(c, (int)(0x01234567 + 0xCAFEBABE + 0xCAFEBABE), "getAndAdd int value");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAdd int value");
+ }
+
+ {
+ vh.set(array, i, 0x01234567);
+
+ int o = (int) vh.getAndAddAcquire(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndAddAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAddAcquire int value");
+ }
+
+ {
+ vh.set(array, i, 0x01234567);
+
+ int o = (int) vh.getAndAddRelease(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndAddReleaseint");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAddRelease int value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(array, i, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseOr(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOr int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOr int value");
+ }
+
+ {
+ vh.set(array, i, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseOrAcquire(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOrAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOrAcquire int value");
+ }
+
+ {
+ vh.set(array, i, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseOrRelease(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOrRelease int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOrRelease int value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(array, i, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseAnd(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAnd int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAnd int value");
+ }
+
+ {
+ vh.set(array, i, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseAndAcquire(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAndAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAndAcquire int value");
+ }
+
+ {
+ vh.set(array, i, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseAndRelease(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAndRelease int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAndRelease int value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(array, i, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseXor(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXor int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXor int value");
+ }
+
+ {
+ vh.set(array, i, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseXorAcquire(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXorAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXorAcquire int value");
+ }
+
+ {
+ vh.set(array, i, 0x01234567);
+
+ int o = (int) vh.getAndBitwiseXorRelease(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXorRelease int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXorRelease int value");
}
}
}
@@ -775,6 +1158,7 @@
int i = 0;
+
}
static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
@@ -832,11 +1216,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, 0x01234567, 0x89ABCDEF);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, 0x01234567, 0x89ABCDEF);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, 0x01234567, 0x89ABCDEF);
+ boolean r = vh.weakCompareAndSet(array, ci, 0x01234567, 0x89ABCDEF);
});
checkIOOBE(() -> {
@@ -852,11 +1236,59 @@
});
checkIOOBE(() -> {
- int o = (int) vh.getAndAdd(array, ci, 0xCAFEBABE);
+ int o = (int) vh.getAndSetAcquire(array, ci, 0x01234567);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndSetRelease(array, ci, 0x01234567);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndAdd(array, ci, 0x01234567);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndAddAcquire(array, ci, 0x01234567);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndAddRelease(array, ci, 0x01234567);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseOr(array, ci, 0x01234567);
});
checkIOOBE(() -> {
- int o = (int) vh.addAndGet(array, ci, 0xCAFEBABE);
+ int o = (int) vh.getAndBitwiseOrAcquire(array, ci, 0x01234567);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseOrRelease(array, ci, 0x01234567);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseAnd(array, ci, 0x01234567);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseAndAcquire(array, ci, 0x01234567);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseAndRelease(array, ci, 0x01234567);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseXor(array, ci, 0x01234567);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseXorAcquire(array, ci, 0x01234567);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseXorRelease(array, ci, 0x01234567);
});
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessLong.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessLong.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessLong.java Fri Sep 02 02:41:37 2016 +0000
@@ -103,14 +103,27 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@@ -261,6 +274,7 @@
});
+
}
@@ -309,6 +323,7 @@
});
+
}
@@ -404,11 +419,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
+ success = vh.weakCompareAndSetPlain(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
}
- assertEquals(success, true, "weakCompareAndSet long");
+ assertEquals(success, true, "weakCompareAndSetPlain long");
long x = (long) vh.get(recv);
- assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSet long value");
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSetPlain long value");
}
{
@@ -434,34 +449,157 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+ success = vh.weakCompareAndSet(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
}
- assertEquals(success, true, "weakCompareAndSetVolatile long");
+ assertEquals(success, true, "weakCompareAndSet long");
long x = (long) vh.get(recv);
- assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetVolatile long value");
+ assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSet long value");
}
// Compare set and get
{
+ vh.set(recv, 0x0123456789ABCDEFL);
+
long o = (long) vh.getAndSet(recv, 0xCAFEBABECAFEBABEL);
assertEquals(o, 0x0123456789ABCDEFL, "getAndSet long");
long x = (long) vh.get(recv);
assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSet long value");
}
- vh.set(recv, 0x0123456789ABCDEFL);
+ {
+ vh.set(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndSetAcquire(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndSetAcquire long");
+ long x = (long) vh.get(recv);
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSetAcquire long value");
+ }
+
+ {
+ vh.set(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndSetRelease(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndSetRelease long");
+ long x = (long) vh.get(recv);
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSetRelease long value");
+ }
// get and add, add and get
{
- long o = (long) vh.getAndAdd(recv, 0xDEADBEEFDEADBEEFL);
+ vh.set(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndAdd(recv, 0xCAFEBABECAFEBABEL);
assertEquals(o, 0x0123456789ABCDEFL, "getAndAdd long");
- long c = (long) vh.addAndGet(recv, 0xDEADBEEFDEADBEEFL);
- assertEquals(c, (long)(0x0123456789ABCDEFL + 0xDEADBEEFDEADBEEFL + 0xDEADBEEFDEADBEEFL), "getAndAdd long value");
+ long x = (long) vh.get(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAdd long value");
+ }
+
+ {
+ vh.set(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndAddAcquire(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndAddAcquire long");
+ long x = (long) vh.get(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAddAcquire long value");
+ }
+
+ {
+ vh.set(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndAddRelease(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndAddReleaselong");
+ long x = (long) vh.get(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAddRelease long value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseOr(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOr long");
+ long x = (long) vh.get(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOr long value");
+ }
+
+ {
+ vh.set(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseOrAcquire(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOrAcquire long");
+ long x = (long) vh.get(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOrAcquire long value");
+ }
+
+ {
+ vh.set(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseOrRelease(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOrRelease long");
+ long x = (long) vh.get(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOrRelease long value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseAnd(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAnd long");
+ long x = (long) vh.get(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAnd long value");
+ }
+
+ {
+ vh.set(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseAndAcquire(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAndAcquire long");
+ long x = (long) vh.get(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAndAcquire long value");
+ }
+
+ {
+ vh.set(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseAndRelease(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAndRelease long");
+ long x = (long) vh.get(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAndRelease long value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseXor(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXor long");
+ long x = (long) vh.get(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXor long value");
+ }
+
+ {
+ vh.set(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseXorAcquire(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXorAcquire long");
+ long x = (long) vh.get(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXorAcquire long value");
+ }
+
+ {
+ vh.set(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseXorRelease(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXorRelease long");
+ long x = (long) vh.get(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXorRelease long value");
}
}
static void testInstanceFieldUnsupported(VarHandleTestAccessLong recv, VarHandle vh) {
+
}
@@ -557,11 +695,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
+ success = vh.weakCompareAndSetPlain(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
}
- assertEquals(success, true, "weakCompareAndSet long");
+ assertEquals(success, true, "weakCompareAndSetPlain long");
long x = (long) vh.get();
- assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSet long value");
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSetPlain long value");
}
{
@@ -587,34 +725,157 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetRelease(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+ success = vh.weakCompareAndSet(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
}
- assertEquals(success, true, "weakCompareAndSetVolatile long");
+ assertEquals(success, true, "weakCompareAndSet long");
long x = (long) vh.get();
- assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetVolatile long");
+ assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSet long");
}
// Compare set and get
{
+ vh.set(0x0123456789ABCDEFL);
+
long o = (long) vh.getAndSet(0xCAFEBABECAFEBABEL);
assertEquals(o, 0x0123456789ABCDEFL, "getAndSet long");
long x = (long) vh.get();
assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSet long value");
}
- vh.set(0x0123456789ABCDEFL);
+ {
+ vh.set(0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndSetAcquire(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndSetAcquire long");
+ long x = (long) vh.get();
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSetAcquire long value");
+ }
+
+ {
+ vh.set(0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndSetRelease(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndSetRelease long");
+ long x = (long) vh.get();
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSetRelease long value");
+ }
// get and add, add and get
{
- long o = (long) vh.getAndAdd( 0xDEADBEEFDEADBEEFL);
+ vh.set(0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndAdd(0xCAFEBABECAFEBABEL);
assertEquals(o, 0x0123456789ABCDEFL, "getAndAdd long");
- long c = (long) vh.addAndGet(0xDEADBEEFDEADBEEFL);
- assertEquals(c, (long)(0x0123456789ABCDEFL + 0xDEADBEEFDEADBEEFL + 0xDEADBEEFDEADBEEFL), "getAndAdd long value");
+ long x = (long) vh.get();
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAdd long value");
+ }
+
+ {
+ vh.set(0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndAddAcquire(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndAddAcquire long");
+ long x = (long) vh.get();
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAddAcquire long value");
+ }
+
+ {
+ vh.set(0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndAddRelease(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndAddReleaselong");
+ long x = (long) vh.get();
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAddRelease long value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseOr(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOr long");
+ long x = (long) vh.get();
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOr long value");
+ }
+
+ {
+ vh.set(0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseOrAcquire(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOrAcquire long");
+ long x = (long) vh.get();
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOrAcquire long value");
+ }
+
+ {
+ vh.set(0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseOrRelease(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOrRelease long");
+ long x = (long) vh.get();
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOrRelease long value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseAnd(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAnd long");
+ long x = (long) vh.get();
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAnd long value");
+ }
+
+ {
+ vh.set(0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseAndAcquire(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAndAcquire long");
+ long x = (long) vh.get();
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAndAcquire long value");
+ }
+
+ {
+ vh.set(0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseAndRelease(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAndRelease long");
+ long x = (long) vh.get();
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAndRelease long value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseXor(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXor long");
+ long x = (long) vh.get();
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXor long value");
+ }
+
+ {
+ vh.set(0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseXorAcquire(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXorAcquire long");
+ long x = (long) vh.get();
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXorAcquire long value");
+ }
+
+ {
+ vh.set(0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseXorRelease(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXorRelease long");
+ long x = (long) vh.get();
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXorRelease long value");
}
}
static void testStaticFieldUnsupported(VarHandle vh) {
+
}
@@ -713,11 +974,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
+ success = vh.weakCompareAndSetPlain(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
}
- assertEquals(success, true, "weakCompareAndSet long");
+ assertEquals(success, true, "weakCompareAndSetPlain long");
long x = (long) vh.get(array, i);
- assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSet long value");
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSetPlain long value");
}
{
@@ -743,29 +1004,151 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+ success = vh.weakCompareAndSet(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
}
- assertEquals(success, true, "weakCompareAndSetVolatile long");
+ assertEquals(success, true, "weakCompareAndSet long");
long x = (long) vh.get(array, i);
- assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetVolatile long");
+ assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSet long");
}
// Compare set and get
{
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
long o = (long) vh.getAndSet(array, i, 0xCAFEBABECAFEBABEL);
assertEquals(o, 0x0123456789ABCDEFL, "getAndSet long");
long x = (long) vh.get(array, i);
assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSet long value");
}
- vh.set(array, i, 0x0123456789ABCDEFL);
+ {
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndSetAcquire(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndSetAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSetAcquire long value");
+ }
+
+ {
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndSetRelease(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndSetRelease long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSetRelease long value");
+ }
// get and add, add and get
{
- long o = (long) vh.getAndAdd(array, i, 0xDEADBEEFDEADBEEFL);
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndAdd(array, i, 0xCAFEBABECAFEBABEL);
assertEquals(o, 0x0123456789ABCDEFL, "getAndAdd long");
- long c = (long) vh.addAndGet(array, i, 0xDEADBEEFDEADBEEFL);
- assertEquals(c, (long)(0x0123456789ABCDEFL + 0xDEADBEEFDEADBEEFL + 0xDEADBEEFDEADBEEFL), "getAndAdd long value");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAdd long value");
+ }
+
+ {
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndAddAcquire(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndAddAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAddAcquire long value");
+ }
+
+ {
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndAddRelease(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndAddReleaselong");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAddRelease long value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseOr(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOr long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOr long value");
+ }
+
+ {
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseOrAcquire(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOrAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOrAcquire long value");
+ }
+
+ {
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseOrRelease(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOrRelease long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOrRelease long value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseAnd(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAnd long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAnd long value");
+ }
+
+ {
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseAndAcquire(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAndAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAndAcquire long value");
+ }
+
+ {
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseAndRelease(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAndRelease long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAndRelease long value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseXor(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXor long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXor long value");
+ }
+
+ {
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseXorAcquire(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXorAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXorAcquire long value");
+ }
+
+ {
+ vh.set(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) vh.getAndBitwiseXorRelease(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXorRelease long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXorRelease long value");
}
}
}
@@ -775,6 +1158,7 @@
int i = 0;
+
}
static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
@@ -832,11 +1216,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
+ boolean r = vh.weakCompareAndSet(array, ci, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
});
checkIOOBE(() -> {
@@ -852,11 +1236,59 @@
});
checkIOOBE(() -> {
- long o = (long) vh.getAndAdd(array, ci, 0xDEADBEEFDEADBEEFL);
+ long o = (long) vh.getAndSetAcquire(array, ci, 0x0123456789ABCDEFL);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndSetRelease(array, ci, 0x0123456789ABCDEFL);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndAdd(array, ci, 0x0123456789ABCDEFL);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndAddAcquire(array, ci, 0x0123456789ABCDEFL);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndAddRelease(array, ci, 0x0123456789ABCDEFL);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseOr(array, ci, 0x0123456789ABCDEFL);
});
checkIOOBE(() -> {
- long o = (long) vh.addAndGet(array, ci, 0xDEADBEEFDEADBEEFL);
+ long o = (long) vh.getAndBitwiseOrAcquire(array, ci, 0x0123456789ABCDEFL);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseOrRelease(array, ci, 0x0123456789ABCDEFL);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseAnd(array, ci, 0x0123456789ABCDEFL);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseAndAcquire(array, ci, 0x0123456789ABCDEFL);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseAndRelease(array, ci, 0x0123456789ABCDEFL);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseXor(array, ci, 0x0123456789ABCDEFL);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseXorAcquire(array, ci, 0x0123456789ABCDEFL);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseXorRelease(array, ci, 0x0123456789ABCDEFL);
});
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessShort.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessShort.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessShort.java Fri Sep 02 02:41:37 2016 +0000
@@ -103,14 +103,27 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@@ -261,6 +274,7 @@
});
+
}
@@ -309,6 +323,7 @@
});
+
}
@@ -404,11 +419,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(recv, (short)0x0123, (short)0x4567);
+ success = vh.weakCompareAndSetPlain(recv, (short)0x0123, (short)0x4567);
}
- assertEquals(success, true, "weakCompareAndSet short");
+ assertEquals(success, true, "weakCompareAndSetPlain short");
short x = (short) vh.get(recv);
- assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
+ assertEquals(x, (short)0x4567, "weakCompareAndSetPlain short value");
}
{
@@ -434,34 +449,157 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(recv, (short)0x4567, (short)0x0123);
+ success = vh.weakCompareAndSet(recv, (short)0x4567, (short)0x0123);
}
- assertEquals(success, true, "weakCompareAndSetVolatile short");
+ assertEquals(success, true, "weakCompareAndSet short");
short x = (short) vh.get(recv);
- assertEquals(x, (short)0x0123, "weakCompareAndSetVolatile short value");
+ assertEquals(x, (short)0x0123, "weakCompareAndSet short value");
}
// Compare set and get
{
+ vh.set(recv, (short)0x0123);
+
short o = (short) vh.getAndSet(recv, (short)0x4567);
assertEquals(o, (short)0x0123, "getAndSet short");
short x = (short) vh.get(recv);
assertEquals(x, (short)0x4567, "getAndSet short value");
}
- vh.set(recv, (short)0x0123);
+ {
+ vh.set(recv, (short)0x0123);
+
+ short o = (short) vh.getAndSetAcquire(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndSetAcquire short");
+ short x = (short) vh.get(recv);
+ assertEquals(x, (short)0x4567, "getAndSetAcquire short value");
+ }
+
+ {
+ vh.set(recv, (short)0x0123);
+
+ short o = (short) vh.getAndSetRelease(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndSetRelease short");
+ short x = (short) vh.get(recv);
+ assertEquals(x, (short)0x4567, "getAndSetRelease short value");
+ }
// get and add, add and get
{
- short o = (short) vh.getAndAdd(recv, (short)0x89AB);
+ vh.set(recv, (short)0x0123);
+
+ short o = (short) vh.getAndAdd(recv, (short)0x4567);
assertEquals(o, (short)0x0123, "getAndAdd short");
- short c = (short) vh.addAndGet(recv, (short)0x89AB);
- assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
+ short x = (short) vh.get(recv);
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAdd short value");
+ }
+
+ {
+ vh.set(recv, (short)0x0123);
+
+ short o = (short) vh.getAndAddAcquire(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndAddAcquire short");
+ short x = (short) vh.get(recv);
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAddAcquire short value");
+ }
+
+ {
+ vh.set(recv, (short)0x0123);
+
+ short o = (short) vh.getAndAddRelease(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndAddReleaseshort");
+ short x = (short) vh.get(recv);
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAddRelease short value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(recv, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseOr(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOr short");
+ short x = (short) vh.get(recv);
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOr short value");
+ }
+
+ {
+ vh.set(recv, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseOrAcquire(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOrAcquire short");
+ short x = (short) vh.get(recv);
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOrAcquire short value");
+ }
+
+ {
+ vh.set(recv, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseOrRelease(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOrRelease short");
+ short x = (short) vh.get(recv);
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOrRelease short value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(recv, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseAnd(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAnd short");
+ short x = (short) vh.get(recv);
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAnd short value");
+ }
+
+ {
+ vh.set(recv, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseAndAcquire(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAndAcquire short");
+ short x = (short) vh.get(recv);
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAndAcquire short value");
+ }
+
+ {
+ vh.set(recv, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseAndRelease(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAndRelease short");
+ short x = (short) vh.get(recv);
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAndRelease short value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(recv, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseXor(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXor short");
+ short x = (short) vh.get(recv);
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXor short value");
+ }
+
+ {
+ vh.set(recv, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseXorAcquire(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXorAcquire short");
+ short x = (short) vh.get(recv);
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXorAcquire short value");
+ }
+
+ {
+ vh.set(recv, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseXorRelease(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXorRelease short");
+ short x = (short) vh.get(recv);
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXorRelease short value");
}
}
static void testInstanceFieldUnsupported(VarHandleTestAccessShort recv, VarHandle vh) {
+
}
@@ -557,11 +695,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet((short)0x0123, (short)0x4567);
+ success = vh.weakCompareAndSetPlain((short)0x0123, (short)0x4567);
}
- assertEquals(success, true, "weakCompareAndSet short");
+ assertEquals(success, true, "weakCompareAndSetPlain short");
short x = (short) vh.get();
- assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
+ assertEquals(x, (short)0x4567, "weakCompareAndSetPlain short value");
}
{
@@ -587,34 +725,157 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetRelease((short)0x4567, (short)0x0123);
+ success = vh.weakCompareAndSet((short)0x4567, (short)0x0123);
}
- assertEquals(success, true, "weakCompareAndSetVolatile short");
+ assertEquals(success, true, "weakCompareAndSet short");
short x = (short) vh.get();
- assertEquals(x, (short)0x0123, "weakCompareAndSetVolatile short");
+ assertEquals(x, (short)0x0123, "weakCompareAndSet short");
}
// Compare set and get
{
+ vh.set((short)0x0123);
+
short o = (short) vh.getAndSet((short)0x4567);
assertEquals(o, (short)0x0123, "getAndSet short");
short x = (short) vh.get();
assertEquals(x, (short)0x4567, "getAndSet short value");
}
- vh.set((short)0x0123);
+ {
+ vh.set((short)0x0123);
+
+ short o = (short) vh.getAndSetAcquire((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndSetAcquire short");
+ short x = (short) vh.get();
+ assertEquals(x, (short)0x4567, "getAndSetAcquire short value");
+ }
+
+ {
+ vh.set((short)0x0123);
+
+ short o = (short) vh.getAndSetRelease((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndSetRelease short");
+ short x = (short) vh.get();
+ assertEquals(x, (short)0x4567, "getAndSetRelease short value");
+ }
// get and add, add and get
{
- short o = (short) vh.getAndAdd( (short)0x89AB);
+ vh.set((short)0x0123);
+
+ short o = (short) vh.getAndAdd((short)0x4567);
assertEquals(o, (short)0x0123, "getAndAdd short");
- short c = (short) vh.addAndGet((short)0x89AB);
- assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
+ short x = (short) vh.get();
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAdd short value");
+ }
+
+ {
+ vh.set((short)0x0123);
+
+ short o = (short) vh.getAndAddAcquire((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndAddAcquire short");
+ short x = (short) vh.get();
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAddAcquire short value");
+ }
+
+ {
+ vh.set((short)0x0123);
+
+ short o = (short) vh.getAndAddRelease((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndAddReleaseshort");
+ short x = (short) vh.get();
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAddRelease short value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set((short)0x0123);
+
+ short o = (short) vh.getAndBitwiseOr((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOr short");
+ short x = (short) vh.get();
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOr short value");
+ }
+
+ {
+ vh.set((short)0x0123);
+
+ short o = (short) vh.getAndBitwiseOrAcquire((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOrAcquire short");
+ short x = (short) vh.get();
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOrAcquire short value");
+ }
+
+ {
+ vh.set((short)0x0123);
+
+ short o = (short) vh.getAndBitwiseOrRelease((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOrRelease short");
+ short x = (short) vh.get();
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOrRelease short value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set((short)0x0123);
+
+ short o = (short) vh.getAndBitwiseAnd((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAnd short");
+ short x = (short) vh.get();
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAnd short value");
+ }
+
+ {
+ vh.set((short)0x0123);
+
+ short o = (short) vh.getAndBitwiseAndAcquire((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAndAcquire short");
+ short x = (short) vh.get();
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAndAcquire short value");
+ }
+
+ {
+ vh.set((short)0x0123);
+
+ short o = (short) vh.getAndBitwiseAndRelease((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAndRelease short");
+ short x = (short) vh.get();
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAndRelease short value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set((short)0x0123);
+
+ short o = (short) vh.getAndBitwiseXor((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXor short");
+ short x = (short) vh.get();
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXor short value");
+ }
+
+ {
+ vh.set((short)0x0123);
+
+ short o = (short) vh.getAndBitwiseXorAcquire((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXorAcquire short");
+ short x = (short) vh.get();
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXorAcquire short value");
+ }
+
+ {
+ vh.set((short)0x0123);
+
+ short o = (short) vh.getAndBitwiseXorRelease((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXorRelease short");
+ short x = (short) vh.get();
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXorRelease short value");
}
}
static void testStaticFieldUnsupported(VarHandle vh) {
+
}
@@ -713,11 +974,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, (short)0x0123, (short)0x4567);
+ success = vh.weakCompareAndSetPlain(array, i, (short)0x0123, (short)0x4567);
}
- assertEquals(success, true, "weakCompareAndSet short");
+ assertEquals(success, true, "weakCompareAndSetPlain short");
short x = (short) vh.get(array, i);
- assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
+ assertEquals(x, (short)0x4567, "weakCompareAndSetPlain short value");
}
{
@@ -743,29 +1004,151 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(array, i, (short)0x4567, (short)0x0123);
+ success = vh.weakCompareAndSet(array, i, (short)0x4567, (short)0x0123);
}
- assertEquals(success, true, "weakCompareAndSetVolatile short");
+ assertEquals(success, true, "weakCompareAndSet short");
short x = (short) vh.get(array, i);
- assertEquals(x, (short)0x0123, "weakCompareAndSetVolatile short");
+ assertEquals(x, (short)0x0123, "weakCompareAndSet short");
}
// Compare set and get
{
+ vh.set(array, i, (short)0x0123);
+
short o = (short) vh.getAndSet(array, i, (short)0x4567);
assertEquals(o, (short)0x0123, "getAndSet short");
short x = (short) vh.get(array, i);
assertEquals(x, (short)0x4567, "getAndSet short value");
}
- vh.set(array, i, (short)0x0123);
+ {
+ vh.set(array, i, (short)0x0123);
+
+ short o = (short) vh.getAndSetAcquire(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndSetAcquire short");
+ short x = (short) vh.get(array, i);
+ assertEquals(x, (short)0x4567, "getAndSetAcquire short value");
+ }
+
+ {
+ vh.set(array, i, (short)0x0123);
+
+ short o = (short) vh.getAndSetRelease(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndSetRelease short");
+ short x = (short) vh.get(array, i);
+ assertEquals(x, (short)0x4567, "getAndSetRelease short value");
+ }
// get and add, add and get
{
- short o = (short) vh.getAndAdd(array, i, (short)0x89AB);
+ vh.set(array, i, (short)0x0123);
+
+ short o = (short) vh.getAndAdd(array, i, (short)0x4567);
assertEquals(o, (short)0x0123, "getAndAdd short");
- short c = (short) vh.addAndGet(array, i, (short)0x89AB);
- assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
+ short x = (short) vh.get(array, i);
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAdd short value");
+ }
+
+ {
+ vh.set(array, i, (short)0x0123);
+
+ short o = (short) vh.getAndAddAcquire(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndAddAcquire short");
+ short x = (short) vh.get(array, i);
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAddAcquire short value");
+ }
+
+ {
+ vh.set(array, i, (short)0x0123);
+
+ short o = (short) vh.getAndAddRelease(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndAddReleaseshort");
+ short x = (short) vh.get(array, i);
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAddRelease short value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(array, i, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseOr(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOr short");
+ short x = (short) vh.get(array, i);
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOr short value");
+ }
+
+ {
+ vh.set(array, i, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseOrAcquire(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOrAcquire short");
+ short x = (short) vh.get(array, i);
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOrAcquire short value");
+ }
+
+ {
+ vh.set(array, i, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseOrRelease(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOrRelease short");
+ short x = (short) vh.get(array, i);
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOrRelease short value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(array, i, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseAnd(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAnd short");
+ short x = (short) vh.get(array, i);
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAnd short value");
+ }
+
+ {
+ vh.set(array, i, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseAndAcquire(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAndAcquire short");
+ short x = (short) vh.get(array, i);
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAndAcquire short value");
+ }
+
+ {
+ vh.set(array, i, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseAndRelease(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAndRelease short");
+ short x = (short) vh.get(array, i);
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAndRelease short value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(array, i, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseXor(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXor short");
+ short x = (short) vh.get(array, i);
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXor short value");
+ }
+
+ {
+ vh.set(array, i, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseXorAcquire(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXorAcquire short");
+ short x = (short) vh.get(array, i);
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXorAcquire short value");
+ }
+
+ {
+ vh.set(array, i, (short)0x0123);
+
+ short o = (short) vh.getAndBitwiseXorRelease(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXorRelease short");
+ short x = (short) vh.get(array, i);
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXorRelease short value");
}
}
}
@@ -775,6 +1158,7 @@
int i = 0;
+
}
static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
@@ -832,11 +1216,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, (short)0x0123, (short)0x4567);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, (short)0x0123, (short)0x4567);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, (short)0x0123, (short)0x4567);
+ boolean r = vh.weakCompareAndSet(array, ci, (short)0x0123, (short)0x4567);
});
checkIOOBE(() -> {
@@ -852,11 +1236,59 @@
});
checkIOOBE(() -> {
- short o = (short) vh.getAndAdd(array, ci, (short)0x89AB);
+ short o = (short) vh.getAndSetAcquire(array, ci, (short)0x0123);
+ });
+
+ checkIOOBE(() -> {
+ short o = (short) vh.getAndSetRelease(array, ci, (short)0x0123);
+ });
+
+ checkIOOBE(() -> {
+ short o = (short) vh.getAndAdd(array, ci, (short)0x0123);
+ });
+
+ checkIOOBE(() -> {
+ short o = (short) vh.getAndAddAcquire(array, ci, (short)0x0123);
+ });
+
+ checkIOOBE(() -> {
+ short o = (short) vh.getAndAddRelease(array, ci, (short)0x0123);
+ });
+
+ checkIOOBE(() -> {
+ short o = (short) vh.getAndBitwiseOr(array, ci, (short)0x0123);
});
checkIOOBE(() -> {
- short o = (short) vh.addAndGet(array, ci, (short)0x89AB);
+ short o = (short) vh.getAndBitwiseOrAcquire(array, ci, (short)0x0123);
+ });
+
+ checkIOOBE(() -> {
+ short o = (short) vh.getAndBitwiseOrRelease(array, ci, (short)0x0123);
+ });
+
+ checkIOOBE(() -> {
+ short o = (short) vh.getAndBitwiseAnd(array, ci, (short)0x0123);
+ });
+
+ checkIOOBE(() -> {
+ short o = (short) vh.getAndBitwiseAndAcquire(array, ci, (short)0x0123);
+ });
+
+ checkIOOBE(() -> {
+ short o = (short) vh.getAndBitwiseAndRelease(array, ci, (short)0x0123);
+ });
+
+ checkIOOBE(() -> {
+ short o = (short) vh.getAndBitwiseXor(array, ci, (short)0x0123);
+ });
+
+ checkIOOBE(() -> {
+ short o = (short) vh.getAndBitwiseXorAcquire(array, ci, (short)0x0123);
+ });
+
+ checkIOOBE(() -> {
+ short o = (short) vh.getAndBitwiseXorRelease(array, ci, (short)0x0123);
});
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessString.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessString.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessString.java Fri Sep 02 02:41:37 2016 +0000
@@ -103,14 +103,27 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@@ -266,7 +279,47 @@
});
checkUOE(() -> {
- String o = (String) vh.addAndGet(recv, "foo");
+ String o = (String) vh.getAndAddAcquire(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndAddRelease(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOr(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOrAcquire(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOrRelease(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAnd(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAndAcquire(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAndRelease(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXor(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXorAcquire(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXorRelease(recv, "foo");
});
}
@@ -321,7 +374,47 @@
});
checkUOE(() -> {
- String o = (String) vh.addAndGet("foo");
+ String o = (String) vh.getAndAddAcquire("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndAddRelease("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOr("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOrAcquire("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOrRelease("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAnd("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAndAcquire("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAndRelease("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXor("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXorAcquire("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXorRelease("foo");
});
}
@@ -418,11 +511,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(recv, "foo", "bar");
+ success = vh.weakCompareAndSetPlain(recv, "foo", "bar");
}
- assertEquals(success, true, "weakCompareAndSet String");
+ assertEquals(success, true, "weakCompareAndSetPlain String");
String x = (String) vh.get(recv);
- assertEquals(x, "bar", "weakCompareAndSet String value");
+ assertEquals(x, "bar", "weakCompareAndSetPlain String value");
}
{
@@ -448,21 +541,42 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(recv, "bar", "foo");
+ success = vh.weakCompareAndSet(recv, "bar", "foo");
}
- assertEquals(success, true, "weakCompareAndSetVolatile String");
+ assertEquals(success, true, "weakCompareAndSet String");
String x = (String) vh.get(recv);
- assertEquals(x, "foo", "weakCompareAndSetVolatile String value");
+ assertEquals(x, "foo", "weakCompareAndSet String value");
}
// Compare set and get
{
+ vh.set(recv, "foo");
+
String o = (String) vh.getAndSet(recv, "bar");
assertEquals(o, "foo", "getAndSet String");
String x = (String) vh.get(recv);
assertEquals(x, "bar", "getAndSet String value");
}
+ {
+ vh.set(recv, "foo");
+
+ String o = (String) vh.getAndSetAcquire(recv, "bar");
+ assertEquals(o, "foo", "getAndSetAcquire String");
+ String x = (String) vh.get(recv);
+ assertEquals(x, "bar", "getAndSetAcquire String value");
+ }
+
+ {
+ vh.set(recv, "foo");
+
+ String o = (String) vh.getAndSetRelease(recv, "bar");
+ assertEquals(o, "foo", "getAndSetRelease String");
+ String x = (String) vh.get(recv);
+ assertEquals(x, "bar", "getAndSetRelease String value");
+ }
+
+
}
static void testInstanceFieldUnsupported(VarHandleTestAccessString recv, VarHandle vh) {
@@ -472,7 +586,47 @@
});
checkUOE(() -> {
- String o = (String) vh.addAndGet(recv, "foo");
+ String o = (String) vh.getAndAddAcquire(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndAddRelease(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOr(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOrAcquire(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOrRelease(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAnd(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAndAcquire(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAndRelease(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXor(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXorAcquire(recv, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXorRelease(recv, "foo");
});
}
@@ -569,11 +723,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet("foo", "bar");
+ success = vh.weakCompareAndSetPlain("foo", "bar");
}
- assertEquals(success, true, "weakCompareAndSet String");
+ assertEquals(success, true, "weakCompareAndSetPlain String");
String x = (String) vh.get();
- assertEquals(x, "bar", "weakCompareAndSet String value");
+ assertEquals(x, "bar", "weakCompareAndSetPlain String value");
}
{
@@ -599,21 +753,42 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetRelease("bar", "foo");
+ success = vh.weakCompareAndSet("bar", "foo");
}
- assertEquals(success, true, "weakCompareAndSetVolatile String");
+ assertEquals(success, true, "weakCompareAndSet String");
String x = (String) vh.get();
- assertEquals(x, "foo", "weakCompareAndSetVolatile String");
+ assertEquals(x, "foo", "weakCompareAndSet String");
}
// Compare set and get
{
+ vh.set("foo");
+
String o = (String) vh.getAndSet("bar");
assertEquals(o, "foo", "getAndSet String");
String x = (String) vh.get();
assertEquals(x, "bar", "getAndSet String value");
}
+ {
+ vh.set("foo");
+
+ String o = (String) vh.getAndSetAcquire("bar");
+ assertEquals(o, "foo", "getAndSetAcquire String");
+ String x = (String) vh.get();
+ assertEquals(x, "bar", "getAndSetAcquire String value");
+ }
+
+ {
+ vh.set("foo");
+
+ String o = (String) vh.getAndSetRelease("bar");
+ assertEquals(o, "foo", "getAndSetRelease String");
+ String x = (String) vh.get();
+ assertEquals(x, "bar", "getAndSetRelease String value");
+ }
+
+
}
static void testStaticFieldUnsupported(VarHandle vh) {
@@ -623,7 +798,47 @@
});
checkUOE(() -> {
- String o = (String) vh.addAndGet("foo");
+ String o = (String) vh.getAndAddAcquire("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndAddRelease("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOr("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOrAcquire("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOrRelease("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAnd("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAndAcquire("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAndRelease("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXor("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXorAcquire("foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXorRelease("foo");
});
}
@@ -723,11 +938,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, "foo", "bar");
+ success = vh.weakCompareAndSetPlain(array, i, "foo", "bar");
}
- assertEquals(success, true, "weakCompareAndSet String");
+ assertEquals(success, true, "weakCompareAndSetPlain String");
String x = (String) vh.get(array, i);
- assertEquals(x, "bar", "weakCompareAndSet String value");
+ assertEquals(x, "bar", "weakCompareAndSetPlain String value");
}
{
@@ -753,21 +968,42 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(array, i, "bar", "foo");
+ success = vh.weakCompareAndSet(array, i, "bar", "foo");
}
- assertEquals(success, true, "weakCompareAndSetVolatile String");
+ assertEquals(success, true, "weakCompareAndSet String");
String x = (String) vh.get(array, i);
- assertEquals(x, "foo", "weakCompareAndSetVolatile String");
+ assertEquals(x, "foo", "weakCompareAndSet String");
}
// Compare set and get
{
+ vh.set(array, i, "foo");
+
String o = (String) vh.getAndSet(array, i, "bar");
assertEquals(o, "foo", "getAndSet String");
String x = (String) vh.get(array, i);
assertEquals(x, "bar", "getAndSet String value");
}
+ {
+ vh.set(array, i, "foo");
+
+ String o = (String) vh.getAndSetAcquire(array, i, "bar");
+ assertEquals(o, "foo", "getAndSetAcquire String");
+ String x = (String) vh.get(array, i);
+ assertEquals(x, "bar", "getAndSetAcquire String value");
+ }
+
+ {
+ vh.set(array, i, "foo");
+
+ String o = (String) vh.getAndSetRelease(array, i, "bar");
+ assertEquals(o, "foo", "getAndSetRelease String");
+ String x = (String) vh.get(array, i);
+ assertEquals(x, "bar", "getAndSetRelease String value");
+ }
+
+
}
}
@@ -781,7 +1017,47 @@
});
checkUOE(() -> {
- String o = (String) vh.addAndGet(array, i, "foo");
+ String o = (String) vh.getAndAddAcquire(array, i, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndAddRelease(array, i, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOr(array, i, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOrAcquire(array, i, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseOrRelease(array, i, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAnd(array, i, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAndAcquire(array, i, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseAndRelease(array, i, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXor(array, i, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXorAcquire(array, i, "foo");
+ });
+
+ checkUOE(() -> {
+ String o = (String) vh.getAndBitwiseXorRelease(array, i, "foo");
});
}
@@ -840,11 +1116,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, "foo", "bar");
+ boolean r = vh.weakCompareAndSetPlain(array, ci, "foo", "bar");
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, "foo", "bar");
+ boolean r = vh.weakCompareAndSet(array, ci, "foo", "bar");
});
checkIOOBE(() -> {
@@ -859,6 +1135,15 @@
String o = (String) vh.getAndSet(array, ci, "foo");
});
+ checkIOOBE(() -> {
+ String o = (String) vh.getAndSetAcquire(array, ci, "foo");
+ });
+
+ checkIOOBE(() -> {
+ String o = (String) vh.getAndSetRelease(array, ci, "foo");
+ });
+
+
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsChar.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsChar.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsChar.java Fri Sep 02 02:41:37 2016 +0000
@@ -92,14 +92,27 @@
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@Test(dataProvider = "typesProvider")
@@ -201,11 +214,11 @@
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
@@ -221,11 +234,59 @@
});
checkUOE(() -> {
+ char o = (char) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
char o = (char) vh.getAndAdd(array, ci, VALUE_1);
});
checkUOE(() -> {
- char o = (char) vh.addAndGet(array, ci, VALUE_1);
+ char o = (char) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
@@ -270,11 +331,11 @@
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
@@ -290,11 +351,59 @@
});
checkUOE(() -> {
+ char o = (char) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
char o = (char) vh.getAndAdd(array, ci, VALUE_1);
});
checkUOE(() -> {
- char o = (char) vh.addAndGet(array, ci, VALUE_1);
+ char o = (char) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
else {
@@ -315,11 +424,11 @@
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
@@ -333,12 +442,59 @@
checkUOE(() -> {
char o = (char) vh.getAndSet(array, ci, VALUE_1);
});
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
checkUOE(() -> {
char o = (char) vh.getAndAdd(array, ci, VALUE_1);
});
checkUOE(() -> {
- char o = (char) vh.addAndGet(array, ci, VALUE_1);
+ char o = (char) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ char o = (char) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
}
@@ -385,6 +541,7 @@
});
+
}
}
@@ -434,6 +591,7 @@
});
+
}
}
}
@@ -518,6 +676,7 @@
});
+
}
}
}
@@ -564,6 +723,7 @@
assertEquals(x, VALUE_2, "setOpaque char value");
}
+
}
}
}
@@ -609,6 +769,7 @@
assertEquals(x, VALUE_2, "setOpaque char value");
}
+
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsDouble.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsDouble.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsDouble.java Fri Sep 02 02:41:37 2016 +0000
@@ -92,14 +92,27 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@Test(dataProvider = "typesProvider")
@@ -190,7 +203,47 @@
});
checkUOE(() -> {
- double o = (double) vh.addAndGet(array, ci, VALUE_1);
+ double o = (double) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
@@ -236,11 +289,11 @@
});
checkROBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkROBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkROBE(() -> {
@@ -255,13 +308,61 @@
double o = (double) vh.getAndSet(array, ci, VALUE_1);
});
+ checkROBE(() -> {
+ double o = (double) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ double o = (double) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
checkUOE(() -> {
double o = (double) vh.getAndAdd(array, ci, VALUE_1);
});
checkUOE(() -> {
- double o = (double) vh.addAndGet(array, ci, VALUE_1);
+ double o = (double) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
else {
@@ -270,7 +371,46 @@
});
checkUOE(() -> {
- double o = (double) vh.addAndGet(array, ci, VALUE_1);
+ double o = (double) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ double o = (double) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
}
@@ -333,11 +473,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
@@ -352,6 +492,15 @@
double o = (double) vh.getAndSet(array, ci, VALUE_1);
});
+ checkIOOBE(() -> {
+ double o = (double) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ double o = (double) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+
}
}
@@ -418,11 +567,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
@@ -437,6 +586,15 @@
double o = (double) vh.getAndSet(array, ci, VALUE_1);
});
+ checkIOOBE(() -> {
+ double o = (double) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ double o = (double) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+
}
}
}
@@ -494,11 +652,11 @@
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
@@ -513,6 +671,14 @@
double o = (double) vh.getAndSet(array, ci, VALUE_1);
});
+ checkISE(() -> {
+ double o = (double) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ double o = (double) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
}
}
@@ -573,11 +739,11 @@
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
@@ -592,6 +758,15 @@
double o = (double) vh.getAndSet(array, ci, VALUE_1);
});
+ checkISE(() -> {
+ double o = (double) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ double o = (double) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+
}
}
}
@@ -700,11 +875,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, VALUE_1, VALUE_2);
+ success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
}
- assertEquals(success, true, "weakCompareAndSet double");
+ assertEquals(success, true, "weakCompareAndSetPlain double");
double x = (double) vh.get(array, i);
- assertEquals(x, VALUE_2, "weakCompareAndSet double value");
+ assertEquals(x, VALUE_2, "weakCompareAndSetPlain double value");
}
{
@@ -728,20 +903,44 @@
}
{
- boolean r = vh.weakCompareAndSetVolatile(array, i, VALUE_2, VALUE_1);
- assertEquals(r, true, "weakCompareAndSetVolatile double");
+ boolean success = false;
+ for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+ success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
+ }
+ assertEquals(success, true, "weakCompareAndSet double");
double x = (double) vh.get(array, i);
- assertEquals(x, VALUE_1, "weakCompareAndSetVolatile double value");
+ assertEquals(x, VALUE_1, "weakCompareAndSet double");
}
// Compare set and get
{
+ vh.set(array, i, VALUE_1);
+
double o = (double) vh.getAndSet(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndSet double");
double x = (double) vh.get(array, i);
assertEquals(x, VALUE_2, "getAndSet double value");
}
+ {
+ vh.set(array, i, VALUE_1);
+
+ double o = (double) vh.getAndSetAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetAcquire double");
+ double x = (double) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetAcquire double value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ double o = (double) vh.getAndSetRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetRelease double");
+ double x = (double) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetRelease double value");
+ }
+
+
}
}
}
@@ -849,11 +1048,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, VALUE_1, VALUE_2);
+ success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
}
- assertEquals(success, true, "weakCompareAndSet double");
+ assertEquals(success, true, "weakCompareAndSetPlain double");
double x = (double) vh.get(array, i);
- assertEquals(x, VALUE_2, "weakCompareAndSet double value");
+ assertEquals(x, VALUE_2, "weakCompareAndSetPlain double value");
}
{
@@ -877,20 +1076,44 @@
}
{
- boolean r = vh.weakCompareAndSetVolatile(array, i, VALUE_2, VALUE_1);
- assertEquals(r, true, "weakCompareAndSetVolatile double");
+ boolean success = false;
+ for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+ success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
+ }
+ assertEquals(success, true, "weakCompareAndSet double");
double x = (double) vh.get(array, i);
- assertEquals(x, VALUE_1, "weakCompareAndSetVolatile double value");
+ assertEquals(x, VALUE_1, "weakCompareAndSet double");
}
// Compare set and get
{
+ vh.set(array, i, VALUE_1);
+
double o = (double) vh.getAndSet(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndSet double");
double x = (double) vh.get(array, i);
assertEquals(x, VALUE_2, "getAndSet double value");
}
+ {
+ vh.set(array, i, VALUE_1);
+
+ double o = (double) vh.getAndSetAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetAcquire double");
+ double x = (double) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetAcquire double value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ double o = (double) vh.getAndSetRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetRelease double");
+ double x = (double) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetRelease double value");
+ }
+
+
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsFloat.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsFloat.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsFloat.java Fri Sep 02 02:41:37 2016 +0000
@@ -92,14 +92,27 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@Test(dataProvider = "typesProvider")
@@ -190,7 +203,47 @@
});
checkUOE(() -> {
- float o = (float) vh.addAndGet(array, ci, VALUE_1);
+ float o = (float) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
@@ -236,11 +289,11 @@
});
checkROBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkROBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkROBE(() -> {
@@ -255,13 +308,61 @@
float o = (float) vh.getAndSet(array, ci, VALUE_1);
});
+ checkROBE(() -> {
+ float o = (float) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ float o = (float) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
checkUOE(() -> {
float o = (float) vh.getAndAdd(array, ci, VALUE_1);
});
checkUOE(() -> {
- float o = (float) vh.addAndGet(array, ci, VALUE_1);
+ float o = (float) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
else {
@@ -270,7 +371,46 @@
});
checkUOE(() -> {
- float o = (float) vh.addAndGet(array, ci, VALUE_1);
+ float o = (float) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ float o = (float) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
}
@@ -333,11 +473,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
@@ -352,6 +492,15 @@
float o = (float) vh.getAndSet(array, ci, VALUE_1);
});
+ checkIOOBE(() -> {
+ float o = (float) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ float o = (float) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+
}
}
@@ -418,11 +567,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
@@ -437,6 +586,15 @@
float o = (float) vh.getAndSet(array, ci, VALUE_1);
});
+ checkIOOBE(() -> {
+ float o = (float) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ float o = (float) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+
}
}
}
@@ -494,11 +652,11 @@
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
@@ -513,6 +671,14 @@
float o = (float) vh.getAndSet(array, ci, VALUE_1);
});
+ checkISE(() -> {
+ float o = (float) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ float o = (float) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
}
}
@@ -573,11 +739,11 @@
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
@@ -592,6 +758,15 @@
float o = (float) vh.getAndSet(array, ci, VALUE_1);
});
+ checkISE(() -> {
+ float o = (float) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ float o = (float) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+
}
}
}
@@ -700,11 +875,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, VALUE_1, VALUE_2);
+ success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
}
- assertEquals(success, true, "weakCompareAndSet float");
+ assertEquals(success, true, "weakCompareAndSetPlain float");
float x = (float) vh.get(array, i);
- assertEquals(x, VALUE_2, "weakCompareAndSet float value");
+ assertEquals(x, VALUE_2, "weakCompareAndSetPlain float value");
}
{
@@ -728,20 +903,44 @@
}
{
- boolean r = vh.weakCompareAndSetVolatile(array, i, VALUE_2, VALUE_1);
- assertEquals(r, true, "weakCompareAndSetVolatile float");
+ boolean success = false;
+ for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+ success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
+ }
+ assertEquals(success, true, "weakCompareAndSet float");
float x = (float) vh.get(array, i);
- assertEquals(x, VALUE_1, "weakCompareAndSetVolatile float value");
+ assertEquals(x, VALUE_1, "weakCompareAndSet float");
}
// Compare set and get
{
+ vh.set(array, i, VALUE_1);
+
float o = (float) vh.getAndSet(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndSet float");
float x = (float) vh.get(array, i);
assertEquals(x, VALUE_2, "getAndSet float value");
}
+ {
+ vh.set(array, i, VALUE_1);
+
+ float o = (float) vh.getAndSetAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetAcquire float");
+ float x = (float) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetAcquire float value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ float o = (float) vh.getAndSetRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetRelease float");
+ float x = (float) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetRelease float value");
+ }
+
+
}
}
}
@@ -849,11 +1048,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, VALUE_1, VALUE_2);
+ success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
}
- assertEquals(success, true, "weakCompareAndSet float");
+ assertEquals(success, true, "weakCompareAndSetPlain float");
float x = (float) vh.get(array, i);
- assertEquals(x, VALUE_2, "weakCompareAndSet float value");
+ assertEquals(x, VALUE_2, "weakCompareAndSetPlain float value");
}
{
@@ -877,20 +1076,44 @@
}
{
- boolean r = vh.weakCompareAndSetVolatile(array, i, VALUE_2, VALUE_1);
- assertEquals(r, true, "weakCompareAndSetVolatile float");
+ boolean success = false;
+ for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+ success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
+ }
+ assertEquals(success, true, "weakCompareAndSet float");
float x = (float) vh.get(array, i);
- assertEquals(x, VALUE_1, "weakCompareAndSetVolatile float value");
+ assertEquals(x, VALUE_1, "weakCompareAndSet float");
}
// Compare set and get
{
+ vh.set(array, i, VALUE_1);
+
float o = (float) vh.getAndSet(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndSet float");
float x = (float) vh.get(array, i);
assertEquals(x, VALUE_2, "getAndSet float value");
}
+ {
+ vh.set(array, i, VALUE_1);
+
+ float o = (float) vh.getAndSetAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetAcquire float");
+ float x = (float) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetAcquire float value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ float o = (float) vh.getAndSetRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetRelease float");
+ float x = (float) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetRelease float value");
+ }
+
+
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java Fri Sep 02 02:41:37 2016 +0000
@@ -92,14 +92,27 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@Test(dataProvider = "typesProvider")
@@ -185,6 +198,7 @@
int ci = 1;
+
}
static void testArrayUnsupported(ByteBufferSource bs, VarHandleSource vhs) {
@@ -229,11 +243,11 @@
});
checkROBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkROBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkROBE(() -> {
@@ -248,13 +262,61 @@
int o = (int) vh.getAndSet(array, ci, VALUE_1);
});
+ checkROBE(() -> {
+ int o = (int) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ int o = (int) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
checkROBE(() -> {
int o = (int) vh.getAndAdd(array, ci, VALUE_1);
});
checkROBE(() -> {
- int o = (int) vh.addAndGet(array, ci, VALUE_1);
+ int o = (int) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ int o = (int) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ int o = (int) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ int o = (int) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ int o = (int) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ int o = (int) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ int o = (int) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ int o = (int) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ int o = (int) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ int o = (int) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ int o = (int) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
else {
@@ -319,11 +381,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
@@ -339,11 +401,59 @@
});
checkIOOBE(() -> {
+ int o = (int) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
int o = (int) vh.getAndAdd(array, ci, VALUE_1);
});
checkIOOBE(() -> {
- int o = (int) vh.addAndGet(array, ci, VALUE_1);
+ int o = (int) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
@@ -411,11 +521,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
@@ -431,11 +541,59 @@
});
checkIOOBE(() -> {
+ int o = (int) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
int o = (int) vh.getAndAdd(array, ci, VALUE_1);
});
checkIOOBE(() -> {
- int o = (int) vh.addAndGet(array, ci, VALUE_1);
+ int o = (int) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ int o = (int) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
}
@@ -494,11 +652,11 @@
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
@@ -514,13 +672,60 @@
});
checkISE(() -> {
+ int o = (int) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
int o = (int) vh.getAndAdd(array, ci, VALUE_1);
});
checkISE(() -> {
- int o = (int) vh.addAndGet(array, ci, VALUE_1);
+ int o = (int) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
});
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
+ });
}
}
}
@@ -580,11 +785,11 @@
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
@@ -600,11 +805,59 @@
});
checkISE(() -> {
+ int o = (int) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
int o = (int) vh.getAndAdd(array, ci, VALUE_1);
});
checkISE(() -> {
- int o = (int) vh.addAndGet(array, ci, VALUE_1);
+ int o = (int) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ int o = (int) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
}
@@ -714,11 +967,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, VALUE_1, VALUE_2);
+ success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
}
- assertEquals(success, true, "weakCompareAndSet int");
+ assertEquals(success, true, "weakCompareAndSetPlain int");
int x = (int) vh.get(array, i);
- assertEquals(x, VALUE_2, "weakCompareAndSet int value");
+ assertEquals(x, VALUE_2, "weakCompareAndSetPlain int value");
}
{
@@ -742,28 +995,153 @@
}
{
- boolean r = vh.weakCompareAndSetVolatile(array, i, VALUE_2, VALUE_1);
- assertEquals(r, true, "weakCompareAndSetVolatile int");
+ boolean success = false;
+ for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+ success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
+ }
+ assertEquals(success, true, "weakCompareAndSet int");
int x = (int) vh.get(array, i);
- assertEquals(x, VALUE_1, "weakCompareAndSetVolatile int value");
+ assertEquals(x, VALUE_1, "weakCompareAndSet int");
}
// Compare set and get
{
+ vh.set(array, i, VALUE_1);
+
int o = (int) vh.getAndSet(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndSet int");
int x = (int) vh.get(array, i);
assertEquals(x, VALUE_2, "getAndSet int value");
}
- vh.set(array, i, VALUE_1);
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndSetAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetAcquire int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndSetRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetRelease int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetRelease int value");
+ }
// get and add, add and get
{
- int o = (int) vh.getAndAdd(array, i, VALUE_3);
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndAdd(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndAdd int");
- int c = (int) vh.addAndGet(array, i, VALUE_3);
- assertEquals(c, VALUE_1 + VALUE_3 + VALUE_3, "getAndAdd int value");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAdd int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndAddAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndAddAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAddAcquire int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndAddRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndAddRelease int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAddRelease int value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseOr(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOr int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOr int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseOrAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOrAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOrAcquire int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseOrRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOrRelease int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOrRelease int value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseAnd(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAnd int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAnd int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseAndAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAndAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAndAcquire int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseAndRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAndRelease int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAndRelease int value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseXor(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXor int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXor int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseXorAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXorAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXorAcquire int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseXorRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXorRelease int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXorRelease int value");
}
}
}
@@ -872,11 +1250,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, VALUE_1, VALUE_2);
+ success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
}
- assertEquals(success, true, "weakCompareAndSet int");
+ assertEquals(success, true, "weakCompareAndSetPlain int");
int x = (int) vh.get(array, i);
- assertEquals(x, VALUE_2, "weakCompareAndSet int value");
+ assertEquals(x, VALUE_2, "weakCompareAndSetPlain int value");
}
{
@@ -900,28 +1278,153 @@
}
{
- boolean r = vh.weakCompareAndSetVolatile(array, i, VALUE_2, VALUE_1);
- assertEquals(r, true, "weakCompareAndSetVolatile int");
+ boolean success = false;
+ for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+ success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
+ }
+ assertEquals(success, true, "weakCompareAndSet int");
int x = (int) vh.get(array, i);
- assertEquals(x, VALUE_1, "weakCompareAndSetVolatile int value");
+ assertEquals(x, VALUE_1, "weakCompareAndSet int");
}
// Compare set and get
{
+ vh.set(array, i, VALUE_1);
+
int o = (int) vh.getAndSet(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndSet int");
int x = (int) vh.get(array, i);
assertEquals(x, VALUE_2, "getAndSet int value");
}
- vh.set(array, i, VALUE_1);
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndSetAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetAcquire int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndSetRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetRelease int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetRelease int value");
+ }
// get and add, add and get
{
- int o = (int) vh.getAndAdd(array, i, VALUE_3);
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndAdd(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndAdd int");
- int c = (int) vh.addAndGet(array, i, VALUE_3);
- assertEquals(c, VALUE_1 + VALUE_3 + VALUE_3, "getAndAdd int value");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAdd int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndAddAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndAddAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAddAcquire int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndAddRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndAddRelease int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAddRelease int value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseOr(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOr int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOr int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseOrAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOrAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOrAcquire int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseOrRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOrRelease int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOrRelease int value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseAnd(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAnd int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAnd int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseAndAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAndAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAndAcquire int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseAndRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAndRelease int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAndRelease int value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseXor(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXor int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXor int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseXorAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXorAcquire int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXorAcquire int value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ int o = (int) vh.getAndBitwiseXorRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXorRelease int");
+ int x = (int) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXorRelease int value");
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsLong.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsLong.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsLong.java Fri Sep 02 02:41:37 2016 +0000
@@ -92,14 +92,27 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@Test(dataProvider = "typesProvider")
@@ -185,6 +198,7 @@
int ci = 1;
+
}
static void testArrayUnsupported(ByteBufferSource bs, VarHandleSource vhs) {
@@ -229,11 +243,11 @@
});
checkROBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkROBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkROBE(() -> {
@@ -248,13 +262,61 @@
long o = (long) vh.getAndSet(array, ci, VALUE_1);
});
+ checkROBE(() -> {
+ long o = (long) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ long o = (long) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
checkROBE(() -> {
long o = (long) vh.getAndAdd(array, ci, VALUE_1);
});
checkROBE(() -> {
- long o = (long) vh.addAndGet(array, ci, VALUE_1);
+ long o = (long) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ long o = (long) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ long o = (long) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ long o = (long) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ long o = (long) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ long o = (long) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ long o = (long) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ long o = (long) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ long o = (long) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ long o = (long) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ long o = (long) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
else {
@@ -319,11 +381,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
@@ -339,11 +401,59 @@
});
checkIOOBE(() -> {
+ long o = (long) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
long o = (long) vh.getAndAdd(array, ci, VALUE_1);
});
checkIOOBE(() -> {
- long o = (long) vh.addAndGet(array, ci, VALUE_1);
+ long o = (long) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
@@ -411,11 +521,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
@@ -431,11 +541,59 @@
});
checkIOOBE(() -> {
+ long o = (long) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
long o = (long) vh.getAndAdd(array, ci, VALUE_1);
});
checkIOOBE(() -> {
- long o = (long) vh.addAndGet(array, ci, VALUE_1);
+ long o = (long) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ long o = (long) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
}
@@ -494,11 +652,11 @@
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
@@ -514,13 +672,60 @@
});
checkISE(() -> {
+ long o = (long) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
long o = (long) vh.getAndAdd(array, ci, VALUE_1);
});
checkISE(() -> {
- long o = (long) vh.addAndGet(array, ci, VALUE_1);
+ long o = (long) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
});
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
+ });
}
}
}
@@ -580,11 +785,11 @@
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
@@ -600,11 +805,59 @@
});
checkISE(() -> {
+ long o = (long) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
long o = (long) vh.getAndAdd(array, ci, VALUE_1);
});
checkISE(() -> {
- long o = (long) vh.addAndGet(array, ci, VALUE_1);
+ long o = (long) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ long o = (long) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
}
@@ -714,11 +967,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, VALUE_1, VALUE_2);
+ success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
}
- assertEquals(success, true, "weakCompareAndSet long");
+ assertEquals(success, true, "weakCompareAndSetPlain long");
long x = (long) vh.get(array, i);
- assertEquals(x, VALUE_2, "weakCompareAndSet long value");
+ assertEquals(x, VALUE_2, "weakCompareAndSetPlain long value");
}
{
@@ -742,28 +995,153 @@
}
{
- boolean r = vh.weakCompareAndSetVolatile(array, i, VALUE_2, VALUE_1);
- assertEquals(r, true, "weakCompareAndSetVolatile long");
+ boolean success = false;
+ for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+ success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
+ }
+ assertEquals(success, true, "weakCompareAndSet long");
long x = (long) vh.get(array, i);
- assertEquals(x, VALUE_1, "weakCompareAndSetVolatile long value");
+ assertEquals(x, VALUE_1, "weakCompareAndSet long");
}
// Compare set and get
{
+ vh.set(array, i, VALUE_1);
+
long o = (long) vh.getAndSet(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndSet long");
long x = (long) vh.get(array, i);
assertEquals(x, VALUE_2, "getAndSet long value");
}
- vh.set(array, i, VALUE_1);
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndSetAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetAcquire long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndSetRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetRelease long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetRelease long value");
+ }
// get and add, add and get
{
- long o = (long) vh.getAndAdd(array, i, VALUE_3);
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndAdd(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndAdd long");
- long c = (long) vh.addAndGet(array, i, VALUE_3);
- assertEquals(c, VALUE_1 + VALUE_3 + VALUE_3, "getAndAdd long value");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAdd long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndAddAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndAddAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAddAcquire long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndAddRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndAddRelease long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAddRelease long value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseOr(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOr long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOr long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseOrAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOrAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOrAcquire long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseOrRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOrRelease long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOrRelease long value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseAnd(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAnd long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAnd long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseAndAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAndAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAndAcquire long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseAndRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAndRelease long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAndRelease long value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseXor(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXor long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXor long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseXorAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXorAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXorAcquire long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseXorRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXorRelease long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXorRelease long value");
}
}
}
@@ -872,11 +1250,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, VALUE_1, VALUE_2);
+ success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
}
- assertEquals(success, true, "weakCompareAndSet long");
+ assertEquals(success, true, "weakCompareAndSetPlain long");
long x = (long) vh.get(array, i);
- assertEquals(x, VALUE_2, "weakCompareAndSet long value");
+ assertEquals(x, VALUE_2, "weakCompareAndSetPlain long value");
}
{
@@ -900,28 +1278,153 @@
}
{
- boolean r = vh.weakCompareAndSetVolatile(array, i, VALUE_2, VALUE_1);
- assertEquals(r, true, "weakCompareAndSetVolatile long");
+ boolean success = false;
+ for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+ success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
+ }
+ assertEquals(success, true, "weakCompareAndSet long");
long x = (long) vh.get(array, i);
- assertEquals(x, VALUE_1, "weakCompareAndSetVolatile long value");
+ assertEquals(x, VALUE_1, "weakCompareAndSet long");
}
// Compare set and get
{
+ vh.set(array, i, VALUE_1);
+
long o = (long) vh.getAndSet(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndSet long");
long x = (long) vh.get(array, i);
assertEquals(x, VALUE_2, "getAndSet long value");
}
- vh.set(array, i, VALUE_1);
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndSetAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetAcquire long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndSetRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetRelease long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetRelease long value");
+ }
// get and add, add and get
{
- long o = (long) vh.getAndAdd(array, i, VALUE_3);
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndAdd(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndAdd long");
- long c = (long) vh.addAndGet(array, i, VALUE_3);
- assertEquals(c, VALUE_1 + VALUE_3 + VALUE_3, "getAndAdd long value");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAdd long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndAddAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndAddAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAddAcquire long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndAddRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndAddRelease long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAddRelease long value");
+ }
+
+ // get and bitwise or
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseOr(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOr long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOr long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseOrAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOrAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOrAcquire long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseOrRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOrRelease long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOrRelease long value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseAnd(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAnd long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAnd long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseAndAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAndAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAndAcquire long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseAndRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAndRelease long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAndRelease long value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseXor(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXor long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXor long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseXorAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXorAcquire long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXorAcquire long value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ long o = (long) vh.getAndBitwiseXorRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXorRelease long");
+ long x = (long) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXorRelease long value");
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsShort.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsShort.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsShort.java Fri Sep 02 02:41:37 2016 +0000
@@ -92,14 +92,27 @@
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
+
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
}
@Test(dataProvider = "typesProvider")
@@ -201,11 +214,11 @@
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
@@ -221,11 +234,59 @@
});
checkUOE(() -> {
+ short o = (short) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
short o = (short) vh.getAndAdd(array, ci, VALUE_1);
});
checkUOE(() -> {
- short o = (short) vh.addAndGet(array, ci, VALUE_1);
+ short o = (short) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
@@ -270,11 +331,11 @@
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
@@ -290,11 +351,59 @@
});
checkUOE(() -> {
+ short o = (short) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
short o = (short) vh.getAndAdd(array, ci, VALUE_1);
});
checkUOE(() -> {
- short o = (short) vh.addAndGet(array, ci, VALUE_1);
+ short o = (short) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
else {
@@ -315,11 +424,11 @@
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
@@ -333,12 +442,59 @@
checkUOE(() -> {
short o = (short) vh.getAndSet(array, ci, VALUE_1);
});
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
checkUOE(() -> {
short o = (short) vh.getAndAdd(array, ci, VALUE_1);
});
checkUOE(() -> {
- short o = (short) vh.addAndGet(array, ci, VALUE_1);
+ short o = (short) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndAddRelease(array, ci, VALUE_1);
+ });
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ short o = (short) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
});
}
}
@@ -385,6 +541,7 @@
});
+
}
}
@@ -434,6 +591,7 @@
});
+
}
}
}
@@ -518,6 +676,7 @@
});
+
}
}
}
@@ -564,6 +723,7 @@
assertEquals(x, VALUE_2, "setOpaque short value");
}
+
}
}
}
@@ -609,6 +769,7 @@
assertEquals(x, VALUE_2, "setOpaque short value");
}
+
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessBoolean.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessBoolean.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessBoolean.java Fri Sep 02 02:41:37 2016 +0000
@@ -210,11 +210,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, true, false);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, true, false);
}
- assertEquals(success, true, "weakCompareAndSet boolean");
+ assertEquals(success, true, "weakCompareAndSetPlain boolean");
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, false, "weakCompareAndSet boolean value");
+ assertEquals(x, false, "weakCompareAndSetPlain boolean value");
}
{
@@ -240,11 +240,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, false, true);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, false, true);
}
- assertEquals(success, true, "weakCompareAndSetVolatile boolean");
+ assertEquals(success, true, "weakCompareAndSet boolean");
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, true, "weakCompareAndSetVolatile boolean");
+ assertEquals(x, true, "weakCompareAndSet boolean");
}
// Compare set and get
@@ -255,6 +255,90 @@
assertEquals(x, false, "getAndSet boolean value");
}
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(recv, false);
+ assertEquals(o, true, "getAndBitwiseOr boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOr boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(recv, false);
+ assertEquals(o, true, "getAndBitwiseOrAcquire boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOrAcquire boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(recv, false);
+ assertEquals(o, true, "getAndBitwiseOrRelease boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOrRelease boolean value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(recv, false);
+ assertEquals(o, true, "getAndBitwiseAnd boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAnd boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(recv, false);
+ assertEquals(o, true, "getAndBitwiseAndAcquire boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAndAcquire boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(recv, false);
+ assertEquals(o, true, "getAndBitwiseAndRelease boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAndRelease boolean value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(recv, false);
+ assertEquals(o, true, "getAndBitwiseXor boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXor boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(recv, false);
+ assertEquals(o, true, "getAndBitwiseXorAcquire boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXorAcquire boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(recv, false);
+ assertEquals(o, true, "getAndBitwiseXorRelease boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXorRelease boolean value");
+ }
}
static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessBoolean recv, Handles hs) throws Throwable {
@@ -264,6 +348,7 @@
boolean r = (boolean) hs.get(am).invokeExact(recv, true);
});
}
+
}
@@ -359,11 +444,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(true, false);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(true, false);
}
- assertEquals(success, true, "weakCompareAndSet boolean");
+ assertEquals(success, true, "weakCompareAndSetPlain boolean");
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, false, "weakCompareAndSet boolean value");
+ assertEquals(x, false, "weakCompareAndSetPlain boolean value");
}
{
@@ -389,21 +474,127 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(false, true);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(false, true);
}
- assertEquals(success, true, "weakCompareAndSetVolatile boolean");
+ assertEquals(success, true, "weakCompareAndSet boolean");
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, true, "weakCompareAndSetVolatile boolean");
+ assertEquals(x, true, "weakCompareAndSet boolean");
}
// Compare set and get
{
- boolean o = (boolean) hs.get(TestAccessMode.GET_AND_SET).invokeExact( false);
+ hs.get(TestAccessMode.SET).invokeExact(true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_SET).invokeExact(false);
assertEquals(o, true, "getAndSet boolean");
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, false, "getAndSet boolean value");
}
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact(true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(false);
+ assertEquals(o, true, "getAndSetAcquire boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, false, "getAndSetAcquire boolean value");
+ }
+
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact(true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(false);
+ assertEquals(o, true, "getAndSetRelease boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, false, "getAndSetRelease boolean value");
+ }
+
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(false);
+ assertEquals(o, true, "getAndBitwiseOr boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOr boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(false);
+ assertEquals(o, true, "getAndBitwiseOrAcquire boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOrAcquire boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(false);
+ assertEquals(o, true, "getAndBitwiseOrRelease boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOrRelease boolean value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(false);
+ assertEquals(o, true, "getAndBitwiseAnd boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAnd boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(false);
+ assertEquals(o, true, "getAndBitwiseAndAcquire boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAndAcquire boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(false);
+ assertEquals(o, true, "getAndBitwiseAndRelease boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAndRelease boolean value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(false);
+ assertEquals(o, true, "getAndBitwiseXor boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXor boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(false);
+ assertEquals(o, true, "getAndBitwiseXorAcquire boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXorAcquire boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(false);
+ assertEquals(o, true, "getAndBitwiseXorRelease boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXorRelease boolean value");
+ }
}
static void testStaticFieldUnsupported(Handles hs) throws Throwable {
@@ -413,6 +604,7 @@
boolean r = (boolean) hs.get(am).invokeExact(true);
});
}
+
}
@@ -511,11 +703,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, true, false);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, true, false);
}
- assertEquals(success, true, "weakCompareAndSet boolean");
+ assertEquals(success, true, "weakCompareAndSetPlain boolean");
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, false, "weakCompareAndSet boolean value");
+ assertEquals(x, false, "weakCompareAndSetPlain boolean value");
}
{
@@ -541,21 +733,125 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, false, true);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, false, true);
}
- assertEquals(success, true, "weakCompareAndSetVolatile boolean");
+ assertEquals(success, true, "weakCompareAndSet boolean");
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, true, "weakCompareAndSetVolatile boolean");
+ assertEquals(x, true, "weakCompareAndSet boolean");
}
// Compare set and get
{
+ hs.get(TestAccessMode.SET).invokeExact(array, i, true);
+
boolean o = (boolean) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, false);
assertEquals(o, true, "getAndSet boolean");
boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, false, "getAndSet boolean value");
}
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(array, i, false);
+ assertEquals(o, true, "getAndSetAcquire boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, false, "getAndSetAcquire boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(array, i, false);
+ assertEquals(o, true, "getAndSetRelease boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, false, "getAndSetRelease boolean value");
+ }
+
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(array, i, false);
+ assertEquals(o, true, "getAndBitwiseOr boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOr boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(array, i, false);
+ assertEquals(o, true, "getAndBitwiseOrAcquire boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOrAcquire boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(array, i, false);
+ assertEquals(o, true, "getAndBitwiseOrRelease boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (boolean)(true | false), "getAndBitwiseOrRelease boolean value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(array, i, false);
+ assertEquals(o, true, "getAndBitwiseAnd boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAnd boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(array, i, false);
+ assertEquals(o, true, "getAndBitwiseAndAcquire boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAndAcquire boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(array, i, false);
+ assertEquals(o, true, "getAndBitwiseAndRelease boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (boolean)(true & false), "getAndBitwiseAndRelease boolean value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(array, i, false);
+ assertEquals(o, true, "getAndBitwiseXor boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXor boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(array, i, false);
+ assertEquals(o, true, "getAndBitwiseXorAcquire boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXorAcquire boolean value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, true);
+
+ boolean o = (boolean) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(array, i, false);
+ assertEquals(o, true, "getAndBitwiseXorRelease boolean");
+ boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (boolean)(true ^ false), "getAndBitwiseXorRelease boolean value");
+ }
}
}
@@ -569,6 +865,7 @@
boolean o = (boolean) hs.get(am).invokeExact(array, i, true);
});
}
+
}
static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -607,6 +904,12 @@
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkIOOBE(am, () -> {
+ boolean o = (boolean) hs.get(am).invokeExact(array, ci, false);
+ });
+ }
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessByte.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessByte.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessByte.java Fri Sep 02 02:41:37 2016 +0000
@@ -210,11 +210,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, (byte)0x01, (byte)0x23);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, (byte)0x01, (byte)0x23);
}
- assertEquals(success, true, "weakCompareAndSet byte");
+ assertEquals(success, true, "weakCompareAndSetPlain byte");
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, (byte)0x23, "weakCompareAndSet byte value");
+ assertEquals(x, (byte)0x23, "weakCompareAndSetPlain byte value");
}
{
@@ -240,11 +240,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, (byte)0x23, (byte)0x01);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, (byte)0x23, (byte)0x01);
}
- assertEquals(success, true, "weakCompareAndSetVolatile byte");
+ assertEquals(success, true, "weakCompareAndSet byte");
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, (byte)0x01, "weakCompareAndSetVolatile byte");
+ assertEquals(x, (byte)0x01, "weakCompareAndSet byte");
}
// Compare set and get
@@ -255,19 +255,122 @@
assertEquals(x, (byte)0x23, "getAndSet byte value");
}
- hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
-
// get and add, add and get
{
- byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, (byte)0x45);
+ hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, (byte)0x23);
assertEquals(o, (byte)0x01, "getAndAdd byte");
- byte c = (byte) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, (byte)0x45);
- assertEquals(c, (byte)((byte)0x01 + (byte)0x45 + (byte)0x45), "getAndAdd byte value");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAdd byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndAddAcquire byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAddAcquire byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndAddRelease byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAddRelease byte value");
+ }
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOr byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOr byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOrAcquire byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOrAcquire byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOrRelease byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOrRelease byte value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAnd byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAnd byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAndAcquire byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAndAcquire byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAndRelease byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAndRelease byte value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXor byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXor byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXorAcquire byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXorAcquire byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(recv, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXorRelease byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXorRelease byte value");
}
}
static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessByte recv, Handles hs) throws Throwable {
+
}
@@ -363,11 +466,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact((byte)0x01, (byte)0x23);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact((byte)0x01, (byte)0x23);
}
- assertEquals(success, true, "weakCompareAndSet byte");
+ assertEquals(success, true, "weakCompareAndSetPlain byte");
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, (byte)0x23, "weakCompareAndSet byte value");
+ assertEquals(x, (byte)0x23, "weakCompareAndSetPlain byte value");
}
{
@@ -393,34 +496,159 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact((byte)0x23, (byte)0x01);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact((byte)0x23, (byte)0x01);
}
- assertEquals(success, true, "weakCompareAndSetVolatile byte");
+ assertEquals(success, true, "weakCompareAndSet byte");
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, (byte)0x01, "weakCompareAndSetVolatile byte");
+ assertEquals(x, (byte)0x01, "weakCompareAndSet byte");
}
// Compare set and get
{
- byte o = (byte) hs.get(TestAccessMode.GET_AND_SET).invokeExact( (byte)0x23);
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_SET).invokeExact((byte)0x23);
assertEquals(o, (byte)0x01, "getAndSet byte");
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, (byte)0x23, "getAndSet byte value");
}
- hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndSetAcquire byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (byte)0x23, "getAndSetAcquire byte value");
+ }
+
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndSetRelease byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (byte)0x23, "getAndSetRelease byte value");
+ }
// get and add, add and get
{
- byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( (byte)0x45);
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD).invokeExact((byte)0x23);
assertEquals(o, (byte)0x01, "getAndAdd byte");
- byte c = (byte) hs.get(TestAccessMode.ADD_AND_GET).invokeExact((byte)0x45);
- assertEquals(c, (byte)((byte)0x01 + (byte)0x45 + (byte)0x45), "getAndAdd byte value");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAdd byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndAddAcquire byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAddAcquire byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndAddRelease byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAddRelease byte value");
+ }
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOr byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOr byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOrAcquire byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOrAcquire byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOrRelease byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOrRelease byte value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAnd byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAnd byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAndAcquire byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAndAcquire byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAndRelease byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAndRelease byte value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXor byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXor byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXorAcquire byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXorAcquire byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact((byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXorRelease byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXorRelease byte value");
}
}
static void testStaticFieldUnsupported(Handles hs) throws Throwable {
+
}
@@ -519,11 +747,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, (byte)0x01, (byte)0x23);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, (byte)0x01, (byte)0x23);
}
- assertEquals(success, true, "weakCompareAndSet byte");
+ assertEquals(success, true, "weakCompareAndSetPlain byte");
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, (byte)0x23, "weakCompareAndSet byte value");
+ assertEquals(x, (byte)0x23, "weakCompareAndSetPlain byte value");
}
{
@@ -549,30 +777,152 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, (byte)0x23, (byte)0x01);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, (byte)0x23, (byte)0x01);
}
- assertEquals(success, true, "weakCompareAndSetVolatile byte");
+ assertEquals(success, true, "weakCompareAndSet byte");
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, (byte)0x01, "weakCompareAndSetVolatile byte");
+ assertEquals(x, (byte)0x01, "weakCompareAndSet byte");
}
// Compare set and get
{
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
byte o = (byte) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, (byte)0x23);
assertEquals(o, (byte)0x01, "getAndSet byte");
byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, (byte)0x23, "getAndSet byte value");
}
- hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndSetAcquire byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (byte)0x23, "getAndSetAcquire byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndSetRelease byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (byte)0x23, "getAndSetRelease byte value");
+ }
// get and add, add and get
{
- byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, (byte)0x45);
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, (byte)0x23);
assertEquals(o, (byte)0x01, "getAndAdd byte");
- byte c = (byte) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, (byte)0x45);
- assertEquals(c, (byte)((byte)0x01 + (byte)0x45 + (byte)0x45), "getAndAdd byte value");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAdd byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndAddAcquire byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAddAcquire byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndAddRelease byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (byte)((byte)0x01 + (byte)0x23), "getAndAddRelease byte value");
}
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOr byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOr byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOrAcquire byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOrAcquire byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseOrRelease byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (byte)((byte)0x01 | (byte)0x23), "getAndBitwiseOrRelease byte value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAnd byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAnd byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAndAcquire byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAndAcquire byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseAndRelease byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (byte)((byte)0x01 & (byte)0x23), "getAndBitwiseAndRelease byte value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXor byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXor byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXorAcquire byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXorAcquire byte value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+ byte o = (byte) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(array, i, (byte)0x23);
+ assertEquals(o, (byte)0x01, "getAndBitwiseXorRelease byte");
+ byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (byte)((byte)0x01 ^ (byte)0x23), "getAndBitwiseXorRelease byte value");
+ }
}
}
@@ -581,6 +931,7 @@
final int i = 0;
+
}
static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -624,6 +975,12 @@
byte o = (byte) hs.get(am).invokeExact(array, ci, (byte)0x45);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkIOOBE(am, () -> {
+ byte o = (byte) hs.get(am).invokeExact(array, ci, (byte)0x45);
+ });
+ }
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessChar.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessChar.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessChar.java Fri Sep 02 02:41:37 2016 +0000
@@ -210,11 +210,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, '\u0123', '\u4567');
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, '\u0123', '\u4567');
}
- assertEquals(success, true, "weakCompareAndSet char");
+ assertEquals(success, true, "weakCompareAndSetPlain char");
char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, '\u4567', "weakCompareAndSet char value");
+ assertEquals(x, '\u4567', "weakCompareAndSetPlain char value");
}
{
@@ -240,11 +240,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, '\u4567', '\u0123');
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, '\u4567', '\u0123');
}
- assertEquals(success, true, "weakCompareAndSetVolatile char");
+ assertEquals(success, true, "weakCompareAndSet char");
char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, '\u0123', "weakCompareAndSetVolatile char");
+ assertEquals(x, '\u0123', "weakCompareAndSet char");
}
// Compare set and get
@@ -255,19 +255,122 @@
assertEquals(x, '\u4567', "getAndSet char value");
}
- hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
-
// get and add, add and get
{
- char o = (char) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, '\u89AB');
+ hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, '\u4567');
assertEquals(o, '\u0123', "getAndAdd char");
- char c = (char) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, '\u89AB');
- assertEquals(c, (char)('\u0123' + '\u89AB' + '\u89AB'), "getAndAdd char value");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAdd char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndAddAcquire char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAddAcquire char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndAddRelease char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAddRelease char value");
+ }
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOr char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOr char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOrAcquire char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOrAcquire char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOrRelease char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOrRelease char value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAnd char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAnd char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAndAcquire char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAndAcquire char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAndRelease char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAndRelease char value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXor char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXor char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXorAcquire char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXorAcquire char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(recv, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXorRelease char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXorRelease char value");
}
}
static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessChar recv, Handles hs) throws Throwable {
+
}
@@ -363,11 +466,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact('\u0123', '\u4567');
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact('\u0123', '\u4567');
}
- assertEquals(success, true, "weakCompareAndSet char");
+ assertEquals(success, true, "weakCompareAndSetPlain char");
char x = (char) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, '\u4567', "weakCompareAndSet char value");
+ assertEquals(x, '\u4567', "weakCompareAndSetPlain char value");
}
{
@@ -393,34 +496,159 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact('\u4567', '\u0123');
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact('\u4567', '\u0123');
}
- assertEquals(success, true, "weakCompareAndSetVolatile char");
+ assertEquals(success, true, "weakCompareAndSet char");
char x = (char) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, '\u0123', "weakCompareAndSetVolatile char");
+ assertEquals(x, '\u0123', "weakCompareAndSet char");
}
// Compare set and get
{
- char o = (char) hs.get(TestAccessMode.GET_AND_SET).invokeExact( '\u4567');
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_SET).invokeExact('\u4567');
assertEquals(o, '\u0123', "getAndSet char");
char x = (char) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, '\u4567', "getAndSet char value");
}
- hs.get(TestAccessMode.SET).invokeExact('\u0123');
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact('\u4567');
+ assertEquals(o, '\u0123', "getAndSetAcquire char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, '\u4567', "getAndSetAcquire char value");
+ }
+
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact('\u4567');
+ assertEquals(o, '\u0123', "getAndSetRelease char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, '\u4567', "getAndSetRelease char value");
+ }
// get and add, add and get
{
- char o = (char) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( '\u89AB');
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_ADD).invokeExact('\u4567');
assertEquals(o, '\u0123', "getAndAdd char");
- char c = (char) hs.get(TestAccessMode.ADD_AND_GET).invokeExact('\u89AB');
- assertEquals(c, (char)('\u0123' + '\u89AB' + '\u89AB'), "getAndAdd char value");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAdd char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact('\u4567');
+ assertEquals(o, '\u0123', "getAndAddAcquire char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAddAcquire char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact('\u4567');
+ assertEquals(o, '\u0123', "getAndAddRelease char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAddRelease char value");
+ }
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOr char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOr char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOrAcquire char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOrAcquire char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOrRelease char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOrRelease char value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAnd char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAnd char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAndAcquire char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAndAcquire char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAndRelease char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAndRelease char value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXor char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXor char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXorAcquire char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXorAcquire char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact('\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXorRelease char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXorRelease char value");
}
}
static void testStaticFieldUnsupported(Handles hs) throws Throwable {
+
}
@@ -519,11 +747,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, '\u0123', '\u4567');
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, '\u0123', '\u4567');
}
- assertEquals(success, true, "weakCompareAndSet char");
+ assertEquals(success, true, "weakCompareAndSetPlain char");
char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, '\u4567', "weakCompareAndSet char value");
+ assertEquals(x, '\u4567', "weakCompareAndSetPlain char value");
}
{
@@ -549,30 +777,152 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, '\u4567', '\u0123');
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, '\u4567', '\u0123');
}
- assertEquals(success, true, "weakCompareAndSetVolatile char");
+ assertEquals(success, true, "weakCompareAndSet char");
char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, '\u0123', "weakCompareAndSetVolatile char");
+ assertEquals(x, '\u0123', "weakCompareAndSet char");
}
// Compare set and get
{
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
char o = (char) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, '\u4567');
assertEquals(o, '\u0123', "getAndSet char");
char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, '\u4567', "getAndSet char value");
}
- hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndSetAcquire char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, '\u4567', "getAndSetAcquire char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndSetRelease char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, '\u4567', "getAndSetRelease char value");
+ }
// get and add, add and get
{
- char o = (char) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, '\u89AB');
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, '\u4567');
assertEquals(o, '\u0123', "getAndAdd char");
- char c = (char) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, '\u89AB');
- assertEquals(c, (char)('\u0123' + '\u89AB' + '\u89AB'), "getAndAdd char value");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAdd char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndAddAcquire char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAddAcquire char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndAddRelease char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (char)('\u0123' + '\u4567'), "getAndAddRelease char value");
}
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOr char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOr char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOrAcquire char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOrAcquire char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseOrRelease char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (char)('\u0123' | '\u4567'), "getAndBitwiseOrRelease char value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAnd char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAnd char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAndAcquire char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAndAcquire char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseAndRelease char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (char)('\u0123' & '\u4567'), "getAndBitwiseAndRelease char value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXor char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXor char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXorAcquire char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXorAcquire char value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+ char o = (char) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(array, i, '\u4567');
+ assertEquals(o, '\u0123', "getAndBitwiseXorRelease char");
+ char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (char)('\u0123' ^ '\u4567'), "getAndBitwiseXorRelease char value");
+ }
}
}
@@ -581,6 +931,7 @@
final int i = 0;
+
}
static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -624,6 +975,12 @@
char o = (char) hs.get(am).invokeExact(array, ci, '\u89AB');
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkIOOBE(am, () -> {
+ char o = (char) hs.get(am).invokeExact(array, ci, '\u89AB');
+ });
+ }
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessDouble.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessDouble.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessDouble.java Fri Sep 02 02:41:37 2016 +0000
@@ -210,11 +210,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 1.0d, 2.0d);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, 1.0d, 2.0d);
}
- assertEquals(success, true, "weakCompareAndSet double");
+ assertEquals(success, true, "weakCompareAndSetPlain double");
double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, 2.0d, "weakCompareAndSet double value");
+ assertEquals(x, 2.0d, "weakCompareAndSetPlain double value");
}
{
@@ -240,11 +240,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, 2.0d, 1.0d);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 2.0d, 1.0d);
}
- assertEquals(success, true, "weakCompareAndSetVolatile double");
+ assertEquals(success, true, "weakCompareAndSet double");
double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, 1.0d, "weakCompareAndSetVolatile double");
+ assertEquals(x, 1.0d, "weakCompareAndSet double");
}
// Compare set and get
@@ -255,19 +255,44 @@
assertEquals(x, 2.0d, "getAndSet double value");
}
- hs.get(TestAccessMode.SET).invokeExact(recv, 1.0d);
-
// get and add, add and get
{
- double o = (double) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, 3.0d);
+ hs.get(TestAccessMode.SET).invokeExact(recv, 1.0d);
+
+ double o = (double) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, 2.0d);
assertEquals(o, 1.0d, "getAndAdd double");
- double c = (double) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, 3.0d);
- assertEquals(c, (double)(1.0d + 3.0d + 3.0d), "getAndAdd double value");
+ double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAdd double value");
}
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 1.0d);
+
+ double o = (double) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(recv, 2.0d);
+ assertEquals(o, 1.0d, "getAndAddAcquire double");
+ double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAddAcquire double value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 1.0d);
+
+ double o = (double) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(recv, 2.0d);
+ assertEquals(o, 1.0d, "getAndAddRelease double");
+ double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAddRelease double value");
+ }
+
}
static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessDouble recv, Handles hs) throws Throwable {
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkUOE(am, () -> {
+ double r = (double) hs.get(am).invokeExact(recv, 1.0d);
+ });
+ }
}
@@ -363,11 +388,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(1.0d, 2.0d);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(1.0d, 2.0d);
}
- assertEquals(success, true, "weakCompareAndSet double");
+ assertEquals(success, true, "weakCompareAndSetPlain double");
double x = (double) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, 2.0d, "weakCompareAndSet double value");
+ assertEquals(x, 2.0d, "weakCompareAndSetPlain double value");
}
{
@@ -393,34 +418,81 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(2.0d, 1.0d);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(2.0d, 1.0d);
}
- assertEquals(success, true, "weakCompareAndSetVolatile double");
+ assertEquals(success, true, "weakCompareAndSet double");
double x = (double) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, 1.0d, "weakCompareAndSetVolatile double");
+ assertEquals(x, 1.0d, "weakCompareAndSet double");
}
// Compare set and get
{
- double o = (double) hs.get(TestAccessMode.GET_AND_SET).invokeExact( 2.0d);
+ hs.get(TestAccessMode.SET).invokeExact(1.0d);
+
+ double o = (double) hs.get(TestAccessMode.GET_AND_SET).invokeExact(2.0d);
assertEquals(o, 1.0d, "getAndSet double");
double x = (double) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, 2.0d, "getAndSet double value");
}
- hs.get(TestAccessMode.SET).invokeExact(1.0d);
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact(1.0d);
+
+ double o = (double) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(2.0d);
+ assertEquals(o, 1.0d, "getAndSetAcquire double");
+ double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, 2.0d, "getAndSetAcquire double value");
+ }
+
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact(1.0d);
+
+ double o = (double) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(2.0d);
+ assertEquals(o, 1.0d, "getAndSetRelease double");
+ double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, 2.0d, "getAndSetRelease double value");
+ }
// get and add, add and get
{
- double o = (double) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( 3.0d);
+ hs.get(TestAccessMode.SET).invokeExact(1.0d);
+
+ double o = (double) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(2.0d);
assertEquals(o, 1.0d, "getAndAdd double");
- double c = (double) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(3.0d);
- assertEquals(c, (double)(1.0d + 3.0d + 3.0d), "getAndAdd double value");
+ double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAdd double value");
}
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(1.0d);
+
+ double o = (double) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(2.0d);
+ assertEquals(o, 1.0d, "getAndAddAcquire double");
+ double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAddAcquire double value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(1.0d);
+
+ double o = (double) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(2.0d);
+ assertEquals(o, 1.0d, "getAndAddRelease double");
+ double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAddRelease double value");
+ }
+
}
static void testStaticFieldUnsupported(Handles hs) throws Throwable {
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkUOE(am, () -> {
+ double r = (double) hs.get(am).invokeExact(1.0d);
+ });
+ }
}
@@ -519,11 +591,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 1.0d, 2.0d);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, 1.0d, 2.0d);
}
- assertEquals(success, true, "weakCompareAndSet double");
+ assertEquals(success, true, "weakCompareAndSetPlain double");
double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, 2.0d, "weakCompareAndSet double value");
+ assertEquals(x, 2.0d, "weakCompareAndSetPlain double value");
}
{
@@ -549,30 +621,69 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, 2.0d, 1.0d);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 2.0d, 1.0d);
}
- assertEquals(success, true, "weakCompareAndSetVolatile double");
+ assertEquals(success, true, "weakCompareAndSet double");
double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, 1.0d, "weakCompareAndSetVolatile double");
+ assertEquals(x, 1.0d, "weakCompareAndSet double");
}
// Compare set and get
{
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0d);
+
double o = (double) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, 2.0d);
assertEquals(o, 1.0d, "getAndSet double");
double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, 2.0d, "getAndSet double value");
}
- hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0d);
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0d);
+
+ double o = (double) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(array, i, 2.0d);
+ assertEquals(o, 1.0d, "getAndSetAcquire double");
+ double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, 2.0d, "getAndSetAcquire double value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0d);
+
+ double o = (double) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(array, i, 2.0d);
+ assertEquals(o, 1.0d, "getAndSetRelease double");
+ double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, 2.0d, "getAndSetRelease double value");
+ }
// get and add, add and get
{
- double o = (double) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, 3.0d);
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0d);
+
+ double o = (double) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, 2.0d);
assertEquals(o, 1.0d, "getAndAdd double");
- double c = (double) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, 3.0d);
- assertEquals(c, (double)(1.0d + 3.0d + 3.0d), "getAndAdd double value");
+ double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAdd double value");
}
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0d);
+
+ double o = (double) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(array, i, 2.0d);
+ assertEquals(o, 1.0d, "getAndAddAcquire double");
+ double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAddAcquire double value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0d);
+
+ double o = (double) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(array, i, 2.0d);
+ assertEquals(o, 1.0d, "getAndAddRelease double");
+ double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (double)(1.0d + 2.0d), "getAndAddRelease double value");
+ }
+
}
}
@@ -581,6 +692,12 @@
final int i = 0;
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkUOE(am, () -> {
+ double o = (double) hs.get(am).invokeExact(array, i, 1.0d);
+ });
+ }
}
static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -624,6 +741,7 @@
double o = (double) hs.get(am).invokeExact(array, ci, 3.0d);
});
}
+
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessFloat.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessFloat.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessFloat.java Fri Sep 02 02:41:37 2016 +0000
@@ -210,11 +210,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 1.0f, 2.0f);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, 1.0f, 2.0f);
}
- assertEquals(success, true, "weakCompareAndSet float");
+ assertEquals(success, true, "weakCompareAndSetPlain float");
float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, 2.0f, "weakCompareAndSet float value");
+ assertEquals(x, 2.0f, "weakCompareAndSetPlain float value");
}
{
@@ -240,11 +240,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, 2.0f, 1.0f);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 2.0f, 1.0f);
}
- assertEquals(success, true, "weakCompareAndSetVolatile float");
+ assertEquals(success, true, "weakCompareAndSet float");
float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, 1.0f, "weakCompareAndSetVolatile float");
+ assertEquals(x, 1.0f, "weakCompareAndSet float");
}
// Compare set and get
@@ -255,19 +255,44 @@
assertEquals(x, 2.0f, "getAndSet float value");
}
- hs.get(TestAccessMode.SET).invokeExact(recv, 1.0f);
-
// get and add, add and get
{
- float o = (float) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, 3.0f);
+ hs.get(TestAccessMode.SET).invokeExact(recv, 1.0f);
+
+ float o = (float) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, 2.0f);
assertEquals(o, 1.0f, "getAndAdd float");
- float c = (float) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, 3.0f);
- assertEquals(c, (float)(1.0f + 3.0f + 3.0f), "getAndAdd float value");
+ float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAdd float value");
}
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 1.0f);
+
+ float o = (float) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(recv, 2.0f);
+ assertEquals(o, 1.0f, "getAndAddAcquire float");
+ float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAddAcquire float value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 1.0f);
+
+ float o = (float) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(recv, 2.0f);
+ assertEquals(o, 1.0f, "getAndAddRelease float");
+ float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAddRelease float value");
+ }
+
}
static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessFloat recv, Handles hs) throws Throwable {
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkUOE(am, () -> {
+ float r = (float) hs.get(am).invokeExact(recv, 1.0f);
+ });
+ }
}
@@ -363,11 +388,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(1.0f, 2.0f);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(1.0f, 2.0f);
}
- assertEquals(success, true, "weakCompareAndSet float");
+ assertEquals(success, true, "weakCompareAndSetPlain float");
float x = (float) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, 2.0f, "weakCompareAndSet float value");
+ assertEquals(x, 2.0f, "weakCompareAndSetPlain float value");
}
{
@@ -393,34 +418,81 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(2.0f, 1.0f);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(2.0f, 1.0f);
}
- assertEquals(success, true, "weakCompareAndSetVolatile float");
+ assertEquals(success, true, "weakCompareAndSet float");
float x = (float) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, 1.0f, "weakCompareAndSetVolatile float");
+ assertEquals(x, 1.0f, "weakCompareAndSet float");
}
// Compare set and get
{
- float o = (float) hs.get(TestAccessMode.GET_AND_SET).invokeExact( 2.0f);
+ hs.get(TestAccessMode.SET).invokeExact(1.0f);
+
+ float o = (float) hs.get(TestAccessMode.GET_AND_SET).invokeExact(2.0f);
assertEquals(o, 1.0f, "getAndSet float");
float x = (float) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, 2.0f, "getAndSet float value");
}
- hs.get(TestAccessMode.SET).invokeExact(1.0f);
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact(1.0f);
+
+ float o = (float) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(2.0f);
+ assertEquals(o, 1.0f, "getAndSetAcquire float");
+ float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, 2.0f, "getAndSetAcquire float value");
+ }
+
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact(1.0f);
+
+ float o = (float) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(2.0f);
+ assertEquals(o, 1.0f, "getAndSetRelease float");
+ float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, 2.0f, "getAndSetRelease float value");
+ }
// get and add, add and get
{
- float o = (float) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( 3.0f);
+ hs.get(TestAccessMode.SET).invokeExact(1.0f);
+
+ float o = (float) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(2.0f);
assertEquals(o, 1.0f, "getAndAdd float");
- float c = (float) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(3.0f);
- assertEquals(c, (float)(1.0f + 3.0f + 3.0f), "getAndAdd float value");
+ float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAdd float value");
}
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(1.0f);
+
+ float o = (float) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(2.0f);
+ assertEquals(o, 1.0f, "getAndAddAcquire float");
+ float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAddAcquire float value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(1.0f);
+
+ float o = (float) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(2.0f);
+ assertEquals(o, 1.0f, "getAndAddRelease float");
+ float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAddRelease float value");
+ }
+
}
static void testStaticFieldUnsupported(Handles hs) throws Throwable {
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkUOE(am, () -> {
+ float r = (float) hs.get(am).invokeExact(1.0f);
+ });
+ }
}
@@ -519,11 +591,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 1.0f, 2.0f);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, 1.0f, 2.0f);
}
- assertEquals(success, true, "weakCompareAndSet float");
+ assertEquals(success, true, "weakCompareAndSetPlain float");
float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, 2.0f, "weakCompareAndSet float value");
+ assertEquals(x, 2.0f, "weakCompareAndSetPlain float value");
}
{
@@ -549,30 +621,69 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, 2.0f, 1.0f);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 2.0f, 1.0f);
}
- assertEquals(success, true, "weakCompareAndSetVolatile float");
+ assertEquals(success, true, "weakCompareAndSet float");
float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, 1.0f, "weakCompareAndSetVolatile float");
+ assertEquals(x, 1.0f, "weakCompareAndSet float");
}
// Compare set and get
{
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0f);
+
float o = (float) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, 2.0f);
assertEquals(o, 1.0f, "getAndSet float");
float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, 2.0f, "getAndSet float value");
}
- hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0f);
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0f);
+
+ float o = (float) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(array, i, 2.0f);
+ assertEquals(o, 1.0f, "getAndSetAcquire float");
+ float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, 2.0f, "getAndSetAcquire float value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0f);
+
+ float o = (float) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(array, i, 2.0f);
+ assertEquals(o, 1.0f, "getAndSetRelease float");
+ float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, 2.0f, "getAndSetRelease float value");
+ }
// get and add, add and get
{
- float o = (float) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, 3.0f);
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0f);
+
+ float o = (float) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, 2.0f);
assertEquals(o, 1.0f, "getAndAdd float");
- float c = (float) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, 3.0f);
- assertEquals(c, (float)(1.0f + 3.0f + 3.0f), "getAndAdd float value");
+ float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAdd float value");
}
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0f);
+
+ float o = (float) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(array, i, 2.0f);
+ assertEquals(o, 1.0f, "getAndAddAcquire float");
+ float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAddAcquire float value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0f);
+
+ float o = (float) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(array, i, 2.0f);
+ assertEquals(o, 1.0f, "getAndAddRelease float");
+ float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (float)(1.0f + 2.0f), "getAndAddRelease float value");
+ }
+
}
}
@@ -581,6 +692,12 @@
final int i = 0;
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkUOE(am, () -> {
+ float o = (float) hs.get(am).invokeExact(array, i, 1.0f);
+ });
+ }
}
static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -624,6 +741,7 @@
float o = (float) hs.get(am).invokeExact(array, ci, 3.0f);
});
}
+
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessInt.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessInt.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessInt.java Fri Sep 02 02:41:37 2016 +0000
@@ -210,11 +210,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 0x01234567, 0x89ABCDEF);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, 0x01234567, 0x89ABCDEF);
}
- assertEquals(success, true, "weakCompareAndSet int");
+ assertEquals(success, true, "weakCompareAndSetPlain int");
int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, 0x89ABCDEF, "weakCompareAndSet int value");
+ assertEquals(x, 0x89ABCDEF, "weakCompareAndSetPlain int value");
}
{
@@ -240,11 +240,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, 0x89ABCDEF, 0x01234567);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 0x89ABCDEF, 0x01234567);
}
- assertEquals(success, true, "weakCompareAndSetVolatile int");
+ assertEquals(success, true, "weakCompareAndSet int");
int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, 0x01234567, "weakCompareAndSetVolatile int");
+ assertEquals(x, 0x01234567, "weakCompareAndSet int");
}
// Compare set and get
@@ -255,19 +255,122 @@
assertEquals(x, 0x89ABCDEF, "getAndSet int value");
}
- hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
-
// get and add, add and get
{
- int o = (int) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, 0xCAFEBABE);
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, 0x89ABCDEF);
assertEquals(o, 0x01234567, "getAndAdd int");
- int c = (int) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, 0xCAFEBABE);
- assertEquals(c, (int)(0x01234567 + 0xCAFEBABE + 0xCAFEBABE), "getAndAdd int value");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAdd int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndAddAcquire int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAddAcquire int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndAddRelease int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAddRelease int value");
+ }
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOr int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOr int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOrAcquire int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOrAcquire int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOrRelease int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOrRelease int value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAnd int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAnd int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAndAcquire int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAndAcquire int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAndRelease int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAndRelease int value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXor int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXor int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXorAcquire int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXorAcquire int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(recv, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXorRelease int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXorRelease int value");
}
}
static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessInt recv, Handles hs) throws Throwable {
+
}
@@ -363,11 +466,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(0x01234567, 0x89ABCDEF);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(0x01234567, 0x89ABCDEF);
}
- assertEquals(success, true, "weakCompareAndSet int");
+ assertEquals(success, true, "weakCompareAndSetPlain int");
int x = (int) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, 0x89ABCDEF, "weakCompareAndSet int value");
+ assertEquals(x, 0x89ABCDEF, "weakCompareAndSetPlain int value");
}
{
@@ -393,34 +496,159 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(0x89ABCDEF, 0x01234567);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(0x89ABCDEF, 0x01234567);
}
- assertEquals(success, true, "weakCompareAndSetVolatile int");
+ assertEquals(success, true, "weakCompareAndSet int");
int x = (int) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, 0x01234567, "weakCompareAndSetVolatile int");
+ assertEquals(x, 0x01234567, "weakCompareAndSet int");
}
// Compare set and get
{
- int o = (int) hs.get(TestAccessMode.GET_AND_SET).invokeExact( 0x89ABCDEF);
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_SET).invokeExact(0x89ABCDEF);
assertEquals(o, 0x01234567, "getAndSet int");
int x = (int) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, 0x89ABCDEF, "getAndSet int value");
}
- hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndSetAcquire int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, 0x89ABCDEF, "getAndSetAcquire int value");
+ }
+
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndSetRelease int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, 0x89ABCDEF, "getAndSetRelease int value");
+ }
// get and add, add and get
{
- int o = (int) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( 0xCAFEBABE);
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(0x89ABCDEF);
assertEquals(o, 0x01234567, "getAndAdd int");
- int c = (int) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(0xCAFEBABE);
- assertEquals(c, (int)(0x01234567 + 0xCAFEBABE + 0xCAFEBABE), "getAndAdd int value");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAdd int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndAddAcquire int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAddAcquire int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndAddRelease int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAddRelease int value");
+ }
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOr int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOr int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOrAcquire int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOrAcquire int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOrRelease int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOrRelease int value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAnd int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAnd int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAndAcquire int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAndAcquire int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAndRelease int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAndRelease int value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXor int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXor int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXorAcquire int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXorAcquire int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXorRelease int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXorRelease int value");
}
}
static void testStaticFieldUnsupported(Handles hs) throws Throwable {
+
}
@@ -519,11 +747,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 0x01234567, 0x89ABCDEF);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, 0x01234567, 0x89ABCDEF);
}
- assertEquals(success, true, "weakCompareAndSet int");
+ assertEquals(success, true, "weakCompareAndSetPlain int");
int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, 0x89ABCDEF, "weakCompareAndSet int value");
+ assertEquals(x, 0x89ABCDEF, "weakCompareAndSetPlain int value");
}
{
@@ -549,30 +777,152 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, 0x89ABCDEF, 0x01234567);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 0x89ABCDEF, 0x01234567);
}
- assertEquals(success, true, "weakCompareAndSetVolatile int");
+ assertEquals(success, true, "weakCompareAndSet int");
int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, 0x01234567, "weakCompareAndSetVolatile int");
+ assertEquals(x, 0x01234567, "weakCompareAndSet int");
}
// Compare set and get
{
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
int o = (int) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, 0x89ABCDEF);
assertEquals(o, 0x01234567, "getAndSet int");
int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, 0x89ABCDEF, "getAndSet int value");
}
- hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndSetAcquire int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, 0x89ABCDEF, "getAndSetAcquire int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndSetRelease int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, 0x89ABCDEF, "getAndSetRelease int value");
+ }
// get and add, add and get
{
- int o = (int) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, 0xCAFEBABE);
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, 0x89ABCDEF);
assertEquals(o, 0x01234567, "getAndAdd int");
- int c = (int) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, 0xCAFEBABE);
- assertEquals(c, (int)(0x01234567 + 0xCAFEBABE + 0xCAFEBABE), "getAndAdd int value");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAdd int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndAddAcquire int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAddAcquire int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndAddRelease int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (int)(0x01234567 + 0x89ABCDEF), "getAndAddRelease int value");
}
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOr int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOr int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOrAcquire int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOrAcquire int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseOrRelease int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (int)(0x01234567 | 0x89ABCDEF), "getAndBitwiseOrRelease int value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAnd int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAnd int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAndAcquire int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAndAcquire int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseAndRelease int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (int)(0x01234567 & 0x89ABCDEF), "getAndBitwiseAndRelease int value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXor int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXor int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXorAcquire int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXorAcquire int value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
+
+ int o = (int) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(array, i, 0x89ABCDEF);
+ assertEquals(o, 0x01234567, "getAndBitwiseXorRelease int");
+ int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (int)(0x01234567 ^ 0x89ABCDEF), "getAndBitwiseXorRelease int value");
+ }
}
}
@@ -581,6 +931,7 @@
final int i = 0;
+
}
static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -624,6 +975,12 @@
int o = (int) hs.get(am).invokeExact(array, ci, 0xCAFEBABE);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkIOOBE(am, () -> {
+ int o = (int) hs.get(am).invokeExact(array, ci, 0xCAFEBABE);
+ });
+ }
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessLong.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessLong.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessLong.java Fri Sep 02 02:41:37 2016 +0000
@@ -210,11 +210,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
}
- assertEquals(success, true, "weakCompareAndSet long");
+ assertEquals(success, true, "weakCompareAndSetPlain long");
long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSet long value");
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSetPlain long value");
}
{
@@ -240,11 +240,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
}
- assertEquals(success, true, "weakCompareAndSetVolatile long");
+ assertEquals(success, true, "weakCompareAndSet long");
long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetVolatile long");
+ assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSet long");
}
// Compare set and get
@@ -255,19 +255,122 @@
assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSet long value");
}
- hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
-
// get and add, add and get
{
- long o = (long) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, 0xDEADBEEFDEADBEEFL);
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, 0xCAFEBABECAFEBABEL);
assertEquals(o, 0x0123456789ABCDEFL, "getAndAdd long");
- long c = (long) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, 0xDEADBEEFDEADBEEFL);
- assertEquals(c, (long)(0x0123456789ABCDEFL + 0xDEADBEEFDEADBEEFL + 0xDEADBEEFDEADBEEFL), "getAndAdd long value");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAdd long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndAddAcquire long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAddAcquire long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndAddRelease long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAddRelease long value");
+ }
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOr long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOr long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOrAcquire long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOrAcquire long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOrRelease long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOrRelease long value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAnd long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAnd long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAndAcquire long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAndAcquire long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAndRelease long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAndRelease long value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXor long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXor long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXorAcquire long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXorAcquire long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(recv, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXorRelease long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXorRelease long value");
}
}
static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessLong recv, Handles hs) throws Throwable {
+
}
@@ -363,11 +466,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
}
- assertEquals(success, true, "weakCompareAndSet long");
+ assertEquals(success, true, "weakCompareAndSetPlain long");
long x = (long) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSet long value");
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSetPlain long value");
}
{
@@ -393,34 +496,159 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
}
- assertEquals(success, true, "weakCompareAndSetVolatile long");
+ assertEquals(success, true, "weakCompareAndSet long");
long x = (long) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetVolatile long");
+ assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSet long");
}
// Compare set and get
{
- long o = (long) hs.get(TestAccessMode.GET_AND_SET).invokeExact( 0xCAFEBABECAFEBABEL);
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_SET).invokeExact(0xCAFEBABECAFEBABEL);
assertEquals(o, 0x0123456789ABCDEFL, "getAndSet long");
long x = (long) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSet long value");
}
- hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndSetAcquire long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSetAcquire long value");
+ }
+
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndSetRelease long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSetRelease long value");
+ }
// get and add, add and get
{
- long o = (long) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( 0xDEADBEEFDEADBEEFL);
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(0xCAFEBABECAFEBABEL);
assertEquals(o, 0x0123456789ABCDEFL, "getAndAdd long");
- long c = (long) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(0xDEADBEEFDEADBEEFL);
- assertEquals(c, (long)(0x0123456789ABCDEFL + 0xDEADBEEFDEADBEEFL + 0xDEADBEEFDEADBEEFL), "getAndAdd long value");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAdd long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndAddAcquire long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAddAcquire long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndAddRelease long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAddRelease long value");
+ }
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOr long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOr long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOrAcquire long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOrAcquire long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOrRelease long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOrRelease long value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAnd long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAnd long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAndAcquire long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAndAcquire long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAndRelease long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAndRelease long value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXor long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXor long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXorAcquire long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXorAcquire long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXorRelease long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXorRelease long value");
}
}
static void testStaticFieldUnsupported(Handles hs) throws Throwable {
+
}
@@ -519,11 +747,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
}
- assertEquals(success, true, "weakCompareAndSet long");
+ assertEquals(success, true, "weakCompareAndSetPlain long");
long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSet long value");
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSetPlain long value");
}
{
@@ -549,30 +777,152 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
}
- assertEquals(success, true, "weakCompareAndSetVolatile long");
+ assertEquals(success, true, "weakCompareAndSet long");
long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetVolatile long");
+ assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSet long");
}
// Compare set and get
{
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
long o = (long) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
assertEquals(o, 0x0123456789ABCDEFL, "getAndSet long");
long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSet long value");
}
- hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndSetAcquire long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSetAcquire long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndSetRelease long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSetRelease long value");
+ }
// get and add, add and get
{
- long o = (long) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, 0xDEADBEEFDEADBEEFL);
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
assertEquals(o, 0x0123456789ABCDEFL, "getAndAdd long");
- long c = (long) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, 0xDEADBEEFDEADBEEFL);
- assertEquals(c, (long)(0x0123456789ABCDEFL + 0xDEADBEEFDEADBEEFL + 0xDEADBEEFDEADBEEFL), "getAndAdd long value");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAdd long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndAddAcquire long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAddAcquire long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndAddRelease long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL + 0xCAFEBABECAFEBABEL), "getAndAddRelease long value");
}
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOr long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOr long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOrAcquire long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOrAcquire long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseOrRelease long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL | 0xCAFEBABECAFEBABEL), "getAndBitwiseOrRelease long value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAnd long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAnd long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAndAcquire long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAndAcquire long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseAndRelease long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL & 0xCAFEBABECAFEBABEL), "getAndBitwiseAndRelease long value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXor long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXor long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXorAcquire long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXorAcquire long value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
+
+ long o = (long) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
+ assertEquals(o, 0x0123456789ABCDEFL, "getAndBitwiseXorRelease long");
+ long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (long)(0x0123456789ABCDEFL ^ 0xCAFEBABECAFEBABEL), "getAndBitwiseXorRelease long value");
+ }
}
}
@@ -581,6 +931,7 @@
final int i = 0;
+
}
static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -624,6 +975,12 @@
long o = (long) hs.get(am).invokeExact(array, ci, 0xDEADBEEFDEADBEEFL);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkIOOBE(am, () -> {
+ long o = (long) hs.get(am).invokeExact(array, ci, 0xDEADBEEFDEADBEEFL);
+ });
+ }
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessShort.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessShort.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessShort.java Fri Sep 02 02:41:37 2016 +0000
@@ -210,11 +210,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, (short)0x0123, (short)0x4567);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, (short)0x0123, (short)0x4567);
}
- assertEquals(success, true, "weakCompareAndSet short");
+ assertEquals(success, true, "weakCompareAndSetPlain short");
short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
+ assertEquals(x, (short)0x4567, "weakCompareAndSetPlain short value");
}
{
@@ -240,11 +240,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, (short)0x4567, (short)0x0123);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, (short)0x4567, (short)0x0123);
}
- assertEquals(success, true, "weakCompareAndSetVolatile short");
+ assertEquals(success, true, "weakCompareAndSet short");
short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, (short)0x0123, "weakCompareAndSetVolatile short");
+ assertEquals(x, (short)0x0123, "weakCompareAndSet short");
}
// Compare set and get
@@ -255,19 +255,122 @@
assertEquals(x, (short)0x4567, "getAndSet short value");
}
- hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
-
// get and add, add and get
{
- short o = (short) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, (short)0x89AB);
+ hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, (short)0x4567);
assertEquals(o, (short)0x0123, "getAndAdd short");
- short c = (short) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, (short)0x89AB);
- assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAdd short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndAddAcquire short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAddAcquire short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndAddRelease short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAddRelease short value");
+ }
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOr short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOr short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOrAcquire short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOrAcquire short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOrRelease short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOrRelease short value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAnd short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAnd short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAndAcquire short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAndAcquire short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAndRelease short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAndRelease short value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXor short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXor short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXorAcquire short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXorAcquire short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(recv, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXorRelease short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXorRelease short value");
}
}
static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessShort recv, Handles hs) throws Throwable {
+
}
@@ -363,11 +466,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact((short)0x0123, (short)0x4567);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact((short)0x0123, (short)0x4567);
}
- assertEquals(success, true, "weakCompareAndSet short");
+ assertEquals(success, true, "weakCompareAndSetPlain short");
short x = (short) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
+ assertEquals(x, (short)0x4567, "weakCompareAndSetPlain short value");
}
{
@@ -393,34 +496,159 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact((short)0x4567, (short)0x0123);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact((short)0x4567, (short)0x0123);
}
- assertEquals(success, true, "weakCompareAndSetVolatile short");
+ assertEquals(success, true, "weakCompareAndSet short");
short x = (short) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, (short)0x0123, "weakCompareAndSetVolatile short");
+ assertEquals(x, (short)0x0123, "weakCompareAndSet short");
}
// Compare set and get
{
- short o = (short) hs.get(TestAccessMode.GET_AND_SET).invokeExact( (short)0x4567);
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_SET).invokeExact((short)0x4567);
assertEquals(o, (short)0x0123, "getAndSet short");
short x = (short) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, (short)0x4567, "getAndSet short value");
}
- hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndSetAcquire short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (short)0x4567, "getAndSetAcquire short value");
+ }
+
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndSetRelease short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (short)0x4567, "getAndSetRelease short value");
+ }
// get and add, add and get
{
- short o = (short) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( (short)0x89AB);
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_ADD).invokeExact((short)0x4567);
assertEquals(o, (short)0x0123, "getAndAdd short");
- short c = (short) hs.get(TestAccessMode.ADD_AND_GET).invokeExact((short)0x89AB);
- assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAdd short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndAddAcquire short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAddAcquire short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndAddRelease short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAddRelease short value");
+ }
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOr short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOr short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOrAcquire short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOrAcquire short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOrRelease short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOrRelease short value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAnd short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAnd short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAndAcquire short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAndAcquire short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAndRelease short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAndRelease short value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXor short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXor short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXorAcquire short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXorAcquire short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact((short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXorRelease short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXorRelease short value");
}
}
static void testStaticFieldUnsupported(Handles hs) throws Throwable {
+
}
@@ -519,11 +747,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, (short)0x0123, (short)0x4567);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, (short)0x0123, (short)0x4567);
}
- assertEquals(success, true, "weakCompareAndSet short");
+ assertEquals(success, true, "weakCompareAndSetPlain short");
short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
+ assertEquals(x, (short)0x4567, "weakCompareAndSetPlain short value");
}
{
@@ -549,30 +777,152 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, (short)0x4567, (short)0x0123);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, (short)0x4567, (short)0x0123);
}
- assertEquals(success, true, "weakCompareAndSetVolatile short");
+ assertEquals(success, true, "weakCompareAndSet short");
short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, (short)0x0123, "weakCompareAndSetVolatile short");
+ assertEquals(x, (short)0x0123, "weakCompareAndSet short");
}
// Compare set and get
{
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
short o = (short) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, (short)0x4567);
assertEquals(o, (short)0x0123, "getAndSet short");
short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, (short)0x4567, "getAndSet short value");
}
- hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndSetAcquire short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (short)0x4567, "getAndSetAcquire short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndSetRelease short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (short)0x4567, "getAndSetRelease short value");
+ }
// get and add, add and get
{
- short o = (short) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, (short)0x89AB);
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, (short)0x4567);
assertEquals(o, (short)0x0123, "getAndAdd short");
- short c = (short) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, (short)0x89AB);
- assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAdd short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndAddAcquire short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAddAcquire short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndAddRelease short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (short)((short)0x0123 + (short)0x4567), "getAndAddRelease short value");
}
+
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOr short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOr short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOrAcquire short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOrAcquire short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseOrRelease short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (short)((short)0x0123 | (short)0x4567), "getAndBitwiseOrRelease short value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAnd short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAnd short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAndAcquire short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAndAcquire short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseAndRelease short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (short)((short)0x0123 & (short)0x4567), "getAndBitwiseAndRelease short value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXor short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXor short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXorAcquire short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXorAcquire short value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+ short o = (short) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(array, i, (short)0x4567);
+ assertEquals(o, (short)0x0123, "getAndBitwiseXorRelease short");
+ short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, (short)((short)0x0123 ^ (short)0x4567), "getAndBitwiseXorRelease short value");
+ }
}
}
@@ -581,6 +931,7 @@
final int i = 0;
+
}
static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -624,6 +975,12 @@
short o = (short) hs.get(am).invokeExact(array, ci, (short)0x89AB);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkIOOBE(am, () -> {
+ short o = (short) hs.get(am).invokeExact(array, ci, (short)0x89AB);
+ });
+ }
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessString.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessString.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessString.java Fri Sep 02 02:41:37 2016 +0000
@@ -210,11 +210,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, "foo", "bar");
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, "foo", "bar");
}
- assertEquals(success, true, "weakCompareAndSet String");
+ assertEquals(success, true, "weakCompareAndSetPlain String");
String x = (String) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, "bar", "weakCompareAndSet String value");
+ assertEquals(x, "bar", "weakCompareAndSetPlain String value");
}
{
@@ -240,11 +240,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, "bar", "foo");
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, "bar", "foo");
}
- assertEquals(success, true, "weakCompareAndSetVolatile String");
+ assertEquals(success, true, "weakCompareAndSet String");
String x = (String) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, "foo", "weakCompareAndSetVolatile String");
+ assertEquals(x, "foo", "weakCompareAndSet String");
}
// Compare set and get
@@ -255,6 +255,7 @@
assertEquals(x, "bar", "getAndSet String value");
}
+
}
static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessString recv, Handles hs) throws Throwable {
@@ -264,6 +265,12 @@
String r = (String) hs.get(am).invokeExact(recv, "foo");
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkUOE(am, () -> {
+ String r = (String) hs.get(am).invokeExact(recv, "foo");
+ });
+ }
}
@@ -359,11 +366,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact("foo", "bar");
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact("foo", "bar");
}
- assertEquals(success, true, "weakCompareAndSet String");
+ assertEquals(success, true, "weakCompareAndSetPlain String");
String x = (String) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, "bar", "weakCompareAndSet String value");
+ assertEquals(x, "bar", "weakCompareAndSetPlain String value");
}
{
@@ -389,21 +396,44 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact("bar", "foo");
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact("bar", "foo");
}
- assertEquals(success, true, "weakCompareAndSetVolatile String");
+ assertEquals(success, true, "weakCompareAndSet String");
String x = (String) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, "foo", "weakCompareAndSetVolatile String");
+ assertEquals(x, "foo", "weakCompareAndSet String");
+ }
+
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact("foo");
+
+ String o = (String) hs.get(TestAccessMode.GET_AND_SET).invokeExact("bar");
+ assertEquals(o, "foo", "getAndSet String");
+ String x = (String) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, "bar", "getAndSet String value");
}
// Compare set and get
{
- String o = (String) hs.get(TestAccessMode.GET_AND_SET).invokeExact( "bar");
- assertEquals(o, "foo", "getAndSet String");
+ hs.get(TestAccessMode.SET).invokeExact("foo");
+
+ String o = (String) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact("bar");
+ assertEquals(o, "foo", "getAndSetAcquire String");
String x = (String) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, "bar", "getAndSet String value");
+ assertEquals(x, "bar", "getAndSetAcquire String value");
}
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact("foo");
+
+ String o = (String) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact("bar");
+ assertEquals(o, "foo", "getAndSetRelease String");
+ String x = (String) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, "bar", "getAndSetRelease String value");
+ }
+
+
}
static void testStaticFieldUnsupported(Handles hs) throws Throwable {
@@ -413,6 +443,12 @@
String r = (String) hs.get(am).invokeExact("foo");
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkUOE(am, () -> {
+ String r = (String) hs.get(am).invokeExact("foo");
+ });
+ }
}
@@ -511,11 +547,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, "foo", "bar");
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, "foo", "bar");
}
- assertEquals(success, true, "weakCompareAndSet String");
+ assertEquals(success, true, "weakCompareAndSetPlain String");
String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, "bar", "weakCompareAndSet String value");
+ assertEquals(x, "bar", "weakCompareAndSetPlain String value");
}
{
@@ -541,21 +577,42 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, "bar", "foo");
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, "bar", "foo");
}
- assertEquals(success, true, "weakCompareAndSetVolatile String");
+ assertEquals(success, true, "weakCompareAndSet String");
String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, "foo", "weakCompareAndSetVolatile String");
+ assertEquals(x, "foo", "weakCompareAndSet String");
}
// Compare set and get
{
+ hs.get(TestAccessMode.SET).invokeExact(array, i, "foo");
+
String o = (String) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, "bar");
assertEquals(o, "foo", "getAndSet String");
String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, "bar", "getAndSet String value");
}
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, "foo");
+
+ String o = (String) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(array, i, "bar");
+ assertEquals(o, "foo", "getAndSetAcquire String");
+ String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, "bar", "getAndSetAcquire String value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, "foo");
+
+ String o = (String) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(array, i, "bar");
+ assertEquals(o, "foo", "getAndSetRelease String");
+ String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, "bar", "getAndSetRelease String value");
+ }
+
+
}
}
@@ -569,6 +626,12 @@
String o = (String) hs.get(am).invokeExact(array, i, "foo");
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkUOE(am, () -> {
+ String o = (String) hs.get(am).invokeExact(array, i, "foo");
+ });
+ }
}
static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -607,6 +670,7 @@
});
}
+
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeBoolean.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeBoolean.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeBoolean.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -353,6 +353,32 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, true, true);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, true, true);
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, Void.class, true);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, true, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, true, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(recv, true, true, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, true, true);
});
checkCCE(() -> { // receiver reference class
@@ -376,32 +402,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, true, true);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, true, true);
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, true);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, true, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, true, true);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(recv, true, true, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -582,6 +582,333 @@
boolean x = (boolean) vh.getAndSet(recv, true, Void.class);
});
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ boolean x = (boolean) vh.getAndSetAcquire(null, true);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean x = (boolean) vh.getAndSetAcquire(Void.class, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndSetAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(0, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(recv, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndSetAcquire(recv, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndSetAcquire(recv, true, Void.class);
+ });
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ boolean x = (boolean) vh.getAndSetRelease(null, true);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean x = (boolean) vh.getAndSetRelease(Void.class, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndSetRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ boolean x = (boolean) vh.getAndSetRelease(0, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(recv, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndSetRelease(recv, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndSetRelease(recv, true, Void.class);
+ });
+
+
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ boolean x = (boolean) vh.getAndBitwiseOr(null, true);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean x = (boolean) vh.getAndBitwiseOr(Void.class, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseOr(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(0, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(recv, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseOr(recv, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseOr(recv, true, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(null, true);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(Void.class, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(0, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(recv, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseOrAcquire(recv, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(recv, true, Void.class);
+ });
+
+
+ // GetAndBitwiseOrRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(null, true);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean x = (boolean) vh.getAndBitwiseOr(Void.class, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseOr(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(0, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(recv, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseOr(recv, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseOr(recv, true, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ boolean x = (boolean) vh.getAndBitwiseAnd(null, true);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean x = (boolean) vh.getAndBitwiseAnd(Void.class, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseAnd(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(0, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(recv, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseAnd(recv, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseAnd(recv, true, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(null, true);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(Void.class, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(0, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(recv, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseAndAcquire(recv, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(recv, true, Void.class);
+ });
+
+
+ // GetAndBitwiseAndRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(null, true);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean x = (boolean) vh.getAndBitwiseAnd(Void.class, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseAnd(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(0, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(recv, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseAnd(recv, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseAnd(recv, true, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ boolean x = (boolean) vh.getAndBitwiseXor(null, true);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean x = (boolean) vh.getAndBitwiseXor(Void.class, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseXor(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(0, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(recv, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseXor(recv, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseXor(recv, true, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(null, true);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(Void.class, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(0, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(recv, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseXorAcquire(recv, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(recv, true, Void.class);
+ });
+
+
+ // GetAndBitwiseXorRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(null, true);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean x = (boolean) vh.getAndBitwiseXor(Void.class, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseXor(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(0, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(recv, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseXor(recv, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseXor(recv, true, Void.class);
+ });
}
static void testInstanceFieldWrongMethodType(VarHandleTestMethodTypeBoolean recv, Handles hs) throws Throwable {
@@ -759,6 +1086,43 @@
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkNPE(() -> { // null receiver
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, boolean.class)).
+ invokeExact((VarHandleTestMethodTypeBoolean) null, true);
+ });
+ hs.checkWMTEOrCCE(() -> { // receiver reference class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, Class.class, boolean.class)).
+ invokeExact(Void.class, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, Class.class)).
+ invokeExact(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class, boolean.class)).
+ invokeExact(0, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeBoolean.class, boolean.class)).
+ invokeExact(recv, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeBoolean.class, boolean.class)).
+ invokeExact(recv, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) hs.get(am, methodType(boolean.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, boolean.class)).
+ invokeExact(recv, true, Void.class);
+ });
+ }
}
@@ -892,6 +1256,23 @@
// WeakCompareAndSet
// Incorrect argument types
checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, true);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(true, Void.class);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(true, true, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkWMTE(() -> { // expected reference class
boolean r = vh.weakCompareAndSet(Void.class, true);
});
checkWMTE(() -> { // actual reference class
@@ -906,23 +1287,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, true);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(true, Void.class);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(true, true, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkWMTE(() -> { // expected reference class
@@ -1049,6 +1413,236 @@
boolean x = (boolean) vh.getAndSet(true, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndSetAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndSetAcquire(true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndSetAcquire(true, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndSetRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndSetRelease(true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndSetRelease(true, Void.class);
+ });
+
+
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseOr(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseOr(true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseOr(true, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseOrAcquire(true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(true, Void.class);
+ });
+
+
+ // GetAndBitwiseOrReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrRelease(true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseOrRelease(true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseOrRelease();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(true, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseAnd(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseAnd(true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseAnd(true, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseAndAcquire(true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(true, Void.class);
+ });
+
+
+ // GetAndBitwiseAndReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndRelease(true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseAndRelease(true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseAndRelease();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(true, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseXor(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseXor(true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseXor(true, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseXorAcquire(true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(true, Void.class);
+ });
+
+
+ // GetAndBitwiseXorReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorRelease(true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseXorRelease(true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseXorRelease();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(true, Void.class);
+ });
}
static void testStaticFieldWrongMethodType(Handles hs) throws Throwable {
@@ -1163,6 +1757,32 @@
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, Class.class)).
+ invokeExact(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, boolean.class)).
+ invokeExact(true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) hs.get(am, methodType(int.class, boolean.class)).
+ invokeExact(true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) hs.get(am, methodType(boolean.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean.class, Class.class)).
+ invokeExact(true, Void.class);
+ });
+ }
}
@@ -1426,6 +2046,35 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, 0, true, true);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 0, true, true);
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, Void.class, true);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, true, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, 0, true, true);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean r = vh.weakCompareAndSetPlain(array, Void.class, true, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(array, 0, true, true, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, 0, true, true);
});
checkCCE(() -> { // receiver reference class
@@ -1452,35 +2101,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 0, true, true);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, true, true);
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, true);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, true, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 0, true, true);
- });
- checkWMTE(() -> { // index reference class
- boolean r = vh.weakCompareAndSetVolatile(array, Void.class, true, true);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(array, 0, true, true, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -1679,6 +2299,368 @@
boolean x = (boolean) vh.getAndSet(array, 0, true, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ boolean x = (boolean) vh.getAndSetAcquire(null, 0, true);
+ });
+ checkCCE(() -> { // array reference class
+ boolean x = (boolean) vh.getAndSetAcquire(Void.class, 0, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndSetAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(0, 0, true);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean x = (boolean) vh.getAndSetAcquire(array, Void.class, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(array, 0, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndSetAcquire(array, 0, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndSetAcquire(array, 0, true, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ boolean x = (boolean) vh.getAndSetRelease(null, 0, true);
+ });
+ checkCCE(() -> { // array reference class
+ boolean x = (boolean) vh.getAndSetRelease(Void.class, 0, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndSetRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ boolean x = (boolean) vh.getAndSetRelease(0, 0, true);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean x = (boolean) vh.getAndSetRelease(array, Void.class, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(array, 0, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndSetRelease(array, 0, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndSetRelease(array, 0, true, Void.class);
+ });
+
+
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ boolean x = (boolean) vh.getAndBitwiseOr(null, 0, true);
+ });
+ checkCCE(() -> { // array reference class
+ boolean x = (boolean) vh.getAndBitwiseOr(Void.class, 0, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseOr(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(0, 0, true);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean x = (boolean) vh.getAndBitwiseOr(array, Void.class, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(array, 0, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseOr(array, 0, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseOr(array, 0, true, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(null, 0, true);
+ });
+ checkCCE(() -> { // array reference class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(Void.class, 0, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(0, 0, true);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(array, Void.class, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(array, 0, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseOrAcquire(array, 0, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(array, 0, true, Void.class);
+ });
+
+
+ // GetAndBitwiseOrRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(null, 0, true);
+ });
+ checkCCE(() -> { // array reference class
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(Void.class, 0, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(0, 0, true);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(array, Void.class, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrRelease(array, 0, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseOrRelease(array, 0, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseOrRelease();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(array, 0, true, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ boolean x = (boolean) vh.getAndBitwiseAnd(null, 0, true);
+ });
+ checkCCE(() -> { // array reference class
+ boolean x = (boolean) vh.getAndBitwiseAnd(Void.class, 0, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseAnd(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(0, 0, true);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean x = (boolean) vh.getAndBitwiseAnd(array, Void.class, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(array, 0, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseAnd(array, 0, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseAnd(array, 0, true, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(null, 0, true);
+ });
+ checkCCE(() -> { // array reference class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(Void.class, 0, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(0, 0, true);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(array, Void.class, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(array, 0, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseAndAcquire(array, 0, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(array, 0, true, Void.class);
+ });
+
+
+ // GetAndBitwiseAndRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(null, 0, true);
+ });
+ checkCCE(() -> { // array reference class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(Void.class, 0, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(0, 0, true);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(array, Void.class, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndRelease(array, 0, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseAndRelease(array, 0, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseAndRelease();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(array, 0, true, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ boolean x = (boolean) vh.getAndBitwiseXor(null, 0, true);
+ });
+ checkCCE(() -> { // array reference class
+ boolean x = (boolean) vh.getAndBitwiseXor(Void.class, 0, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseXor(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(0, 0, true);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean x = (boolean) vh.getAndBitwiseXor(array, Void.class, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(array, 0, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseXor(array, 0, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseXor(array, 0, true, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(null, 0, true);
+ });
+ checkCCE(() -> { // array reference class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(Void.class, 0, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(0, 0, true);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(array, Void.class, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(array, 0, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseXorAcquire(array, 0, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(array, 0, true, Void.class);
+ });
+
+
+ // GetAndBitwiseXorRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(null, 0, true);
+ });
+ checkCCE(() -> { // array reference class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(Void.class, 0, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(0, 0, true);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(array, Void.class, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorRelease(array, 0, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) vh.getAndBitwiseXorRelease(array, 0, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) vh.getAndBitwiseXorRelease();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(array, 0, true, Void.class);
+ });
}
static void testArrayWrongMethodType(Handles hs) throws Throwable {
@@ -1880,6 +2862,48 @@
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, boolean.class)).
+ invokeExact((boolean[]) null, 0, true);
+ });
+ hs.checkWMTEOrCCE(() -> { // array reference class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, boolean.class)).
+ invokeExact(Void.class, 0, true);
+ });
+ checkWMTE(() -> { // value reference class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, Class.class)).
+ invokeExact(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, boolean.class)).
+ invokeExact(0, 0, true);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, Class.class, boolean.class)).
+ invokeExact(array, Void.class, true);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, boolean[].class, int.class, boolean.class)).
+ invokeExact(array, 0, true);
+ });
+ checkWMTE(() -> { // primitive class
+ int x = (int) hs.get(am, methodType(int.class, boolean[].class, int.class, boolean.class)).
+ invokeExact(array, 0, true);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean x = (boolean) hs.get(am, methodType(boolean.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, boolean.class, Class.class)).
+ invokeExact(array, 0, true, Void.class);
+ });
+ }
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeByte.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeByte.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeByte.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -353,6 +353,32 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, (byte)0x01, (byte)0x01);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, (byte)0x01, (byte)0x01);
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, (byte)0x01, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, (byte)0x01, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(recv, (byte)0x01, (byte)0x01, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, (byte)0x01, (byte)0x01);
});
checkCCE(() -> { // receiver reference class
@@ -376,32 +402,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, (byte)0x01, (byte)0x01);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, (byte)0x01, (byte)0x01);
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, (byte)0x01);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, (byte)0x01, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, (byte)0x01, (byte)0x01);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(recv, (byte)0x01, (byte)0x01, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -582,6 +582,64 @@
byte x = (byte) vh.getAndSet(recv, (byte)0x01, Void.class);
});
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ byte x = (byte) vh.getAndSetAcquire(null, (byte)0x01);
+ });
+ checkCCE(() -> { // receiver reference class
+ byte x = (byte) vh.getAndSetAcquire(Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndSetAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ byte x = (byte) vh.getAndSetAcquire(0, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(recv, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(recv, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndSetAcquire(recv, (byte)0x01, Void.class);
+ });
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ byte x = (byte) vh.getAndSetRelease(null, (byte)0x01);
+ });
+ checkCCE(() -> { // receiver reference class
+ byte x = (byte) vh.getAndSetRelease(Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndSetRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ byte x = (byte) vh.getAndSetRelease(0, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(recv, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(recv, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndSetRelease(recv, (byte)0x01, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -611,34 +669,331 @@
byte x = (byte) vh.getAndAdd(recv, (byte)0x01, Void.class);
});
-
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
- byte x = (byte) vh.addAndGet(null, (byte)0x01);
+ byte x = (byte) vh.getAndAddAcquire(null, (byte)0x01);
+ });
+ checkCCE(() -> { // receiver reference class
+ byte x = (byte) vh.getAndAddAcquire(Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndAddAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ byte x = (byte) vh.getAndAddAcquire(0, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire(recv, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire(recv, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndAddAcquire(recv, (byte)0x01, Void.class);
+ });
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ byte x = (byte) vh.getAndAddRelease(null, (byte)0x01);
+ });
+ checkCCE(() -> { // receiver reference class
+ byte x = (byte) vh.getAndAddRelease(Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndAddRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ byte x = (byte) vh.getAndAddRelease(0, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(recv, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(recv, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndAddRelease(recv, (byte)0x01, Void.class);
+ });
+
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ byte x = (byte) vh.getAndBitwiseOr(null, (byte)0x01);
});
checkCCE(() -> { // receiver reference class
- byte x = (byte) vh.addAndGet(Void.class, (byte)0x01);
+ byte x = (byte) vh.getAndBitwiseOr(Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseOr(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ byte x = (byte) vh.getAndBitwiseOr(0, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(recv, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(recv, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseOr(recv, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ byte x = (byte) vh.getAndBitwiseOrAcquire(null, (byte)0x01);
+ });
+ checkCCE(() -> { // receiver reference class
+ byte x = (byte) vh.getAndBitwiseOrAcquire(Void.class, (byte)0x01);
});
checkWMTE(() -> { // value reference class
- byte x = (byte) vh.addAndGet(recv, Void.class);
+ byte x = (byte) vh.getAndBitwiseOrAcquire(recv, Void.class);
});
checkWMTE(() -> { // reciever primitive class
- byte x = (byte) vh.addAndGet(0, (byte)0x01);
+ byte x = (byte) vh.getAndBitwiseOrAcquire(0, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(recv, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(recv, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseOrAcquire(recv, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseOrRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ byte x = (byte) vh.getAndBitwiseOrRelease(null, (byte)0x01);
+ });
+ checkCCE(() -> { // receiver reference class
+ byte x = (byte) vh.getAndBitwiseOr(Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseOr(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ byte x = (byte) vh.getAndBitwiseOr(0, (byte)0x01);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(recv, (byte)0x01);
+ Void r = (Void) vh.getAndBitwiseOr(recv, (byte)0x01);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(recv, (byte)0x01);
+ boolean x = (boolean) vh.getAndBitwiseOr(recv, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseOr(recv, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ byte x = (byte) vh.getAndBitwiseAnd(null, (byte)0x01);
+ });
+ checkCCE(() -> { // receiver reference class
+ byte x = (byte) vh.getAndBitwiseAnd(Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseAnd(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ byte x = (byte) vh.getAndBitwiseAnd(0, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(recv, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(recv, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseAnd(recv, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ byte x = (byte) vh.getAndBitwiseAndAcquire(null, (byte)0x01);
+ });
+ checkCCE(() -> { // receiver reference class
+ byte x = (byte) vh.getAndBitwiseAndAcquire(Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseAndAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ byte x = (byte) vh.getAndBitwiseAndAcquire(0, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(recv, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(recv, (byte)0x01);
});
// Incorrect arity
checkWMTE(() -> { // 0
- byte x = (byte) vh.addAndGet();
+ byte x = (byte) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseAndAcquire(recv, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseAndRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ byte x = (byte) vh.getAndBitwiseAndRelease(null, (byte)0x01);
+ });
+ checkCCE(() -> { // receiver reference class
+ byte x = (byte) vh.getAndBitwiseAnd(Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseAnd(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ byte x = (byte) vh.getAndBitwiseAnd(0, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(recv, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(recv, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseAnd();
});
checkWMTE(() -> { // >
- byte x = (byte) vh.addAndGet(recv, (byte)0x01, Void.class);
+ byte x = (byte) vh.getAndBitwiseAnd(recv, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ byte x = (byte) vh.getAndBitwiseXor(null, (byte)0x01);
+ });
+ checkCCE(() -> { // receiver reference class
+ byte x = (byte) vh.getAndBitwiseXor(Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseXor(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ byte x = (byte) vh.getAndBitwiseXor(0, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(recv, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(recv, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseXor(recv, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ byte x = (byte) vh.getAndBitwiseXorAcquire(null, (byte)0x01);
+ });
+ checkCCE(() -> { // receiver reference class
+ byte x = (byte) vh.getAndBitwiseXorAcquire(Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseXorAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ byte x = (byte) vh.getAndBitwiseXorAcquire(0, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(recv, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(recv, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseXorAcquire(recv, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseXorRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ byte x = (byte) vh.getAndBitwiseXorRelease(null, (byte)0x01);
+ });
+ checkCCE(() -> { // receiver reference class
+ byte x = (byte) vh.getAndBitwiseXor(Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseXor(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ byte x = (byte) vh.getAndBitwiseXor(0, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(recv, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(recv, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseXor(recv, (byte)0x01, Void.class);
});
}
@@ -853,6 +1208,43 @@
invokeExact(recv, (byte)0x01, Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkNPE(() -> { // null receiver
+ byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class, byte.class)).
+ invokeExact((VarHandleTestMethodTypeByte) null, (byte)0x01);
+ });
+ hs.checkWMTEOrCCE(() -> { // receiver reference class
+ byte x = (byte) hs.get(am, methodType(byte.class, Class.class, byte.class)).
+ invokeExact(Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class, Class.class)).
+ invokeExact(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ byte x = (byte) hs.get(am, methodType(byte.class, int.class, byte.class)).
+ invokeExact(0, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeByte.class, byte.class)).
+ invokeExact(recv, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeByte.class, byte.class)).
+ invokeExact(recv, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) hs.get(am, methodType(byte.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class, byte.class)).
+ invokeExact(recv, (byte)0x01, Void.class);
+ });
+ }
}
@@ -986,6 +1378,23 @@
// WeakCompareAndSet
// Incorrect argument types
checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain((byte)0x01, Void.class);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain((byte)0x01, (byte)0x01, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkWMTE(() -> { // expected reference class
boolean r = vh.weakCompareAndSet(Void.class, (byte)0x01);
});
checkWMTE(() -> { // actual reference class
@@ -1000,23 +1409,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, (byte)0x01);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile((byte)0x01, Void.class);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile((byte)0x01, (byte)0x01, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkWMTE(() -> { // expected reference class
@@ -1143,6 +1535,48 @@
byte x = (byte) vh.getAndSet((byte)0x01, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndSetAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire((byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire((byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndSetAcquire((byte)0x01, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndSetRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease((byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease((byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndSetRelease((byte)0x01, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkWMTE(() -> { // value reference class
@@ -1164,24 +1598,233 @@
});
- // AddAndGet
+ // GetAndAddAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndAddAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire((byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire((byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndAddAcquire((byte)0x01, Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndAddRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease((byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease((byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndAddRelease((byte)0x01, Void.class);
+ });
+
+ // GetAndBitwiseOr
// Incorrect argument types
checkWMTE(() -> { // value reference class
- byte x = (byte) vh.addAndGet(Void.class);
+ byte x = (byte) vh.getAndBitwiseOr(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr((byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr((byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseOr((byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseOrAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire((byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire((byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseOrAcquire((byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseOrReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseOrRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrRelease((byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrRelease((byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseOrRelease();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseOrRelease((byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseAnd(Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet((byte)0x01);
+ Void r = (Void) vh.getAndBitwiseAnd((byte)0x01);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet((byte)0x01);
+ boolean x = (boolean) vh.getAndBitwiseAnd((byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseAnd((byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseAndAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire((byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire((byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseAndAcquire((byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseAndReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseAndRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndRelease((byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease((byte)0x01);
});
// Incorrect arity
checkWMTE(() -> { // 0
- byte x = (byte) vh.addAndGet();
+ byte x = (byte) vh.getAndBitwiseAndRelease();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseAndRelease((byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseXor(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor((byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor((byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseXor();
});
checkWMTE(() -> { // >
- byte x = (byte) vh.addAndGet((byte)0x01, Void.class);
+ byte x = (byte) vh.getAndBitwiseXor((byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseXorAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire((byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire((byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseXorAcquire((byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseXorReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseXorRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorRelease((byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease((byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseXorRelease();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseXorRelease((byte)0x01, Void.class);
});
}
@@ -1322,6 +1965,32 @@
invokeExact((byte)0x01, Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) hs.get(am, methodType(byte.class, Class.class)).
+ invokeExact(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, byte.class)).
+ invokeExact((byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, byte.class)).
+ invokeExact((byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) hs.get(am, methodType(byte.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) hs.get(am, methodType(byte.class, byte.class, Class.class)).
+ invokeExact((byte)0x01, Void.class);
+ });
+ }
}
@@ -1585,6 +2254,35 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, 0, (byte)0x01, (byte)0x01);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 0, (byte)0x01, (byte)0x01);
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, Void.class, (byte)0x01);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, (byte)0x01, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, 0, (byte)0x01, (byte)0x01);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean r = vh.weakCompareAndSetPlain(array, Void.class, (byte)0x01, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(array, 0, (byte)0x01, (byte)0x01, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, 0, (byte)0x01, (byte)0x01);
});
checkCCE(() -> { // receiver reference class
@@ -1611,35 +2309,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 0, (byte)0x01, (byte)0x01);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, (byte)0x01, (byte)0x01);
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, (byte)0x01);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, (byte)0x01, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 0, (byte)0x01, (byte)0x01);
- });
- checkWMTE(() -> { // index reference class
- boolean r = vh.weakCompareAndSetVolatile(array, Void.class, (byte)0x01, (byte)0x01);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(array, 0, (byte)0x01, (byte)0x01, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -1838,6 +2507,72 @@
byte x = (byte) vh.getAndSet(array, 0, (byte)0x01, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ byte x = (byte) vh.getAndSetAcquire(null, 0, (byte)0x01);
+ });
+ checkCCE(() -> { // array reference class
+ byte x = (byte) vh.getAndSetAcquire(Void.class, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndSetAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ byte x = (byte) vh.getAndSetAcquire(0, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // index reference class
+ byte x = (byte) vh.getAndSetAcquire(array, Void.class, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(array, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(array, 0, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndSetAcquire(array, 0, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ byte x = (byte) vh.getAndSetRelease(null, 0, (byte)0x01);
+ });
+ checkCCE(() -> { // array reference class
+ byte x = (byte) vh.getAndSetRelease(Void.class, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndSetRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ byte x = (byte) vh.getAndSetRelease(0, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // index reference class
+ byte x = (byte) vh.getAndSetRelease(array, Void.class, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(array, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(array, 0, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndSetRelease(array, 0, (byte)0x01, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null array
@@ -1871,36 +2606,365 @@
});
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkNPE(() -> { // null array
- byte x = (byte) vh.addAndGet(null, 0, (byte)0x01);
+ byte x = (byte) vh.getAndAddAcquire(null, 0, (byte)0x01);
+ });
+ checkCCE(() -> { // array reference class
+ byte x = (byte) vh.getAndAddAcquire(Void.class, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndAddAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ byte x = (byte) vh.getAndAddAcquire(0, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // index reference class
+ byte x = (byte) vh.getAndAddAcquire(array, Void.class, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire(array, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire(array, 0, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndAddAcquire(array, 0, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ byte x = (byte) vh.getAndAddRelease(null, 0, (byte)0x01);
+ });
+ checkCCE(() -> { // array reference class
+ byte x = (byte) vh.getAndAddRelease(Void.class, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndAddRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ byte x = (byte) vh.getAndAddRelease(0, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // index reference class
+ byte x = (byte) vh.getAndAddRelease(array, Void.class, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(array, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(array, 0, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndAddRelease(array, 0, (byte)0x01, Void.class);
+ });
+
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ byte x = (byte) vh.getAndBitwiseOr(null, 0, (byte)0x01);
});
checkCCE(() -> { // array reference class
- byte x = (byte) vh.addAndGet(Void.class, 0, (byte)0x01);
+ byte x = (byte) vh.getAndBitwiseOr(Void.class, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseOr(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ byte x = (byte) vh.getAndBitwiseOr(0, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // index reference class
+ byte x = (byte) vh.getAndBitwiseOr(array, Void.class, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(array, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(array, 0, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseOr(array, 0, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ byte x = (byte) vh.getAndBitwiseOrAcquire(null, 0, (byte)0x01);
+ });
+ checkCCE(() -> { // array reference class
+ byte x = (byte) vh.getAndBitwiseOrAcquire(Void.class, 0, (byte)0x01);
});
checkWMTE(() -> { // value reference class
- byte x = (byte) vh.addAndGet(array, 0, Void.class);
+ byte x = (byte) vh.getAndBitwiseOrAcquire(array, 0, Void.class);
});
checkWMTE(() -> { // array primitive class
- byte x = (byte) vh.addAndGet(0, 0, (byte)0x01);
+ byte x = (byte) vh.getAndBitwiseOrAcquire(0, 0, (byte)0x01);
});
checkWMTE(() -> { // index reference class
- byte x = (byte) vh.addAndGet(array, Void.class, (byte)0x01);
+ byte x = (byte) vh.getAndBitwiseOrAcquire(array, Void.class, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(array, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(array, 0, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseOrAcquire(array, 0, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseOrRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ byte x = (byte) vh.getAndBitwiseOrRelease(null, 0, (byte)0x01);
+ });
+ checkCCE(() -> { // array reference class
+ byte x = (byte) vh.getAndBitwiseOrRelease(Void.class, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseOrRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ byte x = (byte) vh.getAndBitwiseOrRelease(0, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // index reference class
+ byte x = (byte) vh.getAndBitwiseOrRelease(array, Void.class, (byte)0x01);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(array, 0, (byte)0x01);
+ Void r = (Void) vh.getAndBitwiseOrRelease(array, 0, (byte)0x01);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(array, 0, (byte)0x01);
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(array, 0, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseOrRelease();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseOrRelease(array, 0, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ byte x = (byte) vh.getAndBitwiseAnd(null, 0, (byte)0x01);
+ });
+ checkCCE(() -> { // array reference class
+ byte x = (byte) vh.getAndBitwiseAnd(Void.class, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseAnd(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ byte x = (byte) vh.getAndBitwiseAnd(0, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // index reference class
+ byte x = (byte) vh.getAndBitwiseAnd(array, Void.class, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(array, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(array, 0, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseAnd(array, 0, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ byte x = (byte) vh.getAndBitwiseAndAcquire(null, 0, (byte)0x01);
+ });
+ checkCCE(() -> { // array reference class
+ byte x = (byte) vh.getAndBitwiseAndAcquire(Void.class, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseAndAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ byte x = (byte) vh.getAndBitwiseAndAcquire(0, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // index reference class
+ byte x = (byte) vh.getAndBitwiseAndAcquire(array, Void.class, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(array, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(array, 0, (byte)0x01);
});
// Incorrect arity
checkWMTE(() -> { // 0
- byte x = (byte) vh.addAndGet();
+ byte x = (byte) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseAndAcquire(array, 0, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseAndRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ byte x = (byte) vh.getAndBitwiseAndRelease(null, 0, (byte)0x01);
+ });
+ checkCCE(() -> { // array reference class
+ byte x = (byte) vh.getAndBitwiseAndRelease(Void.class, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseAndRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ byte x = (byte) vh.getAndBitwiseAndRelease(0, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // index reference class
+ byte x = (byte) vh.getAndBitwiseAndRelease(array, Void.class, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndRelease(array, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(array, 0, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseAndRelease();
});
checkWMTE(() -> { // >
- byte x = (byte) vh.addAndGet(array, 0, (byte)0x01, Void.class);
+ byte x = (byte) vh.getAndBitwiseAndRelease(array, 0, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ byte x = (byte) vh.getAndBitwiseXor(null, 0, (byte)0x01);
+ });
+ checkCCE(() -> { // array reference class
+ byte x = (byte) vh.getAndBitwiseXor(Void.class, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseXor(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ byte x = (byte) vh.getAndBitwiseXor(0, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // index reference class
+ byte x = (byte) vh.getAndBitwiseXor(array, Void.class, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(array, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(array, 0, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseXor(array, 0, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ byte x = (byte) vh.getAndBitwiseXorAcquire(null, 0, (byte)0x01);
+ });
+ checkCCE(() -> { // array reference class
+ byte x = (byte) vh.getAndBitwiseXorAcquire(Void.class, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseXorAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ byte x = (byte) vh.getAndBitwiseXorAcquire(0, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // index reference class
+ byte x = (byte) vh.getAndBitwiseXorAcquire(array, Void.class, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(array, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(array, 0, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseXorAcquire(array, 0, (byte)0x01, Void.class);
+ });
+
+
+ // GetAndBitwiseXorRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ byte x = (byte) vh.getAndBitwiseXorRelease(null, 0, (byte)0x01);
+ });
+ checkCCE(() -> { // array reference class
+ byte x = (byte) vh.getAndBitwiseXorRelease(Void.class, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) vh.getAndBitwiseXorRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ byte x = (byte) vh.getAndBitwiseXorRelease(0, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // index reference class
+ byte x = (byte) vh.getAndBitwiseXorRelease(array, Void.class, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorRelease(array, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(array, 0, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) vh.getAndBitwiseXorRelease();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) vh.getAndBitwiseXorRelease(array, 0, (byte)0x01, Void.class);
});
}
@@ -2144,6 +3208,48 @@
invokeExact(array, 0, (byte)0x01, Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class, byte.class)).
+ invokeExact((byte[]) null, 0, (byte)0x01);
+ });
+ hs.checkWMTEOrCCE(() -> { // array reference class
+ byte x = (byte) hs.get(am, methodType(byte.class, Class.class, int.class, byte.class)).
+ invokeExact(Void.class, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // value reference class
+ byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class, Class.class)).
+ invokeExact(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ byte x = (byte) hs.get(am, methodType(byte.class, int.class, int.class, byte.class)).
+ invokeExact(0, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // index reference class
+ byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, Class.class, byte.class)).
+ invokeExact(array, Void.class, (byte)0x01);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, byte[].class, int.class, byte.class)).
+ invokeExact(array, 0, (byte)0x01);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, byte[].class, int.class, byte.class)).
+ invokeExact(array, 0, (byte)0x01);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ byte x = (byte) hs.get(am, methodType(byte.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class, byte.class, Class.class)).
+ invokeExact(array, 0, (byte)0x01, Void.class);
+ });
+ }
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeChar.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeChar.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeChar.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -353,6 +353,32 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, '\u0123', '\u0123');
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, '\u0123', '\u0123');
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, '\u0123', Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, '\u0123', '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(recv, '\u0123', '\u0123', Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, '\u0123', '\u0123');
});
checkCCE(() -> { // receiver reference class
@@ -376,32 +402,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, '\u0123', '\u0123');
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, '\u0123', '\u0123');
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, '\u0123');
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, '\u0123', Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, '\u0123', '\u0123');
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(recv, '\u0123', '\u0123', Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -582,6 +582,64 @@
char x = (char) vh.getAndSet(recv, '\u0123', Void.class);
});
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ char x = (char) vh.getAndSetAcquire(null, '\u0123');
+ });
+ checkCCE(() -> { // receiver reference class
+ char x = (char) vh.getAndSetAcquire(Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndSetAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ char x = (char) vh.getAndSetAcquire(0, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(recv, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(recv, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndSetAcquire(recv, '\u0123', Void.class);
+ });
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ char x = (char) vh.getAndSetRelease(null, '\u0123');
+ });
+ checkCCE(() -> { // receiver reference class
+ char x = (char) vh.getAndSetRelease(Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndSetRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ char x = (char) vh.getAndSetRelease(0, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(recv, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(recv, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndSetRelease(recv, '\u0123', Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -611,34 +669,331 @@
char x = (char) vh.getAndAdd(recv, '\u0123', Void.class);
});
-
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
- char x = (char) vh.addAndGet(null, '\u0123');
+ char x = (char) vh.getAndAddAcquire(null, '\u0123');
+ });
+ checkCCE(() -> { // receiver reference class
+ char x = (char) vh.getAndAddAcquire(Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndAddAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ char x = (char) vh.getAndAddAcquire(0, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire(recv, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire(recv, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndAddAcquire(recv, '\u0123', Void.class);
+ });
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ char x = (char) vh.getAndAddRelease(null, '\u0123');
+ });
+ checkCCE(() -> { // receiver reference class
+ char x = (char) vh.getAndAddRelease(Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndAddRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ char x = (char) vh.getAndAddRelease(0, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(recv, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(recv, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndAddRelease(recv, '\u0123', Void.class);
+ });
+
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ char x = (char) vh.getAndBitwiseOr(null, '\u0123');
});
checkCCE(() -> { // receiver reference class
- char x = (char) vh.addAndGet(Void.class, '\u0123');
+ char x = (char) vh.getAndBitwiseOr(Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseOr(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ char x = (char) vh.getAndBitwiseOr(0, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(recv, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(recv, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseOr(recv, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ char x = (char) vh.getAndBitwiseOrAcquire(null, '\u0123');
+ });
+ checkCCE(() -> { // receiver reference class
+ char x = (char) vh.getAndBitwiseOrAcquire(Void.class, '\u0123');
});
checkWMTE(() -> { // value reference class
- char x = (char) vh.addAndGet(recv, Void.class);
+ char x = (char) vh.getAndBitwiseOrAcquire(recv, Void.class);
});
checkWMTE(() -> { // reciever primitive class
- char x = (char) vh.addAndGet(0, '\u0123');
+ char x = (char) vh.getAndBitwiseOrAcquire(0, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(recv, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(recv, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseOrAcquire(recv, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseOrRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ char x = (char) vh.getAndBitwiseOrRelease(null, '\u0123');
+ });
+ checkCCE(() -> { // receiver reference class
+ char x = (char) vh.getAndBitwiseOr(Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseOr(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ char x = (char) vh.getAndBitwiseOr(0, '\u0123');
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(recv, '\u0123');
+ Void r = (Void) vh.getAndBitwiseOr(recv, '\u0123');
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(recv, '\u0123');
+ boolean x = (boolean) vh.getAndBitwiseOr(recv, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseOr(recv, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ char x = (char) vh.getAndBitwiseAnd(null, '\u0123');
+ });
+ checkCCE(() -> { // receiver reference class
+ char x = (char) vh.getAndBitwiseAnd(Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseAnd(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ char x = (char) vh.getAndBitwiseAnd(0, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(recv, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(recv, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseAnd(recv, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ char x = (char) vh.getAndBitwiseAndAcquire(null, '\u0123');
+ });
+ checkCCE(() -> { // receiver reference class
+ char x = (char) vh.getAndBitwiseAndAcquire(Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseAndAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ char x = (char) vh.getAndBitwiseAndAcquire(0, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(recv, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(recv, '\u0123');
});
// Incorrect arity
checkWMTE(() -> { // 0
- char x = (char) vh.addAndGet();
+ char x = (char) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseAndAcquire(recv, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseAndRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ char x = (char) vh.getAndBitwiseAndRelease(null, '\u0123');
+ });
+ checkCCE(() -> { // receiver reference class
+ char x = (char) vh.getAndBitwiseAnd(Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseAnd(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ char x = (char) vh.getAndBitwiseAnd(0, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(recv, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(recv, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseAnd();
});
checkWMTE(() -> { // >
- char x = (char) vh.addAndGet(recv, '\u0123', Void.class);
+ char x = (char) vh.getAndBitwiseAnd(recv, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ char x = (char) vh.getAndBitwiseXor(null, '\u0123');
+ });
+ checkCCE(() -> { // receiver reference class
+ char x = (char) vh.getAndBitwiseXor(Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseXor(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ char x = (char) vh.getAndBitwiseXor(0, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(recv, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(recv, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseXor(recv, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ char x = (char) vh.getAndBitwiseXorAcquire(null, '\u0123');
+ });
+ checkCCE(() -> { // receiver reference class
+ char x = (char) vh.getAndBitwiseXorAcquire(Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseXorAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ char x = (char) vh.getAndBitwiseXorAcquire(0, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(recv, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(recv, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseXorAcquire(recv, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseXorRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ char x = (char) vh.getAndBitwiseXorRelease(null, '\u0123');
+ });
+ checkCCE(() -> { // receiver reference class
+ char x = (char) vh.getAndBitwiseXor(Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseXor(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ char x = (char) vh.getAndBitwiseXor(0, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(recv, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(recv, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseXor(recv, '\u0123', Void.class);
});
}
@@ -853,6 +1208,43 @@
invokeExact(recv, '\u0123', Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkNPE(() -> { // null receiver
+ char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, char.class)).
+ invokeExact((VarHandleTestMethodTypeChar) null, '\u0123');
+ });
+ hs.checkWMTEOrCCE(() -> { // receiver reference class
+ char x = (char) hs.get(am, methodType(char.class, Class.class, char.class)).
+ invokeExact(Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, Class.class)).
+ invokeExact(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ char x = (char) hs.get(am, methodType(char.class, int.class, char.class)).
+ invokeExact(0, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeChar.class, char.class)).
+ invokeExact(recv, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class, char.class)).
+ invokeExact(recv, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) hs.get(am, methodType(char.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, char.class)).
+ invokeExact(recv, '\u0123', Void.class);
+ });
+ }
}
@@ -986,6 +1378,23 @@
// WeakCompareAndSet
// Incorrect argument types
checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain('\u0123', Void.class);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain('\u0123', '\u0123', Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkWMTE(() -> { // expected reference class
boolean r = vh.weakCompareAndSet(Void.class, '\u0123');
});
checkWMTE(() -> { // actual reference class
@@ -1000,23 +1409,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, '\u0123');
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile('\u0123', Void.class);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile('\u0123', '\u0123', Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkWMTE(() -> { // expected reference class
@@ -1143,6 +1535,48 @@
char x = (char) vh.getAndSet('\u0123', Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndSetAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire('\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire('\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndSetAcquire('\u0123', Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndSetRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease('\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease('\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndSetRelease('\u0123', Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkWMTE(() -> { // value reference class
@@ -1164,24 +1598,233 @@
});
- // AddAndGet
+ // GetAndAddAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndAddAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire('\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire('\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndAddAcquire('\u0123', Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndAddRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease('\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease('\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndAddRelease('\u0123', Void.class);
+ });
+
+ // GetAndBitwiseOr
// Incorrect argument types
checkWMTE(() -> { // value reference class
- char x = (char) vh.addAndGet(Void.class);
+ char x = (char) vh.getAndBitwiseOr(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr('\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr('\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseOr('\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseOrAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire('\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire('\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseOrAcquire('\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseOrReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseOrRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrRelease('\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrRelease('\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseOrRelease();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseOrRelease('\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseAnd(Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet('\u0123');
+ Void r = (Void) vh.getAndBitwiseAnd('\u0123');
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet('\u0123');
+ boolean x = (boolean) vh.getAndBitwiseAnd('\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseAnd('\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseAndAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire('\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire('\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseAndAcquire('\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseAndReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseAndRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndRelease('\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease('\u0123');
});
// Incorrect arity
checkWMTE(() -> { // 0
- char x = (char) vh.addAndGet();
+ char x = (char) vh.getAndBitwiseAndRelease();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseAndRelease('\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseXor(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor('\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor('\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseXor();
});
checkWMTE(() -> { // >
- char x = (char) vh.addAndGet('\u0123', Void.class);
+ char x = (char) vh.getAndBitwiseXor('\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseXorAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire('\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire('\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseXorAcquire('\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseXorReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseXorRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorRelease('\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease('\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseXorRelease();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseXorRelease('\u0123', Void.class);
});
}
@@ -1322,6 +1965,32 @@
invokeExact('\u0123', Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ char x = (char) hs.get(am, methodType(char.class, Class.class)).
+ invokeExact(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, char.class)).
+ invokeExact('\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, char.class)).
+ invokeExact('\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) hs.get(am, methodType(char.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) hs.get(am, methodType(char.class, char.class, Class.class)).
+ invokeExact('\u0123', Void.class);
+ });
+ }
}
@@ -1585,6 +2254,35 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, 0, '\u0123', '\u0123');
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 0, '\u0123', '\u0123');
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, Void.class, '\u0123');
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, '\u0123', Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, 0, '\u0123', '\u0123');
+ });
+ checkWMTE(() -> { // index reference class
+ boolean r = vh.weakCompareAndSetPlain(array, Void.class, '\u0123', '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(array, 0, '\u0123', '\u0123', Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, 0, '\u0123', '\u0123');
});
checkCCE(() -> { // receiver reference class
@@ -1611,35 +2309,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 0, '\u0123', '\u0123');
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, '\u0123', '\u0123');
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, '\u0123');
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, '\u0123', Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 0, '\u0123', '\u0123');
- });
- checkWMTE(() -> { // index reference class
- boolean r = vh.weakCompareAndSetVolatile(array, Void.class, '\u0123', '\u0123');
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(array, 0, '\u0123', '\u0123', Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -1838,6 +2507,72 @@
char x = (char) vh.getAndSet(array, 0, '\u0123', Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ char x = (char) vh.getAndSetAcquire(null, 0, '\u0123');
+ });
+ checkCCE(() -> { // array reference class
+ char x = (char) vh.getAndSetAcquire(Void.class, 0, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndSetAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ char x = (char) vh.getAndSetAcquire(0, 0, '\u0123');
+ });
+ checkWMTE(() -> { // index reference class
+ char x = (char) vh.getAndSetAcquire(array, Void.class, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(array, 0, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(array, 0, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndSetAcquire(array, 0, '\u0123', Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ char x = (char) vh.getAndSetRelease(null, 0, '\u0123');
+ });
+ checkCCE(() -> { // array reference class
+ char x = (char) vh.getAndSetRelease(Void.class, 0, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndSetRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ char x = (char) vh.getAndSetRelease(0, 0, '\u0123');
+ });
+ checkWMTE(() -> { // index reference class
+ char x = (char) vh.getAndSetRelease(array, Void.class, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(array, 0, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(array, 0, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndSetRelease(array, 0, '\u0123', Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null array
@@ -1871,36 +2606,365 @@
});
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkNPE(() -> { // null array
- char x = (char) vh.addAndGet(null, 0, '\u0123');
+ char x = (char) vh.getAndAddAcquire(null, 0, '\u0123');
+ });
+ checkCCE(() -> { // array reference class
+ char x = (char) vh.getAndAddAcquire(Void.class, 0, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndAddAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ char x = (char) vh.getAndAddAcquire(0, 0, '\u0123');
+ });
+ checkWMTE(() -> { // index reference class
+ char x = (char) vh.getAndAddAcquire(array, Void.class, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire(array, 0, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire(array, 0, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndAddAcquire(array, 0, '\u0123', Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ char x = (char) vh.getAndAddRelease(null, 0, '\u0123');
+ });
+ checkCCE(() -> { // array reference class
+ char x = (char) vh.getAndAddRelease(Void.class, 0, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndAddRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ char x = (char) vh.getAndAddRelease(0, 0, '\u0123');
+ });
+ checkWMTE(() -> { // index reference class
+ char x = (char) vh.getAndAddRelease(array, Void.class, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(array, 0, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(array, 0, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndAddRelease(array, 0, '\u0123', Void.class);
+ });
+
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ char x = (char) vh.getAndBitwiseOr(null, 0, '\u0123');
});
checkCCE(() -> { // array reference class
- char x = (char) vh.addAndGet(Void.class, 0, '\u0123');
+ char x = (char) vh.getAndBitwiseOr(Void.class, 0, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseOr(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ char x = (char) vh.getAndBitwiseOr(0, 0, '\u0123');
+ });
+ checkWMTE(() -> { // index reference class
+ char x = (char) vh.getAndBitwiseOr(array, Void.class, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(array, 0, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(array, 0, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseOr(array, 0, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ char x = (char) vh.getAndBitwiseOrAcquire(null, 0, '\u0123');
+ });
+ checkCCE(() -> { // array reference class
+ char x = (char) vh.getAndBitwiseOrAcquire(Void.class, 0, '\u0123');
});
checkWMTE(() -> { // value reference class
- char x = (char) vh.addAndGet(array, 0, Void.class);
+ char x = (char) vh.getAndBitwiseOrAcquire(array, 0, Void.class);
});
checkWMTE(() -> { // array primitive class
- char x = (char) vh.addAndGet(0, 0, '\u0123');
+ char x = (char) vh.getAndBitwiseOrAcquire(0, 0, '\u0123');
});
checkWMTE(() -> { // index reference class
- char x = (char) vh.addAndGet(array, Void.class, '\u0123');
+ char x = (char) vh.getAndBitwiseOrAcquire(array, Void.class, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(array, 0, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(array, 0, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseOrAcquire(array, 0, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseOrRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ char x = (char) vh.getAndBitwiseOrRelease(null, 0, '\u0123');
+ });
+ checkCCE(() -> { // array reference class
+ char x = (char) vh.getAndBitwiseOrRelease(Void.class, 0, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseOrRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ char x = (char) vh.getAndBitwiseOrRelease(0, 0, '\u0123');
+ });
+ checkWMTE(() -> { // index reference class
+ char x = (char) vh.getAndBitwiseOrRelease(array, Void.class, '\u0123');
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(array, 0, '\u0123');
+ Void r = (Void) vh.getAndBitwiseOrRelease(array, 0, '\u0123');
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(array, 0, '\u0123');
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(array, 0, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseOrRelease();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseOrRelease(array, 0, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ char x = (char) vh.getAndBitwiseAnd(null, 0, '\u0123');
+ });
+ checkCCE(() -> { // array reference class
+ char x = (char) vh.getAndBitwiseAnd(Void.class, 0, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseAnd(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ char x = (char) vh.getAndBitwiseAnd(0, 0, '\u0123');
+ });
+ checkWMTE(() -> { // index reference class
+ char x = (char) vh.getAndBitwiseAnd(array, Void.class, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(array, 0, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(array, 0, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseAnd(array, 0, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ char x = (char) vh.getAndBitwiseAndAcquire(null, 0, '\u0123');
+ });
+ checkCCE(() -> { // array reference class
+ char x = (char) vh.getAndBitwiseAndAcquire(Void.class, 0, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseAndAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ char x = (char) vh.getAndBitwiseAndAcquire(0, 0, '\u0123');
+ });
+ checkWMTE(() -> { // index reference class
+ char x = (char) vh.getAndBitwiseAndAcquire(array, Void.class, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(array, 0, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(array, 0, '\u0123');
});
// Incorrect arity
checkWMTE(() -> { // 0
- char x = (char) vh.addAndGet();
+ char x = (char) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseAndAcquire(array, 0, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseAndRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ char x = (char) vh.getAndBitwiseAndRelease(null, 0, '\u0123');
+ });
+ checkCCE(() -> { // array reference class
+ char x = (char) vh.getAndBitwiseAndRelease(Void.class, 0, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseAndRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ char x = (char) vh.getAndBitwiseAndRelease(0, 0, '\u0123');
+ });
+ checkWMTE(() -> { // index reference class
+ char x = (char) vh.getAndBitwiseAndRelease(array, Void.class, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndRelease(array, 0, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(array, 0, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseAndRelease();
});
checkWMTE(() -> { // >
- char x = (char) vh.addAndGet(array, 0, '\u0123', Void.class);
+ char x = (char) vh.getAndBitwiseAndRelease(array, 0, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ char x = (char) vh.getAndBitwiseXor(null, 0, '\u0123');
+ });
+ checkCCE(() -> { // array reference class
+ char x = (char) vh.getAndBitwiseXor(Void.class, 0, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseXor(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ char x = (char) vh.getAndBitwiseXor(0, 0, '\u0123');
+ });
+ checkWMTE(() -> { // index reference class
+ char x = (char) vh.getAndBitwiseXor(array, Void.class, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(array, 0, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(array, 0, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseXor(array, 0, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ char x = (char) vh.getAndBitwiseXorAcquire(null, 0, '\u0123');
+ });
+ checkCCE(() -> { // array reference class
+ char x = (char) vh.getAndBitwiseXorAcquire(Void.class, 0, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseXorAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ char x = (char) vh.getAndBitwiseXorAcquire(0, 0, '\u0123');
+ });
+ checkWMTE(() -> { // index reference class
+ char x = (char) vh.getAndBitwiseXorAcquire(array, Void.class, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(array, 0, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(array, 0, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseXorAcquire(array, 0, '\u0123', Void.class);
+ });
+
+
+ // GetAndBitwiseXorRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ char x = (char) vh.getAndBitwiseXorRelease(null, 0, '\u0123');
+ });
+ checkCCE(() -> { // array reference class
+ char x = (char) vh.getAndBitwiseXorRelease(Void.class, 0, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) vh.getAndBitwiseXorRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ char x = (char) vh.getAndBitwiseXorRelease(0, 0, '\u0123');
+ });
+ checkWMTE(() -> { // index reference class
+ char x = (char) vh.getAndBitwiseXorRelease(array, Void.class, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorRelease(array, 0, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(array, 0, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) vh.getAndBitwiseXorRelease();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) vh.getAndBitwiseXorRelease(array, 0, '\u0123', Void.class);
});
}
@@ -2144,6 +3208,48 @@
invokeExact(array, 0, '\u0123', Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, char.class)).
+ invokeExact((char[]) null, 0, '\u0123');
+ });
+ hs.checkWMTEOrCCE(() -> { // array reference class
+ char x = (char) hs.get(am, methodType(char.class, Class.class, int.class, char.class)).
+ invokeExact(Void.class, 0, '\u0123');
+ });
+ checkWMTE(() -> { // value reference class
+ char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, Class.class)).
+ invokeExact(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ char x = (char) hs.get(am, methodType(char.class, int.class, int.class, char.class)).
+ invokeExact(0, 0, '\u0123');
+ });
+ checkWMTE(() -> { // index reference class
+ char x = (char) hs.get(am, methodType(char.class, char[].class, Class.class, char.class)).
+ invokeExact(array, Void.class, '\u0123');
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, char[].class, int.class, char.class)).
+ invokeExact(array, 0, '\u0123');
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class, char.class)).
+ invokeExact(array, 0, '\u0123');
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ char x = (char) hs.get(am, methodType(char.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, char.class, Class.class)).
+ invokeExact(array, 0, '\u0123', Void.class);
+ });
+ }
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeDouble.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeDouble.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeDouble.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -353,6 +353,32 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, 1.0d, 1.0d);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 1.0d, 1.0d);
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, Void.class, 1.0d);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, 1.0d, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, 1.0d, 1.0d);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(recv, 1.0d, 1.0d, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, 1.0d, 1.0d);
});
checkCCE(() -> { // receiver reference class
@@ -376,32 +402,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 1.0d, 1.0d);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 1.0d, 1.0d);
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, 1.0d);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, 1.0d, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 1.0d, 1.0d);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(recv, 1.0d, 1.0d, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -582,6 +582,64 @@
double x = (double) vh.getAndSet(recv, 1.0d, Void.class);
});
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ double x = (double) vh.getAndSetAcquire(null, 1.0d);
+ });
+ checkCCE(() -> { // receiver reference class
+ double x = (double) vh.getAndSetAcquire(Void.class, 1.0d);
+ });
+ checkWMTE(() -> { // value reference class
+ double x = (double) vh.getAndSetAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ double x = (double) vh.getAndSetAcquire(0, 1.0d);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(recv, 1.0d);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(recv, 1.0d);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ double x = (double) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ double x = (double) vh.getAndSetAcquire(recv, 1.0d, Void.class);
+ });
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ double x = (double) vh.getAndSetRelease(null, 1.0d);
+ });
+ checkCCE(() -> { // receiver reference class
+ double x = (double) vh.getAndSetRelease(Void.class, 1.0d);
+ });
+ checkWMTE(() -> { // value reference class
+ double x = (double) vh.getAndSetRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ double x = (double) vh.getAndSetRelease(0, 1.0d);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(recv, 1.0d);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(recv, 1.0d);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ double x = (double) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ double x = (double) vh.getAndSetRelease(recv, 1.0d, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -611,35 +669,64 @@
double x = (double) vh.getAndAdd(recv, 1.0d, Void.class);
});
-
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
- double x = (double) vh.addAndGet(null, 1.0d);
+ double x = (double) vh.getAndAddAcquire(null, 1.0d);
});
checkCCE(() -> { // receiver reference class
- double x = (double) vh.addAndGet(Void.class, 1.0d);
+ double x = (double) vh.getAndAddAcquire(Void.class, 1.0d);
});
checkWMTE(() -> { // value reference class
- double x = (double) vh.addAndGet(recv, Void.class);
+ double x = (double) vh.getAndAddAcquire(recv, Void.class);
});
checkWMTE(() -> { // reciever primitive class
- double x = (double) vh.addAndGet(0, 1.0d);
+ double x = (double) vh.getAndAddAcquire(0, 1.0d);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(recv, 1.0d);
+ Void r = (Void) vh.getAndAddAcquire(recv, 1.0d);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(recv, 1.0d);
+ boolean x = (boolean) vh.getAndAddAcquire(recv, 1.0d);
});
// Incorrect arity
checkWMTE(() -> { // 0
- double x = (double) vh.addAndGet();
+ double x = (double) vh.getAndAddAcquire();
});
checkWMTE(() -> { // >
- double x = (double) vh.addAndGet(recv, 1.0d, Void.class);
- });
+ double x = (double) vh.getAndAddAcquire(recv, 1.0d, Void.class);
+ });
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ double x = (double) vh.getAndAddRelease(null, 1.0d);
+ });
+ checkCCE(() -> { // receiver reference class
+ double x = (double) vh.getAndAddRelease(Void.class, 1.0d);
+ });
+ checkWMTE(() -> { // value reference class
+ double x = (double) vh.getAndAddRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ double x = (double) vh.getAndAddRelease(0, 1.0d);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(recv, 1.0d);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(recv, 1.0d);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ double x = (double) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ double x = (double) vh.getAndAddRelease(recv, 1.0d, Void.class);
+ });
+
}
static void testInstanceFieldWrongMethodType(VarHandleTestMethodTypeDouble recv, Handles hs) throws Throwable {
@@ -853,6 +940,7 @@
invokeExact(recv, 1.0d, Void.class);
});
}
+
}
@@ -986,6 +1074,23 @@
// WeakCompareAndSet
// Incorrect argument types
checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 1.0d);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(1.0d, Void.class);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(1.0d, 1.0d, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkWMTE(() -> { // expected reference class
boolean r = vh.weakCompareAndSet(Void.class, 1.0d);
});
checkWMTE(() -> { // actual reference class
@@ -1000,23 +1105,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 1.0d);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(1.0d, Void.class);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(1.0d, 1.0d, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkWMTE(() -> { // expected reference class
@@ -1143,6 +1231,48 @@
double x = (double) vh.getAndSet(1.0d, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ double x = (double) vh.getAndSetAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(1.0d);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(1.0d);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ double x = (double) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ double x = (double) vh.getAndSetAcquire(1.0d, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ double x = (double) vh.getAndSetRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(1.0d);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(1.0d);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ double x = (double) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ double x = (double) vh.getAndSetRelease(1.0d, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkWMTE(() -> { // value reference class
@@ -1164,25 +1294,47 @@
});
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkWMTE(() -> { // value reference class
- double x = (double) vh.addAndGet(Void.class);
+ double x = (double) vh.getAndAddAcquire(Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(1.0d);
+ Void r = (Void) vh.getAndAddAcquire(1.0d);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(1.0d);
+ boolean x = (boolean) vh.getAndAddAcquire(1.0d);
});
// Incorrect arity
checkWMTE(() -> { // 0
- double x = (double) vh.addAndGet();
+ double x = (double) vh.getAndAddAcquire();
});
checkWMTE(() -> { // >
- double x = (double) vh.addAndGet(1.0d, Void.class);
- });
+ double x = (double) vh.getAndAddAcquire(1.0d, Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ double x = (double) vh.getAndAddRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(1.0d);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(1.0d);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ double x = (double) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ double x = (double) vh.getAndAddRelease(1.0d, Void.class);
+ });
+
}
static void testStaticFieldWrongMethodType(Handles hs) throws Throwable {
@@ -1322,6 +1474,7 @@
invokeExact(1.0d, Void.class);
});
}
+
}
@@ -1585,6 +1738,35 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, 0, 1.0d, 1.0d);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 0, 1.0d, 1.0d);
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, Void.class, 1.0d);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, 1.0d, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, 0, 1.0d, 1.0d);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean r = vh.weakCompareAndSetPlain(array, Void.class, 1.0d, 1.0d);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(array, 0, 1.0d, 1.0d, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, 0, 1.0d, 1.0d);
});
checkCCE(() -> { // receiver reference class
@@ -1611,35 +1793,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 0, 1.0d, 1.0d);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, 1.0d, 1.0d);
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, 1.0d);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, 1.0d, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 0, 1.0d, 1.0d);
- });
- checkWMTE(() -> { // index reference class
- boolean r = vh.weakCompareAndSetVolatile(array, Void.class, 1.0d, 1.0d);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(array, 0, 1.0d, 1.0d, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -1838,6 +1991,72 @@
double x = (double) vh.getAndSet(array, 0, 1.0d, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ double x = (double) vh.getAndSetAcquire(null, 0, 1.0d);
+ });
+ checkCCE(() -> { // array reference class
+ double x = (double) vh.getAndSetAcquire(Void.class, 0, 1.0d);
+ });
+ checkWMTE(() -> { // value reference class
+ double x = (double) vh.getAndSetAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ double x = (double) vh.getAndSetAcquire(0, 0, 1.0d);
+ });
+ checkWMTE(() -> { // index reference class
+ double x = (double) vh.getAndSetAcquire(array, Void.class, 1.0d);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(array, 0, 1.0d);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(array, 0, 1.0d);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ double x = (double) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ double x = (double) vh.getAndSetAcquire(array, 0, 1.0d, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ double x = (double) vh.getAndSetRelease(null, 0, 1.0d);
+ });
+ checkCCE(() -> { // array reference class
+ double x = (double) vh.getAndSetRelease(Void.class, 0, 1.0d);
+ });
+ checkWMTE(() -> { // value reference class
+ double x = (double) vh.getAndSetRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ double x = (double) vh.getAndSetRelease(0, 0, 1.0d);
+ });
+ checkWMTE(() -> { // index reference class
+ double x = (double) vh.getAndSetRelease(array, Void.class, 1.0d);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(array, 0, 1.0d);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(array, 0, 1.0d);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ double x = (double) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ double x = (double) vh.getAndSetRelease(array, 0, 1.0d, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null array
@@ -1871,37 +2090,71 @@
});
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkNPE(() -> { // null array
- double x = (double) vh.addAndGet(null, 0, 1.0d);
+ double x = (double) vh.getAndAddAcquire(null, 0, 1.0d);
});
checkCCE(() -> { // array reference class
- double x = (double) vh.addAndGet(Void.class, 0, 1.0d);
+ double x = (double) vh.getAndAddAcquire(Void.class, 0, 1.0d);
});
checkWMTE(() -> { // value reference class
- double x = (double) vh.addAndGet(array, 0, Void.class);
+ double x = (double) vh.getAndAddAcquire(array, 0, Void.class);
});
checkWMTE(() -> { // array primitive class
- double x = (double) vh.addAndGet(0, 0, 1.0d);
+ double x = (double) vh.getAndAddAcquire(0, 0, 1.0d);
});
checkWMTE(() -> { // index reference class
- double x = (double) vh.addAndGet(array, Void.class, 1.0d);
+ double x = (double) vh.getAndAddAcquire(array, Void.class, 1.0d);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(array, 0, 1.0d);
+ Void r = (Void) vh.getAndAddAcquire(array, 0, 1.0d);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(array, 0, 1.0d);
+ boolean x = (boolean) vh.getAndAddAcquire(array, 0, 1.0d);
});
// Incorrect arity
checkWMTE(() -> { // 0
- double x = (double) vh.addAndGet();
+ double x = (double) vh.getAndAddAcquire();
});
checkWMTE(() -> { // >
- double x = (double) vh.addAndGet(array, 0, 1.0d, Void.class);
- });
+ double x = (double) vh.getAndAddAcquire(array, 0, 1.0d, Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ double x = (double) vh.getAndAddRelease(null, 0, 1.0d);
+ });
+ checkCCE(() -> { // array reference class
+ double x = (double) vh.getAndAddRelease(Void.class, 0, 1.0d);
+ });
+ checkWMTE(() -> { // value reference class
+ double x = (double) vh.getAndAddRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ double x = (double) vh.getAndAddRelease(0, 0, 1.0d);
+ });
+ checkWMTE(() -> { // index reference class
+ double x = (double) vh.getAndAddRelease(array, Void.class, 1.0d);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(array, 0, 1.0d);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(array, 0, 1.0d);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ double x = (double) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ double x = (double) vh.getAndAddRelease(array, 0, 1.0d, Void.class);
+ });
+
}
static void testArrayWrongMethodType(Handles hs) throws Throwable {
@@ -2144,6 +2397,7 @@
invokeExact(array, 0, 1.0d, Void.class);
});
}
+
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeFloat.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeFloat.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeFloat.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -353,6 +353,32 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, 1.0f, 1.0f);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 1.0f, 1.0f);
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, Void.class, 1.0f);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, 1.0f, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, 1.0f, 1.0f);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(recv, 1.0f, 1.0f, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, 1.0f, 1.0f);
});
checkCCE(() -> { // receiver reference class
@@ -376,32 +402,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 1.0f, 1.0f);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 1.0f, 1.0f);
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, 1.0f);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, 1.0f, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 1.0f, 1.0f);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(recv, 1.0f, 1.0f, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -582,6 +582,64 @@
float x = (float) vh.getAndSet(recv, 1.0f, Void.class);
});
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ float x = (float) vh.getAndSetAcquire(null, 1.0f);
+ });
+ checkCCE(() -> { // receiver reference class
+ float x = (float) vh.getAndSetAcquire(Void.class, 1.0f);
+ });
+ checkWMTE(() -> { // value reference class
+ float x = (float) vh.getAndSetAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ float x = (float) vh.getAndSetAcquire(0, 1.0f);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(recv, 1.0f);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(recv, 1.0f);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ float x = (float) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ float x = (float) vh.getAndSetAcquire(recv, 1.0f, Void.class);
+ });
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ float x = (float) vh.getAndSetRelease(null, 1.0f);
+ });
+ checkCCE(() -> { // receiver reference class
+ float x = (float) vh.getAndSetRelease(Void.class, 1.0f);
+ });
+ checkWMTE(() -> { // value reference class
+ float x = (float) vh.getAndSetRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ float x = (float) vh.getAndSetRelease(0, 1.0f);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(recv, 1.0f);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(recv, 1.0f);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ float x = (float) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ float x = (float) vh.getAndSetRelease(recv, 1.0f, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -611,35 +669,64 @@
float x = (float) vh.getAndAdd(recv, 1.0f, Void.class);
});
-
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
- float x = (float) vh.addAndGet(null, 1.0f);
+ float x = (float) vh.getAndAddAcquire(null, 1.0f);
});
checkCCE(() -> { // receiver reference class
- float x = (float) vh.addAndGet(Void.class, 1.0f);
+ float x = (float) vh.getAndAddAcquire(Void.class, 1.0f);
});
checkWMTE(() -> { // value reference class
- float x = (float) vh.addAndGet(recv, Void.class);
+ float x = (float) vh.getAndAddAcquire(recv, Void.class);
});
checkWMTE(() -> { // reciever primitive class
- float x = (float) vh.addAndGet(0, 1.0f);
+ float x = (float) vh.getAndAddAcquire(0, 1.0f);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(recv, 1.0f);
+ Void r = (Void) vh.getAndAddAcquire(recv, 1.0f);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(recv, 1.0f);
+ boolean x = (boolean) vh.getAndAddAcquire(recv, 1.0f);
});
// Incorrect arity
checkWMTE(() -> { // 0
- float x = (float) vh.addAndGet();
+ float x = (float) vh.getAndAddAcquire();
});
checkWMTE(() -> { // >
- float x = (float) vh.addAndGet(recv, 1.0f, Void.class);
- });
+ float x = (float) vh.getAndAddAcquire(recv, 1.0f, Void.class);
+ });
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ float x = (float) vh.getAndAddRelease(null, 1.0f);
+ });
+ checkCCE(() -> { // receiver reference class
+ float x = (float) vh.getAndAddRelease(Void.class, 1.0f);
+ });
+ checkWMTE(() -> { // value reference class
+ float x = (float) vh.getAndAddRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ float x = (float) vh.getAndAddRelease(0, 1.0f);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(recv, 1.0f);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(recv, 1.0f);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ float x = (float) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ float x = (float) vh.getAndAddRelease(recv, 1.0f, Void.class);
+ });
+
}
static void testInstanceFieldWrongMethodType(VarHandleTestMethodTypeFloat recv, Handles hs) throws Throwable {
@@ -853,6 +940,7 @@
invokeExact(recv, 1.0f, Void.class);
});
}
+
}
@@ -986,6 +1074,23 @@
// WeakCompareAndSet
// Incorrect argument types
checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 1.0f);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(1.0f, Void.class);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(1.0f, 1.0f, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkWMTE(() -> { // expected reference class
boolean r = vh.weakCompareAndSet(Void.class, 1.0f);
});
checkWMTE(() -> { // actual reference class
@@ -1000,23 +1105,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 1.0f);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(1.0f, Void.class);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(1.0f, 1.0f, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkWMTE(() -> { // expected reference class
@@ -1143,6 +1231,48 @@
float x = (float) vh.getAndSet(1.0f, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ float x = (float) vh.getAndSetAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(1.0f);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(1.0f);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ float x = (float) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ float x = (float) vh.getAndSetAcquire(1.0f, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ float x = (float) vh.getAndSetRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(1.0f);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(1.0f);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ float x = (float) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ float x = (float) vh.getAndSetRelease(1.0f, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkWMTE(() -> { // value reference class
@@ -1164,25 +1294,47 @@
});
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkWMTE(() -> { // value reference class
- float x = (float) vh.addAndGet(Void.class);
+ float x = (float) vh.getAndAddAcquire(Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(1.0f);
+ Void r = (Void) vh.getAndAddAcquire(1.0f);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(1.0f);
+ boolean x = (boolean) vh.getAndAddAcquire(1.0f);
});
// Incorrect arity
checkWMTE(() -> { // 0
- float x = (float) vh.addAndGet();
+ float x = (float) vh.getAndAddAcquire();
});
checkWMTE(() -> { // >
- float x = (float) vh.addAndGet(1.0f, Void.class);
- });
+ float x = (float) vh.getAndAddAcquire(1.0f, Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ float x = (float) vh.getAndAddRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(1.0f);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(1.0f);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ float x = (float) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ float x = (float) vh.getAndAddRelease(1.0f, Void.class);
+ });
+
}
static void testStaticFieldWrongMethodType(Handles hs) throws Throwable {
@@ -1322,6 +1474,7 @@
invokeExact(1.0f, Void.class);
});
}
+
}
@@ -1585,6 +1738,35 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, 0, 1.0f, 1.0f);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 0, 1.0f, 1.0f);
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, Void.class, 1.0f);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, 1.0f, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, 0, 1.0f, 1.0f);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean r = vh.weakCompareAndSetPlain(array, Void.class, 1.0f, 1.0f);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(array, 0, 1.0f, 1.0f, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, 0, 1.0f, 1.0f);
});
checkCCE(() -> { // receiver reference class
@@ -1611,35 +1793,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 0, 1.0f, 1.0f);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, 1.0f, 1.0f);
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, 1.0f);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, 1.0f, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 0, 1.0f, 1.0f);
- });
- checkWMTE(() -> { // index reference class
- boolean r = vh.weakCompareAndSetVolatile(array, Void.class, 1.0f, 1.0f);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(array, 0, 1.0f, 1.0f, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -1838,6 +1991,72 @@
float x = (float) vh.getAndSet(array, 0, 1.0f, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ float x = (float) vh.getAndSetAcquire(null, 0, 1.0f);
+ });
+ checkCCE(() -> { // array reference class
+ float x = (float) vh.getAndSetAcquire(Void.class, 0, 1.0f);
+ });
+ checkWMTE(() -> { // value reference class
+ float x = (float) vh.getAndSetAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ float x = (float) vh.getAndSetAcquire(0, 0, 1.0f);
+ });
+ checkWMTE(() -> { // index reference class
+ float x = (float) vh.getAndSetAcquire(array, Void.class, 1.0f);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(array, 0, 1.0f);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(array, 0, 1.0f);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ float x = (float) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ float x = (float) vh.getAndSetAcquire(array, 0, 1.0f, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ float x = (float) vh.getAndSetRelease(null, 0, 1.0f);
+ });
+ checkCCE(() -> { // array reference class
+ float x = (float) vh.getAndSetRelease(Void.class, 0, 1.0f);
+ });
+ checkWMTE(() -> { // value reference class
+ float x = (float) vh.getAndSetRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ float x = (float) vh.getAndSetRelease(0, 0, 1.0f);
+ });
+ checkWMTE(() -> { // index reference class
+ float x = (float) vh.getAndSetRelease(array, Void.class, 1.0f);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(array, 0, 1.0f);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(array, 0, 1.0f);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ float x = (float) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ float x = (float) vh.getAndSetRelease(array, 0, 1.0f, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null array
@@ -1871,37 +2090,71 @@
});
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkNPE(() -> { // null array
- float x = (float) vh.addAndGet(null, 0, 1.0f);
+ float x = (float) vh.getAndAddAcquire(null, 0, 1.0f);
});
checkCCE(() -> { // array reference class
- float x = (float) vh.addAndGet(Void.class, 0, 1.0f);
+ float x = (float) vh.getAndAddAcquire(Void.class, 0, 1.0f);
});
checkWMTE(() -> { // value reference class
- float x = (float) vh.addAndGet(array, 0, Void.class);
+ float x = (float) vh.getAndAddAcquire(array, 0, Void.class);
});
checkWMTE(() -> { // array primitive class
- float x = (float) vh.addAndGet(0, 0, 1.0f);
+ float x = (float) vh.getAndAddAcquire(0, 0, 1.0f);
});
checkWMTE(() -> { // index reference class
- float x = (float) vh.addAndGet(array, Void.class, 1.0f);
+ float x = (float) vh.getAndAddAcquire(array, Void.class, 1.0f);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(array, 0, 1.0f);
+ Void r = (Void) vh.getAndAddAcquire(array, 0, 1.0f);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(array, 0, 1.0f);
+ boolean x = (boolean) vh.getAndAddAcquire(array, 0, 1.0f);
});
// Incorrect arity
checkWMTE(() -> { // 0
- float x = (float) vh.addAndGet();
+ float x = (float) vh.getAndAddAcquire();
});
checkWMTE(() -> { // >
- float x = (float) vh.addAndGet(array, 0, 1.0f, Void.class);
- });
+ float x = (float) vh.getAndAddAcquire(array, 0, 1.0f, Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ float x = (float) vh.getAndAddRelease(null, 0, 1.0f);
+ });
+ checkCCE(() -> { // array reference class
+ float x = (float) vh.getAndAddRelease(Void.class, 0, 1.0f);
+ });
+ checkWMTE(() -> { // value reference class
+ float x = (float) vh.getAndAddRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ float x = (float) vh.getAndAddRelease(0, 0, 1.0f);
+ });
+ checkWMTE(() -> { // index reference class
+ float x = (float) vh.getAndAddRelease(array, Void.class, 1.0f);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(array, 0, 1.0f);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(array, 0, 1.0f);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ float x = (float) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ float x = (float) vh.getAndAddRelease(array, 0, 1.0f, Void.class);
+ });
+
}
static void testArrayWrongMethodType(Handles hs) throws Throwable {
@@ -2144,6 +2397,7 @@
invokeExact(array, 0, 1.0f, Void.class);
});
}
+
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeInt.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeInt.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeInt.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -353,6 +353,32 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, 0x01234567, 0x01234567);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 0x01234567, 0x01234567);
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, 0x01234567, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, 0x01234567, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(recv, 0x01234567, 0x01234567, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
@@ -376,32 +402,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 0x01234567, 0x01234567);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0x01234567, 0x01234567);
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, 0x01234567);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, 0x01234567, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 0x01234567, 0x01234567);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(recv, 0x01234567, 0x01234567, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -582,6 +582,64 @@
int x = (int) vh.getAndSet(recv, 0x01234567, Void.class);
});
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ int x = (int) vh.getAndSetAcquire(null, 0x01234567);
+ });
+ checkCCE(() -> { // receiver reference class
+ int x = (int) vh.getAndSetAcquire(Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndSetAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ int x = (int) vh.getAndSetAcquire(0, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(recv, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(recv, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndSetAcquire(recv, 0x01234567, Void.class);
+ });
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ int x = (int) vh.getAndSetRelease(null, 0x01234567);
+ });
+ checkCCE(() -> { // receiver reference class
+ int x = (int) vh.getAndSetRelease(Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndSetRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ int x = (int) vh.getAndSetRelease(0, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(recv, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(recv, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndSetRelease(recv, 0x01234567, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -611,34 +669,331 @@
int x = (int) vh.getAndAdd(recv, 0x01234567, Void.class);
});
-
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
- int x = (int) vh.addAndGet(null, 0x01234567);
+ int x = (int) vh.getAndAddAcquire(null, 0x01234567);
+ });
+ checkCCE(() -> { // receiver reference class
+ int x = (int) vh.getAndAddAcquire(Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndAddAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ int x = (int) vh.getAndAddAcquire(0, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire(recv, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire(recv, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndAddAcquire(recv, 0x01234567, Void.class);
+ });
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ int x = (int) vh.getAndAddRelease(null, 0x01234567);
+ });
+ checkCCE(() -> { // receiver reference class
+ int x = (int) vh.getAndAddRelease(Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndAddRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ int x = (int) vh.getAndAddRelease(0, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(recv, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(recv, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndAddRelease(recv, 0x01234567, Void.class);
+ });
+
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ int x = (int) vh.getAndBitwiseOr(null, 0x01234567);
});
checkCCE(() -> { // receiver reference class
- int x = (int) vh.addAndGet(Void.class, 0x01234567);
+ int x = (int) vh.getAndBitwiseOr(Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseOr(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ int x = (int) vh.getAndBitwiseOr(0, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(recv, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(recv, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseOr(recv, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ int x = (int) vh.getAndBitwiseOrAcquire(null, 0x01234567);
+ });
+ checkCCE(() -> { // receiver reference class
+ int x = (int) vh.getAndBitwiseOrAcquire(Void.class, 0x01234567);
});
checkWMTE(() -> { // value reference class
- int x = (int) vh.addAndGet(recv, Void.class);
+ int x = (int) vh.getAndBitwiseOrAcquire(recv, Void.class);
});
checkWMTE(() -> { // reciever primitive class
- int x = (int) vh.addAndGet(0, 0x01234567);
+ int x = (int) vh.getAndBitwiseOrAcquire(0, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(recv, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(recv, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseOrAcquire(recv, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseOrRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ int x = (int) vh.getAndBitwiseOrRelease(null, 0x01234567);
+ });
+ checkCCE(() -> { // receiver reference class
+ int x = (int) vh.getAndBitwiseOr(Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseOr(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ int x = (int) vh.getAndBitwiseOr(0, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(recv, 0x01234567);
+ Void r = (Void) vh.getAndBitwiseOr(recv, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(recv, 0x01234567);
+ boolean x = (boolean) vh.getAndBitwiseOr(recv, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseOr(recv, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ int x = (int) vh.getAndBitwiseAnd(null, 0x01234567);
+ });
+ checkCCE(() -> { // receiver reference class
+ int x = (int) vh.getAndBitwiseAnd(Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseAnd(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ int x = (int) vh.getAndBitwiseAnd(0, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(recv, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(recv, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseAnd(recv, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ int x = (int) vh.getAndBitwiseAndAcquire(null, 0x01234567);
+ });
+ checkCCE(() -> { // receiver reference class
+ int x = (int) vh.getAndBitwiseAndAcquire(Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseAndAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ int x = (int) vh.getAndBitwiseAndAcquire(0, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(recv, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(recv, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
- int x = (int) vh.addAndGet();
+ int x = (int) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseAndAcquire(recv, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseAndRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ int x = (int) vh.getAndBitwiseAndRelease(null, 0x01234567);
+ });
+ checkCCE(() -> { // receiver reference class
+ int x = (int) vh.getAndBitwiseAnd(Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseAnd(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ int x = (int) vh.getAndBitwiseAnd(0, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(recv, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(recv, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseAnd();
});
checkWMTE(() -> { // >
- int x = (int) vh.addAndGet(recv, 0x01234567, Void.class);
+ int x = (int) vh.getAndBitwiseAnd(recv, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ int x = (int) vh.getAndBitwiseXor(null, 0x01234567);
+ });
+ checkCCE(() -> { // receiver reference class
+ int x = (int) vh.getAndBitwiseXor(Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseXor(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ int x = (int) vh.getAndBitwiseXor(0, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(recv, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(recv, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseXor(recv, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ int x = (int) vh.getAndBitwiseXorAcquire(null, 0x01234567);
+ });
+ checkCCE(() -> { // receiver reference class
+ int x = (int) vh.getAndBitwiseXorAcquire(Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseXorAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ int x = (int) vh.getAndBitwiseXorAcquire(0, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(recv, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(recv, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseXorAcquire(recv, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseXorRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ int x = (int) vh.getAndBitwiseXorRelease(null, 0x01234567);
+ });
+ checkCCE(() -> { // receiver reference class
+ int x = (int) vh.getAndBitwiseXor(Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseXor(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ int x = (int) vh.getAndBitwiseXor(0, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(recv, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(recv, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseXor(recv, 0x01234567, Void.class);
});
}
@@ -853,6 +1208,43 @@
invokeExact(recv, 0x01234567, Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkNPE(() -> { // null receiver
+ int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class)).
+ invokeExact((VarHandleTestMethodTypeInt) null, 0x01234567);
+ });
+ hs.checkWMTEOrCCE(() -> { // receiver reference class
+ int x = (int) hs.get(am, methodType(int.class, Class.class, int.class)).
+ invokeExact(Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, Class.class)).
+ invokeExact(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ int x = (int) hs.get(am, methodType(int.class, int.class, int.class)).
+ invokeExact(0, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeInt.class, int.class)).
+ invokeExact(recv, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class)).
+ invokeExact(recv, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) hs.get(am, methodType(int.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class)).
+ invokeExact(recv, 0x01234567, Void.class);
+ });
+ }
}
@@ -986,6 +1378,23 @@
// WeakCompareAndSet
// Incorrect argument types
checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(0x01234567, Void.class);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(0x01234567, 0x01234567, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkWMTE(() -> { // expected reference class
boolean r = vh.weakCompareAndSet(Void.class, 0x01234567);
});
checkWMTE(() -> { // actual reference class
@@ -1000,23 +1409,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0x01234567);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(0x01234567, Void.class);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(0x01234567, 0x01234567, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkWMTE(() -> { // expected reference class
@@ -1143,6 +1535,48 @@
int x = (int) vh.getAndSet(0x01234567, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndSetAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndSetAcquire(0x01234567, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndSetRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndSetRelease(0x01234567, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkWMTE(() -> { // value reference class
@@ -1164,24 +1598,233 @@
});
- // AddAndGet
+ // GetAndAddAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndAddAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire(0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire(0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndAddAcquire(0x01234567, Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndAddRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndAddRelease(0x01234567, Void.class);
+ });
+
+ // GetAndBitwiseOr
// Incorrect argument types
checkWMTE(() -> { // value reference class
- int x = (int) vh.addAndGet(Void.class);
+ int x = (int) vh.getAndBitwiseOr(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseOr(0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseOrAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseOrAcquire(0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseOrReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseOrRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrRelease(0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseOrRelease();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseOrRelease(0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseAnd(Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(0x01234567);
+ Void r = (Void) vh.getAndBitwiseAnd(0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(0x01234567);
+ boolean x = (boolean) vh.getAndBitwiseAnd(0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseAnd(0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseAndAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseAndAcquire(0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseAndReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseAndRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndRelease(0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
- int x = (int) vh.addAndGet();
+ int x = (int) vh.getAndBitwiseAndRelease();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseAndRelease(0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseXor(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseXor();
});
checkWMTE(() -> { // >
- int x = (int) vh.addAndGet(0x01234567, Void.class);
+ int x = (int) vh.getAndBitwiseXor(0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseXorAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseXorAcquire(0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseXorReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseXorRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorRelease(0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseXorRelease();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseXorRelease(0x01234567, Void.class);
});
}
@@ -1322,6 +1965,32 @@
invokeExact(0x01234567, Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ int x = (int) hs.get(am, methodType(int.class, Class.class)).
+ invokeExact(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, int.class)).
+ invokeExact(0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class)).
+ invokeExact(0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) hs.get(am, methodType(int.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) hs.get(am, methodType(int.class, int.class, Class.class)).
+ invokeExact(0x01234567, Void.class);
+ });
+ }
}
@@ -1585,6 +2254,35 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, 0, 0x01234567, 0x01234567);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 0, 0x01234567, 0x01234567);
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, Void.class, 0x01234567);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, 0x01234567, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, 0, 0x01234567, 0x01234567);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean r = vh.weakCompareAndSetPlain(array, Void.class, 0x01234567, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(array, 0, 0x01234567, 0x01234567, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, 0, 0x01234567, 0x01234567);
});
checkCCE(() -> { // receiver reference class
@@ -1611,35 +2309,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 0, 0x01234567, 0x01234567);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, 0x01234567, 0x01234567);
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, 0x01234567);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, 0x01234567, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 0, 0x01234567, 0x01234567);
- });
- checkWMTE(() -> { // index reference class
- boolean r = vh.weakCompareAndSetVolatile(array, Void.class, 0x01234567, 0x01234567);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(array, 0, 0x01234567, 0x01234567, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -1838,6 +2507,72 @@
int x = (int) vh.getAndSet(array, 0, 0x01234567, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ int x = (int) vh.getAndSetAcquire(null, 0, 0x01234567);
+ });
+ checkCCE(() -> { // array reference class
+ int x = (int) vh.getAndSetAcquire(Void.class, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndSetAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ int x = (int) vh.getAndSetAcquire(0, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // index reference class
+ int x = (int) vh.getAndSetAcquire(array, Void.class, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(array, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(array, 0, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndSetAcquire(array, 0, 0x01234567, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ int x = (int) vh.getAndSetRelease(null, 0, 0x01234567);
+ });
+ checkCCE(() -> { // array reference class
+ int x = (int) vh.getAndSetRelease(Void.class, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndSetRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ int x = (int) vh.getAndSetRelease(0, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // index reference class
+ int x = (int) vh.getAndSetRelease(array, Void.class, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(array, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(array, 0, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndSetRelease(array, 0, 0x01234567, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null array
@@ -1871,36 +2606,365 @@
});
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkNPE(() -> { // null array
- int x = (int) vh.addAndGet(null, 0, 0x01234567);
+ int x = (int) vh.getAndAddAcquire(null, 0, 0x01234567);
+ });
+ checkCCE(() -> { // array reference class
+ int x = (int) vh.getAndAddAcquire(Void.class, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndAddAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ int x = (int) vh.getAndAddAcquire(0, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // index reference class
+ int x = (int) vh.getAndAddAcquire(array, Void.class, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire(array, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire(array, 0, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndAddAcquire(array, 0, 0x01234567, Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ int x = (int) vh.getAndAddRelease(null, 0, 0x01234567);
+ });
+ checkCCE(() -> { // array reference class
+ int x = (int) vh.getAndAddRelease(Void.class, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndAddRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ int x = (int) vh.getAndAddRelease(0, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // index reference class
+ int x = (int) vh.getAndAddRelease(array, Void.class, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(array, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(array, 0, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndAddRelease(array, 0, 0x01234567, Void.class);
+ });
+
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ int x = (int) vh.getAndBitwiseOr(null, 0, 0x01234567);
});
checkCCE(() -> { // array reference class
- int x = (int) vh.addAndGet(Void.class, 0, 0x01234567);
+ int x = (int) vh.getAndBitwiseOr(Void.class, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseOr(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ int x = (int) vh.getAndBitwiseOr(0, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // index reference class
+ int x = (int) vh.getAndBitwiseOr(array, Void.class, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(array, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(array, 0, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseOr(array, 0, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ int x = (int) vh.getAndBitwiseOrAcquire(null, 0, 0x01234567);
+ });
+ checkCCE(() -> { // array reference class
+ int x = (int) vh.getAndBitwiseOrAcquire(Void.class, 0, 0x01234567);
});
checkWMTE(() -> { // value reference class
- int x = (int) vh.addAndGet(array, 0, Void.class);
+ int x = (int) vh.getAndBitwiseOrAcquire(array, 0, Void.class);
});
checkWMTE(() -> { // array primitive class
- int x = (int) vh.addAndGet(0, 0, 0x01234567);
+ int x = (int) vh.getAndBitwiseOrAcquire(0, 0, 0x01234567);
});
checkWMTE(() -> { // index reference class
- int x = (int) vh.addAndGet(array, Void.class, 0x01234567);
+ int x = (int) vh.getAndBitwiseOrAcquire(array, Void.class, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(array, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(array, 0, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseOrAcquire(array, 0, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseOrRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ int x = (int) vh.getAndBitwiseOrRelease(null, 0, 0x01234567);
+ });
+ checkCCE(() -> { // array reference class
+ int x = (int) vh.getAndBitwiseOrRelease(Void.class, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseOrRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ int x = (int) vh.getAndBitwiseOrRelease(0, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // index reference class
+ int x = (int) vh.getAndBitwiseOrRelease(array, Void.class, 0x01234567);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(array, 0, 0x01234567);
+ Void r = (Void) vh.getAndBitwiseOrRelease(array, 0, 0x01234567);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(array, 0, 0x01234567);
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(array, 0, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseOrRelease();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseOrRelease(array, 0, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ int x = (int) vh.getAndBitwiseAnd(null, 0, 0x01234567);
+ });
+ checkCCE(() -> { // array reference class
+ int x = (int) vh.getAndBitwiseAnd(Void.class, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseAnd(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ int x = (int) vh.getAndBitwiseAnd(0, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // index reference class
+ int x = (int) vh.getAndBitwiseAnd(array, Void.class, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(array, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(array, 0, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseAnd(array, 0, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ int x = (int) vh.getAndBitwiseAndAcquire(null, 0, 0x01234567);
+ });
+ checkCCE(() -> { // array reference class
+ int x = (int) vh.getAndBitwiseAndAcquire(Void.class, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseAndAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ int x = (int) vh.getAndBitwiseAndAcquire(0, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // index reference class
+ int x = (int) vh.getAndBitwiseAndAcquire(array, Void.class, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(array, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(array, 0, 0x01234567);
});
// Incorrect arity
checkWMTE(() -> { // 0
- int x = (int) vh.addAndGet();
+ int x = (int) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseAndAcquire(array, 0, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseAndRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ int x = (int) vh.getAndBitwiseAndRelease(null, 0, 0x01234567);
+ });
+ checkCCE(() -> { // array reference class
+ int x = (int) vh.getAndBitwiseAndRelease(Void.class, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseAndRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ int x = (int) vh.getAndBitwiseAndRelease(0, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // index reference class
+ int x = (int) vh.getAndBitwiseAndRelease(array, Void.class, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndRelease(array, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(array, 0, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseAndRelease();
});
checkWMTE(() -> { // >
- int x = (int) vh.addAndGet(array, 0, 0x01234567, Void.class);
+ int x = (int) vh.getAndBitwiseAndRelease(array, 0, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ int x = (int) vh.getAndBitwiseXor(null, 0, 0x01234567);
+ });
+ checkCCE(() -> { // array reference class
+ int x = (int) vh.getAndBitwiseXor(Void.class, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseXor(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ int x = (int) vh.getAndBitwiseXor(0, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // index reference class
+ int x = (int) vh.getAndBitwiseXor(array, Void.class, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(array, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(array, 0, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseXor(array, 0, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ int x = (int) vh.getAndBitwiseXorAcquire(null, 0, 0x01234567);
+ });
+ checkCCE(() -> { // array reference class
+ int x = (int) vh.getAndBitwiseXorAcquire(Void.class, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseXorAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ int x = (int) vh.getAndBitwiseXorAcquire(0, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // index reference class
+ int x = (int) vh.getAndBitwiseXorAcquire(array, Void.class, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(array, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(array, 0, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseXorAcquire(array, 0, 0x01234567, Void.class);
+ });
+
+
+ // GetAndBitwiseXorRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ int x = (int) vh.getAndBitwiseXorRelease(null, 0, 0x01234567);
+ });
+ checkCCE(() -> { // array reference class
+ int x = (int) vh.getAndBitwiseXorRelease(Void.class, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) vh.getAndBitwiseXorRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ int x = (int) vh.getAndBitwiseXorRelease(0, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // index reference class
+ int x = (int) vh.getAndBitwiseXorRelease(array, Void.class, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorRelease(array, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(array, 0, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) vh.getAndBitwiseXorRelease();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) vh.getAndBitwiseXorRelease(array, 0, 0x01234567, Void.class);
});
}
@@ -2144,6 +3208,48 @@
invokeExact(array, 0, 0x01234567, Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class)).
+ invokeExact((int[]) null, 0, 0x01234567);
+ });
+ hs.checkWMTEOrCCE(() -> { // array reference class
+ int x = (int) hs.get(am, methodType(int.class, Class.class, int.class, int.class)).
+ invokeExact(Void.class, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // value reference class
+ int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, Class.class)).
+ invokeExact(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ int x = (int) hs.get(am, methodType(int.class, int.class, int.class, int.class)).
+ invokeExact(0, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // index reference class
+ int x = (int) hs.get(am, methodType(int.class, int[].class, Class.class, int.class)).
+ invokeExact(array, Void.class, 0x01234567);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, int[].class, int.class, int.class)).
+ invokeExact(array, 0, 0x01234567);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class)).
+ invokeExact(array, 0, 0x01234567);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ int x = (int) hs.get(am, methodType(int.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, Class.class)).
+ invokeExact(array, 0, 0x01234567, Void.class);
+ });
+ }
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeLong.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeLong.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeLong.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -353,6 +353,32 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, 0x0123456789ABCDEFL, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
checkCCE(() -> { // receiver reference class
@@ -376,32 +402,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, 0x0123456789ABCDEFL);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, 0x0123456789ABCDEFL, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -582,6 +582,64 @@
long x = (long) vh.getAndSet(recv, 0x0123456789ABCDEFL, Void.class);
});
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ long x = (long) vh.getAndSetAcquire(null, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // receiver reference class
+ long x = (long) vh.getAndSetAcquire(Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndSetAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ long x = (long) vh.getAndSetAcquire(0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(recv, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(recv, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndSetAcquire(recv, 0x0123456789ABCDEFL, Void.class);
+ });
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ long x = (long) vh.getAndSetRelease(null, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // receiver reference class
+ long x = (long) vh.getAndSetRelease(Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndSetRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ long x = (long) vh.getAndSetRelease(0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(recv, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(recv, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndSetRelease(recv, 0x0123456789ABCDEFL, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -611,34 +669,331 @@
long x = (long) vh.getAndAdd(recv, 0x0123456789ABCDEFL, Void.class);
});
-
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
- long x = (long) vh.addAndGet(null, 0x0123456789ABCDEFL);
+ long x = (long) vh.getAndAddAcquire(null, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // receiver reference class
+ long x = (long) vh.getAndAddAcquire(Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndAddAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ long x = (long) vh.getAndAddAcquire(0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire(recv, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire(recv, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndAddAcquire(recv, 0x0123456789ABCDEFL, Void.class);
+ });
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ long x = (long) vh.getAndAddRelease(null, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // receiver reference class
+ long x = (long) vh.getAndAddRelease(Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndAddRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ long x = (long) vh.getAndAddRelease(0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(recv, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(recv, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndAddRelease(recv, 0x0123456789ABCDEFL, Void.class);
+ });
+
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ long x = (long) vh.getAndBitwiseOr(null, 0x0123456789ABCDEFL);
});
checkCCE(() -> { // receiver reference class
- long x = (long) vh.addAndGet(Void.class, 0x0123456789ABCDEFL);
+ long x = (long) vh.getAndBitwiseOr(Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseOr(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ long x = (long) vh.getAndBitwiseOr(0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(recv, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(recv, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseOr(recv, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ long x = (long) vh.getAndBitwiseOrAcquire(null, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // receiver reference class
+ long x = (long) vh.getAndBitwiseOrAcquire(Void.class, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // value reference class
- long x = (long) vh.addAndGet(recv, Void.class);
+ long x = (long) vh.getAndBitwiseOrAcquire(recv, Void.class);
});
checkWMTE(() -> { // reciever primitive class
- long x = (long) vh.addAndGet(0, 0x0123456789ABCDEFL);
+ long x = (long) vh.getAndBitwiseOrAcquire(0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(recv, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(recv, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseOrAcquire(recv, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseOrRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ long x = (long) vh.getAndBitwiseOrRelease(null, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // receiver reference class
+ long x = (long) vh.getAndBitwiseOr(Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseOr(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ long x = (long) vh.getAndBitwiseOr(0, 0x0123456789ABCDEFL);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(recv, 0x0123456789ABCDEFL);
+ Void r = (Void) vh.getAndBitwiseOr(recv, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(recv, 0x0123456789ABCDEFL);
+ boolean x = (boolean) vh.getAndBitwiseOr(recv, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseOr(recv, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ long x = (long) vh.getAndBitwiseAnd(null, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // receiver reference class
+ long x = (long) vh.getAndBitwiseAnd(Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseAnd(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ long x = (long) vh.getAndBitwiseAnd(0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(recv, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(recv, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseAnd(recv, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ long x = (long) vh.getAndBitwiseAndAcquire(null, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // receiver reference class
+ long x = (long) vh.getAndBitwiseAndAcquire(Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseAndAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ long x = (long) vh.getAndBitwiseAndAcquire(0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(recv, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(recv, 0x0123456789ABCDEFL);
});
// Incorrect arity
checkWMTE(() -> { // 0
- long x = (long) vh.addAndGet();
+ long x = (long) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseAndAcquire(recv, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseAndRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ long x = (long) vh.getAndBitwiseAndRelease(null, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // receiver reference class
+ long x = (long) vh.getAndBitwiseAnd(Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseAnd(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ long x = (long) vh.getAndBitwiseAnd(0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(recv, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(recv, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseAnd();
});
checkWMTE(() -> { // >
- long x = (long) vh.addAndGet(recv, 0x0123456789ABCDEFL, Void.class);
+ long x = (long) vh.getAndBitwiseAnd(recv, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ long x = (long) vh.getAndBitwiseXor(null, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // receiver reference class
+ long x = (long) vh.getAndBitwiseXor(Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseXor(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ long x = (long) vh.getAndBitwiseXor(0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(recv, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(recv, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseXor(recv, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ long x = (long) vh.getAndBitwiseXorAcquire(null, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // receiver reference class
+ long x = (long) vh.getAndBitwiseXorAcquire(Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseXorAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ long x = (long) vh.getAndBitwiseXorAcquire(0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(recv, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(recv, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseXorAcquire(recv, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseXorRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ long x = (long) vh.getAndBitwiseXorRelease(null, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // receiver reference class
+ long x = (long) vh.getAndBitwiseXor(Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseXor(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ long x = (long) vh.getAndBitwiseXor(0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(recv, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(recv, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseXor(recv, 0x0123456789ABCDEFL, Void.class);
});
}
@@ -853,6 +1208,43 @@
invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkNPE(() -> { // null receiver
+ long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
+ invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL);
+ });
+ hs.checkWMTEOrCCE(() -> { // receiver reference class
+ long x = (long) hs.get(am, methodType(long.class, Class.class, long.class)).
+ invokeExact(Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, Class.class)).
+ invokeExact(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ long x = (long) hs.get(am, methodType(long.class, int.class, long.class)).
+ invokeExact(0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class, long.class)).
+ invokeExact(recv, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class)).
+ invokeExact(recv, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) hs.get(am, methodType(long.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
+ invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
+ });
+ }
}
@@ -986,6 +1378,23 @@
// WeakCompareAndSet
// Incorrect argument types
checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(0x0123456789ABCDEFL, Void.class);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkWMTE(() -> { // expected reference class
boolean r = vh.weakCompareAndSet(Void.class, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // actual reference class
@@ -1000,23 +1409,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0x0123456789ABCDEFL);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(0x0123456789ABCDEFL, Void.class);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkWMTE(() -> { // expected reference class
@@ -1143,6 +1535,48 @@
long x = (long) vh.getAndSet(0x0123456789ABCDEFL, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndSetAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndSetAcquire(0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndSetRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndSetRelease(0x0123456789ABCDEFL, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkWMTE(() -> { // value reference class
@@ -1164,24 +1598,233 @@
});
- // AddAndGet
+ // GetAndAddAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndAddAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire(0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire(0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndAddAcquire(0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndAddRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndAddRelease(0x0123456789ABCDEFL, Void.class);
+ });
+
+ // GetAndBitwiseOr
// Incorrect argument types
checkWMTE(() -> { // value reference class
- long x = (long) vh.addAndGet(Void.class);
+ long x = (long) vh.getAndBitwiseOr(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseOr(0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseOrAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseOrAcquire(0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseOrReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseOrRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrRelease(0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseOrRelease();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseOrRelease(0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseAnd(Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(0x0123456789ABCDEFL);
+ Void r = (Void) vh.getAndBitwiseAnd(0x0123456789ABCDEFL);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(0x0123456789ABCDEFL);
+ boolean x = (boolean) vh.getAndBitwiseAnd(0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseAnd(0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseAndAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseAndAcquire(0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseAndReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseAndRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndRelease(0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(0x0123456789ABCDEFL);
});
// Incorrect arity
checkWMTE(() -> { // 0
- long x = (long) vh.addAndGet();
+ long x = (long) vh.getAndBitwiseAndRelease();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseAndRelease(0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseXor(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseXor();
});
checkWMTE(() -> { // >
- long x = (long) vh.addAndGet(0x0123456789ABCDEFL, Void.class);
+ long x = (long) vh.getAndBitwiseXor(0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseXorAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseXorAcquire(0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseXorReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseXorRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorRelease(0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseXorRelease();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseXorRelease(0x0123456789ABCDEFL, Void.class);
});
}
@@ -1322,6 +1965,32 @@
invokeExact(0x0123456789ABCDEFL, Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ long x = (long) hs.get(am, methodType(long.class, Class.class)).
+ invokeExact(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, long.class)).
+ invokeExact(0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, long.class)).
+ invokeExact(0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) hs.get(am, methodType(long.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) hs.get(am, methodType(long.class, long.class, Class.class)).
+ invokeExact(0x0123456789ABCDEFL, Void.class);
+ });
+ }
}
@@ -1585,6 +2254,35 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, Void.class, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, 0x0123456789ABCDEFL, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean r = vh.weakCompareAndSetPlain(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
});
checkCCE(() -> { // receiver reference class
@@ -1611,35 +2309,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, 0x0123456789ABCDEFL);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, 0x0123456789ABCDEFL, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
- });
- checkWMTE(() -> { // index reference class
- boolean r = vh.weakCompareAndSetVolatile(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -1838,6 +2507,72 @@
long x = (long) vh.getAndSet(array, 0, 0x0123456789ABCDEFL, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ long x = (long) vh.getAndSetAcquire(null, 0, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // array reference class
+ long x = (long) vh.getAndSetAcquire(Void.class, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndSetAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ long x = (long) vh.getAndSetAcquire(0, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // index reference class
+ long x = (long) vh.getAndSetAcquire(array, Void.class, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(array, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(array, 0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndSetAcquire(array, 0, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ long x = (long) vh.getAndSetRelease(null, 0, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // array reference class
+ long x = (long) vh.getAndSetRelease(Void.class, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndSetRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ long x = (long) vh.getAndSetRelease(0, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // index reference class
+ long x = (long) vh.getAndSetRelease(array, Void.class, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(array, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(array, 0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndSetRelease(array, 0, 0x0123456789ABCDEFL, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null array
@@ -1871,36 +2606,365 @@
});
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkNPE(() -> { // null array
- long x = (long) vh.addAndGet(null, 0, 0x0123456789ABCDEFL);
+ long x = (long) vh.getAndAddAcquire(null, 0, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // array reference class
+ long x = (long) vh.getAndAddAcquire(Void.class, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndAddAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ long x = (long) vh.getAndAddAcquire(0, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // index reference class
+ long x = (long) vh.getAndAddAcquire(array, Void.class, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire(array, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire(array, 0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndAddAcquire(array, 0, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ long x = (long) vh.getAndAddRelease(null, 0, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // array reference class
+ long x = (long) vh.getAndAddRelease(Void.class, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndAddRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ long x = (long) vh.getAndAddRelease(0, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // index reference class
+ long x = (long) vh.getAndAddRelease(array, Void.class, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(array, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(array, 0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndAddRelease(array, 0, 0x0123456789ABCDEFL, Void.class);
+ });
+
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ long x = (long) vh.getAndBitwiseOr(null, 0, 0x0123456789ABCDEFL);
});
checkCCE(() -> { // array reference class
- long x = (long) vh.addAndGet(Void.class, 0, 0x0123456789ABCDEFL);
+ long x = (long) vh.getAndBitwiseOr(Void.class, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseOr(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ long x = (long) vh.getAndBitwiseOr(0, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // index reference class
+ long x = (long) vh.getAndBitwiseOr(array, Void.class, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(array, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(array, 0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseOr(array, 0, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ long x = (long) vh.getAndBitwiseOrAcquire(null, 0, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // array reference class
+ long x = (long) vh.getAndBitwiseOrAcquire(Void.class, 0, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // value reference class
- long x = (long) vh.addAndGet(array, 0, Void.class);
+ long x = (long) vh.getAndBitwiseOrAcquire(array, 0, Void.class);
});
checkWMTE(() -> { // array primitive class
- long x = (long) vh.addAndGet(0, 0, 0x0123456789ABCDEFL);
+ long x = (long) vh.getAndBitwiseOrAcquire(0, 0, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // index reference class
- long x = (long) vh.addAndGet(array, Void.class, 0x0123456789ABCDEFL);
+ long x = (long) vh.getAndBitwiseOrAcquire(array, Void.class, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(array, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(array, 0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseOrAcquire(array, 0, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseOrRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ long x = (long) vh.getAndBitwiseOrRelease(null, 0, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // array reference class
+ long x = (long) vh.getAndBitwiseOrRelease(Void.class, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseOrRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ long x = (long) vh.getAndBitwiseOrRelease(0, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // index reference class
+ long x = (long) vh.getAndBitwiseOrRelease(array, Void.class, 0x0123456789ABCDEFL);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(array, 0, 0x0123456789ABCDEFL);
+ Void r = (Void) vh.getAndBitwiseOrRelease(array, 0, 0x0123456789ABCDEFL);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(array, 0, 0x0123456789ABCDEFL);
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(array, 0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseOrRelease();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseOrRelease(array, 0, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ long x = (long) vh.getAndBitwiseAnd(null, 0, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // array reference class
+ long x = (long) vh.getAndBitwiseAnd(Void.class, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseAnd(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ long x = (long) vh.getAndBitwiseAnd(0, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // index reference class
+ long x = (long) vh.getAndBitwiseAnd(array, Void.class, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(array, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(array, 0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseAnd(array, 0, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ long x = (long) vh.getAndBitwiseAndAcquire(null, 0, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // array reference class
+ long x = (long) vh.getAndBitwiseAndAcquire(Void.class, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseAndAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ long x = (long) vh.getAndBitwiseAndAcquire(0, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // index reference class
+ long x = (long) vh.getAndBitwiseAndAcquire(array, Void.class, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(array, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(array, 0, 0x0123456789ABCDEFL);
});
// Incorrect arity
checkWMTE(() -> { // 0
- long x = (long) vh.addAndGet();
+ long x = (long) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseAndAcquire(array, 0, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseAndRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ long x = (long) vh.getAndBitwiseAndRelease(null, 0, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // array reference class
+ long x = (long) vh.getAndBitwiseAndRelease(Void.class, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseAndRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ long x = (long) vh.getAndBitwiseAndRelease(0, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // index reference class
+ long x = (long) vh.getAndBitwiseAndRelease(array, Void.class, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndRelease(array, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(array, 0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseAndRelease();
});
checkWMTE(() -> { // >
- long x = (long) vh.addAndGet(array, 0, 0x0123456789ABCDEFL, Void.class);
+ long x = (long) vh.getAndBitwiseAndRelease(array, 0, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ long x = (long) vh.getAndBitwiseXor(null, 0, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // array reference class
+ long x = (long) vh.getAndBitwiseXor(Void.class, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseXor(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ long x = (long) vh.getAndBitwiseXor(0, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // index reference class
+ long x = (long) vh.getAndBitwiseXor(array, Void.class, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(array, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(array, 0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseXor(array, 0, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ long x = (long) vh.getAndBitwiseXorAcquire(null, 0, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // array reference class
+ long x = (long) vh.getAndBitwiseXorAcquire(Void.class, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseXorAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ long x = (long) vh.getAndBitwiseXorAcquire(0, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // index reference class
+ long x = (long) vh.getAndBitwiseXorAcquire(array, Void.class, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(array, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(array, 0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseXorAcquire(array, 0, 0x0123456789ABCDEFL, Void.class);
+ });
+
+
+ // GetAndBitwiseXorRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ long x = (long) vh.getAndBitwiseXorRelease(null, 0, 0x0123456789ABCDEFL);
+ });
+ checkCCE(() -> { // array reference class
+ long x = (long) vh.getAndBitwiseXorRelease(Void.class, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) vh.getAndBitwiseXorRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ long x = (long) vh.getAndBitwiseXorRelease(0, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // index reference class
+ long x = (long) vh.getAndBitwiseXorRelease(array, Void.class, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorRelease(array, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(array, 0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) vh.getAndBitwiseXorRelease();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) vh.getAndBitwiseXorRelease(array, 0, 0x0123456789ABCDEFL, Void.class);
});
}
@@ -2144,6 +3208,48 @@
invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class)).
+ invokeExact((long[]) null, 0, 0x0123456789ABCDEFL);
+ });
+ hs.checkWMTEOrCCE(() -> { // array reference class
+ long x = (long) hs.get(am, methodType(long.class, Class.class, int.class, long.class)).
+ invokeExact(Void.class, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // value reference class
+ long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, Class.class)).
+ invokeExact(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ long x = (long) hs.get(am, methodType(long.class, int.class, int.class, long.class)).
+ invokeExact(0, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // index reference class
+ long x = (long) hs.get(am, methodType(long.class, long[].class, Class.class, long.class)).
+ invokeExact(array, Void.class, 0x0123456789ABCDEFL);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, long.class)).
+ invokeExact(array, 0, 0x0123456789ABCDEFL);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class)).
+ invokeExact(array, 0, 0x0123456789ABCDEFL);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ long x = (long) hs.get(am, methodType(long.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, Class.class)).
+ invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
+ });
+ }
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeShort.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeShort.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeShort.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -353,6 +353,32 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, (short)0x0123, (short)0x0123);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, (short)0x0123, (short)0x0123);
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, (short)0x0123, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, (short)0x0123, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(recv, (short)0x0123, (short)0x0123, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, (short)0x0123, (short)0x0123);
});
checkCCE(() -> { // receiver reference class
@@ -376,32 +402,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, (short)0x0123, (short)0x0123);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, (short)0x0123, (short)0x0123);
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, (short)0x0123);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, (short)0x0123, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, (short)0x0123, (short)0x0123);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(recv, (short)0x0123, (short)0x0123, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -582,6 +582,64 @@
short x = (short) vh.getAndSet(recv, (short)0x0123, Void.class);
});
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ short x = (short) vh.getAndSetAcquire(null, (short)0x0123);
+ });
+ checkCCE(() -> { // receiver reference class
+ short x = (short) vh.getAndSetAcquire(Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndSetAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ short x = (short) vh.getAndSetAcquire(0, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(recv, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(recv, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndSetAcquire(recv, (short)0x0123, Void.class);
+ });
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ short x = (short) vh.getAndSetRelease(null, (short)0x0123);
+ });
+ checkCCE(() -> { // receiver reference class
+ short x = (short) vh.getAndSetRelease(Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndSetRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ short x = (short) vh.getAndSetRelease(0, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(recv, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(recv, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndSetRelease(recv, (short)0x0123, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -611,34 +669,331 @@
short x = (short) vh.getAndAdd(recv, (short)0x0123, Void.class);
});
-
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
- short x = (short) vh.addAndGet(null, (short)0x0123);
+ short x = (short) vh.getAndAddAcquire(null, (short)0x0123);
+ });
+ checkCCE(() -> { // receiver reference class
+ short x = (short) vh.getAndAddAcquire(Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndAddAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ short x = (short) vh.getAndAddAcquire(0, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire(recv, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire(recv, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndAddAcquire(recv, (short)0x0123, Void.class);
+ });
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ short x = (short) vh.getAndAddRelease(null, (short)0x0123);
+ });
+ checkCCE(() -> { // receiver reference class
+ short x = (short) vh.getAndAddRelease(Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndAddRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ short x = (short) vh.getAndAddRelease(0, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(recv, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(recv, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndAddRelease(recv, (short)0x0123, Void.class);
+ });
+
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ short x = (short) vh.getAndBitwiseOr(null, (short)0x0123);
});
checkCCE(() -> { // receiver reference class
- short x = (short) vh.addAndGet(Void.class, (short)0x0123);
+ short x = (short) vh.getAndBitwiseOr(Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseOr(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ short x = (short) vh.getAndBitwiseOr(0, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(recv, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(recv, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseOr(recv, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ short x = (short) vh.getAndBitwiseOrAcquire(null, (short)0x0123);
+ });
+ checkCCE(() -> { // receiver reference class
+ short x = (short) vh.getAndBitwiseOrAcquire(Void.class, (short)0x0123);
});
checkWMTE(() -> { // value reference class
- short x = (short) vh.addAndGet(recv, Void.class);
+ short x = (short) vh.getAndBitwiseOrAcquire(recv, Void.class);
});
checkWMTE(() -> { // reciever primitive class
- short x = (short) vh.addAndGet(0, (short)0x0123);
+ short x = (short) vh.getAndBitwiseOrAcquire(0, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(recv, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(recv, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseOrAcquire(recv, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseOrRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ short x = (short) vh.getAndBitwiseOrRelease(null, (short)0x0123);
+ });
+ checkCCE(() -> { // receiver reference class
+ short x = (short) vh.getAndBitwiseOr(Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseOr(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ short x = (short) vh.getAndBitwiseOr(0, (short)0x0123);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(recv, (short)0x0123);
+ Void r = (Void) vh.getAndBitwiseOr(recv, (short)0x0123);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(recv, (short)0x0123);
+ boolean x = (boolean) vh.getAndBitwiseOr(recv, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseOr(recv, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ short x = (short) vh.getAndBitwiseAnd(null, (short)0x0123);
+ });
+ checkCCE(() -> { // receiver reference class
+ short x = (short) vh.getAndBitwiseAnd(Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseAnd(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ short x = (short) vh.getAndBitwiseAnd(0, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(recv, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(recv, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseAnd(recv, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ short x = (short) vh.getAndBitwiseAndAcquire(null, (short)0x0123);
+ });
+ checkCCE(() -> { // receiver reference class
+ short x = (short) vh.getAndBitwiseAndAcquire(Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseAndAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ short x = (short) vh.getAndBitwiseAndAcquire(0, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(recv, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(recv, (short)0x0123);
});
// Incorrect arity
checkWMTE(() -> { // 0
- short x = (short) vh.addAndGet();
+ short x = (short) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseAndAcquire(recv, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseAndRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ short x = (short) vh.getAndBitwiseAndRelease(null, (short)0x0123);
+ });
+ checkCCE(() -> { // receiver reference class
+ short x = (short) vh.getAndBitwiseAnd(Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseAnd(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ short x = (short) vh.getAndBitwiseAnd(0, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(recv, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(recv, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseAnd();
});
checkWMTE(() -> { // >
- short x = (short) vh.addAndGet(recv, (short)0x0123, Void.class);
+ short x = (short) vh.getAndBitwiseAnd(recv, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ short x = (short) vh.getAndBitwiseXor(null, (short)0x0123);
+ });
+ checkCCE(() -> { // receiver reference class
+ short x = (short) vh.getAndBitwiseXor(Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseXor(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ short x = (short) vh.getAndBitwiseXor(0, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(recv, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(recv, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseXor(recv, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ short x = (short) vh.getAndBitwiseXorAcquire(null, (short)0x0123);
+ });
+ checkCCE(() -> { // receiver reference class
+ short x = (short) vh.getAndBitwiseXorAcquire(Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseXorAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ short x = (short) vh.getAndBitwiseXorAcquire(0, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(recv, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(recv, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseXorAcquire(recv, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseXorRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ short x = (short) vh.getAndBitwiseXorRelease(null, (short)0x0123);
+ });
+ checkCCE(() -> { // receiver reference class
+ short x = (short) vh.getAndBitwiseXor(Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseXor(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ short x = (short) vh.getAndBitwiseXor(0, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(recv, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(recv, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseXor(recv, (short)0x0123, Void.class);
});
}
@@ -853,6 +1208,43 @@
invokeExact(recv, (short)0x0123, Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkNPE(() -> { // null receiver
+ short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class, short.class)).
+ invokeExact((VarHandleTestMethodTypeShort) null, (short)0x0123);
+ });
+ hs.checkWMTEOrCCE(() -> { // receiver reference class
+ short x = (short) hs.get(am, methodType(short.class, Class.class, short.class)).
+ invokeExact(Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class, Class.class)).
+ invokeExact(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ short x = (short) hs.get(am, methodType(short.class, int.class, short.class)).
+ invokeExact(0, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeShort.class, short.class)).
+ invokeExact(recv, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeShort.class, short.class)).
+ invokeExact(recv, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) hs.get(am, methodType(short.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class, short.class)).
+ invokeExact(recv, (short)0x0123, Void.class);
+ });
+ }
}
@@ -986,6 +1378,23 @@
// WeakCompareAndSet
// Incorrect argument types
checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain((short)0x0123, Void.class);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain((short)0x0123, (short)0x0123, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkWMTE(() -> { // expected reference class
boolean r = vh.weakCompareAndSet(Void.class, (short)0x0123);
});
checkWMTE(() -> { // actual reference class
@@ -1000,23 +1409,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, (short)0x0123);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile((short)0x0123, Void.class);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile((short)0x0123, (short)0x0123, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkWMTE(() -> { // expected reference class
@@ -1143,6 +1535,48 @@
short x = (short) vh.getAndSet((short)0x0123, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndSetAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire((short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire((short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndSetAcquire((short)0x0123, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndSetRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease((short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease((short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndSetRelease((short)0x0123, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkWMTE(() -> { // value reference class
@@ -1164,24 +1598,233 @@
});
- // AddAndGet
+ // GetAndAddAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndAddAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire((short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire((short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndAddAcquire((short)0x0123, Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndAddRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease((short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease((short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndAddRelease((short)0x0123, Void.class);
+ });
+
+ // GetAndBitwiseOr
// Incorrect argument types
checkWMTE(() -> { // value reference class
- short x = (short) vh.addAndGet(Void.class);
+ short x = (short) vh.getAndBitwiseOr(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr((short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr((short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseOr((short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseOrAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire((short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire((short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseOrAcquire((short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseOrReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseOrRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrRelease((short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrRelease((short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseOrRelease();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseOrRelease((short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseAnd(Void.class);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet((short)0x0123);
+ Void r = (Void) vh.getAndBitwiseAnd((short)0x0123);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet((short)0x0123);
+ boolean x = (boolean) vh.getAndBitwiseAnd((short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseAnd((short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseAndAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire((short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire((short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseAndAcquire((short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseAndReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseAndRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndRelease((short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease((short)0x0123);
});
// Incorrect arity
checkWMTE(() -> { // 0
- short x = (short) vh.addAndGet();
+ short x = (short) vh.getAndBitwiseAndRelease();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseAndRelease((short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseXor(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor((short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor((short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseXor();
});
checkWMTE(() -> { // >
- short x = (short) vh.addAndGet((short)0x0123, Void.class);
+ short x = (short) vh.getAndBitwiseXor((short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseXorAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire((short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire((short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseXorAcquire((short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseXorReleaseRelease
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseXorRelease(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorRelease((short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease((short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseXorRelease();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseXorRelease((short)0x0123, Void.class);
});
}
@@ -1322,6 +1965,32 @@
invokeExact((short)0x0123, Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ // Incorrect argument types
+ checkWMTE(() -> { // value reference class
+ short x = (short) hs.get(am, methodType(short.class, Class.class)).
+ invokeExact(Void.class);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, short.class)).
+ invokeExact((short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, short.class)).
+ invokeExact((short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) hs.get(am, methodType(short.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) hs.get(am, methodType(short.class, short.class, Class.class)).
+ invokeExact((short)0x0123, Void.class);
+ });
+ }
}
@@ -1585,6 +2254,35 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, 0, (short)0x0123, (short)0x0123);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 0, (short)0x0123, (short)0x0123);
+ });
+ checkWMTE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, Void.class, (short)0x0123);
+ });
+ checkWMTE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, (short)0x0123, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, 0, (short)0x0123, (short)0x0123);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean r = vh.weakCompareAndSetPlain(array, Void.class, (short)0x0123, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(array, 0, (short)0x0123, (short)0x0123, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, 0, (short)0x0123, (short)0x0123);
});
checkCCE(() -> { // receiver reference class
@@ -1611,35 +2309,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 0, (short)0x0123, (short)0x0123);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, (short)0x0123, (short)0x0123);
- });
- checkWMTE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, (short)0x0123);
- });
- checkWMTE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, (short)0x0123, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 0, (short)0x0123, (short)0x0123);
- });
- checkWMTE(() -> { // index reference class
- boolean r = vh.weakCompareAndSetVolatile(array, Void.class, (short)0x0123, (short)0x0123);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(array, 0, (short)0x0123, (short)0x0123, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -1838,6 +2507,72 @@
short x = (short) vh.getAndSet(array, 0, (short)0x0123, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ short x = (short) vh.getAndSetAcquire(null, 0, (short)0x0123);
+ });
+ checkCCE(() -> { // array reference class
+ short x = (short) vh.getAndSetAcquire(Void.class, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndSetAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ short x = (short) vh.getAndSetAcquire(0, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // index reference class
+ short x = (short) vh.getAndSetAcquire(array, Void.class, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(array, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(array, 0, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndSetAcquire(array, 0, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ short x = (short) vh.getAndSetRelease(null, 0, (short)0x0123);
+ });
+ checkCCE(() -> { // array reference class
+ short x = (short) vh.getAndSetRelease(Void.class, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndSetRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ short x = (short) vh.getAndSetRelease(0, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // index reference class
+ short x = (short) vh.getAndSetRelease(array, Void.class, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(array, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(array, 0, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndSetRelease(array, 0, (short)0x0123, Void.class);
+ });
+
// GetAndAdd
// Incorrect argument types
checkNPE(() -> { // null array
@@ -1871,36 +2606,365 @@
});
- // AddAndGet
+ // GetAndAddAcquire
// Incorrect argument types
checkNPE(() -> { // null array
- short x = (short) vh.addAndGet(null, 0, (short)0x0123);
+ short x = (short) vh.getAndAddAcquire(null, 0, (short)0x0123);
+ });
+ checkCCE(() -> { // array reference class
+ short x = (short) vh.getAndAddAcquire(Void.class, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndAddAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ short x = (short) vh.getAndAddAcquire(0, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // index reference class
+ short x = (short) vh.getAndAddAcquire(array, Void.class, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire(array, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddAcquire(array, 0, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndAddAcquire(array, 0, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ short x = (short) vh.getAndAddRelease(null, 0, (short)0x0123);
+ });
+ checkCCE(() -> { // array reference class
+ short x = (short) vh.getAndAddRelease(Void.class, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndAddRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ short x = (short) vh.getAndAddRelease(0, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // index reference class
+ short x = (short) vh.getAndAddRelease(array, Void.class, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(array, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndAddRelease(array, 0, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndAddRelease(array, 0, (short)0x0123, Void.class);
+ });
+
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ short x = (short) vh.getAndBitwiseOr(null, 0, (short)0x0123);
});
checkCCE(() -> { // array reference class
- short x = (short) vh.addAndGet(Void.class, 0, (short)0x0123);
+ short x = (short) vh.getAndBitwiseOr(Void.class, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseOr(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ short x = (short) vh.getAndBitwiseOr(0, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // index reference class
+ short x = (short) vh.getAndBitwiseOr(array, Void.class, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(array, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOr(array, 0, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseOr(array, 0, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ short x = (short) vh.getAndBitwiseOrAcquire(null, 0, (short)0x0123);
+ });
+ checkCCE(() -> { // array reference class
+ short x = (short) vh.getAndBitwiseOrAcquire(Void.class, 0, (short)0x0123);
});
checkWMTE(() -> { // value reference class
- short x = (short) vh.addAndGet(array, 0, Void.class);
+ short x = (short) vh.getAndBitwiseOrAcquire(array, 0, Void.class);
});
checkWMTE(() -> { // array primitive class
- short x = (short) vh.addAndGet(0, 0, (short)0x0123);
+ short x = (short) vh.getAndBitwiseOrAcquire(0, 0, (short)0x0123);
});
checkWMTE(() -> { // index reference class
- short x = (short) vh.addAndGet(array, Void.class, (short)0x0123);
+ short x = (short) vh.getAndBitwiseOrAcquire(array, Void.class, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(array, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseOrAcquire(array, 0, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseOrAcquire(array, 0, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseOrRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ short x = (short) vh.getAndBitwiseOrRelease(null, 0, (short)0x0123);
+ });
+ checkCCE(() -> { // array reference class
+ short x = (short) vh.getAndBitwiseOrRelease(Void.class, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseOrRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ short x = (short) vh.getAndBitwiseOrRelease(0, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // index reference class
+ short x = (short) vh.getAndBitwiseOrRelease(array, Void.class, (short)0x0123);
});
// Incorrect return type
checkWMTE(() -> { // reference class
- Void r = (Void) vh.addAndGet(array, 0, (short)0x0123);
+ Void r = (Void) vh.getAndBitwiseOrRelease(array, 0, (short)0x0123);
});
checkWMTE(() -> { // primitive class
- boolean x = (boolean) vh.addAndGet(array, 0, (short)0x0123);
+ boolean x = (boolean) vh.getAndBitwiseOrRelease(array, 0, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseOrRelease();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseOrRelease(array, 0, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ short x = (short) vh.getAndBitwiseAnd(null, 0, (short)0x0123);
+ });
+ checkCCE(() -> { // array reference class
+ short x = (short) vh.getAndBitwiseAnd(Void.class, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseAnd(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ short x = (short) vh.getAndBitwiseAnd(0, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // index reference class
+ short x = (short) vh.getAndBitwiseAnd(array, Void.class, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(array, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAnd(array, 0, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseAnd(array, 0, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ short x = (short) vh.getAndBitwiseAndAcquire(null, 0, (short)0x0123);
+ });
+ checkCCE(() -> { // array reference class
+ short x = (short) vh.getAndBitwiseAndAcquire(Void.class, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseAndAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ short x = (short) vh.getAndBitwiseAndAcquire(0, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // index reference class
+ short x = (short) vh.getAndBitwiseAndAcquire(array, Void.class, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(array, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndAcquire(array, 0, (short)0x0123);
});
// Incorrect arity
checkWMTE(() -> { // 0
- short x = (short) vh.addAndGet();
+ short x = (short) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseAndAcquire(array, 0, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseAndRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ short x = (short) vh.getAndBitwiseAndRelease(null, 0, (short)0x0123);
+ });
+ checkCCE(() -> { // array reference class
+ short x = (short) vh.getAndBitwiseAndRelease(Void.class, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseAndRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ short x = (short) vh.getAndBitwiseAndRelease(0, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // index reference class
+ short x = (short) vh.getAndBitwiseAndRelease(array, Void.class, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndRelease(array, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseAndRelease(array, 0, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseAndRelease();
});
checkWMTE(() -> { // >
- short x = (short) vh.addAndGet(array, 0, (short)0x0123, Void.class);
+ short x = (short) vh.getAndBitwiseAndRelease(array, 0, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ short x = (short) vh.getAndBitwiseXor(null, 0, (short)0x0123);
+ });
+ checkCCE(() -> { // array reference class
+ short x = (short) vh.getAndBitwiseXor(Void.class, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseXor(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ short x = (short) vh.getAndBitwiseXor(0, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // index reference class
+ short x = (short) vh.getAndBitwiseXor(array, Void.class, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(array, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXor(array, 0, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseXor(array, 0, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ short x = (short) vh.getAndBitwiseXorAcquire(null, 0, (short)0x0123);
+ });
+ checkCCE(() -> { // array reference class
+ short x = (short) vh.getAndBitwiseXorAcquire(Void.class, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseXorAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ short x = (short) vh.getAndBitwiseXorAcquire(0, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // index reference class
+ short x = (short) vh.getAndBitwiseXorAcquire(array, Void.class, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(array, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorAcquire(array, 0, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseXorAcquire(array, 0, (short)0x0123, Void.class);
+ });
+
+
+ // GetAndBitwiseXorRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ short x = (short) vh.getAndBitwiseXorRelease(null, 0, (short)0x0123);
+ });
+ checkCCE(() -> { // array reference class
+ short x = (short) vh.getAndBitwiseXorRelease(Void.class, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) vh.getAndBitwiseXorRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ short x = (short) vh.getAndBitwiseXorRelease(0, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // index reference class
+ short x = (short) vh.getAndBitwiseXorRelease(array, Void.class, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorRelease(array, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndBitwiseXorRelease(array, 0, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) vh.getAndBitwiseXorRelease();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) vh.getAndBitwiseXorRelease(array, 0, (short)0x0123, Void.class);
});
}
@@ -2144,6 +3208,48 @@
invokeExact(array, 0, (short)0x0123, Void.class);
});
}
+
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ short x = (short) hs.get(am, methodType(short.class, short[].class, int.class, short.class)).
+ invokeExact((short[]) null, 0, (short)0x0123);
+ });
+ hs.checkWMTEOrCCE(() -> { // array reference class
+ short x = (short) hs.get(am, methodType(short.class, Class.class, int.class, short.class)).
+ invokeExact(Void.class, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // value reference class
+ short x = (short) hs.get(am, methodType(short.class, short[].class, int.class, Class.class)).
+ invokeExact(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ short x = (short) hs.get(am, methodType(short.class, int.class, int.class, short.class)).
+ invokeExact(0, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // index reference class
+ short x = (short) hs.get(am, methodType(short.class, short[].class, Class.class, short.class)).
+ invokeExact(array, Void.class, (short)0x0123);
+ });
+ // Incorrect return type
+ checkWMTE(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, short[].class, int.class, short.class)).
+ invokeExact(array, 0, (short)0x0123);
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) hs.get(am, methodType(boolean.class, short[].class, int.class, short.class)).
+ invokeExact(array, 0, (short)0x0123);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ short x = (short) hs.get(am, methodType(short.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ short x = (short) hs.get(am, methodType(short.class, short[].class, int.class, short.class, Class.class)).
+ invokeExact(array, 0, (short)0x0123, Void.class);
+ });
+ }
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeString.java
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeString.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeString.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -353,6 +353,32 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, "foo", "foo");
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, "foo", "foo");
+ });
+ checkCCE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, Void.class, "foo");
+ });
+ checkCCE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, "foo", Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, "foo", "foo");
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(recv, "foo", "foo", Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, "foo", "foo");
});
checkCCE(() -> { // receiver reference class
@@ -376,32 +402,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, "foo", "foo");
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, "foo", "foo");
- });
- checkCCE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, "foo");
- });
- checkCCE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, "foo", Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, "foo", "foo");
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(recv, "foo", "foo", Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -582,6 +582,65 @@
String x = (String) vh.getAndSet(recv, "foo", Void.class);
});
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ String x = (String) vh.getAndSetAcquire(null, "foo");
+ });
+ checkCCE(() -> { // receiver reference class
+ String x = (String) vh.getAndSetAcquire(Void.class, "foo");
+ });
+ checkCCE(() -> { // value reference class
+ String x = (String) vh.getAndSetAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ String x = (String) vh.getAndSetAcquire(0, "foo");
+ });
+ // Incorrect return type
+ checkCCE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(recv, "foo");
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(recv, "foo");
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ String x = (String) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ String x = (String) vh.getAndSetAcquire(recv, "foo", Void.class);
+ });
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ String x = (String) vh.getAndSetRelease(null, "foo");
+ });
+ checkCCE(() -> { // receiver reference class
+ String x = (String) vh.getAndSetRelease(Void.class, "foo");
+ });
+ checkCCE(() -> { // value reference class
+ String x = (String) vh.getAndSetRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ String x = (String) vh.getAndSetRelease(0, "foo");
+ });
+ // Incorrect return type
+ checkCCE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(recv, "foo");
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(recv, "foo");
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ String x = (String) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ String x = (String) vh.getAndSetRelease(recv, "foo", Void.class);
+ });
+
+
}
static void testInstanceFieldWrongMethodType(VarHandleTestMethodTypeString recv, Handles hs) throws Throwable {
@@ -759,6 +818,7 @@
});
}
+
}
@@ -892,6 +952,23 @@
// WeakCompareAndSet
// Incorrect argument types
checkCCE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, "foo");
+ });
+ checkCCE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain("foo", Void.class);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain("foo", "foo", Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkCCE(() -> { // expected reference class
boolean r = vh.weakCompareAndSet(Void.class, "foo");
});
checkCCE(() -> { // actual reference class
@@ -906,23 +983,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkCCE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, "foo");
- });
- checkCCE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile("foo", Void.class);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile("foo", "foo", Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkCCE(() -> { // expected reference class
@@ -1049,6 +1109,49 @@
String x = (String) vh.getAndSet("foo", Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkCCE(() -> { // value reference class
+ String x = (String) vh.getAndSetAcquire(Void.class);
+ });
+ // Incorrect return type
+ checkCCE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire("foo");
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire("foo");
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ String x = (String) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ String x = (String) vh.getAndSetAcquire("foo", Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkCCE(() -> { // value reference class
+ String x = (String) vh.getAndSetRelease(Void.class);
+ });
+ // Incorrect return type
+ checkCCE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease("foo");
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease("foo");
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ String x = (String) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ String x = (String) vh.getAndSetRelease("foo", Void.class);
+ });
+
+
}
static void testStaticFieldWrongMethodType(Handles hs) throws Throwable {
@@ -1163,6 +1266,7 @@
});
}
+
}
@@ -1426,6 +1530,35 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, 0, "foo", "foo");
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 0, "foo", "foo");
+ });
+ checkCCE(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, Void.class, "foo");
+ });
+ checkCCE(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, "foo", Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, 0, "foo", "foo");
+ });
+ checkWMTE(() -> { // index reference class
+ boolean r = vh.weakCompareAndSetPlain(array, Void.class, "foo", "foo");
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(array, 0, "foo", "foo", Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, 0, "foo", "foo");
});
checkCCE(() -> { // receiver reference class
@@ -1452,35 +1585,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 0, "foo", "foo");
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, "foo", "foo");
- });
- checkCCE(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, "foo");
- });
- checkCCE(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, "foo", Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 0, "foo", "foo");
- });
- checkWMTE(() -> { // index reference class
- boolean r = vh.weakCompareAndSetVolatile(array, Void.class, "foo", "foo");
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(array, 0, "foo", "foo", Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -1679,6 +1783,73 @@
String x = (String) vh.getAndSet(array, 0, "foo", Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ String x = (String) vh.getAndSetAcquire(null, 0, "foo");
+ });
+ checkCCE(() -> { // array reference class
+ String x = (String) vh.getAndSetAcquire(Void.class, 0, "foo");
+ });
+ checkCCE(() -> { // value reference class
+ String x = (String) vh.getAndSetAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ String x = (String) vh.getAndSetAcquire(0, 0, "foo");
+ });
+ checkWMTE(() -> { // index reference class
+ String x = (String) vh.getAndSetAcquire(array, Void.class, "foo");
+ });
+ // Incorrect return type
+ checkCCE(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(array, 0, "foo");
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetAcquire(array, 0, "foo");
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ String x = (String) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ String x = (String) vh.getAndSetAcquire(array, 0, "foo", Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ String x = (String) vh.getAndSetRelease(null, 0, "foo");
+ });
+ checkCCE(() -> { // array reference class
+ String x = (String) vh.getAndSetRelease(Void.class, 0, "foo");
+ });
+ checkCCE(() -> { // value reference class
+ String x = (String) vh.getAndSetRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ String x = (String) vh.getAndSetRelease(0, 0, "foo");
+ });
+ checkWMTE(() -> { // index reference class
+ String x = (String) vh.getAndSetRelease(array, Void.class, "foo");
+ });
+ // Incorrect return type
+ checkCCE(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(array, 0, "foo");
+ });
+ checkWMTE(() -> { // primitive class
+ boolean x = (boolean) vh.getAndSetRelease(array, 0, "foo");
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ String x = (String) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ String x = (String) vh.getAndSetRelease(array, 0, "foo", Void.class);
+ });
+
+
}
static void testArrayWrongMethodType(Handles hs) throws Throwable {
@@ -1880,6 +2051,7 @@
});
}
+
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestAccess.java.template
--- a/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestAccess.java.template Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestAccess.java.template Fri Sep 02 02:41:37 2016 +0000
@@ -104,30 +104,58 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
#else[CAS]
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
#end[CAS]
#if[AtomicAdd]
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
#else[AtomicAdd]
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
#end[AtomicAdd]
+
+#if[Bitwise]
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
+#else[Bitwise]
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
+#end[Bitwise]
}
@@ -295,11 +323,11 @@
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSet(recv, $value1$, $value2$);
+ boolean r = vh.weakCompareAndSetPlain(recv, $value1$, $value2$);
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(recv, $value1$, $value2$);
+ boolean r = vh.weakCompareAndSet(recv, $value1$, $value2$);
});
checkUOE(() -> {
@@ -313,6 +341,14 @@
checkUOE(() -> {
$type$ r = ($type$) vh.getAndSet(recv, $value1$);
});
+
+ checkUOE(() -> {
+ $type$ r = ($type$) vh.getAndSetAcquire(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ r = ($type$) vh.getAndSetRelease(recv, $value1$);
+ });
#end[CAS]
#if[!AtomicAdd]
@@ -321,9 +357,51 @@
});
checkUOE(() -> {
- $type$ o = ($type$) vh.addAndGet(recv, $value1$);
+ $type$ o = ($type$) vh.getAndAddAcquire(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndAddRelease(recv, $value1$);
});
#end[AtomicAdd]
+
+#if[!Bitwise]
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOr(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAnd(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXor(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(recv, $value1$);
+ });
+#end[Bitwise]
}
@@ -389,11 +467,11 @@
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSet($value1$, $value2$);
+ boolean r = vh.weakCompareAndSetPlain($value1$, $value2$);
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSetVolatile($value1$, $value2$);
+ boolean r = vh.weakCompareAndSet($value1$, $value2$);
});
checkUOE(() -> {
@@ -407,6 +485,14 @@
checkUOE(() -> {
$type$ r = ($type$) vh.getAndSet($value1$);
});
+
+ checkUOE(() -> {
+ $type$ r = ($type$) vh.getAndSetAcquire($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ r = ($type$) vh.getAndSetRelease($value1$);
+ });
#end[CAS]
#if[!AtomicAdd]
@@ -415,9 +501,51 @@
});
checkUOE(() -> {
- $type$ o = ($type$) vh.addAndGet($value1$);
+ $type$ o = ($type$) vh.getAndAddAcquire($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndAddRelease($value1$);
});
#end[AtomicAdd]
+
+#if[!Bitwise]
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOr($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAnd($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXor($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease($value1$);
+ });
+#end[Bitwise]
}
@@ -514,11 +642,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(recv, $value1$, $value2$);
+ success = vh.weakCompareAndSetPlain(recv, $value1$, $value2$);
}
- assertEquals(success, true, "weakCompareAndSet $type$");
+ assertEquals(success, true, "weakCompareAndSetPlain $type$");
$type$ x = ($type$) vh.get(recv);
- assertEquals(x, $value2$, "weakCompareAndSet $type$ value");
+ assertEquals(x, $value2$, "weakCompareAndSetPlain $type$ value");
}
{
@@ -544,33 +672,157 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(recv, $value2$, $value1$);
+ success = vh.weakCompareAndSet(recv, $value2$, $value1$);
}
- assertEquals(success, true, "weakCompareAndSetVolatile $type$");
+ assertEquals(success, true, "weakCompareAndSet $type$");
$type$ x = ($type$) vh.get(recv);
- assertEquals(x, $value1$, "weakCompareAndSetVolatile $type$ value");
+ assertEquals(x, $value1$, "weakCompareAndSet $type$ value");
}
// Compare set and get
{
+ vh.set(recv, $value1$);
+
$type$ o = ($type$) vh.getAndSet(recv, $value2$);
assertEquals(o, $value1$, "getAndSet $type$");
$type$ x = ($type$) vh.get(recv);
assertEquals(x, $value2$, "getAndSet $type$ value");
}
+
+ {
+ vh.set(recv, $value1$);
+
+ $type$ o = ($type$) vh.getAndSetAcquire(recv, $value2$);
+ assertEquals(o, $value1$, "getAndSetAcquire $type$");
+ $type$ x = ($type$) vh.get(recv);
+ assertEquals(x, $value2$, "getAndSetAcquire $type$ value");
+ }
+
+ {
+ vh.set(recv, $value1$);
+
+ $type$ o = ($type$) vh.getAndSetRelease(recv, $value2$);
+ assertEquals(o, $value1$, "getAndSetRelease $type$");
+ $type$ x = ($type$) vh.get(recv);
+ assertEquals(x, $value2$, "getAndSetRelease $type$ value");
+ }
#end[CAS]
#if[AtomicAdd]
- vh.set(recv, $value1$);
-
// get and add, add and get
{
- $type$ o = ($type$) vh.getAndAdd(recv, $value3$);
+ vh.set(recv, $value1$);
+
+ $type$ o = ($type$) vh.getAndAdd(recv, $value2$);
assertEquals(o, $value1$, "getAndAdd $type$");
- $type$ c = ($type$) vh.addAndGet(recv, $value3$);
- assertEquals(c, ($type$)($value1$ + $value3$ + $value3$), "getAndAdd $type$ value");
+ $type$ x = ($type$) vh.get(recv);
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAdd $type$ value");
+ }
+
+ {
+ vh.set(recv, $value1$);
+
+ $type$ o = ($type$) vh.getAndAddAcquire(recv, $value2$);
+ assertEquals(o, $value1$, "getAndAddAcquire $type$");
+ $type$ x = ($type$) vh.get(recv);
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAddAcquire $type$ value");
+ }
+
+ {
+ vh.set(recv, $value1$);
+
+ $type$ o = ($type$) vh.getAndAddRelease(recv, $value2$);
+ assertEquals(o, $value1$, "getAndAddRelease$type$");
+ $type$ x = ($type$) vh.get(recv);
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAddRelease $type$ value");
}
#end[AtomicAdd]
+
+#if[Bitwise]
+ // get and bitwise or
+ {
+ vh.set(recv, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseOr(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOr $type$");
+ $type$ x = ($type$) vh.get(recv);
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOr $type$ value");
+ }
+
+ {
+ vh.set(recv, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOrAcquire $type$");
+ $type$ x = ($type$) vh.get(recv);
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOrAcquire $type$ value");
+ }
+
+ {
+ vh.set(recv, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOrRelease $type$");
+ $type$ x = ($type$) vh.get(recv);
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOrRelease $type$ value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(recv, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseAnd(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAnd $type$");
+ $type$ x = ($type$) vh.get(recv);
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAnd $type$ value");
+ }
+
+ {
+ vh.set(recv, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAndAcquire $type$");
+ $type$ x = ($type$) vh.get(recv);
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAndAcquire $type$ value");
+ }
+
+ {
+ vh.set(recv, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAndRelease $type$");
+ $type$ x = ($type$) vh.get(recv);
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAndRelease $type$ value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(recv, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseXor(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXor $type$");
+ $type$ x = ($type$) vh.get(recv);
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXor $type$ value");
+ }
+
+ {
+ vh.set(recv, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXorAcquire $type$");
+ $type$ x = ($type$) vh.get(recv);
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXorAcquire $type$ value");
+ }
+
+ {
+ vh.set(recv, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXorRelease $type$");
+ $type$ x = ($type$) vh.get(recv);
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXorRelease $type$ value");
+ }
+#end[Bitwise]
}
static void testInstanceFieldUnsupported(VarHandleTestAccess$Type$ recv, VarHandle vh) {
@@ -592,11 +844,11 @@
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSet(recv, $value1$, $value2$);
+ boolean r = vh.weakCompareAndSetPlain(recv, $value1$, $value2$);
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(recv, $value1$, $value2$);
+ boolean r = vh.weakCompareAndSet(recv, $value1$, $value2$);
});
checkUOE(() -> {
@@ -610,6 +862,14 @@
checkUOE(() -> {
$type$ r = ($type$) vh.getAndSet(recv, $value1$);
});
+
+ checkUOE(() -> {
+ $type$ r = ($type$) vh.getAndSetAcquire(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ r = ($type$) vh.getAndSetRelease(recv, $value1$);
+ });
#end[CAS]
#if[!AtomicAdd]
@@ -618,9 +878,51 @@
});
checkUOE(() -> {
- $type$ o = ($type$) vh.addAndGet(recv, $value1$);
+ $type$ o = ($type$) vh.getAndAddAcquire(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndAddRelease(recv, $value1$);
});
#end[AtomicAdd]
+
+#if[!Bitwise]
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOr(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAnd(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXor(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(recv, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(recv, $value1$);
+ });
+#end[Bitwise]
}
@@ -717,11 +1019,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet($value1$, $value2$);
+ success = vh.weakCompareAndSetPlain($value1$, $value2$);
}
- assertEquals(success, true, "weakCompareAndSet $type$");
+ assertEquals(success, true, "weakCompareAndSetPlain $type$");
$type$ x = ($type$) vh.get();
- assertEquals(x, $value2$, "weakCompareAndSet $type$ value");
+ assertEquals(x, $value2$, "weakCompareAndSetPlain $type$ value");
}
{
@@ -747,33 +1049,157 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetRelease($value2$, $value1$);
+ success = vh.weakCompareAndSet($value2$, $value1$);
}
- assertEquals(success, true, "weakCompareAndSetVolatile $type$");
+ assertEquals(success, true, "weakCompareAndSet $type$");
$type$ x = ($type$) vh.get();
- assertEquals(x, $value1$, "weakCompareAndSetVolatile $type$");
+ assertEquals(x, $value1$, "weakCompareAndSet $type$");
}
// Compare set and get
{
+ vh.set($value1$);
+
$type$ o = ($type$) vh.getAndSet($value2$);
assertEquals(o, $value1$, "getAndSet $type$");
$type$ x = ($type$) vh.get();
assertEquals(x, $value2$, "getAndSet $type$ value");
}
+
+ {
+ vh.set($value1$);
+
+ $type$ o = ($type$) vh.getAndSetAcquire($value2$);
+ assertEquals(o, $value1$, "getAndSetAcquire $type$");
+ $type$ x = ($type$) vh.get();
+ assertEquals(x, $value2$, "getAndSetAcquire $type$ value");
+ }
+
+ {
+ vh.set($value1$);
+
+ $type$ o = ($type$) vh.getAndSetRelease($value2$);
+ assertEquals(o, $value1$, "getAndSetRelease $type$");
+ $type$ x = ($type$) vh.get();
+ assertEquals(x, $value2$, "getAndSetRelease $type$ value");
+ }
#end[CAS]
#if[AtomicAdd]
- vh.set($value1$);
-
// get and add, add and get
{
- $type$ o = ($type$) vh.getAndAdd( $value3$);
+ vh.set($value1$);
+
+ $type$ o = ($type$) vh.getAndAdd($value2$);
assertEquals(o, $value1$, "getAndAdd $type$");
- $type$ c = ($type$) vh.addAndGet($value3$);
- assertEquals(c, ($type$)($value1$ + $value3$ + $value3$), "getAndAdd $type$ value");
+ $type$ x = ($type$) vh.get();
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAdd $type$ value");
+ }
+
+ {
+ vh.set($value1$);
+
+ $type$ o = ($type$) vh.getAndAddAcquire($value2$);
+ assertEquals(o, $value1$, "getAndAddAcquire $type$");
+ $type$ x = ($type$) vh.get();
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAddAcquire $type$ value");
+ }
+
+ {
+ vh.set($value1$);
+
+ $type$ o = ($type$) vh.getAndAddRelease($value2$);
+ assertEquals(o, $value1$, "getAndAddRelease$type$");
+ $type$ x = ($type$) vh.get();
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAddRelease $type$ value");
}
#end[AtomicAdd]
+
+#if[Bitwise]
+ // get and bitwise or
+ {
+ vh.set($value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseOr($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOr $type$");
+ $type$ x = ($type$) vh.get();
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOr $type$ value");
+ }
+
+ {
+ vh.set($value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOrAcquire $type$");
+ $type$ x = ($type$) vh.get();
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOrAcquire $type$ value");
+ }
+
+ {
+ vh.set($value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOrRelease $type$");
+ $type$ x = ($type$) vh.get();
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOrRelease $type$ value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set($value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseAnd($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAnd $type$");
+ $type$ x = ($type$) vh.get();
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAnd $type$ value");
+ }
+
+ {
+ vh.set($value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAndAcquire $type$");
+ $type$ x = ($type$) vh.get();
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAndAcquire $type$ value");
+ }
+
+ {
+ vh.set($value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAndRelease $type$");
+ $type$ x = ($type$) vh.get();
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAndRelease $type$ value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set($value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseXor($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXor $type$");
+ $type$ x = ($type$) vh.get();
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXor $type$ value");
+ }
+
+ {
+ vh.set($value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXorAcquire $type$");
+ $type$ x = ($type$) vh.get();
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXorAcquire $type$ value");
+ }
+
+ {
+ vh.set($value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXorRelease $type$");
+ $type$ x = ($type$) vh.get();
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXorRelease $type$ value");
+ }
+#end[Bitwise]
}
static void testStaticFieldUnsupported(VarHandle vh) {
@@ -795,11 +1221,11 @@
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSet($value1$, $value2$);
+ boolean r = vh.weakCompareAndSetPlain($value1$, $value2$);
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSetVolatile($value1$, $value2$);
+ boolean r = vh.weakCompareAndSet($value1$, $value2$);
});
checkUOE(() -> {
@@ -813,6 +1239,14 @@
checkUOE(() -> {
$type$ r = ($type$) vh.getAndSet($value1$);
});
+
+ checkUOE(() -> {
+ $type$ r = ($type$) vh.getAndSetAcquire($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ r = ($type$) vh.getAndSetRelease($value1$);
+ });
#end[CAS]
#if[!AtomicAdd]
@@ -821,9 +1255,51 @@
});
checkUOE(() -> {
- $type$ o = ($type$) vh.addAndGet($value1$);
+ $type$ o = ($type$) vh.getAndAddAcquire($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndAddRelease($value1$);
});
#end[AtomicAdd]
+
+#if[!Bitwise]
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOr($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAnd($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXor($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire($value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease($value1$);
+ });
+#end[Bitwise]
}
@@ -923,11 +1399,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, $value1$, $value2$);
+ success = vh.weakCompareAndSetPlain(array, i, $value1$, $value2$);
}
- assertEquals(success, true, "weakCompareAndSet $type$");
+ assertEquals(success, true, "weakCompareAndSetPlain $type$");
$type$ x = ($type$) vh.get(array, i);
- assertEquals(x, $value2$, "weakCompareAndSet $type$ value");
+ assertEquals(x, $value2$, "weakCompareAndSetPlain $type$ value");
}
{
@@ -953,33 +1429,157 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSetVolatile(array, i, $value2$, $value1$);
+ success = vh.weakCompareAndSet(array, i, $value2$, $value1$);
}
- assertEquals(success, true, "weakCompareAndSetVolatile $type$");
+ assertEquals(success, true, "weakCompareAndSet $type$");
$type$ x = ($type$) vh.get(array, i);
- assertEquals(x, $value1$, "weakCompareAndSetVolatile $type$");
+ assertEquals(x, $value1$, "weakCompareAndSet $type$");
}
// Compare set and get
{
+ vh.set(array, i, $value1$);
+
$type$ o = ($type$) vh.getAndSet(array, i, $value2$);
assertEquals(o, $value1$, "getAndSet $type$");
$type$ x = ($type$) vh.get(array, i);
assertEquals(x, $value2$, "getAndSet $type$ value");
}
+
+ {
+ vh.set(array, i, $value1$);
+
+ $type$ o = ($type$) vh.getAndSetAcquire(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndSetAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, $value2$, "getAndSetAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, $value1$);
+
+ $type$ o = ($type$) vh.getAndSetRelease(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndSetRelease $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, $value2$, "getAndSetRelease $type$ value");
+ }
#end[CAS]
#if[AtomicAdd]
- vh.set(array, i, $value1$);
-
// get and add, add and get
{
- $type$ o = ($type$) vh.getAndAdd(array, i, $value3$);
+ vh.set(array, i, $value1$);
+
+ $type$ o = ($type$) vh.getAndAdd(array, i, $value2$);
assertEquals(o, $value1$, "getAndAdd $type$");
- $type$ c = ($type$) vh.addAndGet(array, i, $value3$);
- assertEquals(c, ($type$)($value1$ + $value3$ + $value3$), "getAndAdd $type$ value");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAdd $type$ value");
+ }
+
+ {
+ vh.set(array, i, $value1$);
+
+ $type$ o = ($type$) vh.getAndAddAcquire(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndAddAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAddAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, $value1$);
+
+ $type$ o = ($type$) vh.getAndAddRelease(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndAddRelease$type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAddRelease $type$ value");
}
#end[AtomicAdd]
+
+#if[Bitwise]
+ // get and bitwise or
+ {
+ vh.set(array, i, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseOr(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOr $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOr $type$ value");
+ }
+
+ {
+ vh.set(array, i, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOrAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOrAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOrRelease $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOrRelease $type$ value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(array, i, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseAnd(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAnd $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAnd $type$ value");
+ }
+
+ {
+ vh.set(array, i, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAndAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAndAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAndRelease $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAndRelease $type$ value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(array, i, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseXor(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXor $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXor $type$ value");
+ }
+
+ {
+ vh.set(array, i, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXorAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXorAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, $value1$);
+
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXorRelease $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXorRelease $type$ value");
+ }
+#end[Bitwise]
}
}
@@ -1005,11 +1605,11 @@
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSet(array, i, $value1$, $value2$);
+ boolean r = vh.weakCompareAndSetPlain(array, i, $value1$, $value2$);
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, i, $value1$, $value2$);
+ boolean r = vh.weakCompareAndSet(array, i, $value1$, $value2$);
});
checkUOE(() -> {
@@ -1023,6 +1623,14 @@
checkUOE(() -> {
$type$ r = ($type$) vh.getAndSet(array, i, $value1$);
});
+
+ checkUOE(() -> {
+ $type$ r = ($type$) vh.getAndSetAcquire(array, i, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ r = ($type$) vh.getAndSetRelease(array, i, $value1$);
+ });
#end[CAS]
#if[!AtomicAdd]
@@ -1031,9 +1639,51 @@
});
checkUOE(() -> {
- $type$ o = ($type$) vh.addAndGet(array, i, $value1$);
+ $type$ o = ($type$) vh.getAndAddAcquire(array, i, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndAddRelease(array, i, $value1$);
});
#end[AtomicAdd]
+
+#if[!Bitwise]
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOr(array, i, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(array, i, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(array, i, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAnd(array, i, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(array, i, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(array, i, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXor(array, i, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(array, i, $value1$);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(array, i, $value1$);
+ });
+#end[Bitwise]
}
static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
@@ -1092,11 +1742,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, $value1$, $value2$);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, $value1$, $value2$);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, $value1$, $value2$);
+ boolean r = vh.weakCompareAndSet(array, ci, $value1$, $value2$);
});
checkIOOBE(() -> {
@@ -1110,17 +1760,67 @@
checkIOOBE(() -> {
$type$ o = ($type$) vh.getAndSet(array, ci, $value1$);
});
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndSetAcquire(array, ci, $value1$);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndSetRelease(array, ci, $value1$);
+ });
#end[CAS]
#if[AtomicAdd]
checkIOOBE(() -> {
- $type$ o = ($type$) vh.getAndAdd(array, ci, $value3$);
+ $type$ o = ($type$) vh.getAndAdd(array, ci, $value1$);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndAddAcquire(array, ci, $value1$);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndAddRelease(array, ci, $value1$);
+ });
+#end[AtomicAdd]
+
+#if[Bitwise]
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOr(array, ci, $value1$);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(array, ci, $value1$);
});
checkIOOBE(() -> {
- $type$ o = ($type$) vh.addAndGet(array, ci, $value3$);
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(array, ci, $value1$);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAnd(array, ci, $value1$);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(array, ci, $value1$);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(array, ci, $value1$);
});
-#end[AtomicAdd]
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXor(array, ci, $value1$);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(array, ci, $value1$);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(array, ci, $value1$);
+ });
+#end[Bitwise]
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestByteArrayView.java.template
--- a/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestByteArrayView.java.template Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestByteArrayView.java.template Fri Sep 02 02:41:37 2016 +0000
@@ -93,30 +93,58 @@
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
#else[CAS]
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_PLAIN));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
- assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET_RELEASE));
#end[CAS]
#if[AtomicAdd]
assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
#else[AtomicAdd]
assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
- assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD_RELEASE));
#end[AtomicAdd]
+
+#if[Bitwise]
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
+#else[Bitwise]
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_OR_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_AND_RELEASE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE));
+ assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE));
+#end[Bitwise]
}
@Test(dataProvider = "typesProvider")
@@ -219,11 +247,11 @@
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
@@ -237,6 +265,14 @@
checkUOE(() -> {
$type$ o = ($type$) vh.getAndSet(array, ci, VALUE_1);
});
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
#end[CAS]
#if[!AtomicAdd]
@@ -245,9 +281,51 @@
});
checkUOE(() -> {
- $type$ o = ($type$) vh.addAndGet(array, ci, VALUE_1);
+ $type$ o = ($type$) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndAddRelease(array, ci, VALUE_1);
});
#end[AtomicAdd]
+
+#if[!Bitwise]
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
+ });
+#end[Bitwise]
}
static void testArrayUnsupported(ByteBufferSource bs, VarHandleSource vhs) {
@@ -293,11 +371,11 @@
});
checkROBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkROBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkROBE(() -> {
@@ -312,6 +390,14 @@
$type$ o = ($type$) vh.getAndSet(array, ci, VALUE_1);
});
+ checkROBE(() -> {
+ $type$ o = ($type$) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ $type$ o = ($type$) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
+
#else[CAS]
checkUOE(() -> {
boolean r = vh.compareAndSet(array, ci, VALUE_1, VALUE_2);
@@ -330,11 +416,11 @@
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
@@ -348,6 +434,14 @@
checkUOE(() -> {
$type$ o = ($type$) vh.getAndSet(array, ci, VALUE_1);
});
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
#end[CAS]
#if[AtomicAdd]
@@ -356,7 +450,11 @@
});
checkROBE(() -> {
- $type$ o = ($type$) vh.addAndGet(array, ci, VALUE_1);
+ $type$ o = ($type$) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ $type$ o = ($type$) vh.getAndAddRelease(array, ci, VALUE_1);
});
#else[AtomicAdd]
checkUOE(() -> {
@@ -364,9 +462,87 @@
});
checkUOE(() -> {
- $type$ o = ($type$) vh.addAndGet(array, ci, VALUE_1);
+ $type$ o = ($type$) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndAddRelease(array, ci, VALUE_1);
});
#end[AtomicAdd]
+
+#if[Bitwise]
+ checkROBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkROBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
+ });
+#else[Bitwise]
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
+ });
+#end[Bitwise]
}
else {
#if[!CAS]
@@ -387,11 +563,11 @@
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkUOE(() -> {
@@ -405,6 +581,14 @@
checkUOE(() -> {
$type$ o = ($type$) vh.getAndSet(array, ci, VALUE_1);
});
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
#end[CAS]
#if[!AtomicAdd]
checkUOE(() -> {
@@ -412,9 +596,50 @@
});
checkUOE(() -> {
- $type$ o = ($type$) vh.addAndGet(array, ci, VALUE_1);
+ $type$ o = ($type$) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndAddRelease(array, ci, VALUE_1);
});
#end[AtomicAdd]
+#if[!Bitwise]
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkUOE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
+ });
+#end[Bitwise]
}
}
@@ -477,11 +702,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
@@ -495,6 +720,14 @@
checkIOOBE(() -> {
$type$ o = ($type$) vh.getAndSet(array, ci, VALUE_1);
});
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
#end[CAS]
#if[AtomicAdd]
@@ -503,10 +736,52 @@
});
checkIOOBE(() -> {
- $type$ o = ($type$) vh.addAndGet(array, ci, VALUE_1);
+ $type$ o = ($type$) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndAddRelease(array, ci, VALUE_1);
});
#end[AtomicAdd]
+#if[Bitwise]
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
+ });
+#end[Bitwise]
+
}
}
@@ -573,11 +848,11 @@
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkIOOBE(() -> {
@@ -591,6 +866,14 @@
checkIOOBE(() -> {
$type$ o = ($type$) vh.getAndSet(array, ci, VALUE_1);
});
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
#end[CAS]
#if[AtomicAdd]
@@ -599,9 +882,51 @@
});
checkIOOBE(() -> {
- $type$ o = ($type$) vh.addAndGet(array, ci, VALUE_1);
+ $type$ o = ($type$) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndAddRelease(array, ci, VALUE_1);
});
#end[AtomicAdd]
+
+#if[Bitwise]
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkIOOBE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
+ });
+#end[Bitwise]
}
}
}
@@ -660,11 +985,11 @@
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
@@ -678,6 +1003,14 @@
checkISE(() -> {
$type$ o = ($type$) vh.getAndSet(array, ci, VALUE_1);
});
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
#end[CAS]
#if[AtomicAdd]
@@ -686,10 +1019,51 @@
});
checkISE(() -> {
- $type$ o = ($type$) vh.addAndGet(array, ci, VALUE_1);
+ $type$ o = ($type$) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndAddRelease(array, ci, VALUE_1);
});
#end[AtomicAdd]
+#if[Bitwise]
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
+ });
+#end[Bitwise]
}
}
}
@@ -750,11 +1124,11 @@
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSetPlain(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
- boolean r = vh.weakCompareAndSetVolatile(array, ci, VALUE_1, VALUE_2);
+ boolean r = vh.weakCompareAndSet(array, ci, VALUE_1, VALUE_2);
});
checkISE(() -> {
@@ -768,6 +1142,14 @@
checkISE(() -> {
$type$ o = ($type$) vh.getAndSet(array, ci, VALUE_1);
});
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndSetAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndSetRelease(array, ci, VALUE_1);
+ });
#end[CAS]
#if[AtomicAdd]
@@ -776,9 +1158,51 @@
});
checkISE(() -> {
- $type$ o = ($type$) vh.addAndGet(array, ci, VALUE_1);
+ $type$ o = ($type$) vh.getAndAddAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndAddRelease(array, ci, VALUE_1);
});
#end[AtomicAdd]
+
+#if[Bitwise]
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOr(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAnd(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXor(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(array, ci, VALUE_1);
+ });
+
+ checkISE(() -> {
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(array, ci, VALUE_1);
+ });
+#end[Bitwise]
}
}
}
@@ -888,11 +1312,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, VALUE_1, VALUE_2);
+ success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
}
- assertEquals(success, true, "weakCompareAndSet $type$");
+ assertEquals(success, true, "weakCompareAndSetPlain $type$");
$type$ x = ($type$) vh.get(array, i);
- assertEquals(x, VALUE_2, "weakCompareAndSet $type$ value");
+ assertEquals(x, VALUE_2, "weakCompareAndSetPlain $type$ value");
}
{
@@ -916,32 +1340,159 @@
}
{
- boolean r = vh.weakCompareAndSetVolatile(array, i, VALUE_2, VALUE_1);
- assertEquals(r, true, "weakCompareAndSetVolatile $type$");
+ boolean success = false;
+ for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+ success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
+ }
+ assertEquals(success, true, "weakCompareAndSet $type$");
$type$ x = ($type$) vh.get(array, i);
- assertEquals(x, VALUE_1, "weakCompareAndSetVolatile $type$ value");
+ assertEquals(x, VALUE_1, "weakCompareAndSet $type$");
}
// Compare set and get
{
+ vh.set(array, i, VALUE_1);
+
$type$ o = ($type$) vh.getAndSet(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndSet $type$");
$type$ x = ($type$) vh.get(array, i);
assertEquals(x, VALUE_2, "getAndSet $type$ value");
}
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndSetAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndSetRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetRelease $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetRelease $type$ value");
+ }
#end[CAS]
#if[AtomicAdd]
- vh.set(array, i, VALUE_1);
-
// get and add, add and get
{
- $type$ o = ($type$) vh.getAndAdd(array, i, VALUE_3);
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndAdd(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndAdd $type$");
- $type$ c = ($type$) vh.addAndGet(array, i, VALUE_3);
- assertEquals(c, VALUE_1 + VALUE_3 + VALUE_3, "getAndAdd $type$ value");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAdd $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndAddAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndAddAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAddAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndAddRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndAddRelease $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAddRelease $type$ value");
}
#end[AtomicAdd]
+
+#if[Bitwise]
+ // get and bitwise or
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseOr(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOr $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOr $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOrAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOrAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOrRelease $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOrRelease $type$ value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseAnd(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAnd $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAnd $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAndAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAndAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAndRelease $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAndRelease $type$ value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseXor(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXor $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXor $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXorAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXorAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXorRelease $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXorRelease $type$ value");
+ }
+#end[Bitwise]
}
}
}
@@ -1050,11 +1601,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = vh.weakCompareAndSet(array, i, VALUE_1, VALUE_2);
+ success = vh.weakCompareAndSetPlain(array, i, VALUE_1, VALUE_2);
}
- assertEquals(success, true, "weakCompareAndSet $type$");
+ assertEquals(success, true, "weakCompareAndSetPlain $type$");
$type$ x = ($type$) vh.get(array, i);
- assertEquals(x, VALUE_2, "weakCompareAndSet $type$ value");
+ assertEquals(x, VALUE_2, "weakCompareAndSetPlain $type$ value");
}
{
@@ -1078,32 +1629,159 @@
}
{
- boolean r = vh.weakCompareAndSetVolatile(array, i, VALUE_2, VALUE_1);
- assertEquals(r, true, "weakCompareAndSetVolatile $type$");
+ boolean success = false;
+ for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+ success = vh.weakCompareAndSet(array, i, VALUE_2, VALUE_1);
+ }
+ assertEquals(success, true, "weakCompareAndSet $type$");
$type$ x = ($type$) vh.get(array, i);
- assertEquals(x, VALUE_1, "weakCompareAndSetVolatile $type$ value");
+ assertEquals(x, VALUE_1, "weakCompareAndSet $type$");
}
// Compare set and get
{
+ vh.set(array, i, VALUE_1);
+
$type$ o = ($type$) vh.getAndSet(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndSet $type$");
$type$ x = ($type$) vh.get(array, i);
assertEquals(x, VALUE_2, "getAndSet $type$ value");
}
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndSetAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndSetRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndSetRelease $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_2, "getAndSetRelease $type$ value");
+ }
#end[CAS]
#if[AtomicAdd]
- vh.set(array, i, VALUE_1);
-
// get and add, add and get
{
- $type$ o = ($type$) vh.getAndAdd(array, i, VALUE_3);
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndAdd(array, i, VALUE_2);
assertEquals(o, VALUE_1, "getAndAdd $type$");
- $type$ c = ($type$) vh.addAndGet(array, i, VALUE_3);
- assertEquals(c, VALUE_1 + VALUE_3 + VALUE_3, "getAndAdd $type$ value");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAdd $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndAddAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndAddAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAddAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndAddRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndAddRelease $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 + VALUE_2, "getAndAddRelease $type$ value");
}
#end[AtomicAdd]
+
+#if[Bitwise]
+ // get and bitwise or
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseOr(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOr $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOr $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseOrAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOrAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOrAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseOrRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseOrRelease $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 | VALUE_2, "getAndBitwiseOrRelease $type$ value");
+ }
+
+ // get and bitwise and
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseAnd(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAnd $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAnd $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseAndAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAndAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAndAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseAndRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseAndRelease $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 & VALUE_2, "getAndBitwiseAndRelease $type$ value");
+ }
+
+ // get and bitwise xor
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseXor(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXor $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXor $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseXorAcquire(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXorAcquire $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXorAcquire $type$ value");
+ }
+
+ {
+ vh.set(array, i, VALUE_1);
+
+ $type$ o = ($type$) vh.getAndBitwiseXorRelease(array, i, VALUE_2);
+ assertEquals(o, VALUE_1, "getAndBitwiseXorRelease $type$");
+ $type$ x = ($type$) vh.get(array, i);
+ assertEquals(x, VALUE_1 ^ VALUE_2, "getAndBitwiseXorRelease $type$ value");
+ }
+#end[Bitwise]
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestMethodHandleAccess.java.template
--- a/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestMethodHandleAccess.java.template Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestMethodHandleAccess.java.template Fri Sep 02 02:41:37 2016 +0000
@@ -211,11 +211,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, $value1$, $value2$);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(recv, $value1$, $value2$);
}
- assertEquals(success, true, "weakCompareAndSet $type$");
+ assertEquals(success, true, "weakCompareAndSetPlain $type$");
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, $value2$, "weakCompareAndSet $type$ value");
+ assertEquals(x, $value2$, "weakCompareAndSetPlain $type$ value");
}
{
@@ -241,11 +241,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, $value2$, $value1$);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, $value2$, $value1$);
}
- assertEquals(success, true, "weakCompareAndSetVolatile $type$");
+ assertEquals(success, true, "weakCompareAndSet $type$");
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
- assertEquals(x, $value1$, "weakCompareAndSetVolatile $type$");
+ assertEquals(x, $value1$, "weakCompareAndSet $type$");
}
// Compare set and get
@@ -258,16 +258,120 @@
#end[CAS]
#if[AtomicAdd]
- hs.get(TestAccessMode.SET).invokeExact(recv, $value1$);
-
// get and add, add and get
{
- $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, $value3$);
+ hs.get(TestAccessMode.SET).invokeExact(recv, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, $value2$);
assertEquals(o, $value1$, "getAndAdd $type$");
- $type$ c = ($type$) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, $value3$);
- assertEquals(c, ($type$)($value1$ + $value3$ + $value3$), "getAndAdd $type$ value");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAdd $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(recv, $value2$);
+ assertEquals(o, $value1$, "getAndAddAcquire $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAddAcquire $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(recv, $value2$);
+ assertEquals(o, $value1$, "getAndAddRelease $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAddRelease $type$ value");
}
#end[AtomicAdd]
+
+#if[Bitwise]
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOr $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOr $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOrAcquire $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOrAcquire $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOrRelease $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOrRelease $type$ value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAnd $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAnd $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAndAcquire $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAndAcquire $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAndRelease $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAndRelease $type$ value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXor $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXor $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXorAcquire $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXorAcquire $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(recv, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(recv, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXorRelease $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXorRelease $type$ value");
+ }
+#end[Bitwise]
}
static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccess$Type$ recv, Handles hs) throws Throwable {
@@ -298,6 +402,14 @@
});
}
#end[AtomicAdd]
+
+#if[!Bitwise]
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkUOE(am, () -> {
+ $type$ r = ($type$) hs.get(am).invokeExact(recv, $value1$);
+ });
+ }
+#end[Bitwise]
}
@@ -394,11 +506,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact($value1$, $value2$);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact($value1$, $value2$);
}
- assertEquals(success, true, "weakCompareAndSet $type$");
+ assertEquals(success, true, "weakCompareAndSetPlain $type$");
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, $value2$, "weakCompareAndSet $type$ value");
+ assertEquals(x, $value2$, "weakCompareAndSetPlain $type$ value");
}
{
@@ -424,33 +536,159 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact($value2$, $value1$);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact($value2$, $value1$);
}
- assertEquals(success, true, "weakCompareAndSetVolatile $type$");
+ assertEquals(success, true, "weakCompareAndSet $type$");
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
- assertEquals(x, $value1$, "weakCompareAndSetVolatile $type$");
+ assertEquals(x, $value1$, "weakCompareAndSet $type$");
}
// Compare set and get
{
- $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_SET).invokeExact( $value2$);
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_SET).invokeExact($value2$);
assertEquals(o, $value1$, "getAndSet $type$");
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
assertEquals(x, $value2$, "getAndSet $type$ value");
}
+
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact($value2$);
+ assertEquals(o, $value1$, "getAndSetAcquire $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, $value2$, "getAndSetAcquire $type$ value");
+ }
+
+ // Compare set and get
+ {
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact($value2$);
+ assertEquals(o, $value1$, "getAndSetRelease $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, $value2$, "getAndSetRelease $type$ value");
+ }
#end[CAS]
#if[AtomicAdd]
- hs.get(TestAccessMode.SET).invokeExact($value1$);
-
// get and add, add and get
{
- $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( $value3$);
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD).invokeExact($value2$);
assertEquals(o, $value1$, "getAndAdd $type$");
- $type$ c = ($type$) hs.get(TestAccessMode.ADD_AND_GET).invokeExact($value3$);
- assertEquals(c, ($type$)($value1$ + $value3$ + $value3$), "getAndAdd $type$ value");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAdd $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact($value2$);
+ assertEquals(o, $value1$, "getAndAddAcquire $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAddAcquire $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact($value2$);
+ assertEquals(o, $value1$, "getAndAddRelease $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAddRelease $type$ value");
}
#end[AtomicAdd]
+
+#if[Bitwise]
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOr $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOr $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOrAcquire $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOrAcquire $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOrRelease $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOrRelease $type$ value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAnd $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAnd $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAndAcquire $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAndAcquire $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAndRelease $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAndRelease $type$ value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXor $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXor $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXorAcquire $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXorAcquire $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact($value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact($value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXorRelease $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXorRelease $type$ value");
+ }
+#end[Bitwise]
}
static void testStaticFieldUnsupported(Handles hs) throws Throwable {
@@ -481,6 +719,14 @@
});
}
#end[AtomicAdd]
+
+#if[!Bitwise]
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkUOE(am, () -> {
+ $type$ r = ($type$) hs.get(am).invokeExact($value1$);
+ });
+ }
+#end[Bitwise]
}
@@ -580,11 +826,11 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, $value1$, $value2$);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_PLAIN).invokeExact(array, i, $value1$, $value2$);
}
- assertEquals(success, true, "weakCompareAndSet $type$");
+ assertEquals(success, true, "weakCompareAndSetPlain $type$");
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, $value2$, "weakCompareAndSet $type$ value");
+ assertEquals(x, $value2$, "weakCompareAndSetPlain $type$ value");
}
{
@@ -610,33 +856,157 @@
{
boolean success = false;
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
- success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, $value2$, $value1$);
+ success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, $value2$, $value1$);
}
- assertEquals(success, true, "weakCompareAndSetVolatile $type$");
+ assertEquals(success, true, "weakCompareAndSet $type$");
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
- assertEquals(x, $value1$, "weakCompareAndSetVolatile $type$");
+ assertEquals(x, $value1$, "weakCompareAndSet $type$");
}
// Compare set and get
{
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
$type$ o = ($type$) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, $value2$);
assertEquals(o, $value1$, "getAndSet $type$");
$type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
assertEquals(x, $value2$, "getAndSet $type$ value");
}
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_SET_ACQUIRE).invokeExact(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndSetAcquire $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, $value2$, "getAndSetAcquire $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_SET_RELEASE).invokeExact(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndSetRelease $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, $value2$, "getAndSetRelease $type$ value");
+ }
#end[CAS]
#if[AtomicAdd]
- hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
-
// get and add, add and get
{
- $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, $value3$);
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, $value2$);
assertEquals(o, $value1$, "getAndAdd $type$");
- $type$ c = ($type$) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, $value3$);
- assertEquals(c, ($type$)($value1$ + $value3$ + $value3$), "getAndAdd $type$ value");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAdd $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD_ACQUIRE).invokeExact(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndAddAcquire $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAddAcquire $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD_RELEASE).invokeExact(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndAddRelease $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, ($type$)($value1$ + $value2$), "getAndAddRelease $type$ value");
}
#end[AtomicAdd]
+
+#if[Bitwise]
+ // get and bitwise or
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_OR).invokeExact(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOr $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOr $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_OR_ACQUIRE).invokeExact(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOrAcquire $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOrAcquire $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_OR_RELEASE).invokeExact(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseOrRelease $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, ($type$)($value1$ | $value2$), "getAndBitwiseOrRelease $type$ value");
+ }
+
+ // get and bitwise and
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_AND).invokeExact(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAnd $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAnd $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_AND_ACQUIRE).invokeExact(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAndAcquire $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAndAcquire $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_AND_RELEASE).invokeExact(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseAndRelease $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, ($type$)($value1$ & $value2$), "getAndBitwiseAndRelease $type$ value");
+ }
+
+ // get and bitwise xor
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_XOR).invokeExact(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXor $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXor $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_ACQUIRE).invokeExact(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXorAcquire $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXorAcquire $type$ value");
+ }
+
+ {
+ hs.get(TestAccessMode.SET).invokeExact(array, i, $value1$);
+
+ $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_BITWISE_XOR_RELEASE).invokeExact(array, i, $value2$);
+ assertEquals(o, $value1$, "getAndBitwiseXorRelease $type$");
+ $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
+ assertEquals(x, ($type$)($value1$ ^ $value2$), "getAndBitwiseXorRelease $type$ value");
+ }
+#end[Bitwise]
}
}
@@ -671,6 +1041,14 @@
});
}
#end[AtomicAdd]
+
+#if[!Bitwise]
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkUOE(am, () -> {
+ $type$ o = ($type$) hs.get(am).invokeExact(array, i, $value1$);
+ });
+ }
+#end[Bitwise]
}
static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -718,6 +1096,14 @@
});
}
#end[AtomicAdd]
+
+#if[Bitwise]
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkIOOBE(am, () -> {
+ $type$ o = ($type$) hs.get(am).invokeExact(array, ci, $value3$);
+ });
+ }
+#end[Bitwise]
}
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestMethodType.java.template
--- a/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestMethodType.java.template Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestMethodType.java.template Fri Sep 02 02:41:37 2016 +0000
@@ -354,6 +354,32 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, $value1$, $value1$);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, $value1$, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(recv, $value1$, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, $value1$, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(recv, $value1$, $value1$, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, $value1$, $value1$);
});
checkCCE(() -> { // receiver reference class
@@ -377,32 +403,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, $value1$, $value1$);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, $value1$, $value1$);
- });
- check{#if[String]?CCE:WMTE}(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, $value1$);
- });
- check{#if[String]?CCE:WMTE}(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(recv, $value1$, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, $value1$, $value1$);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(recv, $value1$, $value1$, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -582,6 +582,64 @@
checkWMTE(() -> { // >
$type$ x = ($type$) vh.getAndSet(recv, $value1$, Void.class);
});
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ $type$ x = ($type$) vh.getAndSetAcquire(null, $value1$);
+ });
+ checkCCE(() -> { // receiver reference class
+ $type$ x = ($type$) vh.getAndSetAcquire(Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndSetAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ $type$ x = ($type$) vh.getAndSetAcquire(0, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(recv, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSetAcquire(recv, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndSetAcquire(recv, $value1$, Void.class);
+ });
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ $type$ x = ($type$) vh.getAndSetRelease(null, $value1$);
+ });
+ checkCCE(() -> { // receiver reference class
+ $type$ x = ($type$) vh.getAndSetRelease(Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndSetRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ $type$ x = ($type$) vh.getAndSetRelease(0, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(recv, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSetRelease(recv, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndSetRelease(recv, $value1$, Void.class);
+ });
#end[CAS]
#if[AtomicAdd]
@@ -614,36 +672,335 @@
$type$ x = ($type$) vh.getAndAdd(recv, $value1$, Void.class);
});
+ // GetAndAddAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ $type$ x = ($type$) vh.getAndAddAcquire(null, $value1$);
+ });
+ checkCCE(() -> { // receiver reference class
+ $type$ x = ($type$) vh.getAndAddAcquire(Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndAddAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ $type$ x = ($type$) vh.getAndAddAcquire(0, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire(recv, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAddAcquire(recv, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndAddAcquire(recv, $value1$, Void.class);
+ });
- // AddAndGet
+ // GetAndAddRelease
// Incorrect argument types
checkNPE(() -> { // null receiver
- $type$ x = ($type$) vh.addAndGet(null, $value1$);
+ $type$ x = ($type$) vh.getAndAddRelease(null, $value1$);
+ });
+ checkCCE(() -> { // receiver reference class
+ $type$ x = ($type$) vh.getAndAddRelease(Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndAddRelease(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ $type$ x = ($type$) vh.getAndAddRelease(0, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(recv, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAddRelease(recv, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndAddRelease(recv, $value1$, Void.class);
+ });
+#end[AtomicAdd]
+
+#if[Bitwise]
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ $type$ x = ($type$) vh.getAndBitwiseOr(null, $value1$);
});
checkCCE(() -> { // receiver reference class
- $type$ x = ($type$) vh.addAndGet(Void.class, $value1$);
+ $type$ x = ($type$) vh.getAndBitwiseOr(Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseOr(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ $type$ x = ($type$) vh.getAndBitwiseOr(0, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(recv, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOr(recv, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseOr(recv, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire(null, $value1$);
+ });
+ checkCCE(() -> { // receiver reference class
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire(Void.class, $value1$);
});
check{#if[String]?CCE:WMTE}(() -> { // value reference class
- $type$ x = ($type$) vh.addAndGet(recv, Void.class);
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire(recv, Void.class);
});
checkWMTE(() -> { // reciever primitive class
- $type$ x = ($type$) vh.addAndGet(0, $value1$);
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire(0, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(recv, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOrAcquire(recv, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire(recv, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseOrRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ $type$ x = ($type$) vh.getAndBitwiseOrRelease(null, $value1$);
+ });
+ checkCCE(() -> { // receiver reference class
+ $type$ x = ($type$) vh.getAndBitwiseOr(Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseOr(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ $type$ x = ($type$) vh.getAndBitwiseOr(0, $value1$);
});
// Incorrect return type
check{#if[String]?CCE:WMTE}(() -> { // reference class
- Void r = (Void) vh.addAndGet(recv, $value1$);
+ Void r = (Void) vh.getAndBitwiseOr(recv, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOr(recv, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseOr(recv, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ $type$ x = ($type$) vh.getAndBitwiseAnd(null, $value1$);
+ });
+ checkCCE(() -> { // receiver reference class
+ $type$ x = ($type$) vh.getAndBitwiseAnd(Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseAnd(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ $type$ x = ($type$) vh.getAndBitwiseAnd(0, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(recv, $value1$);
});
checkWMTE(() -> { // primitive class
- $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.addAndGet(recv, $value1$);
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAnd(recv, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseAnd(recv, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire(null, $value1$);
+ });
+ checkCCE(() -> { // receiver reference class
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire(Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire(0, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(recv, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAndAcquire(recv, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire(recv, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseAndRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ $type$ x = ($type$) vh.getAndBitwiseAndRelease(null, $value1$);
+ });
+ checkCCE(() -> { // receiver reference class
+ $type$ x = ($type$) vh.getAndBitwiseAnd(Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseAnd(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ $type$ x = ($type$) vh.getAndBitwiseAnd(0, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(recv, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAnd(recv, $value1$);
});
// Incorrect arity
checkWMTE(() -> { // 0
- $type$ x = ($type$) vh.addAndGet();
+ $type$ x = ($type$) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseAnd(recv, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ $type$ x = ($type$) vh.getAndBitwiseXor(null, $value1$);
+ });
+ checkCCE(() -> { // receiver reference class
+ $type$ x = ($type$) vh.getAndBitwiseXor(Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseXor(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ $type$ x = ($type$) vh.getAndBitwiseXor(0, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(recv, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXor(recv, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseXor();
});
checkWMTE(() -> { // >
- $type$ x = ($type$) vh.addAndGet(recv, $value1$, Void.class);
- });
-#end[AtomicAdd]
+ $type$ x = ($type$) vh.getAndBitwiseXor(recv, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire(null, $value1$);
+ });
+ checkCCE(() -> { // receiver reference class
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire(Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire(0, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(recv, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXorAcquire(recv, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire(recv, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseXorRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
+ $type$ x = ($type$) vh.getAndBitwiseXorRelease(null, $value1$);
+ });
+ checkCCE(() -> { // receiver reference class
+ $type$ x = ($type$) vh.getAndBitwiseXor(Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseXor(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ $type$ x = ($type$) vh.getAndBitwiseXor(0, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(recv, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXor(recv, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseXor();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseXor(recv, $value1$, Void.class);
+ });
+#end[Bitwise]
}
static void testInstanceFieldWrongMethodType(VarHandleTestMethodType$Type$ recv, Handles hs) throws Throwable {
@@ -861,6 +1218,45 @@
});
}
#end[AtomicAdd]
+
+#if[Bitwise]
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ checkNPE(() -> { // null receiver
+ $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, $type$.class)).
+ invokeExact((VarHandleTestMethodType$Type$) null, $value1$);
+ });
+ hs.checkWMTEOrCCE(() -> { // receiver reference class
+ $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class, $type$.class)).
+ invokeExact(Void.class, $value1$);
+ });
+ {#if[String]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // value reference class
+ $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, Class.class)).
+ invokeExact(recv, Void.class);
+ });
+ checkWMTE(() -> { // reciever primitive class
+ $type$ x = ($type$) hs.get(am, methodType($type$.class, int.class, $type$.class)).
+ invokeExact(0, $value1$);
+ });
+ // Incorrect return type
+ {#if[String]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodType$Type$.class, $type$.class)).
+ invokeExact(recv, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, VarHandleTestMethodType$Type$.class, $type$.class)).
+ invokeExact(recv, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) hs.get(am, methodType($type$.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, $type$.class)).
+ invokeExact(recv, $value1$, Void.class);
+ });
+ }
+#end[Bitwise]
}
@@ -995,6 +1391,23 @@
// WeakCompareAndSet
// Incorrect argument types
check{#if[String]?CCE:WMTE}(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain($value1$, Void.class);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain($value1$, $value1$, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ check{#if[String]?CCE:WMTE}(() -> { // expected reference class
boolean r = vh.weakCompareAndSet(Void.class, $value1$);
});
check{#if[String]?CCE:WMTE}(() -> { // actual reference class
@@ -1009,23 +1422,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- check{#if[String]?CCE:WMTE}(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, $value1$);
- });
- check{#if[String]?CCE:WMTE}(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile($value1$, Void.class);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile($value1$, $value1$, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
check{#if[String]?CCE:WMTE}(() -> { // expected reference class
@@ -1151,6 +1547,48 @@
checkWMTE(() -> { // >
$type$ x = ($type$) vh.getAndSet($value1$, Void.class);
});
+
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndSetAcquire(Void.class);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire($value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSetAcquire($value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndSetAcquire($value1$, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndSetRelease(Void.class);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease($value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSetRelease($value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndSetRelease($value1$, Void.class);
+ });
#end[CAS]
#if[AtomicAdd]
@@ -1175,26 +1613,237 @@
});
- // AddAndGet
+ // GetAndAddAcquire
+ // Incorrect argument types
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndAddAcquire(Void.class);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire($value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAddAcquire($value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndAddAcquire($value1$, Void.class);
+ });
+
+
+ // GetAndAddRelease
+ // Incorrect argument types
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndAddRelease(Void.class);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease($value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAddRelease($value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndAddRelease($value1$, Void.class);
+ });
+#end[AtomicAdd]
+
+#if[Bitwise]
+ // GetAndBitwiseOr
// Incorrect argument types
check{#if[String]?CCE:WMTE}(() -> { // value reference class
- $type$ x = ($type$) vh.addAndGet(Void.class);
+ $type$ x = ($type$) vh.getAndBitwiseOr(Void.class);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr($value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOr($value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseOr($value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire(Void.class);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire($value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOrAcquire($value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire($value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseOrReleaseRelease
+ // Incorrect argument types
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseOrRelease(Void.class);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrRelease($value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOrRelease($value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseOrRelease();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseOrRelease($value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseAnd(Void.class);
});
// Incorrect return type
check{#if[String]?CCE:WMTE}(() -> { // reference class
- Void r = (Void) vh.addAndGet($value1$);
+ Void r = (Void) vh.getAndBitwiseAnd($value1$);
});
checkWMTE(() -> { // primitive class
- $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.addAndGet($value1$);
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAnd($value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseAnd($value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire(Void.class);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire($value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAndAcquire($value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire($value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseAndReleaseRelease
+ // Incorrect argument types
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseAndRelease(Void.class);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndRelease($value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAndRelease($value1$);
});
// Incorrect arity
checkWMTE(() -> { // 0
- $type$ x = ($type$) vh.addAndGet();
+ $type$ x = ($type$) vh.getAndBitwiseAndRelease();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseAndRelease($value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseXor(Void.class);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor($value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXor($value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseXor();
});
checkWMTE(() -> { // >
- $type$ x = ($type$) vh.addAndGet($value1$, Void.class);
- });
-#end[AtomicAdd]
+ $type$ x = ($type$) vh.getAndBitwiseXor($value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire(Void.class);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire($value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXorAcquire($value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire($value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseXorReleaseRelease
+ // Incorrect argument types
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseXorRelease(Void.class);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorRelease($value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXorRelease($value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseXorRelease();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseXorRelease($value1$, Void.class);
+ });
+#end[Bitwise]
}
static void testStaticFieldWrongMethodType(Handles hs) throws Throwable {
@@ -1338,6 +1987,34 @@
});
}
#end[AtomicAdd]
+
+#if[Bitwise]
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ // Incorrect argument types
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class)).
+ invokeExact(Void.class);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, $type$.class)).
+ invokeExact($value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, $type$.class)).
+ invokeExact($value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) hs.get(am, methodType($type$.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$.class, Class.class)).
+ invokeExact($value1$, Void.class);
+ });
+ }
+#end[Bitwise]
}
@@ -1602,6 +2279,35 @@
// WeakCompareAndSet
// Incorrect argument types
checkNPE(() -> { // null receiver
+ boolean r = vh.weakCompareAndSetPlain(null, 0, $value1$, $value1$);
+ });
+ checkCCE(() -> { // receiver reference class
+ boolean r = vh.weakCompareAndSetPlain(Void.class, 0, $value1$, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // expected reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, Void.class, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // actual reference class
+ boolean r = vh.weakCompareAndSetPlain(array, 0, $value1$, Void.class);
+ });
+ checkWMTE(() -> { // receiver primitive class
+ boolean r = vh.weakCompareAndSetPlain(0, 0, $value1$, $value1$);
+ });
+ checkWMTE(() -> { // index reference class
+ boolean r = vh.weakCompareAndSetPlain(array, Void.class, $value1$, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ boolean r = vh.weakCompareAndSetPlain();
+ });
+ checkWMTE(() -> { // >
+ boolean r = vh.weakCompareAndSetPlain(array, 0, $value1$, $value1$, Void.class);
+ });
+
+
+ // WeakCompareAndSetVolatile
+ // Incorrect argument types
+ checkNPE(() -> { // null receiver
boolean r = vh.weakCompareAndSet(null, 0, $value1$, $value1$);
});
checkCCE(() -> { // receiver reference class
@@ -1628,35 +2334,6 @@
});
- // WeakCompareAndSetVolatile
- // Incorrect argument types
- checkNPE(() -> { // null receiver
- boolean r = vh.weakCompareAndSetVolatile(null, 0, $value1$, $value1$);
- });
- checkCCE(() -> { // receiver reference class
- boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, $value1$, $value1$);
- });
- check{#if[String]?CCE:WMTE}(() -> { // expected reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, $value1$);
- });
- check{#if[String]?CCE:WMTE}(() -> { // actual reference class
- boolean r = vh.weakCompareAndSetVolatile(array, 0, $value1$, Void.class);
- });
- checkWMTE(() -> { // receiver primitive class
- boolean r = vh.weakCompareAndSetVolatile(0, 0, $value1$, $value1$);
- });
- checkWMTE(() -> { // index reference class
- boolean r = vh.weakCompareAndSetVolatile(array, Void.class, $value1$, $value1$);
- });
- // Incorrect arity
- checkWMTE(() -> { // 0
- boolean r = vh.weakCompareAndSetVolatile();
- });
- checkWMTE(() -> { // >
- boolean r = vh.weakCompareAndSetVolatile(array, 0, $value1$, $value1$, Void.class);
- });
-
-
// WeakCompareAndSetAcquire
// Incorrect argument types
checkNPE(() -> { // null receiver
@@ -1854,6 +2531,72 @@
checkWMTE(() -> { // >
$type$ x = ($type$) vh.getAndSet(array, 0, $value1$, Void.class);
});
+
+
+ // GetAndSetAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ $type$ x = ($type$) vh.getAndSetAcquire(null, 0, $value1$);
+ });
+ checkCCE(() -> { // array reference class
+ $type$ x = ($type$) vh.getAndSetAcquire(Void.class, 0, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndSetAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ $type$ x = ($type$) vh.getAndSetAcquire(0, 0, $value1$);
+ });
+ checkWMTE(() -> { // index reference class
+ $type$ x = ($type$) vh.getAndSetAcquire(array, Void.class, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndSetAcquire(array, 0, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSetAcquire(array, 0, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndSetAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndSetAcquire(array, 0, $value1$, Void.class);
+ });
+
+
+ // GetAndSetRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ $type$ x = ($type$) vh.getAndSetRelease(null, 0, $value1$);
+ });
+ checkCCE(() -> { // array reference class
+ $type$ x = ($type$) vh.getAndSetRelease(Void.class, 0, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndSetRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // reciarrayever primitive class
+ $type$ x = ($type$) vh.getAndSetRelease(0, 0, $value1$);
+ });
+ checkWMTE(() -> { // index reference class
+ $type$ x = ($type$) vh.getAndSetRelease(array, Void.class, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndSetRelease(array, 0, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSetRelease(array, 0, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndSetRelease();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndSetRelease(array, 0, $value1$, Void.class);
+ });
#end[CAS]
#if[AtomicAdd]
@@ -1890,38 +2633,369 @@
});
- // AddAndGet
+ // GetAndAddAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ $type$ x = ($type$) vh.getAndAddAcquire(null, 0, $value1$);
+ });
+ checkCCE(() -> { // array reference class
+ $type$ x = ($type$) vh.getAndAddAcquire(Void.class, 0, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndAddAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ $type$ x = ($type$) vh.getAndAddAcquire(0, 0, $value1$);
+ });
+ checkWMTE(() -> { // index reference class
+ $type$ x = ($type$) vh.getAndAddAcquire(array, Void.class, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndAddAcquire(array, 0, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAddAcquire(array, 0, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndAddAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndAddAcquire(array, 0, $value1$, Void.class);
+ });
+
+
+ // GetAndAddRelease
// Incorrect argument types
checkNPE(() -> { // null array
- $type$ x = ($type$) vh.addAndGet(null, 0, $value1$);
+ $type$ x = ($type$) vh.getAndAddRelease(null, 0, $value1$);
+ });
+ checkCCE(() -> { // array reference class
+ $type$ x = ($type$) vh.getAndAddRelease(Void.class, 0, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndAddRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ $type$ x = ($type$) vh.getAndAddRelease(0, 0, $value1$);
+ });
+ checkWMTE(() -> { // index reference class
+ $type$ x = ($type$) vh.getAndAddRelease(array, Void.class, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndAddRelease(array, 0, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAddRelease(array, 0, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndAddRelease();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndAddRelease(array, 0, $value1$, Void.class);
+ });
+#end[AtomicAdd]
+
+#if[Bitwise]
+ // GetAndBitwiseOr
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ $type$ x = ($type$) vh.getAndBitwiseOr(null, 0, $value1$);
});
checkCCE(() -> { // array reference class
- $type$ x = ($type$) vh.addAndGet(Void.class, 0, $value1$);
+ $type$ x = ($type$) vh.getAndBitwiseOr(Void.class, 0, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseOr(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ $type$ x = ($type$) vh.getAndBitwiseOr(0, 0, $value1$);
+ });
+ checkWMTE(() -> { // index reference class
+ $type$ x = ($type$) vh.getAndBitwiseOr(array, Void.class, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOr(array, 0, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOr(array, 0, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseOr();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseOr(array, 0, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseOrAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire(null, 0, $value1$);
+ });
+ checkCCE(() -> { // array reference class
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire(Void.class, 0, $value1$);
});
check{#if[String]?CCE:WMTE}(() -> { // value reference class
- $type$ x = ($type$) vh.addAndGet(array, 0, Void.class);
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire(array, 0, Void.class);
});
checkWMTE(() -> { // array primitive class
- $type$ x = ($type$) vh.addAndGet(0, 0, $value1$);
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire(0, 0, $value1$);
});
checkWMTE(() -> { // index reference class
- $type$ x = ($type$) vh.addAndGet(array, Void.class, $value1$);
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire(array, Void.class, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseOrAcquire(array, 0, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOrAcquire(array, 0, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseOrAcquire(array, 0, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseOrRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ $type$ x = ($type$) vh.getAndBitwiseOrRelease(null, 0, $value1$);
+ });
+ checkCCE(() -> { // array reference class
+ $type$ x = ($type$) vh.getAndBitwiseOrRelease(Void.class, 0, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseOrRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ $type$ x = ($type$) vh.getAndBitwiseOrRelease(0, 0, $value1$);
+ });
+ checkWMTE(() -> { // index reference class
+ $type$ x = ($type$) vh.getAndBitwiseOrRelease(array, Void.class, $value1$);
});
// Incorrect return type
check{#if[String]?CCE:WMTE}(() -> { // reference class
- Void r = (Void) vh.addAndGet(array, 0, $value1$);
+ Void r = (Void) vh.getAndBitwiseOrRelease(array, 0, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOrRelease(array, 0, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseOrRelease();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseOrRelease(array, 0, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseAnd
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ $type$ x = ($type$) vh.getAndBitwiseAnd(null, 0, $value1$);
+ });
+ checkCCE(() -> { // array reference class
+ $type$ x = ($type$) vh.getAndBitwiseAnd(Void.class, 0, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseAnd(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ $type$ x = ($type$) vh.getAndBitwiseAnd(0, 0, $value1$);
+ });
+ checkWMTE(() -> { // index reference class
+ $type$ x = ($type$) vh.getAndBitwiseAnd(array, Void.class, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAnd(array, 0, $value1$);
});
checkWMTE(() -> { // primitive class
- $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.addAndGet(array, 0, $value1$);
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAnd(array, 0, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseAnd();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseAnd(array, 0, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseAndAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire(null, 0, $value1$);
+ });
+ checkCCE(() -> { // array reference class
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire(Void.class, 0, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire(0, 0, $value1$);
+ });
+ checkWMTE(() -> { // index reference class
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire(array, Void.class, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndAcquire(array, 0, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAndAcquire(array, 0, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseAndAcquire(array, 0, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseAndRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ $type$ x = ($type$) vh.getAndBitwiseAndRelease(null, 0, $value1$);
+ });
+ checkCCE(() -> { // array reference class
+ $type$ x = ($type$) vh.getAndBitwiseAndRelease(Void.class, 0, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseAndRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ $type$ x = ($type$) vh.getAndBitwiseAndRelease(0, 0, $value1$);
+ });
+ checkWMTE(() -> { // index reference class
+ $type$ x = ($type$) vh.getAndBitwiseAndRelease(array, Void.class, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseAndRelease(array, 0, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAndRelease(array, 0, $value1$);
});
// Incorrect arity
checkWMTE(() -> { // 0
- $type$ x = ($type$) vh.addAndGet();
+ $type$ x = ($type$) vh.getAndBitwiseAndRelease();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseAndRelease(array, 0, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseXor
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ $type$ x = ($type$) vh.getAndBitwiseXor(null, 0, $value1$);
+ });
+ checkCCE(() -> { // array reference class
+ $type$ x = ($type$) vh.getAndBitwiseXor(Void.class, 0, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseXor(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ $type$ x = ($type$) vh.getAndBitwiseXor(0, 0, $value1$);
+ });
+ checkWMTE(() -> { // index reference class
+ $type$ x = ($type$) vh.getAndBitwiseXor(array, Void.class, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXor(array, 0, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXor(array, 0, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseXor();
});
checkWMTE(() -> { // >
- $type$ x = ($type$) vh.addAndGet(array, 0, $value1$, Void.class);
- });
-#end[AtomicAdd]
+ $type$ x = ($type$) vh.getAndBitwiseXor(array, 0, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseXorAcquire
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire(null, 0, $value1$);
+ });
+ checkCCE(() -> { // array reference class
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire(Void.class, 0, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire(0, 0, $value1$);
+ });
+ checkWMTE(() -> { // index reference class
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire(array, Void.class, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorAcquire(array, 0, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXorAcquire(array, 0, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseXorAcquire(array, 0, $value1$, Void.class);
+ });
+
+
+ // GetAndBitwiseXorRelease
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ $type$ x = ($type$) vh.getAndBitwiseXorRelease(null, 0, $value1$);
+ });
+ checkCCE(() -> { // array reference class
+ $type$ x = ($type$) vh.getAndBitwiseXorRelease(Void.class, 0, $value1$);
+ });
+ check{#if[String]?CCE:WMTE}(() -> { // value reference class
+ $type$ x = ($type$) vh.getAndBitwiseXorRelease(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ $type$ x = ($type$) vh.getAndBitwiseXorRelease(0, 0, $value1$);
+ });
+ checkWMTE(() -> { // index reference class
+ $type$ x = ($type$) vh.getAndBitwiseXorRelease(array, Void.class, $value1$);
+ });
+ // Incorrect return type
+ check{#if[String]?CCE:WMTE}(() -> { // reference class
+ Void r = (Void) vh.getAndBitwiseXorRelease(array, 0, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXorRelease(array, 0, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) vh.getAndBitwiseXorRelease();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) vh.getAndBitwiseXorRelease(array, 0, $value1$, Void.class);
+ });
+#end[Bitwise]
}
static void testArrayWrongMethodType(Handles hs) throws Throwable {
@@ -2168,6 +3242,50 @@
});
}
#end[AtomicAdd]
+
+#if[Bitwise]
+ for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) {
+ // Incorrect argument types
+ checkNPE(() -> { // null array
+ $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, $type$.class)).
+ invokeExact(($type$[]) null, 0, $value1$);
+ });
+ hs.checkWMTEOrCCE(() -> { // array reference class
+ $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class, int.class, $type$.class)).
+ invokeExact(Void.class, 0, $value1$);
+ });
+ {#if[String]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // value reference class
+ $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, Class.class)).
+ invokeExact(array, 0, Void.class);
+ });
+ checkWMTE(() -> { // array primitive class
+ $type$ x = ($type$) hs.get(am, methodType($type$.class, int.class, int.class, $type$.class)).
+ invokeExact(0, 0, $value1$);
+ });
+ checkWMTE(() -> { // index reference class
+ $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, Class.class, $type$.class)).
+ invokeExact(array, Void.class, $value1$);
+ });
+ // Incorrect return type
+ {#if[String]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class
+ Void r = (Void) hs.get(am, methodType(Void.class, $type$[].class, int.class, $type$.class)).
+ invokeExact(array, 0, $value1$);
+ });
+ checkWMTE(() -> { // primitive class
+ $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, $type$[].class, int.class, $type$.class)).
+ invokeExact(array, 0, $value1$);
+ });
+ // Incorrect arity
+ checkWMTE(() -> { // 0
+ $type$ x = ($type$) hs.get(am, methodType($type$.class)).
+ invokeExact();
+ });
+ checkWMTE(() -> { // >
+ $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, $type$.class, Class.class)).
+ invokeExact(array, 0, $value1$, Void.class);
+ });
+ }
+#end[Bitwise]
}
}
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/VarHandles/generate-vh-tests.sh
--- a/jdk/test/java/lang/invoke/VarHandles/generate-vh-tests.sh Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/generate-vh-tests.sh Fri Sep 02 02:41:37 2016 +0000
@@ -22,6 +22,12 @@
;;
esac
+ case $type in
+ boolean|byte|short|char|int|long)
+ args="$args -KBitwise"
+ ;;
+ esac
+
wrong_primitive_type=boolean
case $type in
@@ -109,6 +115,12 @@
;;
esac
+ case $type in
+ int|long)
+ args="$args -KBitwise"
+ ;;
+ esac
+
# The value of `value3` is chosen such that when added to `value1` or `value2`
# it will result in carrying of bits over to the next byte, thereby detecting
# possible errors in endianness conversion e.g. if say for atomic addition the
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/accessProtectedSuper/BogoLoader.java
--- a/jdk/test/java/lang/invoke/accessProtectedSuper/BogoLoader.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/accessProtectedSuper/BogoLoader.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
import java.io.BufferedInputStream;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/accessProtectedSuper/MethodInvoker.java
--- a/jdk/test/java/lang/invoke/accessProtectedSuper/MethodInvoker.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/accessProtectedSuper/MethodInvoker.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
import anotherpkg.MethodSupplierOuter;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/accessProtectedSuper/Test.java
--- a/jdk/test/java/lang/invoke/accessProtectedSuper/Test.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/accessProtectedSuper/Test.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/invoke/accessProtectedSuper/anotherpkg/MethodSupplierOuter.java
--- a/jdk/test/java/lang/invoke/accessProtectedSuper/anotherpkg/MethodSupplierOuter.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/invoke/accessProtectedSuper/anotherpkg/MethodSupplierOuter.java Fri Sep 02 02:41:37 2016 +0000
@@ -19,7 +19,6 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
- *
*/
package anotherpkg;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java
--- a/jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/lang/ref/CleanerTest.java
--- a/jdk/test/java/lang/ref/CleanerTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/lang/ref/CleanerTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -49,7 +49,7 @@
/*
* @test
- * @library /test/lib/share/classes /lib/testlibrary /test/lib
+ * @library /lib/testlibrary /test/lib
* @build sun.hotspot.WhiteBox
* @build jdk.test.lib.Utils
* @modules java.base/jdk.internal
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/net/Inet4Address/textToNumericFormat.java
--- a/jdk/test/java/net/Inet4Address/textToNumericFormat.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/net/Inet4Address/textToNumericFormat.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/net/ProxySelector/B8035158.java
--- a/jdk/test/java/net/ProxySelector/B8035158.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/net/ProxySelector/B8035158.java Fri Sep 02 02:41:37 2016 +0000
@@ -20,6 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
/*
* @test
* @bug 8035158 8145732
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/net/URLClassLoader/definePackage/SplitPackage.java
--- a/jdk/test/java/net/URLClassLoader/definePackage/SplitPackage.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/net/URLClassLoader/definePackage/SplitPackage.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/net/URLPermission/nstest/LookupTest.java
--- a/jdk/test/java/net/URLPermission/nstest/LookupTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/net/URLPermission/nstest/LookupTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/net/URLPermission/nstest/lookup.sh
--- a/jdk/test/java/net/URLPermission/nstest/lookup.sh Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/net/URLPermission/nstest/lookup.sh Fri Sep 02 02:41:37 2016 +0000
@@ -27,6 +27,7 @@
# @build jdk.testlibrary.*
# @compile -XDignore.symbol.file=true LookupTest.java
# @run shell/timeout=50 lookup.sh
+# @key intermittent
#
OS=`uname -s`
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/net/httpclient/BasicAuthTest.java
--- a/jdk/test/java/net/httpclient/BasicAuthTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/net/httpclient/BasicAuthTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -20,6 +20,7 @@
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
+ * questions.
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/net/httpclient/HeadersTest1.java
--- a/jdk/test/java/net/httpclient/HeadersTest1.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/net/httpclient/HeadersTest1.java Fri Sep 02 02:41:37 2016 +0000
@@ -20,6 +20,7 @@
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
+ * questions.
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/net/httpclient/ImmutableHeaders.java
--- a/jdk/test/java/net/httpclient/ImmutableHeaders.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/net/httpclient/ImmutableHeaders.java Fri Sep 02 02:41:37 2016 +0000
@@ -20,6 +20,7 @@
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
+ * questions.
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/net/httpclient/security/Driver.java
--- a/jdk/test/java/net/httpclient/security/Driver.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/net/httpclient/security/Driver.java Fri Sep 02 02:41:37 2016 +0000
@@ -20,6 +20,7 @@
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
+ * questions.
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/net/httpclient/security/Security.java
--- a/jdk/test/java/net/httpclient/security/Security.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/net/httpclient/security/Security.java Fri Sep 02 02:41:37 2016 +0000
@@ -20,6 +20,7 @@
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
+ * questions.
*/
/**
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/security/SecureRandom/DrbgParametersSpec.java
--- a/jdk/test/java/security/SecureRandom/DrbgParametersSpec.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/security/SecureRandom/DrbgParametersSpec.java Fri Sep 02 02:41:37 2016 +0000
@@ -24,7 +24,7 @@
/* @test
* @bug 8051408 8158534
* @summary Make sure DrbgParameters coded as specified
- * @library /test/lib/share/classes
+ * @library /test/lib
*/
import jdk.test.lib.Asserts;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Bidi/BidiConformance.java
--- a/jdk/test/java/text/Bidi/BidiConformance.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Bidi/BidiConformance.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2016, 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
@@ -25,6 +25,7 @@
* @test
* @bug 6850113 8032446
* @summary confirm the behavior of new Bidi implementation. (Backward compatibility)
+ * @modules java.desktop
*/
import java.awt.font.NumericShaper;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Bidi/BidiEmbeddingTest.java
--- a/jdk/test/java/text/Bidi/BidiEmbeddingTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Bidi/BidiEmbeddingTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2016, 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
@@ -28,6 +28,7 @@
* indicate overrides, rather than using bit 7. Also tests Bidi without loading awt classes to
* confirm that Bidi can be used without awt. Verify that embedding level 0 is properly mapped
* to the base embedding level.
+ * @modules java.desktop
*/
import java.awt.Color;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Bidi/Bug7042148.java
--- a/jdk/test/java/text/Bidi/Bug7042148.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Bidi/Bug7042148.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, 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
@@ -25,6 +25,7 @@
* @test
* @bug 7042148
* @summary verify that Bidi.baseIsLeftToRight() returns the correct value even if an incorrect position is set in the given AttributedCharacterIterator.
+ * @modules java.desktop
*/
import java.awt.font.*;
import java.text.*;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Bidi/Bug7051769.java
--- a/jdk/test/java/text/Bidi/Bug7051769.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Bidi/Bug7051769.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, 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
@@ -26,6 +26,7 @@
* @bug 7051769 8038092
* @summary verify that Bidi.toString() returns the corect result.
* The second run is intended to test lazy SharedSectets init for 8038092
+ * @modules java.desktop
* @run main Bug7051769
* @run main/othervm -DpreloadBidi=true Bug7051769
*/
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/BreakIterator/NewVSOld_th_TH.java
--- a/jdk/test/java/text/BreakIterator/NewVSOld_th_TH.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/BreakIterator/NewVSOld_th_TH.java Fri Sep 02 02:41:37 2016 +0000
@@ -22,9 +22,10 @@
*/
/*
- @test
- @summary test Comparison of New Collators against Old Collators in the en_US locale
-*/
+ * @test
+ * @summary test Comparison of New Collators against Old Collators in the en_US locale
+ * @modules jdk.localedata
+ */
import java.io.*;
import java.util.Enumeration;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Collator/APITest.java
--- a/jdk/test/java/text/Collator/APITest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Collator/APITest.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,6 +25,7 @@
* @test
* @library /java/text/testlib
* @summary test Collation API
+ * @modules jdk.localedata
*/
/*
(C) Copyright Taligent, Inc. 1996 - All Rights Reserved
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Collator/CollationKeyTest.java
--- a/jdk/test/java/text/Collator/CollationKeyTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Collator/CollationKeyTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -29,6 +29,7 @@
* RuleBasedCollationKey. This test basically tests on the two features:
* 1. Existing code using CollationKey works (backward compatiblility)
* 2. CollationKey can be extended by its subclass.
+ * @modules jdk.localedata
*/
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Collator/DanishTest.java
--- a/jdk/test/java/text/Collator/DanishTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Collator/DanishTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -26,6 +26,7 @@
* @bug 4930708 4174436 5008498
* @library /java/text/testlib
* @summary test Danish Collation
+ * @modules jdk.localedata
*/
/*
(C) Copyright Taligent, Inc. 1996 - All Rights Reserved
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Collator/FinnishTest.java
--- a/jdk/test/java/text/Collator/FinnishTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Collator/FinnishTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,6 +25,7 @@
* @test
* @library /java/text/testlib
* @summary test Finnish Collation
+ * @modules jdk.localedata
*/
/*
(C) Copyright Taligent, Inc. 1996 - All Rights Reserved
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Collator/FrenchTest.java
--- a/jdk/test/java/text/Collator/FrenchTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Collator/FrenchTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,6 +25,7 @@
* @test
* @library /java/text/testlib
* @summary test French Collation
+ * @modules jdk.localedata
*/
/*
(C) Copyright Taligent, Inc. 1996 - All Rights Reserved
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Collator/G7Test.java
--- a/jdk/test/java/text/Collator/G7Test.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Collator/G7Test.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,6 +25,7 @@
* @test
* @library /java/text/testlib
* @summary test G7 Collation
+ * @modules jdk.localedata
*/
/*
*
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Collator/JapaneseTest.java
--- a/jdk/test/java/text/Collator/JapaneseTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Collator/JapaneseTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,6 +25,7 @@
* @test 1.1 02/09/11
* @bug 4176141 4655819
* @summary Regression tests for Japanese Collation
+ * @modules jdk.localedata
*/
import java.text.*;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Collator/KoreanTest.java
--- a/jdk/test/java/text/Collator/KoreanTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Collator/KoreanTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,6 +25,7 @@
* @test 1.1 02/09/12
* @bug 4176141 4655819
* @summary Regression tests for Korean Collation
+ * @modules jdk.localedata
*/
import java.text.*;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Collator/Regression.java
--- a/jdk/test/java/text/Collator/Regression.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Collator/Regression.java Fri Sep 02 02:41:37 2016 +0000
@@ -29,6 +29,7 @@
* 4133509 4139572 4141640 4179126 4179686 4244884 4663220
* @library /java/text/testlib
* @summary Regression tests for Collation and associated classes
+ * @modules jdk.localedata
*/
/*
(C) Copyright Taligent, Inc. 1996 - All Rights Reserved
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Collator/ThaiTest.java
--- a/jdk/test/java/text/Collator/ThaiTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Collator/ThaiTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,6 +25,7 @@
* @test
* @library /java/text/testlib
* @summary test Thai Collation
+ * @modules jdk.localedata
*/
/*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Collator/TurkishTest.java
--- a/jdk/test/java/text/Collator/TurkishTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Collator/TurkishTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,6 +25,7 @@
* @test
* @library /java/text/testlib
* @summary test Turkish Collation
+ * @modules jdk.localedata
*/
/*
(C) Copyright Taligent, Inc. 1996 - All Rights Reserved
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Collator/VietnameseTest.java
--- a/jdk/test/java/text/Collator/VietnameseTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Collator/VietnameseTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -26,6 +26,7 @@
* @bug 4932968 5015215
* @library /java/text/testlib
* @summary test Vietnamese Collation
+ * @modules jdk.localedata
*/
/*
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Format/DateFormat/Bug4823811.java
--- a/jdk/test/java/text/Format/DateFormat/Bug4823811.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Format/DateFormat/Bug4823811.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2016, 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
@@ -25,6 +25,7 @@
* @test
* @bug 4823811 8008577
* @summary Confirm that text which includes numbers with a trailing minus sign is parsed correctly.
+ * @modules jdk.localedata
* @run main/othervm -Duser.timezone=GMT+09:00 -Djava.locale.providers=JRE,SPI Bug4823811
*/
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Format/DateFormat/Bug6683975.java
--- a/jdk/test/java/text/Format/DateFormat/Bug6683975.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Format/DateFormat/Bug6683975.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2016, 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
@@ -25,6 +25,7 @@
* @test
* @bug 6683975 8008577
* @summary Make sure that date is formatted correctlyin th locale.
+ * @modules jdk.localedata
* @run main/othervm -Djava.locale.providers=JRE,SPI Bug6683975
*/
import java.text.*;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Format/DateFormat/Bug8139572.java
--- a/jdk/test/java/text/Format/DateFormat/Bug8139572.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Format/DateFormat/Bug8139572.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -26,6 +26,7 @@
* @bug 8139572
* @summary SimpleDateFormat parse month stand-alone format bug
* @compile -encoding utf-8 Bug8139572.java
+ * @modules jdk.localedata
* @run main Bug8139572
*/
import java.text.ParseException;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Format/DateFormat/ContextMonthNamesTest.java
--- a/jdk/test/java/text/Format/DateFormat/ContextMonthNamesTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Format/DateFormat/ContextMonthNamesTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, 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
@@ -25,6 +25,7 @@
* @test
* @bug 7079560 8008577
* @summary Unit test for context-sensitive month names
+ * @modules jdk.localedata
* @run main/othervm -Djava.locale.providers=JRE,SPI ContextMonthNamesTest
*/
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Format/DateFormat/DateFormatTest.java
--- a/jdk/test/java/text/Format/DateFormat/DateFormatTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Format/DateFormat/DateFormatTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -26,6 +26,7 @@
* @bug 4052223 4089987 4469904 4326988 4486735 8008577 8045998 8140571
* @summary test DateFormat and SimpleDateFormat.
* @library /java/text/testlib
+ * @modules jdk.localedata
* @run main/othervm -Djava.locale.providers=COMPAT,SPI DateFormatTest
*/
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Format/DateFormat/LocaleDateFormats.java
--- a/jdk/test/java/text/Format/DateFormat/LocaleDateFormats.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Format/DateFormat/LocaleDateFormats.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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,7 @@
/**
* @test
* @bug 8080774
+ * @modules jdk.localedata
* @run testng/othervm -Djava.locale.providers=JRE,CLDR LocaleDateFormats
* @summary This file contains tests for JRE locales date formats
*/
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Format/DateFormat/NonGregorianFormatTest.java
--- a/jdk/test/java/text/Format/DateFormat/NonGregorianFormatTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Format/DateFormat/NonGregorianFormatTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,6 +25,7 @@
* @test
* @bug 4833268 6253991 8008577
* @summary Test formatting and parsing with non-Gregorian calendars
+ * @modules jdk.localedata
* @run main/othervm -Djava.locale.providers=COMPAT,SPI NonGregorianFormatTest
*/
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Format/DateFormat/bug4117335.java
--- a/jdk/test/java/text/Format/DateFormat/bug4117335.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Format/DateFormat/bug4117335.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,6 +25,7 @@
* @test
*
* @bug 4117335 4432617
+ * @modules jdk.localedata
*/
import java.text.DateFormatSymbols ;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Format/MessageFormat/LargeMessageFormat.java
--- a/jdk/test/java/text/Format/MessageFormat/LargeMessageFormat.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Format/MessageFormat/LargeMessageFormat.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,6 +25,7 @@
* @test
* @bug 4112090 8008577
* @summary verify that MessageFormat can handle large numbers of arguments
+ * @modules jdk.localedata
* @run main/othervm -Djava.locale.providers=COMPAT,SPI LargeMessageFormat
*/
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Format/NumberFormat/Bug8132125.java
--- a/jdk/test/java/text/Format/NumberFormat/Bug8132125.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Format/NumberFormat/Bug8132125.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -25,6 +25,7 @@
* @test
* @bug 8132125
* @summary Checks Swiss' number elements
+ * @modules jdk.localedata
*/
import java.text.*;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Format/NumberFormat/CurrencyFormat.java
--- a/jdk/test/java/text/Format/NumberFormat/CurrencyFormat.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Format/NumberFormat/CurrencyFormat.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,6 +25,7 @@
* @test
* @bug 4290801 4942982 5102005 8008577 8021121
* @summary Basic tests for currency formatting.
+ * @modules jdk.localedata
* @run main/othervm -Djava.locale.providers=JRE,SPI CurrencyFormat
*/
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Format/NumberFormat/IntlTestNumberFormatAPI.java
--- a/jdk/test/java/text/Format/NumberFormat/IntlTestNumberFormatAPI.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Format/NumberFormat/IntlTestNumberFormatAPI.java Fri Sep 02 02:41:37 2016 +0000
@@ -25,6 +25,7 @@
* @test
* @library /java/text/testlib
* @summary test International Number Format API
+ * @modules jdk.localedata
*/
/*
(C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Format/NumberFormat/NumberRegression.java
--- a/jdk/test/java/text/Format/NumberFormat/NumberRegression.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Format/NumberFormat/NumberRegression.java Fri Sep 02 02:41:37 2016 +0000
@@ -34,6 +34,7 @@
* @library /java/text/testlib
* @build IntlTest HexDumpReader TestUtils
* @modules java.base/sun.util.resources
+ * jdk.localedata
* @compile -XDignore.symbol.file NumberRegression.java
* @run main/othervm -Djava.locale.providers=COMPAT,SPI NumberRegression
*/
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/text/Format/NumberFormat/NumberTest.java
--- a/jdk/test/java/text/Format/NumberFormat/NumberTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/text/Format/NumberFormat/NumberTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -27,6 +27,7 @@
* @summary test NumberFormat
* @library /java/text/testlib
* @modules java.base/sun.util.resources
+ * jdk.localedata
* @compile -XDignore.symbol.file NumberTest.java
* @run main/othervm -Djava.locale.providers=COMPAT,SPI NumberTest
*/
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/util/Arrays/Correct.java
--- a/jdk/test/java/util/Arrays/Correct.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/util/Arrays/Correct.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/util/Map/FunctionalCMEs.java
--- a/jdk/test/java/util/Map/FunctionalCMEs.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/util/Map/FunctionalCMEs.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
import java.util.Arrays;
import java.util.ConcurrentModificationException;
import java.util.HashMap;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/util/Objects/CheckIndex.java
--- a/jdk/test/java/util/Objects/CheckIndex.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/util/Objects/CheckIndex.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/util/concurrent/FutureTask/NegativeTimeout.java
--- a/jdk/test/java/util/concurrent/FutureTask/NegativeTimeout.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/util/concurrent/FutureTask/NegativeTimeout.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/util/logging/Logger/entering/LoggerEnteringWithParams.java
--- a/jdk/test/java/util/logging/Logger/entering/LoggerEnteringWithParams.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/util/logging/Logger/entering/LoggerEnteringWithParams.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,4 +1,3 @@
-
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/util/logging/XMLFormatterDate.java
--- a/jdk/test/java/util/logging/XMLFormatterDate.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/util/logging/XMLFormatterDate.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,4 +1,3 @@
-
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -21,6 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/util/regex/PatternStreamTest.java
--- a/jdk/test/java/util/regex/PatternStreamTest.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/util/regex/PatternStreamTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/util/zip/TestCRC32.java
--- a/jdk/test/java/util/zip/TestCRC32.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/util/zip/TestCRC32.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,6 +1,3 @@
-
-import java.util.zip.CRC32;
-
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,6 +21,8 @@
* questions.
*/
+import java.util.zip.CRC32;
+
/**
* @test @summary Check that CRC-32 returns the expected CRC value for the
* string 123456789
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/util/zip/TestCRC32C.java
--- a/jdk/test/java/util/zip/TestCRC32C.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/util/zip/TestCRC32C.java Fri Sep 02 02:41:37 2016 +0000
@@ -1,6 +1,3 @@
-
-import java.util.zip.CRC32C;
-
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,6 +21,8 @@
* questions.
*/
+import java.util.zip.CRC32C;
+
/**
* @test @summary Check that CRC-32C returns the expected CRC value for the
* string 123456789
diff -r b079fff22b3c -r de9ff562c112 jdk/test/java/util/zip/ZipFile/TestZipFile.java
--- a/jdk/test/java/util/zip/ZipFile/TestZipFile.java Thu Sep 01 23:20:11 2016 +0000
+++ b/jdk/test/java/util/zip/ZipFile/TestZipFile.java Fri Sep 02 02:41:37 2016 +0000
@@ -8,7 +8,7 @@
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
diff -r b079fff22b3c -r de9ff562c112 jdk/test/javax/imageio/GetReaderWriterInfoNullTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/imageio/GetReaderWriterInfoNullTest.java Fri Sep 02 02:41:37 2016 +0000
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2016, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8163258
+ * @summary Test verifies that when we create our own ImageReaderSpi
+ * implementaion with MIMEType or FileSuffix as null, it should
+ * not throw NullPointerException when we call
+ * ImageIO.getReaderMIMETypes() or ImageIO.getReaderFileSuffixes().
+ * @run main GetReaderWriterInfoNullTest
+ */
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Locale;
+import javax.imageio.IIOException;
+import javax.imageio.ImageReadParam;
+import javax.imageio.ImageReader;
+import javax.imageio.ImageTypeSpecifier;
+import javax.imageio.metadata.IIOMetadata;
+import javax.imageio.spi.ImageReaderSpi;
+import javax.imageio.stream.ImageInputStream;
+import javax.imageio.ImageIO;
+import javax.imageio.spi.IIORegistry;
+
+class TestImageReaderSpi extends ImageReaderSpi {
+
+ public TestImageReaderSpi(String[] FORMATNAMES, String[] SUFFIXES,
+ String[] MIMETYPES) {
+ super("J Duke", // vendor
+ "1.0", // version
+ FORMATNAMES, // format names
+ SUFFIXES, // file suffixes
+ MIMETYPES, // mimetypes
+ "readTest.TestImageReader", // reader class name
+ new Class>[] { ImageInputStream.class }, // input types
+ null, // writer class names.
+ true, // supports native metadata,
+ null, // [no] native stream metadata format
+ null, // [no] native stream metadata class
+ null, // [no] native extra stream metadata format
+ null, // [no] native extra stream metadata class
+ true, // supports standard metadata,
+ null, // metadata format name,
+ null, // metadata format class name
+ null, // [no] extra image metadata format
+ null // [no] extra image metadata format class
+ );
+ }
+
+ @Override
+ public boolean canDecodeInput(Object source) throws IOException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getDescription(Locale locale) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public ImageReader createReaderInstance(Object extension)
+ throws IOException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+}
+
+class TestImageReader extends ImageReader {
+
+ public TestImageReader(ImageReaderSpi originatingProvider) {
+ super(originatingProvider);
+ }
+
+ @Override
+ public int getNumImages(boolean allowSearch) throws IOException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getWidth(int imageIndex) throws IOException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int getHeight(int imageIndex) throws IOException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Iterator