Mercurial > hg > graal-jvmci-8
comparison src/share/vm/interpreter/linkResolver.cpp @ 12885:8df6f123d35e
8026124: JSR-292 bug: java.nio.file.Path.toString cores dump
Summary: catch problem case, assert it matches valid input, new test
Reviewed-by: jrose, twisti, kvn
author | drchase |
---|---|
date | Sat, 12 Oct 2013 17:26:41 -0400 |
parents | ac9cb1d5a202 |
children | 8f4bb1773fd9 |
comparison
equal
deleted
inserted
replaced
12884:e504cd481ec0 | 12885:8df6f123d35e |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. | |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. | 3 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 5 * |
5 * This code is free software; you can redistribute it and/or modify it | 6 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 7 * under the terms of the GNU General Public License version 2 only, as |
155 // A miranda method. Compute the vtable index. | 156 // A miranda method. Compute the vtable index. |
156 ResourceMark rm; | 157 ResourceMark rm; |
157 klassVtable* vt = InstanceKlass::cast(resolved_klass)->vtable(); | 158 klassVtable* vt = InstanceKlass::cast(resolved_klass)->vtable(); |
158 index = vt->index_of_miranda(resolved_method->name(), | 159 index = vt->index_of_miranda(resolved_method->name(), |
159 resolved_method->signature()); | 160 resolved_method->signature()); |
161 kind = CallInfo::vtable_call; | |
162 } else if (resolved_method->has_vtable_index()) { | |
163 // Can occur if an interface redeclares a method of Object. | |
164 | |
165 #ifdef ASSERT | |
166 // Ensure that this is really the case. | |
167 KlassHandle object_klass = SystemDictionary::Object_klass(); | |
168 Method * object_resolved_method = object_klass()->vtable()->method_at(index); | |
169 assert(object_resolved_method->name() == resolved_method->name(), | |
170 err_msg("Object and interface method names should match at vtable index %d, %s != %s", | |
171 index, object_resolved_method->name()->as_C_string(), resolved_method->name()->as_C_string())); | |
172 assert(object_resolved_method->signature() == resolved_method->signature(), | |
173 err_msg("Object and interface method signatures should match at vtable index %d, %s != %s", | |
174 index, object_resolved_method->signature()->as_C_string(), resolved_method->signature()->as_C_string())); | |
175 #endif // ASSERT | |
176 | |
160 kind = CallInfo::vtable_call; | 177 kind = CallInfo::vtable_call; |
161 } else { | 178 } else { |
162 // A regular interface call. | 179 // A regular interface call. |
163 kind = CallInfo::itable_call; | 180 kind = CallInfo::itable_call; |
164 index = resolved_method->itable_index(); | 181 index = resolved_method->itable_index(); |