8308396: Fix offset_of conversion warnings in runtime code

Reviewed-by: amitkumar, jsjolen, fparain
This commit is contained in:
Coleen Phillimore 2023-05-19 17:16:04 +00:00
parent a5343fa605
commit 265f40b4f7
85 changed files with 438 additions and 436 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2023, 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
@ -54,6 +54,9 @@ constexpr ByteSize operator + (ByteSize x, ByteSize y) { return in_ByteSize(in_b
constexpr ByteSize operator - (ByteSize x, ByteSize y) { return in_ByteSize(in_bytes(x) - in_bytes(y)); }
constexpr ByteSize operator * (ByteSize x, int y) { return in_ByteSize(in_bytes(x) * y ); }
constexpr bool operator == (ByteSize x, int y) { return in_bytes(x) == y; }
constexpr bool operator != (ByteSize x, int y) { return in_bytes(x) != y; }
// Use the following #define to get C++ field member offsets
#define byte_offset_of(klass,field) in_ByteSize((int)offset_of(klass, field))