< prev index next >

src/hotspot/share/classfile/stringTable.cpp

Print this page

        

*** 34,44 **** #include "logging/log.hpp" #include "logging/logStream.hpp" #include "memory/allocation.inline.hpp" #include "memory/filemap.hpp" #include "memory/heapShared.inline.hpp" - #include "memory/metaspaceShared.inline.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.hpp" #include "oops/access.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/typeArrayOop.inline.hpp" --- 34,43 ----
*** 796,817 **** } oop StringTable::create_archived_string(oop s, Thread* THREAD) { assert(DumpSharedSpaces, "this function is only used with -Xshare:dump"); ! if (MetaspaceShared::is_archive_object(s)) { return s; } oop new_s = NULL; typeArrayOop v = java_lang_String::value_no_keepalive(s); ! typeArrayOop new_v = ! (typeArrayOop)MetaspaceShared::archive_heap_object(v, THREAD); if (new_v == NULL) { return NULL; } ! new_s = MetaspaceShared::archive_heap_object(s, THREAD); if (new_s == NULL) { return NULL; } // adjust the pointer to the 'value' field in the new String oop --- 795,815 ---- } oop StringTable::create_archived_string(oop s, Thread* THREAD) { assert(DumpSharedSpaces, "this function is only used with -Xshare:dump"); ! if (HeapShared::is_archived_object(s)) { return s; } oop new_s = NULL; typeArrayOop v = java_lang_String::value_no_keepalive(s); ! typeArrayOop new_v = (typeArrayOop)HeapShared::archive_heap_object(v, THREAD); if (new_v == NULL) { return NULL; } ! new_s = HeapShared::archive_heap_object(s, THREAD); if (new_s == NULL) { return NULL; } // adjust the pointer to the 'value' field in the new String oop
*** 853,870 **** return true; } }; void StringTable::copy_shared_string_table(CompactStringTableWriter* writer) { ! assert(MetaspaceShared::is_heap_object_archiving_allowed(), "must be"); CopyToArchive copy(writer); StringTable::the_table()->_local_table->do_scan(Thread::current(), copy); } void StringTable::write_to_archive() { ! assert(MetaspaceShared::is_heap_object_archiving_allowed(), "must be"); _shared_table.reset(); int num_buckets = the_table()->_items_count / SharedSymbolTableBucketSize; // calculation of num_buckets can result in zero buckets, we need at least one CompactStringTableWriter writer(num_buckets > 1 ? num_buckets : 1, --- 851,868 ---- return true; } }; void StringTable::copy_shared_string_table(CompactStringTableWriter* writer) { ! assert(HeapShared::is_heap_object_archiving_allowed(), "must be"); CopyToArchive copy(writer); StringTable::the_table()->_local_table->do_scan(Thread::current(), copy); } void StringTable::write_to_archive() { ! assert(HeapShared::is_heap_object_archiving_allowed(), "must be"); _shared_table.reset(); int num_buckets = the_table()->_items_count / SharedSymbolTableBucketSize; // calculation of num_buckets can result in zero buckets, we need at least one CompactStringTableWriter writer(num_buckets > 1 ? num_buckets : 1,
< prev index next >