8197864: VS2017 (C4334) Result of 32-bit Shift Implicitly Converted to 64 bits
authorlfoltan
Mon, 26 Feb 2018 10:20:06 -0500
changeset 49168 23348e42fb34
parent 49167 ba9da6aaae36
child 49169 af8578e25d17
8197864: VS2017 (C4334) Result of 32-bit Shift Implicitly Converted to 64 bits Summary: Correctly perform a 64 bit shift when setting SlowSignatureHandler::_fp_identifiers. Reviewed-by: gtriantafill, hseigel Contributed-by: kim.barrett@oracle.com, lois.foltan@oracle.com
src/hotspot/cpu/x86/interpreterRT_x86_64.cpp
--- a/src/hotspot/cpu/x86/interpreterRT_x86_64.cpp	Mon Feb 26 10:11:05 2018 -0500
+++ b/src/hotspot/cpu/x86/interpreterRT_x86_64.cpp	Mon Feb 26 10:20:06 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -346,8 +346,9 @@
     _from -= Interpreter::stackElementSize;
 
     if (_num_args < Argument::n_float_register_parameters_c-1) {
+      assert((_num_args*2) < BitsPerWord, "_num_args*2 is out of range");
       *_reg_args++ = from_obj;
-      *_fp_identifiers |= (intptr_t)(0x01 << (_num_args*2)); // mark as float
+      *_fp_identifiers |= ((intptr_t)0x01 << (_num_args*2)); // mark as float
       _num_args++;
     } else {
       *_to++ = from_obj;
@@ -360,8 +361,9 @@
     _from -= 2*Interpreter::stackElementSize;
 
     if (_num_args < Argument::n_float_register_parameters_c-1) {
+      assert((_num_args*2) < BitsPerWord, "_num_args*2 is out of range");
       *_reg_args++ = from_obj;
-      *_fp_identifiers |= (intptr_t)(0x3 << (_num_args*2)); // mark as double
+      *_fp_identifiers |= ((intptr_t)0x3 << (_num_args*2)); // mark as double
       _num_args++;
     } else {
       *_to++ = from_obj;