changeset 57792:ec9dead6ae87

8237512: AArch64: aarch64TestHook leaks a BufferBlob Reviewed-by: adinn, aph
author ngasson
date Wed, 22 Jan 2020 09:08:36 +0000
parents 055d9be4dd30
children e2bc57500c1b
files src/hotspot/cpu/aarch64/aarch64Test.cpp src/hotspot/cpu/aarch64/assembler_aarch64.cpp src/hotspot/cpu/aarch64/icache_aarch64.cpp
diffstat 3 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/cpu/aarch64/aarch64Test.cpp	Wed Jan 22 14:16:14 2020 +0530
+++ b/src/hotspot/cpu/aarch64/aarch64Test.cpp	Wed Jan 22 09:08:36 2020 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Red Hat Inc. All rights reserved.
+ * Copyright (c) 2014, 2020, Red Hat Inc. 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
@@ -32,10 +32,12 @@
 
 extern "C" void entry(CodeBuffer*);
 
+#ifdef ASSERT
 void aarch64TestHook()
 {
   BufferBlob* b = BufferBlob::create("aarch64Test", 500000);
   CodeBuffer code(b);
-  MacroAssembler _masm(&code);
   entry(&code);
+  BufferBlob::free(b);
 }
+#endif
--- a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp	Wed Jan 22 14:16:14 2020 +0530
+++ b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp	Wed Jan 22 09:08:36 2020 +0000
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2014, Red Hat Inc. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2020 Red Hat Inc. 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
@@ -73,7 +73,6 @@
     }
     assert(ok, "Assembler smoke test failed");
   }
-#endif // ASSERT
 
 void entry(CodeBuffer *cb) {
 
@@ -91,7 +90,6 @@
 
   // Smoke test for assembler
 
-#ifdef ASSERT
 // BEGIN  Generated code -- do not edit
 // Generated by aarch64-asmtest.py
     Label back, forth;
@@ -1459,9 +1457,8 @@
     asm_check((unsigned int *)PC, vector_insns,
               sizeof vector_insns / sizeof vector_insns[0]);
   }
-
+}
 #endif // ASSERT
-}
 
 #undef __
 
--- a/src/hotspot/cpu/aarch64/icache_aarch64.cpp	Wed Jan 22 14:16:14 2020 +0530
+++ b/src/hotspot/cpu/aarch64/icache_aarch64.cpp	Wed Jan 22 09:08:36 2020 +0000
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2014, Red Hat Inc. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2020 Red Hat Inc. 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
@@ -24,7 +24,6 @@
  */
 
 #include "precompiled.hpp"
-#include "asm/macroAssembler.hpp"
 #include "runtime/icache.hpp"
 
 extern void aarch64TestHook();
@@ -36,5 +35,7 @@
 }
 
 void ICache::initialize() {
+#ifdef ASSERT
   aarch64TestHook();
+#endif
 }