equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * 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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
2166 CASE(_new): { |
2166 CASE(_new): { |
2167 u2 index = Bytes::get_Java_u2(pc+1); |
2167 u2 index = Bytes::get_Java_u2(pc+1); |
2168 ConstantPool* constants = istate->method()->constants(); |
2168 ConstantPool* constants = istate->method()->constants(); |
2169 if (!constants->tag_at(index).is_unresolved_klass()) { |
2169 if (!constants->tag_at(index).is_unresolved_klass()) { |
2170 // Make sure klass is initialized and doesn't have a finalizer |
2170 // Make sure klass is initialized and doesn't have a finalizer |
2171 Klass* entry = constants->slot_at(index).get_klass(); |
2171 Klass* entry = constants->resolved_klass_at(index); |
2172 InstanceKlass* ik = InstanceKlass::cast(entry); |
2172 InstanceKlass* ik = InstanceKlass::cast(entry); |
2173 if (ik->is_initialized() && ik->can_be_fastpath_allocated() ) { |
2173 if (ik->is_initialized() && ik->can_be_fastpath_allocated() ) { |
2174 size_t obj_size = ik->size_helper(); |
2174 size_t obj_size = ik->size_helper(); |
2175 oop result = NULL; |
2175 oop result = NULL; |
2176 // If the TLAB isn't pre-zeroed then we'll have to do it |
2176 // If the TLAB isn't pre-zeroed then we'll have to do it |
2266 // Constant pool may have actual klass or unresolved klass. If it is |
2266 // Constant pool may have actual klass or unresolved klass. If it is |
2267 // unresolved we must resolve it. |
2267 // unresolved we must resolve it. |
2268 if (METHOD->constants()->tag_at(index).is_unresolved_klass()) { |
2268 if (METHOD->constants()->tag_at(index).is_unresolved_klass()) { |
2269 CALL_VM(InterpreterRuntime::quicken_io_cc(THREAD), handle_exception); |
2269 CALL_VM(InterpreterRuntime::quicken_io_cc(THREAD), handle_exception); |
2270 } |
2270 } |
2271 Klass* klassOf = (Klass*) METHOD->constants()->slot_at(index).get_klass(); |
2271 Klass* klassOf = (Klass*) METHOD->constants()->resolved_klass_at(index); |
2272 Klass* objKlass = STACK_OBJECT(-1)->klass(); // ebx |
2272 Klass* objKlass = STACK_OBJECT(-1)->klass(); // ebx |
2273 // |
2273 // |
2274 // Check for compatibilty. This check must not GC!! |
2274 // Check for compatibilty. This check must not GC!! |
2275 // Seems way more expensive now that we must dispatch. |
2275 // Seems way more expensive now that we must dispatch. |
2276 // |
2276 // |
2301 // Constant pool may have actual klass or unresolved klass. If it is |
2301 // Constant pool may have actual klass or unresolved klass. If it is |
2302 // unresolved we must resolve it. |
2302 // unresolved we must resolve it. |
2303 if (METHOD->constants()->tag_at(index).is_unresolved_klass()) { |
2303 if (METHOD->constants()->tag_at(index).is_unresolved_klass()) { |
2304 CALL_VM(InterpreterRuntime::quicken_io_cc(THREAD), handle_exception); |
2304 CALL_VM(InterpreterRuntime::quicken_io_cc(THREAD), handle_exception); |
2305 } |
2305 } |
2306 Klass* klassOf = (Klass*) METHOD->constants()->slot_at(index).get_klass(); |
2306 Klass* klassOf = (Klass*) METHOD->constants()->resolved_klass_at(index); |
2307 Klass* objKlass = STACK_OBJECT(-1)->klass(); |
2307 Klass* objKlass = STACK_OBJECT(-1)->klass(); |
2308 // |
2308 // |
2309 // Check for compatibilty. This check must not GC!! |
2309 // Check for compatibilty. This check must not GC!! |
2310 // Seems way more expensive now that we must dispatch. |
2310 // Seems way more expensive now that we must dispatch. |
2311 // |
2311 // |