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,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/symbolTable.hpp"
27 #include "classfile/systemDictionary.hpp"
28 #include "memory/oopFactory.hpp"
29 #include "oops/instanceKlass.hpp"
30 #include "oops/oop.inline.hpp"
31 #include "oops/symbol.hpp"
32 #include "oops/typeArrayKlass.hpp"
33 #include "runtime/signature.hpp"
34
35 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
36
37 // Implementation of SignatureIterator
38
39 // Signature syntax:
40 //
41 // Signature = "(" {Parameter} ")" ReturnType.
42 // Parameter = FieldType.
43 // ReturnType = FieldType | "V".
44 // FieldType = "B" | "C" | "D" | "F" | "I" | "J" | "S" | "Z" | "L" ClassName ";" | "[" FieldType.
45 // ClassName = string.
46
47
48 SignatureIterator::SignatureIterator(Symbol* signature) {
49 _signature = signature;
50 _parameter_index = 0;
51 }
52
53 void SignatureIterator::expect(char c) {
54 if (_signature->byte_at(_index) != c) fatal("expecting %c", c);
55 _index++;
56 }
192 case obj_parm:
193 do_object(0, 0);
194 _parameter_index += T_OBJECT_size;
195 break;
196 case long_parm:
197 do_long();
198 _parameter_index += T_LONG_size;
199 break;
200 case float_parm:
201 do_float();
202 _parameter_index += T_FLOAT_size;
203 break;
204 case double_parm:
205 do_double();
206 _parameter_index += T_DOUBLE_size;
207 break;
208 case done_parm:
209 return;
210 break;
211 default:
212 tty->print_cr("*** parameter is %d", fingerprint & parameter_feature_mask);
213 tty->print_cr("*** fingerprint is " PTR64_FORMAT, saved_fingerprint);
214 ShouldNotReachHere();
215 break;
216 }
217 fingerprint >>= parameter_feature_size;
218 }
219 _parameter_index = 0;
220 }
221
222
223 void SignatureIterator::iterate_returntype() {
224 // Ignore parameters
225 _index = 0;
226 expect('(');
227 Symbol* sig = _signature;
228 while (sig->byte_at(_index) != ')') _index++;
229 expect(')');
230 // Parse return type
231 _parameter_index = -1;
232 parse_type();
|
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,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/symbolTable.hpp"
27 #include "classfile/systemDictionary.hpp"
28 #include "memory/oopFactory.hpp"
29 #include "oops/instanceKlass.hpp"
30 #include "oops/oop.inline.hpp"
31 #include "oops/symbol.hpp"
32 #include "oops/typeArrayKlass.hpp"
33 #include "runtime/signature.hpp"
34
35 // Implementation of SignatureIterator
36
37 // Signature syntax:
38 //
39 // Signature = "(" {Parameter} ")" ReturnType.
40 // Parameter = FieldType.
41 // ReturnType = FieldType | "V".
42 // FieldType = "B" | "C" | "D" | "F" | "I" | "J" | "S" | "Z" | "L" ClassName ";" | "[" FieldType.
43 // ClassName = string.
44
45
46 SignatureIterator::SignatureIterator(Symbol* signature) {
47 _signature = signature;
48 _parameter_index = 0;
49 }
50
51 void SignatureIterator::expect(char c) {
52 if (_signature->byte_at(_index) != c) fatal("expecting %c", c);
53 _index++;
54 }
190 case obj_parm:
191 do_object(0, 0);
192 _parameter_index += T_OBJECT_size;
193 break;
194 case long_parm:
195 do_long();
196 _parameter_index += T_LONG_size;
197 break;
198 case float_parm:
199 do_float();
200 _parameter_index += T_FLOAT_size;
201 break;
202 case double_parm:
203 do_double();
204 _parameter_index += T_DOUBLE_size;
205 break;
206 case done_parm:
207 return;
208 break;
209 default:
210 tty->print_cr("*** parameter is " INT64_FORMAT, fingerprint & parameter_feature_mask);
211 tty->print_cr("*** fingerprint is " PTR64_FORMAT, saved_fingerprint);
212 ShouldNotReachHere();
213 break;
214 }
215 fingerprint >>= parameter_feature_size;
216 }
217 _parameter_index = 0;
218 }
219
220
221 void SignatureIterator::iterate_returntype() {
222 // Ignore parameters
223 _index = 0;
224 expect('(');
225 Symbol* sig = _signature;
226 while (sig->byte_at(_index) != ')') _index++;
227 expect(')');
228 // Parse return type
229 _parameter_index = -1;
230 parse_type();
|