8178351: Simplify MetaspaceShared::is_in_shared_space and MetaspaceObj::is_shared

Use a single range check with MetaspaceObj::_shared_metaspace_{base,top}

Reviewed-by: jiangli, redestad, shade
This commit is contained in:
Ioi Lam 2018-01-16 16:57:53 -08:00
parent dcb4e73a38
commit a3cb6e9204
15 changed files with 93 additions and 90 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, 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
@ -2180,7 +2180,7 @@ bool Method::is_valid_method() const {
} else if ((intptr_t(this) & (wordSize-1)) != 0) {
// Quick sanity check on pointer.
return false;
} else if (MetaspaceShared::is_in_shared_space(this)) {
} else if (is_shared()) {
return MetaspaceShared::is_valid_shared_method(this);
} else if (Metaspace::contains_non_shared(this)) {
return has_method_vptr((const void*)this);