Mon, 03 Mar 2014 13:58:52 -0500
8035735: Metaspace::contains become extremely slow in some cases
Summary: Call is_metadata instead which does less work for the call in debugInfo.hpp which is called for all compiled code stack frames.
Reviewed-by: jmasa, dcubed
src/share/vm/code/debugInfo.hpp | file | annotate | diff | comparison | revisions | |
src/share/vm/oops/metadata.hpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/code/debugInfo.hpp Fri Apr 11 20:02:37 2014 +0000 1.2 +++ b/src/share/vm/code/debugInfo.hpp Mon Mar 03 13:58:52 2014 -0500 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2014, 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 @@ -273,8 +273,8 @@ 1.11 } 1.12 Method* read_method() { 1.13 Method* o = (Method*)(code()->metadata_at(read_int())); 1.14 - assert(o == NULL || 1.15 - o->is_metaspace_object(), "meta data only"); 1.16 + // is_metadata() is a faster check than is_metaspace_object() 1.17 + assert(o == NULL || o->is_metadata(), "meta data only"); 1.18 return o; 1.19 } 1.20 ScopeValue* read_object_value();
2.1 --- a/src/share/vm/oops/metadata.hpp Fri Apr 11 20:02:37 2014 +0000 2.2 +++ b/src/share/vm/oops/metadata.hpp Mon Mar 03 13:58:52 2014 -0500 2.3 @@ -42,6 +42,7 @@ 2.4 // Rehashing support for tables containing pointers to this 2.5 unsigned int new_hash(juint seed) { ShouldNotReachHere(); return 0; } 2.6 2.7 + virtual bool is_metadata() const volatile { return true; } 2.8 virtual bool is_klass() const volatile { return false; } 2.9 virtual bool is_method() const volatile { return false; } 2.10 virtual bool is_methodData() const volatile { return false; }