1.1 --- a/src/share/vm/ci/ciInstanceKlass.cpp Tue Dec 13 10:07:12 2016 -0800 1.2 +++ b/src/share/vm/ci/ciInstanceKlass.cpp Tue Dec 13 14:37:04 2016 -0500 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1999, 2016, 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 @@ -58,6 +58,7 @@ 1.11 _nonstatic_field_size = ik->nonstatic_field_size(); 1.12 _has_nonstatic_fields = ik->has_nonstatic_fields(); 1.13 _has_default_methods = ik->has_default_methods(); 1.14 + _is_anonymous = ik->is_anonymous(); 1.15 _nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields: 1.16 1.17 _implementor = NULL; // we will fill these lazily 1.18 @@ -100,6 +101,7 @@ 1.19 _nonstatic_field_size = -1; 1.20 _has_nonstatic_fields = false; 1.21 _nonstatic_fields = NULL; 1.22 + _is_anonymous = false; 1.23 _loader = loader; 1.24 _protection_domain = protection_domain; 1.25 _is_shared = false; 1.26 @@ -591,6 +593,16 @@ 1.27 return impl; 1.28 } 1.29 1.30 +ciInstanceKlass* ciInstanceKlass::host_klass() { 1.31 + assert(is_loaded(), "must be loaded"); 1.32 + if (is_anonymous()) { 1.33 + VM_ENTRY_MARK 1.34 + Klass* host_klass = get_instanceKlass()->host_klass(); 1.35 + return CURRENT_ENV->get_instance_klass(host_klass); 1.36 + } 1.37 + return NULL; 1.38 +} 1.39 + 1.40 // Utility class for printing of the contents of the static fields for 1.41 // use by compilation replay. It only prints out the information that 1.42 // could be consumed by the compiler, so for primitive types it prints