< prev index next >

src/share/vm/opto/c2compiler.cpp

Print this page
rev 12711 : 8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
Reviewed-by: psandoz, dholmes, thartmann
Contributed-by: ron.pressler@oracle.com, claes.redestad@oracle.com
   1 /*
   2  * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 227     break;
 228   case vmIntrinsics::_numberOfTrailingZeros_i:
 229     if (!Matcher::match_rule_supported(Op_CountTrailingZerosI)) return false;
 230     break;
 231   case vmIntrinsics::_numberOfTrailingZeros_l:
 232     if (!Matcher::match_rule_supported(Op_CountTrailingZerosL)) return false;
 233     break;
 234   case vmIntrinsics::_reverseBytes_c:
 235     if (!Matcher::match_rule_supported(Op_ReverseBytesUS)) return false;
 236     break;
 237   case vmIntrinsics::_reverseBytes_s:
 238     if (!Matcher::match_rule_supported(Op_ReverseBytesS)) return false;
 239     break;
 240   case vmIntrinsics::_reverseBytes_i:
 241     if (!Matcher::match_rule_supported(Op_ReverseBytesI)) return false;
 242     break;
 243   case vmIntrinsics::_reverseBytes_l:
 244     if (!Matcher::match_rule_supported(Op_ReverseBytesL)) return false;
 245     break;
 246 
 247   /* CompareAndSwap, Object: */
 248   case vmIntrinsics::_compareAndSwapObject:
 249 #ifdef _LP64
 250     if ( UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndSwapN)) return false;
 251     if (!UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndSwapP)) return false;
 252 #else
 253     if (!Matcher::match_rule_supported(Op_CompareAndSwapP)) return false;
 254 #endif
 255     break;
 256   case vmIntrinsics::_weakCompareAndSwapObject:
 257   case vmIntrinsics::_weakCompareAndSwapObjectAcquire:
 258   case vmIntrinsics::_weakCompareAndSwapObjectRelease:
 259   case vmIntrinsics::_weakCompareAndSwapObjectVolatile:
 260 #ifdef _LP64
 261     if ( UseCompressedOops && !Matcher::match_rule_supported(Op_WeakCompareAndSwapN)) return false;
 262     if (!UseCompressedOops && !Matcher::match_rule_supported(Op_WeakCompareAndSwapP)) return false;
 263 #else
 264     if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapP)) return false;
 265 #endif
 266     break;
 267   /* CompareAndSwap, Long: */
 268   case vmIntrinsics::_compareAndSwapLong:
 269     if (!Matcher::match_rule_supported(Op_CompareAndSwapL)) return false;
 270     break;
 271   case vmIntrinsics::_weakCompareAndSwapLong:
 272   case vmIntrinsics::_weakCompareAndSwapLongAcquire:
 273   case vmIntrinsics::_weakCompareAndSwapLongRelease:
 274   case vmIntrinsics::_weakCompareAndSwapLongVolatile:
 275     if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapL)) return false;
 276     break;
 277 
 278   /* CompareAndSwap, Int: */
 279   case vmIntrinsics::_compareAndSwapInt:
 280     if (!Matcher::match_rule_supported(Op_CompareAndSwapI)) return false;
 281     break;
 282   case vmIntrinsics::_weakCompareAndSwapInt:
 283   case vmIntrinsics::_weakCompareAndSwapIntAcquire:
 284   case vmIntrinsics::_weakCompareAndSwapIntRelease:
 285   case vmIntrinsics::_weakCompareAndSwapIntVolatile:
 286     if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapL)) return false;
 287     break;
 288 
 289   /* CompareAndSwap, Byte: */
 290   case vmIntrinsics::_compareAndSwapByte:
 291     if (!Matcher::match_rule_supported(Op_CompareAndSwapB)) return false;
 292     break;
 293   case vmIntrinsics::_weakCompareAndSwapByte:
 294   case vmIntrinsics::_weakCompareAndSwapByteAcquire:
 295   case vmIntrinsics::_weakCompareAndSwapByteRelease:
 296   case vmIntrinsics::_weakCompareAndSwapByteVolatile:
 297     if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapB)) return false;
 298     break;
 299 
 300   /* CompareAndSwap, Short: */
 301   case vmIntrinsics::_compareAndSwapShort:
 302     if (!Matcher::match_rule_supported(Op_CompareAndSwapS)) return false;
 303     break;
 304   case vmIntrinsics::_weakCompareAndSwapShort:
 305   case vmIntrinsics::_weakCompareAndSwapShortAcquire:
 306   case vmIntrinsics::_weakCompareAndSwapShortRelease:
 307   case vmIntrinsics::_weakCompareAndSwapShortVolatile:
 308     if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapS)) return false;
 309     break;
 310 
 311   /* CompareAndExchange, Object: */
 312   case vmIntrinsics::_compareAndExchangeObjectVolatile:
 313   case vmIntrinsics::_compareAndExchangeObjectAcquire:
 314   case vmIntrinsics::_compareAndExchangeObjectRelease:
 315 #ifdef _LP64
 316     if ( UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndExchangeN)) return false;
 317     if (!UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndExchangeP)) return false;
 318 #else
 319     if (!Matcher::match_rule_supported(Op_CompareAndExchangeP)) return false;
 320 #endif
 321     break;
 322 
 323   /* CompareAndExchange, Long: */
 324   case vmIntrinsics::_compareAndExchangeLongVolatile:
 325   case vmIntrinsics::_compareAndExchangeLongAcquire:
 326   case vmIntrinsics::_compareAndExchangeLongRelease:
 327     if (!Matcher::match_rule_supported(Op_CompareAndExchangeL)) return false;
 328     break;
 329 
 330   /* CompareAndExchange, Int: */
 331   case vmIntrinsics::_compareAndExchangeIntVolatile:
 332   case vmIntrinsics::_compareAndExchangeIntAcquire:
 333   case vmIntrinsics::_compareAndExchangeIntRelease:
 334     if (!Matcher::match_rule_supported(Op_CompareAndExchangeI)) return false;
 335     break;
 336 
 337   /* CompareAndExchange, Byte: */
 338   case vmIntrinsics::_compareAndExchangeByteVolatile:
 339   case vmIntrinsics::_compareAndExchangeByteAcquire:
 340   case vmIntrinsics::_compareAndExchangeByteRelease:
 341     if (!Matcher::match_rule_supported(Op_CompareAndExchangeB)) return false;
 342     break;
 343 
 344   /* CompareAndExchange, Short: */
 345   case vmIntrinsics::_compareAndExchangeShortVolatile:
 346   case vmIntrinsics::_compareAndExchangeShortAcquire:
 347   case vmIntrinsics::_compareAndExchangeShortRelease:
 348     if (!Matcher::match_rule_supported(Op_CompareAndExchangeS)) return false;
 349     break;
 350 
 351   case vmIntrinsics::_getAndAddByte:
 352     if (!Matcher::match_rule_supported(Op_GetAndAddB)) return false;
 353     break;
 354   case vmIntrinsics::_getAndAddShort:
 355     if (!Matcher::match_rule_supported(Op_GetAndAddS)) return false;
 356     break;
 357   case vmIntrinsics::_getAndAddInt:
 358     if (!Matcher::match_rule_supported(Op_GetAndAddI)) return false;
 359     break;
 360   case vmIntrinsics::_getAndAddLong:
 361     if (!Matcher::match_rule_supported(Op_GetAndAddL)) return false;
 362     break;
 363 
 364   case vmIntrinsics::_getAndSetByte:
 365     if (!Matcher::match_rule_supported(Op_GetAndSetB)) return false;


   1 /*
   2  * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 227     break;
 228   case vmIntrinsics::_numberOfTrailingZeros_i:
 229     if (!Matcher::match_rule_supported(Op_CountTrailingZerosI)) return false;
 230     break;
 231   case vmIntrinsics::_numberOfTrailingZeros_l:
 232     if (!Matcher::match_rule_supported(Op_CountTrailingZerosL)) return false;
 233     break;
 234   case vmIntrinsics::_reverseBytes_c:
 235     if (!Matcher::match_rule_supported(Op_ReverseBytesUS)) return false;
 236     break;
 237   case vmIntrinsics::_reverseBytes_s:
 238     if (!Matcher::match_rule_supported(Op_ReverseBytesS)) return false;
 239     break;
 240   case vmIntrinsics::_reverseBytes_i:
 241     if (!Matcher::match_rule_supported(Op_ReverseBytesI)) return false;
 242     break;
 243   case vmIntrinsics::_reverseBytes_l:
 244     if (!Matcher::match_rule_supported(Op_ReverseBytesL)) return false;
 245     break;
 246 
 247   /* CompareAndSet, Object: */
 248   case vmIntrinsics::_compareAndSetObject:
 249 #ifdef _LP64
 250     if ( UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndSwapN)) return false;
 251     if (!UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndSwapP)) return false;
 252 #else
 253     if (!Matcher::match_rule_supported(Op_CompareAndSwapP)) return false;
 254 #endif
 255     break;
 256   case vmIntrinsics::_weakCompareAndSetObjectPlain:
 257   case vmIntrinsics::_weakCompareAndSetObjectAcquire:
 258   case vmIntrinsics::_weakCompareAndSetObjectRelease:
 259   case vmIntrinsics::_weakCompareAndSetObject:
 260 #ifdef _LP64
 261     if ( UseCompressedOops && !Matcher::match_rule_supported(Op_WeakCompareAndSwapN)) return false;
 262     if (!UseCompressedOops && !Matcher::match_rule_supported(Op_WeakCompareAndSwapP)) return false;
 263 #else
 264     if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapP)) return false;
 265 #endif
 266     break;
 267   /* CompareAndSet, Long: */
 268   case vmIntrinsics::_compareAndSetLong:
 269     if (!Matcher::match_rule_supported(Op_CompareAndSwapL)) return false;
 270     break;
 271   case vmIntrinsics::_weakCompareAndSetLongPlain:
 272   case vmIntrinsics::_weakCompareAndSetLongAcquire:
 273   case vmIntrinsics::_weakCompareAndSetLongRelease:
 274   case vmIntrinsics::_weakCompareAndSetLong:
 275     if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapL)) return false;
 276     break;
 277 
 278   /* CompareAndSet, Int: */
 279   case vmIntrinsics::_compareAndSetInt:
 280     if (!Matcher::match_rule_supported(Op_CompareAndSwapI)) return false;
 281     break;
 282   case vmIntrinsics::_weakCompareAndSetIntPlain:
 283   case vmIntrinsics::_weakCompareAndSetIntAcquire:
 284   case vmIntrinsics::_weakCompareAndSetIntRelease:
 285   case vmIntrinsics::_weakCompareAndSetInt:
 286     if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapL)) return false;
 287     break;
 288 
 289   /* CompareAndSet, Byte: */
 290   case vmIntrinsics::_compareAndSetByte:
 291     if (!Matcher::match_rule_supported(Op_CompareAndSwapB)) return false;
 292     break;
 293   case vmIntrinsics::_weakCompareAndSetBytePlain:
 294   case vmIntrinsics::_weakCompareAndSetByteAcquire:
 295   case vmIntrinsics::_weakCompareAndSetByteRelease:
 296   case vmIntrinsics::_weakCompareAndSetByte:
 297     if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapB)) return false;
 298     break;
 299 
 300   /* CompareAndSet, Short: */
 301   case vmIntrinsics::_compareAndSetShort:
 302     if (!Matcher::match_rule_supported(Op_CompareAndSwapS)) return false;
 303     break;
 304   case vmIntrinsics::_weakCompareAndSetShortPlain:
 305   case vmIntrinsics::_weakCompareAndSetShortAcquire:
 306   case vmIntrinsics::_weakCompareAndSetShortRelease:
 307   case vmIntrinsics::_weakCompareAndSetShort:
 308     if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapS)) return false;
 309     break;
 310 
 311   /* CompareAndExchange, Object: */
 312   case vmIntrinsics::_compareAndExchangeObject:
 313   case vmIntrinsics::_compareAndExchangeObjectAcquire:
 314   case vmIntrinsics::_compareAndExchangeObjectRelease:
 315 #ifdef _LP64
 316     if ( UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndExchangeN)) return false;
 317     if (!UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndExchangeP)) return false;
 318 #else
 319     if (!Matcher::match_rule_supported(Op_CompareAndExchangeP)) return false;
 320 #endif
 321     break;
 322 
 323   /* CompareAndExchange, Long: */
 324   case vmIntrinsics::_compareAndExchangeLong:
 325   case vmIntrinsics::_compareAndExchangeLongAcquire:
 326   case vmIntrinsics::_compareAndExchangeLongRelease:
 327     if (!Matcher::match_rule_supported(Op_CompareAndExchangeL)) return false;
 328     break;
 329 
 330   /* CompareAndExchange, Int: */
 331   case vmIntrinsics::_compareAndExchangeInt:
 332   case vmIntrinsics::_compareAndExchangeIntAcquire:
 333   case vmIntrinsics::_compareAndExchangeIntRelease:
 334     if (!Matcher::match_rule_supported(Op_CompareAndExchangeI)) return false;
 335     break;
 336 
 337   /* CompareAndExchange, Byte: */
 338   case vmIntrinsics::_compareAndExchangeByte:
 339   case vmIntrinsics::_compareAndExchangeByteAcquire:
 340   case vmIntrinsics::_compareAndExchangeByteRelease:
 341     if (!Matcher::match_rule_supported(Op_CompareAndExchangeB)) return false;
 342     break;
 343 
 344   /* CompareAndExchange, Short: */
 345   case vmIntrinsics::_compareAndExchangeShort:
 346   case vmIntrinsics::_compareAndExchangeShortAcquire:
 347   case vmIntrinsics::_compareAndExchangeShortRelease:
 348     if (!Matcher::match_rule_supported(Op_CompareAndExchangeS)) return false;
 349     break;
 350 
 351   case vmIntrinsics::_getAndAddByte:
 352     if (!Matcher::match_rule_supported(Op_GetAndAddB)) return false;
 353     break;
 354   case vmIntrinsics::_getAndAddShort:
 355     if (!Matcher::match_rule_supported(Op_GetAndAddS)) return false;
 356     break;
 357   case vmIntrinsics::_getAndAddInt:
 358     if (!Matcher::match_rule_supported(Op_GetAndAddI)) return false;
 359     break;
 360   case vmIntrinsics::_getAndAddLong:
 361     if (!Matcher::match_rule_supported(Op_GetAndAddL)) return false;
 362     break;
 363 
 364   case vmIntrinsics::_getAndSetByte:
 365     if (!Matcher::match_rule_supported(Op_GetAndSetB)) return false;


< prev index next >