< prev index next >
src/share/vm/memory/metaspaceShared.hpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2012, 2016, 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.
--- 1,7 ----
/*
! * Copyright (c) 2012, 2017, 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.
*** 30,50 ****
#include "memory/memRegion.hpp"
#include "memory/virtualspace.hpp"
#include "utilities/exceptions.hpp"
#include "utilities/macros.hpp"
- #define DEFAULT_VTBL_LIST_SIZE (17) // number of entries in the shared space vtable list.
- #define DEFAULT_VTBL_VIRTUALS_COUNT (200) // maximum number of virtual functions
- // If virtual functions are added to Metadata,
- // this number needs to be increased. Also,
- // SharedMiscCodeSize will need to be increased.
- // The following 2 sizes were based on
- // MetaspaceShared::generate_vtable_methods()
- #define DEFAULT_VTBL_METHOD_SIZE (16) // conservative size of the mov1 and jmp instructions
- // for the x64 platform
- #define DEFAULT_VTBL_COMMON_CODE_SIZE (1*K) // conservative size of the "common_code" for the x64 platform
-
#define DEFAULT_SHARED_READ_WRITE_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M))
#define MIN_SHARED_READ_WRITE_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M))
#define DEFAULT_SHARED_READ_ONLY_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M))
#define MIN_SHARED_READ_ONLY_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M))
--- 30,39 ----
*** 133,149 ****
static SharedMiscRegion _md;
static SharedMiscRegion _mc;
static SharedMiscRegion _od;
public:
enum {
- vtbl_list_size = DEFAULT_VTBL_LIST_SIZE,
- num_virtuals = DEFAULT_VTBL_VIRTUALS_COUNT,
- vtbl_method_size = DEFAULT_VTBL_METHOD_SIZE,
- vtbl_common_code_size = DEFAULT_VTBL_COMMON_CODE_SIZE
- };
-
- enum {
ro = 0, // read-only shared space in the heap
rw = 1, // read-write shared space in the heap
md = 2, // miscellaneous data for initializing tables, etc.
mc = 3, // miscellaneous code - vtable replacement.
max_strings = 2, // max number of string regions in string space
--- 122,131 ----
*** 192,205 ****
// Return true if given address is in the shared region corresponding to the idx
static bool is_in_shared_region(const void* p, int idx) NOT_CDS_RETURN_(false);
static bool is_string_region(int idx) NOT_CDS_RETURN_(false);
! static void generate_vtable_methods(void** vtbl_list,
! void** vtable,
! char** md_top, char* md_end,
! char** mc_top, char* mc_end);
static void serialize(SerializeClosure* sc, GrowableArray<MemRegion> *string_space,
size_t* space_size);
static MetaspaceSharedStats* stats() {
return &_stats;
--- 174,191 ----
// Return true if given address is in the shared region corresponding to the idx
static bool is_in_shared_region(const void* p, int idx) NOT_CDS_RETURN_(false);
static bool is_string_region(int idx) NOT_CDS_RETURN_(false);
! private:
! static intptr_t* allocate_cpp_vtable_clones(intptr_t* md_top, intptr_t* md_end);
! public:
! static intptr_t* clone_cpp_vtables(intptr_t* p);
! static intptr_t* init_cpp_vtable_clones(intptr_t* md_top, intptr_t* md_end);
! static void zero_cpp_vtable_clones_for_writing();
! static void patch_cpp_vtable_pointers();
!
static void serialize(SerializeClosure* sc, GrowableArray<MemRegion> *string_space,
size_t* space_size);
static MetaspaceSharedStats* stats() {
return &_stats;
< prev index next >