1 /*
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
358 };
359 static NARROW_OOP_MODE narrow_oop_mode();
360 static const char* narrow_oop_mode_to_string(NARROW_OOP_MODE mode);
361 static char* preferred_heap_base(size_t heap_size, size_t alignment, NARROW_OOP_MODE mode);
362 static char* preferred_metaspace_base(size_t heap_size, NARROW_OOP_MODE mode);
363 static address narrow_oop_base() { return _narrow_oop._base; }
364 static bool is_narrow_oop_base(void* addr) { return (narrow_oop_base() == (address)addr); }
365 static int narrow_oop_shift() { return _narrow_oop._shift; }
366 static bool narrow_oop_use_implicit_null_checks() { return _narrow_oop._use_implicit_null_checks; }
367
368 // For UseCompressedClassPointers
369 static address narrow_klass_base() { return _narrow_klass._base; }
370 static bool is_narrow_klass_base(void* addr) { return (narrow_klass_base() == (address)addr); }
371 static int narrow_klass_shift() { return _narrow_klass._shift; }
372 static bool narrow_klass_use_implicit_null_checks() { return _narrow_klass._use_implicit_null_checks; }
373
374 static address* narrow_ptrs_base_addr() { return &_narrow_ptrs_base; }
375 static void set_narrow_ptrs_base(address a) { _narrow_ptrs_base = a; }
376 static address narrow_ptrs_base() { return _narrow_ptrs_base; }
377
378 static void print_compressed_oops_mode();
379
380 // this is set in vm_version on sparc (and then reset in universe afaict)
381 static void set_narrow_oop_shift(int shift) {
382 _narrow_oop._shift = shift;
383 }
384
385 static void set_narrow_klass_shift(int shift) {
386 assert(shift == 0 || shift == LogKlassAlignmentInBytes, "invalid shift for klass ptrs");
387 _narrow_klass._shift = shift;
388 }
389
390 // Reserve Java heap and determine CompressedOops mode
391 static ReservedSpace reserve_heap(size_t heap_size, size_t alignment);
392
393 // Historic gc information
394 static size_t get_heap_capacity_at_last_gc() { return _heap_capacity_at_last_gc; }
395 static size_t get_heap_free_at_last_gc() { return _heap_capacity_at_last_gc - _heap_used_at_last_gc; }
396 static size_t get_heap_used_at_last_gc() { return _heap_used_at_last_gc; }
397 static void update_heap_info_at_gc();
398
|
1 /*
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
358 };
359 static NARROW_OOP_MODE narrow_oop_mode();
360 static const char* narrow_oop_mode_to_string(NARROW_OOP_MODE mode);
361 static char* preferred_heap_base(size_t heap_size, size_t alignment, NARROW_OOP_MODE mode);
362 static char* preferred_metaspace_base(size_t heap_size, NARROW_OOP_MODE mode);
363 static address narrow_oop_base() { return _narrow_oop._base; }
364 static bool is_narrow_oop_base(void* addr) { return (narrow_oop_base() == (address)addr); }
365 static int narrow_oop_shift() { return _narrow_oop._shift; }
366 static bool narrow_oop_use_implicit_null_checks() { return _narrow_oop._use_implicit_null_checks; }
367
368 // For UseCompressedClassPointers
369 static address narrow_klass_base() { return _narrow_klass._base; }
370 static bool is_narrow_klass_base(void* addr) { return (narrow_klass_base() == (address)addr); }
371 static int narrow_klass_shift() { return _narrow_klass._shift; }
372 static bool narrow_klass_use_implicit_null_checks() { return _narrow_klass._use_implicit_null_checks; }
373
374 static address* narrow_ptrs_base_addr() { return &_narrow_ptrs_base; }
375 static void set_narrow_ptrs_base(address a) { _narrow_ptrs_base = a; }
376 static address narrow_ptrs_base() { return _narrow_ptrs_base; }
377
378 static void print_compressed_oops_mode(outputStream* st);
379
380 // this is set in vm_version on sparc (and then reset in universe afaict)
381 static void set_narrow_oop_shift(int shift) {
382 _narrow_oop._shift = shift;
383 }
384
385 static void set_narrow_klass_shift(int shift) {
386 assert(shift == 0 || shift == LogKlassAlignmentInBytes, "invalid shift for klass ptrs");
387 _narrow_klass._shift = shift;
388 }
389
390 // Reserve Java heap and determine CompressedOops mode
391 static ReservedSpace reserve_heap(size_t heap_size, size_t alignment);
392
393 // Historic gc information
394 static size_t get_heap_capacity_at_last_gc() { return _heap_capacity_at_last_gc; }
395 static size_t get_heap_free_at_last_gc() { return _heap_capacity_at_last_gc - _heap_used_at_last_gc; }
396 static size_t get_heap_used_at_last_gc() { return _heap_used_at_last_gc; }
397 static void update_heap_info_at_gc();
398
|