8141570: Fix Zero interpreter build for --disable-precompiled-headers
Summary: change to include atomic.inline.hpp and allocation.inline.hpp only in .cpp files and some build fixes from Kim to build on ubuntu without devkits
Reviewed-by: kbarrett, sgehwolf, erikj
--- a/hotspot/make/linux/makefiles/zeroshark.make Tue Nov 17 15:14:29 2015 -0800
+++ b/hotspot/make/linux/makefiles/zeroshark.make Wed Nov 18 11:47:55 2015 -0500
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright 2007, 2008 Red Hat, Inc.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
@@ -25,8 +25,16 @@
# Setup common to Zero (non-Shark) and Shark versions of VM
-# override this from the main file because some version of llvm do not like -Wundef
-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wunused-function -Wunused-value
+# Some versions of llvm do not like -Wundef
+ifeq ($(USE_CLANG), true)
+ WARNING_FLAGS += -Wno-undef
+endif
+# Suppress some warning flags that are normally turned on for hotspot,
+# because some of the zero code has not been updated accordingly.
+WARNING_FLAGS += -Wno-return-type \
+ -Wno-format-nonliteral -Wno-format-security \
+ -Wno-maybe-uninitialized
+
# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
@@ -42,5 +50,3 @@
ifeq ($(ARCH_DATA_MODEL), 64)
CFLAGS += -D_LP64=1
endif
-
-OPT_CFLAGS/compactingPermGenGen.o = -O1
--- a/hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp Tue Nov 17 15:14:29 2015 -0800
+++ b/hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp Wed Nov 18 11:47:55 2015 -0500
@@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "gc/g1/g1AllocRegion.inline.hpp"
+#include "gc/g1/g1EvacStats.inline.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "runtime/orderAccess.inline.hpp"
--- a/hotspot/src/share/vm/gc/g1/g1Allocator.cpp Tue Nov 17 15:14:29 2015 -0800
+++ b/hotspot/src/share/vm/gc/g1/g1Allocator.cpp Wed Nov 18 11:47:55 2015 -0500
@@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "gc/g1/g1Allocator.inline.hpp"
#include "gc/g1/g1AllocRegion.inline.hpp"
+#include "gc/g1/g1EvacStats.inline.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1CollectorPolicy.hpp"
#include "gc/g1/g1MarkSweep.hpp"
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp Tue Nov 17 15:14:29 2015 -0800
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp Wed Nov 18 11:47:55 2015 -0500
@@ -37,6 +37,7 @@
#include "gc/g1/g1CollectorState.hpp"
#include "gc/g1/g1ErgoVerbose.hpp"
#include "gc/g1/g1EvacFailure.hpp"
+#include "gc/g1/g1EvacStats.inline.hpp"
#include "gc/g1/g1GCPhaseTimes.hpp"
#include "gc/g1/g1Log.hpp"
#include "gc/g1/g1MarkSweep.hpp"
--- a/hotspot/src/share/vm/gc/g1/g1EvacStats.cpp Tue Nov 17 15:14:29 2015 -0800
+++ b/hotspot/src/share/vm/gc/g1/g1EvacStats.cpp Wed Nov 18 11:47:55 2015 -0500
@@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
#include "gc/g1/g1EvacStats.hpp"
#include "gc/shared/gcId.hpp"
#include "trace/tracing.hpp"
@@ -114,3 +115,4 @@
reset();
}
+G1EvacStats::~G1EvacStats() { }
--- a/hotspot/src/share/vm/gc/g1/g1EvacStats.hpp Tue Nov 17 15:14:29 2015 -0800
+++ b/hotspot/src/share/vm/gc/g1/g1EvacStats.hpp Wed Nov 18 11:47:55 2015 -0500
@@ -22,11 +22,10 @@
*
*/
-#ifndef SHARE_VM_gc_G1_G1EVACSTATS_HPP
-#define SHARE_VM_gc_G1_G1EVACSTATS_HPP
+#ifndef SHARE_VM_GC_G1_G1EVACSTATS_HPP
+#define SHARE_VM_GC_G1_G1EVACSTATS_HPP
#include "gc/shared/plab.hpp"
-#include "runtime/atomic.hpp"
// Records various memory allocation statistics gathered during evacuation.
class G1EvacStats : public PLABStats {
@@ -75,19 +74,11 @@
// Amount of space in heapwords wasted (unused) in the failing regions when an evacuation failure happens.
size_t failure_waste() const { return _failure_waste; }
- void add_direct_allocated(size_t value) {
- Atomic::add_ptr(value, &_direct_allocated);
- }
+ inline void add_direct_allocated(size_t value);
+ inline void add_region_end_waste(size_t value);
+ inline void add_failure_used_and_waste(size_t used, size_t waste);
- void add_region_end_waste(size_t value) {
- Atomic::add_ptr(value, &_region_end_waste);
- Atomic::add_ptr(1, &_regions_filled);
- }
-
- void add_failure_used_and_waste(size_t used, size_t waste) {
- Atomic::add_ptr(used, &_failure_used);
- Atomic::add_ptr(waste, &_failure_waste);
- }
+ ~G1EvacStats();
};
-#endif // SHARE_VM_gc_G1_G1EVACSTATS_HPP
+#endif // SHARE_VM_GC_G1_G1EVACSTATS_HPP
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc/g1/g1EvacStats.inline.hpp Wed Nov 18 11:47:55 2015 -0500
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_G1_G1EVACSTATS_INLINE_HPP
+#define SHARE_VM_GC_G1_G1EVACSTATS_INLINE_HPP
+
+#include "gc/g1/g1EvacStats.hpp"
+#include "runtime/atomic.inline.hpp"
+
+inline void G1EvacStats::add_direct_allocated(size_t value) {
+ Atomic::add_ptr(value, &_direct_allocated);
+}
+
+inline void G1EvacStats::add_region_end_waste(size_t value) {
+ Atomic::add_ptr(value, &_region_end_waste);
+ Atomic::add_ptr(1, &_regions_filled);
+}
+
+inline void G1EvacStats::add_failure_used_and_waste(size_t used, size_t waste) {
+ Atomic::add_ptr(used, &_failure_used);
+ Atomic::add_ptr(waste, &_failure_waste);
+}
+
+#endif // SHARE_VM_GC_G1_G1EVACSTATS_INLINE_HPP
--- a/hotspot/src/share/vm/runtime/java.cpp Tue Nov 17 15:14:29 2015 -0800
+++ b/hotspot/src/share/vm/runtime/java.cpp Wed Nov 18 11:47:55 2015 -0500
@@ -49,6 +49,7 @@
#include "runtime/arguments.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/compilationPolicy.hpp"
+#include "runtime/deoptimization.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/init.hpp"
#include "runtime/interfaceSupport.hpp"