Wed, 13 Mar 2013 15:15:56 -0400
8009829: CDS: JDK JPRT test fails crash in Symbol::equals()
Summary: -Xshare:dump was creating a Symbol in C_heap. There's an assert there that jdk jprt wasn't hitting because it was only done in product
Reviewed-by: dholmes, hseigel, iklam
src/share/vm/classfile/symbolTable.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/classfile/symbolTable.cpp Wed Mar 13 13:47:35 2013 -0400 1.2 +++ b/src/share/vm/classfile/symbolTable.cpp Wed Mar 13 15:15:56 2013 -0400 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -49,18 +49,17 @@ 1.11 1.12 Symbol* sym; 1.13 1.14 - if (c_heap) { 1.15 + if (DumpSharedSpaces) { 1.16 + // Allocate all symbols to CLD shared metaspace 1.17 + sym = new (len, ClassLoaderData::the_null_class_loader_data(), THREAD) Symbol(name, len, -1); 1.18 + } else if (c_heap) { 1.19 // refcount starts as 1 1.20 - assert(!DumpSharedSpaces, "never allocate to C heap"); 1.21 sym = new (len, THREAD) Symbol(name, len, 1); 1.22 assert(sym != NULL, "new should call vm_exit_out_of_memory if C_HEAP is exhausted"); 1.23 } else { 1.24 - if (DumpSharedSpaces) { 1.25 - sym = new (len, ClassLoaderData::the_null_class_loader_data(), THREAD) Symbol(name, len, -1); 1.26 - } else { 1.27 + // Allocate to global arena 1.28 sym = new (len, arena(), THREAD) Symbol(name, len, -1); 1.29 } 1.30 - } 1.31 return sym; 1.32 } 1.33