--- a/hotspot/src/share/vm/memory/metaspaceShared.hpp Fri Mar 10 12:58:37 2017 -0500
+++ b/hotspot/src/share/vm/memory/metaspaceShared.hpp Fri Mar 03 23:08:35 2017 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -32,17 +32,6 @@
#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))
@@ -135,13 +124,6 @@
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.
@@ -194,10 +176,12 @@
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 intptr_t* allocate_cpp_vtable_clones(intptr_t* top, intptr_t* end);
+ static intptr_t* clone_cpp_vtables(intptr_t* p);
+ static void zero_cpp_vtable_clones_for_writing();
+ static void patch_cpp_vtable_pointers();
+ static bool is_valid_shared_method(const Method* m);
+
static void serialize(SerializeClosure* sc, GrowableArray<MemRegion> *string_space,
size_t* space_size);