1 /* |
1 /* |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2012, 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. |
24 |
24 |
25 #ifndef SHARE_VM_RUNTIME_SIGNATURE_HPP |
25 #ifndef SHARE_VM_RUNTIME_SIGNATURE_HPP |
26 #define SHARE_VM_RUNTIME_SIGNATURE_HPP |
26 #define SHARE_VM_RUNTIME_SIGNATURE_HPP |
27 |
27 |
28 #include "memory/allocation.hpp" |
28 #include "memory/allocation.hpp" |
29 #include "oops/methodOop.hpp" |
29 #include "oops/method.hpp" |
30 #include "utilities/top.hpp" |
30 #include "utilities/top.hpp" |
31 |
31 |
32 // SignatureIterators iterate over a Java signature (or parts of it). |
32 // SignatureIterators iterate over a Java signature (or parts of it). |
33 // (Syntax according to: "The Java Virtual Machine Specification" by |
33 // (Syntax according to: "The Java Virtual Machine Specification" by |
34 // Tim Lindholm & Frank Yellin; section 4.3 Descriptors; p. 89ff.) |
34 // Tim Lindholm & Frank Yellin; section 4.3 Descriptors; p. 89ff.) |
392 bool is_object() const; // True if this argument is an object |
392 bool is_object() const; // True if this argument is an object |
393 bool is_array() const; // True if this argument is an array |
393 bool is_array() const; // True if this argument is an array |
394 BasicType type() const { return _type; } |
394 BasicType type() const { return _type; } |
395 Symbol* as_symbol(TRAPS); |
395 Symbol* as_symbol(TRAPS); |
396 enum FailureMode { ReturnNull, CNFException, NCDFError }; |
396 enum FailureMode { ReturnNull, CNFException, NCDFError }; |
397 klassOop as_klass(Handle class_loader, Handle protection_domain, FailureMode failure_mode, TRAPS); |
397 Klass* as_klass(Handle class_loader, Handle protection_domain, FailureMode failure_mode, TRAPS); |
398 oop as_java_mirror(Handle class_loader, Handle protection_domain, FailureMode failure_mode, TRAPS); |
398 oop as_java_mirror(Handle class_loader, Handle protection_domain, FailureMode failure_mode, TRAPS); |
399 const jbyte* raw_bytes() { return _signature->bytes() + _begin; } |
399 const jbyte* raw_bytes() { return _signature->bytes() + _begin; } |
400 int raw_length() { return _end - _begin; } |
400 int raw_length() { return _end - _begin; } |
401 |
401 |
402 // return same as_symbol except allocation of new symbols is avoided. |
402 // return same as_symbol except allocation of new symbols is avoided. |