# HG changeset patch # User coleenp # Date 1393873132 18000 # Node ID 7380034e5b31bbc66f88d56df524706a531dd8de # Parent 2edca307b15a05698376c48f99b8422f7a9e775e 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 diff -r 2edca307b15a -r 7380034e5b31 src/share/vm/code/debugInfo.hpp --- a/src/share/vm/code/debugInfo.hpp Sat Mar 01 09:56:15 2014 -0800 +++ b/src/share/vm/code/debugInfo.hpp Mon Mar 03 13:58:52 2014 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -273,8 +273,8 @@ } Method* read_method() { Method* o = (Method*)(code()->metadata_at(read_int())); - assert(o == NULL || - o->is_metaspace_object(), "meta data only"); + // is_metadata() is a faster check than is_metaspace_object() + assert(o == NULL || o->is_metadata(), "meta data only"); return o; } ScopeValue* read_object_value(); diff -r 2edca307b15a -r 7380034e5b31 src/share/vm/oops/metadata.hpp --- a/src/share/vm/oops/metadata.hpp Sat Mar 01 09:56:15 2014 -0800 +++ b/src/share/vm/oops/metadata.hpp Mon Mar 03 13:58:52 2014 -0500 @@ -42,6 +42,7 @@ // Rehashing support for tables containing pointers to this unsigned int new_hash(juint seed) { ShouldNotReachHere(); return 0; } + virtual bool is_metadata() const volatile { return true; } virtual bool is_klass() const volatile { return false; } virtual bool is_method() const volatile { return false; } virtual bool is_methodData() const volatile { return false; }