Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/javaClasses.cpp @ 1930:2d26b0046e0d
Merge.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Tue, 30 Nov 2010 14:53:30 +0100 |
parents | d257356e35f0 |
children | f95d63e2154a |
comparison
equal
deleted
inserted
replaced
1484:6b7001391c97 | 1930:2d26b0046e0d |
---|---|
1 /* | 1 /* |
2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright (c) 1997, 2009, 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. |
14 * | 14 * |
15 * You should have received a copy of the GNU General Public License version | 15 * You should have received a copy of the GNU General Public License version |
16 * 2 along with this work; if not, write to the Free Software Foundation, | 16 * 2 along with this work; if not, write to the Free Software Foundation, |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
18 * | 18 * |
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 * CA 95054 USA or visit www.sun.com if you need additional information or | 20 * or visit www.oracle.com if you need additional information or have any |
21 * have any questions. | 21 * questions. |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 # include "incls/_precompiled.incl" | 25 # include "incls/_precompiled.incl" |
26 # include "incls/_javaClasses.cpp.incl" | 26 # include "incls/_javaClasses.cpp.incl" |
2422 | 2422 |
2423 // Support for java_dyn_MethodTypeForm | 2423 // Support for java_dyn_MethodTypeForm |
2424 | 2424 |
2425 int java_dyn_MethodTypeForm::_vmslots_offset; | 2425 int java_dyn_MethodTypeForm::_vmslots_offset; |
2426 int java_dyn_MethodTypeForm::_erasedType_offset; | 2426 int java_dyn_MethodTypeForm::_erasedType_offset; |
2427 int java_dyn_MethodTypeForm::_genericInvoker_offset; | |
2427 | 2428 |
2428 void java_dyn_MethodTypeForm::compute_offsets() { | 2429 void java_dyn_MethodTypeForm::compute_offsets() { |
2429 klassOop k = SystemDictionary::MethodTypeForm_klass(); | 2430 klassOop k = SystemDictionary::MethodTypeForm_klass(); |
2430 if (k != NULL) { | 2431 if (k != NULL) { |
2431 compute_optional_offset(_vmslots_offset, k, vmSymbols::vmslots_name(), vmSymbols::int_signature(), true); | 2432 compute_optional_offset(_vmslots_offset, k, vmSymbols::vmslots_name(), vmSymbols::int_signature(), true); |
2432 compute_optional_offset(_erasedType_offset, k, vmSymbols::erasedType_name(), vmSymbols::java_dyn_MethodType_signature(), true); | 2433 compute_optional_offset(_erasedType_offset, k, vmSymbols::erasedType_name(), vmSymbols::java_dyn_MethodType_signature(), true); |
2434 compute_optional_offset(_genericInvoker_offset, k, vmSymbols::genericInvoker_name(), vmSymbols::java_dyn_MethodHandle_signature(), true); | |
2435 if (_genericInvoker_offset == 0) _genericInvoker_offset = -1; // set to explicit "empty" value | |
2433 } | 2436 } |
2434 } | 2437 } |
2435 | 2438 |
2436 int java_dyn_MethodTypeForm::vmslots(oop mtform) { | 2439 int java_dyn_MethodTypeForm::vmslots(oop mtform) { |
2437 assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only"); | 2440 assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only"); |
2441 oop java_dyn_MethodTypeForm::erasedType(oop mtform) { | 2444 oop java_dyn_MethodTypeForm::erasedType(oop mtform) { |
2442 assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only"); | 2445 assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only"); |
2443 return mtform->obj_field(_erasedType_offset); | 2446 return mtform->obj_field(_erasedType_offset); |
2444 } | 2447 } |
2445 | 2448 |
2449 oop java_dyn_MethodTypeForm::genericInvoker(oop mtform) { | |
2450 assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only"); | |
2451 return mtform->obj_field(_genericInvoker_offset); | |
2452 } | |
2453 | |
2446 | 2454 |
2447 // Support for java_dyn_CallSite | 2455 // Support for java_dyn_CallSite |
2448 | 2456 |
2449 int java_dyn_CallSite::_type_offset; | |
2450 int java_dyn_CallSite::_target_offset; | 2457 int java_dyn_CallSite::_target_offset; |
2451 int java_dyn_CallSite::_vmmethod_offset; | 2458 int java_dyn_CallSite::_caller_method_offset; |
2459 int java_dyn_CallSite::_caller_bci_offset; | |
2452 | 2460 |
2453 void java_dyn_CallSite::compute_offsets() { | 2461 void java_dyn_CallSite::compute_offsets() { |
2454 if (!EnableInvokeDynamic) return; | 2462 if (!EnableInvokeDynamic) return; |
2455 klassOop k = SystemDictionary::CallSite_klass(); | 2463 klassOop k = SystemDictionary::CallSite_klass(); |
2456 if (k != NULL) { | 2464 if (k != NULL) { |
2457 compute_offset(_type_offset, k, vmSymbols::type_name(), vmSymbols::java_dyn_MethodType_signature(), true); | 2465 compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_dyn_MethodHandle_signature()); |
2458 compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_dyn_MethodHandle_signature(), true); | 2466 compute_offset(_caller_method_offset, k, vmSymbols::vmmethod_name(), vmSymbols::sun_dyn_MemberName_signature()); |
2459 compute_offset(_vmmethod_offset, k, vmSymbols::vmmethod_name(), vmSymbols::object_signature(), true); | 2467 compute_offset(_caller_bci_offset, k, vmSymbols::vmindex_name(), vmSymbols::int_signature()); |
2460 } | 2468 } |
2461 } | |
2462 | |
2463 oop java_dyn_CallSite::type(oop site) { | |
2464 return site->obj_field(_type_offset); | |
2465 } | 2469 } |
2466 | 2470 |
2467 oop java_dyn_CallSite::target(oop site) { | 2471 oop java_dyn_CallSite::target(oop site) { |
2468 return site->obj_field(_target_offset); | 2472 return site->obj_field(_target_offset); |
2469 } | 2473 } |
2470 | 2474 |
2471 void java_dyn_CallSite::set_target(oop site, oop target) { | 2475 void java_dyn_CallSite::set_target(oop site, oop target) { |
2472 site->obj_field_put(_target_offset, target); | 2476 site->obj_field_put(_target_offset, target); |
2473 } | 2477 } |
2474 | 2478 |
2475 oop java_dyn_CallSite::vmmethod(oop site) { | 2479 oop java_dyn_CallSite::caller_method(oop site) { |
2476 return site->obj_field(_vmmethod_offset); | 2480 return site->obj_field(_caller_method_offset); |
2477 } | 2481 } |
2478 | 2482 |
2479 void java_dyn_CallSite::set_vmmethod(oop site, oop ref) { | 2483 void java_dyn_CallSite::set_caller_method(oop site, oop ref) { |
2480 site->obj_field_put(_vmmethod_offset, ref); | 2484 site->obj_field_put(_caller_method_offset, ref); |
2485 } | |
2486 | |
2487 jint java_dyn_CallSite::caller_bci(oop site) { | |
2488 return site->int_field(_caller_bci_offset); | |
2489 } | |
2490 | |
2491 void java_dyn_CallSite::set_caller_bci(oop site, jint bci) { | |
2492 site->int_field_put(_caller_bci_offset, bci); | |
2481 } | 2493 } |
2482 | 2494 |
2483 | 2495 |
2484 // Support for java_security_AccessControlContext | 2496 // Support for java_security_AccessControlContext |
2485 | 2497 |