< prev index next >
src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
Print this page
rev 56448 : imported patch 8220310.mut.0
rev 56449 : imported patch 8220310.mut.1
rev 56450 : imported patch 8220310.mut.2
rev 56451 : imported patch 8220310.mut.3-thomas
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, 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.
@@ -21,27 +21,28 @@
* questions.
*
*/
#include "precompiled.hpp"
+#include "gc/g1/g1MemoryNodeManager.hpp"
#include "gc/g1/g1PageBasedVirtualSpace.hpp"
#include "gc/shared/workgroup.hpp"
#include "oops/markWord.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/os.inline.hpp"
#include "services/memTracker.hpp"
#include "utilities/align.hpp"
#include "utilities/bitMap.inline.hpp"
-G1PageBasedVirtualSpace::G1PageBasedVirtualSpace(ReservedSpace rs, size_t used_size, size_t page_size) :
+G1PageBasedVirtualSpace::G1PageBasedVirtualSpace(ReservedSpace rs, size_t used_size, size_t page_size, MemoryType type) :
_low_boundary(NULL), _high_boundary(NULL), _tail_size(0), _page_size(0),
- _committed(mtGC), _dirty(mtGC), _special(false), _executable(false) {
- initialize_with_page_size(rs, used_size, page_size);
+ _committed(mtGC), _dirty(mtGC), _special(false), _executable(false), _memory_type(type) {
+ initialize_with_page_size(rs, used_size, page_size, type);
}
-void G1PageBasedVirtualSpace::initialize_with_page_size(ReservedSpace rs, size_t used_size, size_t page_size) {
+void G1PageBasedVirtualSpace::initialize_with_page_size(ReservedSpace rs, size_t used_size, size_t page_size, MemoryType type) {
guarantee(rs.is_reserved(), "Given reserved space must have been reserved already.");
vmassert(_low_boundary == NULL, "VirtualSpace already initialized");
vmassert(page_size > 0, "Page size must be non-zero.");
@@ -208,10 +209,21 @@
_committed.set_range(start_page, end_page);
return zero_filled;
}
+void G1PageBasedVirtualSpace::request_memory_on_node(size_t start_page, size_t size_in_pages, uint node_index) {
+ // Only request if this space is for java heap.
+ if (_memory_type == mtJavaHeap) {
+ // We need to make sure the given area is committed.
+ guarantee(is_area_committed(start_page, size_in_pages), "Specified area is not committed");
+
+ char* start_addr = page_start(start_page);
+ G1MemoryNodeManager::mgr()->request_memory_on_node(start_addr, size_in_pages * _page_size, node_index);
+ }
+}
+
void G1PageBasedVirtualSpace::uncommit_internal(size_t start_page, size_t end_page) {
guarantee(start_page < end_page,
"Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page);
char* start_addr = page_start(start_page);
< prev index next >