changeset 8857:21681548b712

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: lfoltan, gtriantafill, hseigel Contributed-by: kim.barrett@oracle.com, lois.foltan@oracle.com
author kevinw
date Fri, 15 Jun 2018 08:34:38 -0700
parents c741a7bc982a
children ae93017b2930
files src/cpu/x86/vm/interpreterRT_x86_64.cpp
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/x86/vm/interpreterRT_x86_64.cpp	Thu Jun 14 21:39:57 2018 +0000
+++ b/src/cpu/x86/vm/interpreterRT_x86_64.cpp	Fri Jun 15 08:34:38 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, 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;