[8u-dev] Request for Review and Approval: 8198304: VS2017 (C4838, C4312) Various conversion issues with gtest tests

Kevin Walls kevin.walls at oracle.com
Thu Jun 21 11:31:54 UTC 2018


Hi,

I'd like to get review/approval for an 8u (partial) backport of:

8198304: VS2017 (C4838, C4312) Various conversion issues with gtest tests
jbs: https://bugs.openjdk.java.net/browse/JDK-8198304

It's a simple backport, a cast to avoid a compile error with later 
compilers, and introduces a #define as the same thing is repeated.

Only some of the changes are relevant for 8u, and in 11 they are 
"gtests" but in jdk8u they are in the regular source, #ifndef PRODUCT

jdk 11 diff:
http://hg.openjdk.java.net/jdk/jdk/rev/ba9da6aaae36

11 review thread:
http://mail.openjdk.java.net/pipermail/hotspot-dev/2018-February/030323.html

8u diff:

bash-4.2$ hg status
M src/share/vm/memory/guardedMemory.cpp
bash-4.2$ hg diff
diff -r c96534cd81fe src/share/vm/memory/guardedMemory.cpp
--- a/src/share/vm/memory/guardedMemory.cpp     Fri Jun 20 08:14:30 2014 
+0200
+++ b/src/share/vm/memory/guardedMemory.cpp     Thu Jun 21 03:51:32 2018 
-0700
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -84,6 +84,8 @@

  #ifndef PRODUCT

+#define GEN_PURPOSE_TAG ((void *) ((uintptr_t)0xf000f000))
+
  static void guarded_memory_test_check(void* p, size_t sz, void* tag) {
    assert(p != NULL, "NULL pointer given to check");
    u_char* c = (u_char*) p;
@@ -100,12 +102,12 @@
    assert(total_sz > 1 && total_sz >= (sizeof(GuardHeader) + 1 + 
sizeof(Guard)), "Unexpected size");
    u_char* basep = (u_char*) os::malloc(total_sz, mtInternal);

-  GuardedMemory guarded(basep, 1, (void*)0xf000f000);
+  GuardedMemory guarded(basep, 1, GEN_PURPOSE_TAG);

    assert(*basep == badResourceValue, "Expected guard in the form of 
badResourceValue");
    u_char* userp = guarded.get_user_ptr();
    assert(*userp == uninitBlockPad, "Expected uninitialized data in the 
form of uninitBlockPad");
-  guarded_memory_test_check(userp, 1, (void*)0xf000f000);
+  guarded_memory_test_check(userp, 1, GEN_PURPOSE_TAG);

    void* freep = guarded.release_for_freeing();
    assert((u_char*)freep == basep, "Expected the same pointer guard was ");
bash-4.2$



Thanks
Kevin



More information about the jdk8u-dev mailing list