1 /* This file has been automatically generated from "method_invoke.list" */
2
3 /*
4 ----------------------------------------------------------------------
5 _svmh_invoke_nonvirtual_jlclass_init
6 ----------------------------------------------------------------------
7 */
8
9 svm_static jint
_svmh_invoke_nonvirtual_jlclass_init(_svmt_JNIEnv * env,jobject this,jobject param_1,jobject param_2)10 _svmh_invoke_nonvirtual_jlclass_init (_svmt_JNIEnv *env, jobject this, jobject param_1, jobject param_2)
11 {
12 _svmt_JavaVM *vm = env->vm;
13 _svmt_stack_frame *initial_frame;
14 _svmt_method_info *method = vm->class_loading.boot_loader.methods.jlclass_init;
15 _svmt_method_frame_info *frame_info = method->frame_info;
16
17 assert (_svmf_is_set_flag
18 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
19
20 if (this == NULL)
21 {
22 _svmf_error_NullPointerException (env);
23 return JNI_ERR;
24 }
25
26 /* syncronized? */
27 if (method->synchronized)
28 {
29 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
30 {
31 return JNI_ERR;
32 }
33 }
34
35 if (_svmf_ensure_stack_capacity
36 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
37 {
38 return JNI_ERR;
39 }
40
41 initial_frame = env->stack.current_frame;
42
43 /* setup internal call frame */
44 {
45 size_t offset = env->stack.current_frame->end_offset;
46 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
47 (((char *) env->stack.current_frame) + offset);
48
49 frame->previous_offset = offset;
50 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
51 frame->method = &vm->vm_initiated_call_method;
52 frame->stack_trace_element = NULL;
53 frame->lock_count = 0;
54 frame->this = NULL;
55 frame->pc = vm->vm_initiated_call_method.frame_info->code;
56 frame->stack_size = 0;
57
58 env->stack.current_frame = frame;
59 }
60
61 /* push parameters */
62 {
63 _svmt_stack_frame *prev_frame = env->stack.current_frame;
64 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
65 (((char *) prev_frame) + prev_frame->end_offset);
66 jint i = 0;
67
68 locals[i++].reference = *this;
69 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
70 locals[i++].reference = (param_2 == NULL) ? NULL : *param_2;
71
72 {
73 jint ref_count = frame_info->non_parameter_ref_locals_count;
74 jint j;
75
76 for (j = 0; j < ref_count; j++)
77 {
78 locals[i++].reference = NULL;
79 }
80 }
81 }
82
83 /* setup java call frame */
84 {
85 size_t offset =
86 env->stack.current_frame->end_offset + frame_info->start_offset;
87 _svmt_stack_frame *frame =
88 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
89 offset);
90
91 frame->previous_offset = offset;
92 frame->end_offset = frame_info->end_offset;
93 frame->method = method;
94 frame->stack_trace_element = NULL;
95 frame->lock_count = 0;
96 frame->this = *this;
97 frame->pc = frame_info->code;
98 frame->stack_size = 0;
99
100 env->stack.current_frame = frame;
101 }
102
103 /* interpret and pop internal call frame */
104 {
105 /* call the interpreter */
106 jint status = _svmf_interpreter (env);
107
108 /* retrieve stack frame */
109 _svmt_stack_frame *frame = env->stack.current_frame;
110
111 assert (frame->method == &vm->vm_initiated_call_method);
112
113 /* pop frame */
114 env->stack.current_frame = (_svmt_stack_frame *) (void *)
115 (((char *) frame) - frame->previous_offset);
116
117 /* rethrow exception */
118 if (status != JNI_OK)
119 {
120 return JNI_ERR;
121 }
122
123 }
124
125 return JNI_OK;
126 }
127
128
129 /*
130 ----------------------------------------------------------------------
131 _svmh_invoke_nonvirtual_jlclass_init_primitive
132 ----------------------------------------------------------------------
133 */
134
135 svm_static jint
_svmh_invoke_nonvirtual_jlclass_init_primitive(_svmt_JNIEnv * env,jobject this,jint param_1)136 _svmh_invoke_nonvirtual_jlclass_init_primitive (_svmt_JNIEnv *env, jobject this, jint param_1)
137 {
138 _svmt_JavaVM *vm = env->vm;
139 _svmt_stack_frame *initial_frame;
140 _svmt_method_info *method = vm->class_loading.boot_loader.methods.jlclass_init_primitive;
141 _svmt_method_frame_info *frame_info = method->frame_info;
142
143 assert (_svmf_is_set_flag
144 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
145
146 if (this == NULL)
147 {
148 _svmf_error_NullPointerException (env);
149 return JNI_ERR;
150 }
151
152 /* syncronized? */
153 if (method->synchronized)
154 {
155 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
156 {
157 return JNI_ERR;
158 }
159 }
160
161 if (_svmf_ensure_stack_capacity
162 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
163 {
164 return JNI_ERR;
165 }
166
167 initial_frame = env->stack.current_frame;
168
169 /* setup internal call frame */
170 {
171 size_t offset = env->stack.current_frame->end_offset;
172 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
173 (((char *) env->stack.current_frame) + offset);
174
175 frame->previous_offset = offset;
176 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
177 frame->method = &vm->vm_initiated_call_method;
178 frame->stack_trace_element = NULL;
179 frame->lock_count = 0;
180 frame->this = NULL;
181 frame->pc = vm->vm_initiated_call_method.frame_info->code;
182 frame->stack_size = 0;
183
184 env->stack.current_frame = frame;
185 }
186
187 /* push parameters */
188 {
189 _svmt_stack_frame *prev_frame = env->stack.current_frame;
190 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
191 (((char *) prev_frame) + prev_frame->end_offset);
192 jint i = 0;
193
194 locals[i++].reference = *this;
195 locals[i++].jint = param_1;
196
197 {
198 jint ref_count = frame_info->non_parameter_ref_locals_count;
199 jint j;
200
201 for (j = 0; j < ref_count; j++)
202 {
203 locals[i++].reference = NULL;
204 }
205 }
206 }
207
208 /* setup java call frame */
209 {
210 size_t offset =
211 env->stack.current_frame->end_offset + frame_info->start_offset;
212 _svmt_stack_frame *frame =
213 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
214 offset);
215
216 frame->previous_offset = offset;
217 frame->end_offset = frame_info->end_offset;
218 frame->method = method;
219 frame->stack_trace_element = NULL;
220 frame->lock_count = 0;
221 frame->this = *this;
222 frame->pc = frame_info->code;
223 frame->stack_size = 0;
224
225 env->stack.current_frame = frame;
226 }
227
228 /* interpret and pop internal call frame */
229 {
230 /* call the interpreter */
231 jint status = _svmf_interpreter (env);
232
233 /* retrieve stack frame */
234 _svmt_stack_frame *frame = env->stack.current_frame;
235
236 assert (frame->method == &vm->vm_initiated_call_method);
237
238 /* pop frame */
239 env->stack.current_frame = (_svmt_stack_frame *) (void *)
240 (((char *) frame) - frame->previous_offset);
241
242 /* rethrow exception */
243 if (status != JNI_OK)
244 {
245 return JNI_ERR;
246 }
247
248 }
249
250 return JNI_OK;
251 }
252
253
254 /*
255 ----------------------------------------------------------------------
256 _svmh_invoke_nonvirtual_jlclass_initialize
257 ----------------------------------------------------------------------
258 */
259
260 svm_static jint
_svmh_invoke_nonvirtual_jlclass_initialize(_svmt_JNIEnv * env,jobject this,jint param_1)261 _svmh_invoke_nonvirtual_jlclass_initialize (_svmt_JNIEnv *env, jobject this, jint param_1)
262 {
263 _svmt_JavaVM *vm = env->vm;
264 _svmt_stack_frame *initial_frame;
265 _svmt_method_info *method = vm->class_loading.boot_loader.methods.jlclass_initialize;
266 _svmt_method_frame_info *frame_info = method->frame_info;
267
268 assert (_svmf_is_set_flag
269 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
270
271 if (this == NULL)
272 {
273 _svmf_error_NullPointerException (env);
274 return JNI_ERR;
275 }
276
277 /* syncronized? */
278 if (method->synchronized)
279 {
280 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
281 {
282 return JNI_ERR;
283 }
284 }
285
286 if (_svmf_ensure_stack_capacity
287 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
288 {
289 return JNI_ERR;
290 }
291
292 initial_frame = env->stack.current_frame;
293
294 /* setup internal call frame */
295 {
296 size_t offset = env->stack.current_frame->end_offset;
297 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
298 (((char *) env->stack.current_frame) + offset);
299
300 frame->previous_offset = offset;
301 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
302 frame->method = &vm->vm_initiated_call_method;
303 frame->stack_trace_element = NULL;
304 frame->lock_count = 0;
305 frame->this = NULL;
306 frame->pc = vm->vm_initiated_call_method.frame_info->code;
307 frame->stack_size = 0;
308
309 env->stack.current_frame = frame;
310 }
311
312 /* push parameters */
313 {
314 _svmt_stack_frame *prev_frame = env->stack.current_frame;
315 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
316 (((char *) prev_frame) + prev_frame->end_offset);
317 jint i = 0;
318
319 locals[i++].reference = *this;
320 locals[i++].jint = param_1;
321
322 {
323 jint ref_count = frame_info->non_parameter_ref_locals_count;
324 jint j;
325
326 for (j = 0; j < ref_count; j++)
327 {
328 locals[i++].reference = NULL;
329 }
330 }
331 }
332
333 /* setup java call frame */
334 {
335 size_t offset =
336 env->stack.current_frame->end_offset + frame_info->start_offset;
337 _svmt_stack_frame *frame =
338 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
339 offset);
340
341 frame->previous_offset = offset;
342 frame->end_offset = frame_info->end_offset;
343 frame->method = method;
344 frame->stack_trace_element = NULL;
345 frame->lock_count = 0;
346 frame->this = *this;
347 frame->pc = frame_info->code;
348 frame->stack_size = 0;
349
350 env->stack.current_frame = frame;
351 }
352
353 /* interpret and pop internal call frame */
354 {
355 /* call the interpreter */
356 jint status = _svmf_interpreter (env);
357
358 /* retrieve stack frame */
359 _svmt_stack_frame *frame = env->stack.current_frame;
360
361 assert (frame->method == &vm->vm_initiated_call_method);
362
363 /* pop frame */
364 env->stack.current_frame = (_svmt_stack_frame *) (void *)
365 (((char *) frame) - frame->previous_offset);
366
367 /* rethrow exception */
368 if (status != JNI_OK)
369 {
370 return JNI_ERR;
371 }
372
373 }
374
375 return JNI_OK;
376 }
377
378
379 /*
380 ----------------------------------------------------------------------
381 _svmh_invoke_nonvirtual_jlrconstructor_init
382 ----------------------------------------------------------------------
383 */
384
385 svm_static jint
_svmh_invoke_nonvirtual_jlrconstructor_init(_svmt_JNIEnv * env,jobject this,jobject param_1)386 _svmh_invoke_nonvirtual_jlrconstructor_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
387 {
388 _svmt_JavaVM *vm = env->vm;
389 _svmt_stack_frame *initial_frame;
390 _svmt_method_info *method = vm->class_loading.boot_loader.methods.jlrconstructor_init;
391 _svmt_method_frame_info *frame_info = method->frame_info;
392
393 assert (_svmf_is_set_flag
394 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
395
396 if (this == NULL)
397 {
398 _svmf_error_NullPointerException (env);
399 return JNI_ERR;
400 }
401
402 /* syncronized? */
403 if (method->synchronized)
404 {
405 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
406 {
407 return JNI_ERR;
408 }
409 }
410
411 if (_svmf_ensure_stack_capacity
412 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
413 {
414 return JNI_ERR;
415 }
416
417 initial_frame = env->stack.current_frame;
418
419 /* setup internal call frame */
420 {
421 size_t offset = env->stack.current_frame->end_offset;
422 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
423 (((char *) env->stack.current_frame) + offset);
424
425 frame->previous_offset = offset;
426 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
427 frame->method = &vm->vm_initiated_call_method;
428 frame->stack_trace_element = NULL;
429 frame->lock_count = 0;
430 frame->this = NULL;
431 frame->pc = vm->vm_initiated_call_method.frame_info->code;
432 frame->stack_size = 0;
433
434 env->stack.current_frame = frame;
435 }
436
437 /* push parameters */
438 {
439 _svmt_stack_frame *prev_frame = env->stack.current_frame;
440 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
441 (((char *) prev_frame) + prev_frame->end_offset);
442 jint i = 0;
443
444 locals[i++].reference = *this;
445 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
446
447 {
448 jint ref_count = frame_info->non_parameter_ref_locals_count;
449 jint j;
450
451 for (j = 0; j < ref_count; j++)
452 {
453 locals[i++].reference = NULL;
454 }
455 }
456 }
457
458 /* setup java call frame */
459 {
460 size_t offset =
461 env->stack.current_frame->end_offset + frame_info->start_offset;
462 _svmt_stack_frame *frame =
463 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
464 offset);
465
466 frame->previous_offset = offset;
467 frame->end_offset = frame_info->end_offset;
468 frame->method = method;
469 frame->stack_trace_element = NULL;
470 frame->lock_count = 0;
471 frame->this = *this;
472 frame->pc = frame_info->code;
473 frame->stack_size = 0;
474
475 env->stack.current_frame = frame;
476 }
477
478 /* interpret and pop internal call frame */
479 {
480 /* call the interpreter */
481 jint status = _svmf_interpreter (env);
482
483 /* retrieve stack frame */
484 _svmt_stack_frame *frame = env->stack.current_frame;
485
486 assert (frame->method == &vm->vm_initiated_call_method);
487
488 /* pop frame */
489 env->stack.current_frame = (_svmt_stack_frame *) (void *)
490 (((char *) frame) - frame->previous_offset);
491
492 /* rethrow exception */
493 if (status != JNI_OK)
494 {
495 return JNI_ERR;
496 }
497
498 }
499
500 return JNI_OK;
501 }
502
503
504 /*
505 ----------------------------------------------------------------------
506 _svmh_invoke_nonvirtual_jlrfield_init
507 ----------------------------------------------------------------------
508 */
509
510 svm_static jint
_svmh_invoke_nonvirtual_jlrfield_init(_svmt_JNIEnv * env,jobject this,jobject param_1)511 _svmh_invoke_nonvirtual_jlrfield_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
512 {
513 _svmt_JavaVM *vm = env->vm;
514 _svmt_stack_frame *initial_frame;
515 _svmt_method_info *method = vm->class_loading.boot_loader.methods.jlrfield_init;
516 _svmt_method_frame_info *frame_info = method->frame_info;
517
518 assert (_svmf_is_set_flag
519 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
520
521 if (this == NULL)
522 {
523 _svmf_error_NullPointerException (env);
524 return JNI_ERR;
525 }
526
527 /* syncronized? */
528 if (method->synchronized)
529 {
530 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
531 {
532 return JNI_ERR;
533 }
534 }
535
536 if (_svmf_ensure_stack_capacity
537 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
538 {
539 return JNI_ERR;
540 }
541
542 initial_frame = env->stack.current_frame;
543
544 /* setup internal call frame */
545 {
546 size_t offset = env->stack.current_frame->end_offset;
547 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
548 (((char *) env->stack.current_frame) + offset);
549
550 frame->previous_offset = offset;
551 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
552 frame->method = &vm->vm_initiated_call_method;
553 frame->stack_trace_element = NULL;
554 frame->lock_count = 0;
555 frame->this = NULL;
556 frame->pc = vm->vm_initiated_call_method.frame_info->code;
557 frame->stack_size = 0;
558
559 env->stack.current_frame = frame;
560 }
561
562 /* push parameters */
563 {
564 _svmt_stack_frame *prev_frame = env->stack.current_frame;
565 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
566 (((char *) prev_frame) + prev_frame->end_offset);
567 jint i = 0;
568
569 locals[i++].reference = *this;
570 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
571
572 {
573 jint ref_count = frame_info->non_parameter_ref_locals_count;
574 jint j;
575
576 for (j = 0; j < ref_count; j++)
577 {
578 locals[i++].reference = NULL;
579 }
580 }
581 }
582
583 /* setup java call frame */
584 {
585 size_t offset =
586 env->stack.current_frame->end_offset + frame_info->start_offset;
587 _svmt_stack_frame *frame =
588 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
589 offset);
590
591 frame->previous_offset = offset;
592 frame->end_offset = frame_info->end_offset;
593 frame->method = method;
594 frame->stack_trace_element = NULL;
595 frame->lock_count = 0;
596 frame->this = *this;
597 frame->pc = frame_info->code;
598 frame->stack_size = 0;
599
600 env->stack.current_frame = frame;
601 }
602
603 /* interpret and pop internal call frame */
604 {
605 /* call the interpreter */
606 jint status = _svmf_interpreter (env);
607
608 /* retrieve stack frame */
609 _svmt_stack_frame *frame = env->stack.current_frame;
610
611 assert (frame->method == &vm->vm_initiated_call_method);
612
613 /* pop frame */
614 env->stack.current_frame = (_svmt_stack_frame *) (void *)
615 (((char *) frame) - frame->previous_offset);
616
617 /* rethrow exception */
618 if (status != JNI_OK)
619 {
620 return JNI_ERR;
621 }
622
623 }
624
625 return JNI_OK;
626 }
627
628
629 /*
630 ----------------------------------------------------------------------
631 _svmh_invoke_nonvirtual_jlrinvocationtargetexception_init
632 ----------------------------------------------------------------------
633 */
634
635 svm_static jint
_svmh_invoke_nonvirtual_jlrinvocationtargetexception_init(_svmt_JNIEnv * env,jobject this,jobject param_1)636 _svmh_invoke_nonvirtual_jlrinvocationtargetexception_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
637 {
638 _svmt_JavaVM *vm = env->vm;
639 _svmt_stack_frame *initial_frame;
640 _svmt_method_info *method = vm->class_loading.boot_loader.methods.jlrinvocationtargetexception_init;
641 _svmt_method_frame_info *frame_info = method->frame_info;
642
643 assert (_svmf_is_set_flag
644 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
645
646 if (this == NULL)
647 {
648 _svmf_error_NullPointerException (env);
649 return JNI_ERR;
650 }
651
652 /* syncronized? */
653 if (method->synchronized)
654 {
655 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
656 {
657 return JNI_ERR;
658 }
659 }
660
661 if (_svmf_ensure_stack_capacity
662 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
663 {
664 return JNI_ERR;
665 }
666
667 initial_frame = env->stack.current_frame;
668
669 /* setup internal call frame */
670 {
671 size_t offset = env->stack.current_frame->end_offset;
672 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
673 (((char *) env->stack.current_frame) + offset);
674
675 frame->previous_offset = offset;
676 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
677 frame->method = &vm->vm_initiated_call_method;
678 frame->stack_trace_element = NULL;
679 frame->lock_count = 0;
680 frame->this = NULL;
681 frame->pc = vm->vm_initiated_call_method.frame_info->code;
682 frame->stack_size = 0;
683
684 env->stack.current_frame = frame;
685 }
686
687 /* push parameters */
688 {
689 _svmt_stack_frame *prev_frame = env->stack.current_frame;
690 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
691 (((char *) prev_frame) + prev_frame->end_offset);
692 jint i = 0;
693
694 locals[i++].reference = *this;
695 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
696
697 {
698 jint ref_count = frame_info->non_parameter_ref_locals_count;
699 jint j;
700
701 for (j = 0; j < ref_count; j++)
702 {
703 locals[i++].reference = NULL;
704 }
705 }
706 }
707
708 /* setup java call frame */
709 {
710 size_t offset =
711 env->stack.current_frame->end_offset + frame_info->start_offset;
712 _svmt_stack_frame *frame =
713 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
714 offset);
715
716 frame->previous_offset = offset;
717 frame->end_offset = frame_info->end_offset;
718 frame->method = method;
719 frame->stack_trace_element = NULL;
720 frame->lock_count = 0;
721 frame->this = *this;
722 frame->pc = frame_info->code;
723 frame->stack_size = 0;
724
725 env->stack.current_frame = frame;
726 }
727
728 /* interpret and pop internal call frame */
729 {
730 /* call the interpreter */
731 jint status = _svmf_interpreter (env);
732
733 /* retrieve stack frame */
734 _svmt_stack_frame *frame = env->stack.current_frame;
735
736 assert (frame->method == &vm->vm_initiated_call_method);
737
738 /* pop frame */
739 env->stack.current_frame = (_svmt_stack_frame *) (void *)
740 (((char *) frame) - frame->previous_offset);
741
742 /* rethrow exception */
743 if (status != JNI_OK)
744 {
745 return JNI_ERR;
746 }
747
748 }
749
750 return JNI_OK;
751 }
752
753
754 /*
755 ----------------------------------------------------------------------
756 _svmh_invoke_nonvirtual_jlrmethod_init
757 ----------------------------------------------------------------------
758 */
759
760 svm_static jint
_svmh_invoke_nonvirtual_jlrmethod_init(_svmt_JNIEnv * env,jobject this,jobject param_1)761 _svmh_invoke_nonvirtual_jlrmethod_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
762 {
763 _svmt_JavaVM *vm = env->vm;
764 _svmt_stack_frame *initial_frame;
765 _svmt_method_info *method = vm->class_loading.boot_loader.methods.jlrmethod_init;
766 _svmt_method_frame_info *frame_info = method->frame_info;
767
768 assert (_svmf_is_set_flag
769 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
770
771 if (this == NULL)
772 {
773 _svmf_error_NullPointerException (env);
774 return JNI_ERR;
775 }
776
777 /* syncronized? */
778 if (method->synchronized)
779 {
780 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
781 {
782 return JNI_ERR;
783 }
784 }
785
786 if (_svmf_ensure_stack_capacity
787 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
788 {
789 return JNI_ERR;
790 }
791
792 initial_frame = env->stack.current_frame;
793
794 /* setup internal call frame */
795 {
796 size_t offset = env->stack.current_frame->end_offset;
797 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
798 (((char *) env->stack.current_frame) + offset);
799
800 frame->previous_offset = offset;
801 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
802 frame->method = &vm->vm_initiated_call_method;
803 frame->stack_trace_element = NULL;
804 frame->lock_count = 0;
805 frame->this = NULL;
806 frame->pc = vm->vm_initiated_call_method.frame_info->code;
807 frame->stack_size = 0;
808
809 env->stack.current_frame = frame;
810 }
811
812 /* push parameters */
813 {
814 _svmt_stack_frame *prev_frame = env->stack.current_frame;
815 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
816 (((char *) prev_frame) + prev_frame->end_offset);
817 jint i = 0;
818
819 locals[i++].reference = *this;
820 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
821
822 {
823 jint ref_count = frame_info->non_parameter_ref_locals_count;
824 jint j;
825
826 for (j = 0; j < ref_count; j++)
827 {
828 locals[i++].reference = NULL;
829 }
830 }
831 }
832
833 /* setup java call frame */
834 {
835 size_t offset =
836 env->stack.current_frame->end_offset + frame_info->start_offset;
837 _svmt_stack_frame *frame =
838 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
839 offset);
840
841 frame->previous_offset = offset;
842 frame->end_offset = frame_info->end_offset;
843 frame->method = method;
844 frame->stack_trace_element = NULL;
845 frame->lock_count = 0;
846 frame->this = *this;
847 frame->pc = frame_info->code;
848 frame->stack_size = 0;
849
850 env->stack.current_frame = frame;
851 }
852
853 /* interpret and pop internal call frame */
854 {
855 /* call the interpreter */
856 jint status = _svmf_interpreter (env);
857
858 /* retrieve stack frame */
859 _svmt_stack_frame *frame = env->stack.current_frame;
860
861 assert (frame->method == &vm->vm_initiated_call_method);
862
863 /* pop frame */
864 env->stack.current_frame = (_svmt_stack_frame *) (void *)
865 (((char *) frame) - frame->previous_offset);
866
867 /* rethrow exception */
868 if (status != JNI_OK)
869 {
870 return JNI_ERR;
871 }
872
873 }
874
875 return JNI_OK;
876 }
877
878
879 /*
880 ----------------------------------------------------------------------
881 _svmh_invoke_nonvirtual_jlstacktraceelement_init
882 ----------------------------------------------------------------------
883 */
884
885 svm_static jint
_svmh_invoke_nonvirtual_jlstacktraceelement_init(_svmt_JNIEnv * env,jobject this,jobject param_1,jint param_2,jobject param_3,jobject param_4,jint param_5)886 _svmh_invoke_nonvirtual_jlstacktraceelement_init (_svmt_JNIEnv *env, jobject this, jobject param_1, jint param_2, jobject param_3, jobject param_4, jint param_5)
887 {
888 _svmt_JavaVM *vm = env->vm;
889 _svmt_stack_frame *initial_frame;
890 _svmt_method_info *method = vm->class_loading.boot_loader.methods.jlstacktraceelement_init;
891 _svmt_method_frame_info *frame_info = method->frame_info;
892
893 assert (_svmf_is_set_flag
894 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
895
896 if (this == NULL)
897 {
898 _svmf_error_NullPointerException (env);
899 return JNI_ERR;
900 }
901
902 /* syncronized? */
903 if (method->synchronized)
904 {
905 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
906 {
907 return JNI_ERR;
908 }
909 }
910
911 if (_svmf_ensure_stack_capacity
912 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
913 {
914 return JNI_ERR;
915 }
916
917 initial_frame = env->stack.current_frame;
918
919 /* setup internal call frame */
920 {
921 size_t offset = env->stack.current_frame->end_offset;
922 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
923 (((char *) env->stack.current_frame) + offset);
924
925 frame->previous_offset = offset;
926 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
927 frame->method = &vm->vm_initiated_call_method;
928 frame->stack_trace_element = NULL;
929 frame->lock_count = 0;
930 frame->this = NULL;
931 frame->pc = vm->vm_initiated_call_method.frame_info->code;
932 frame->stack_size = 0;
933
934 env->stack.current_frame = frame;
935 }
936
937 /* push parameters */
938 {
939 _svmt_stack_frame *prev_frame = env->stack.current_frame;
940 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
941 (((char *) prev_frame) + prev_frame->end_offset);
942 jint i = 0;
943
944 locals[i++].reference = *this;
945 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
946 locals[i++].jint = param_2;
947 locals[i++].reference = (param_3 == NULL) ? NULL : *param_3;
948 locals[i++].reference = (param_4 == NULL) ? NULL : *param_4;
949 locals[i++].jint = param_5;
950
951 {
952 jint ref_count = frame_info->non_parameter_ref_locals_count;
953 jint j;
954
955 for (j = 0; j < ref_count; j++)
956 {
957 locals[i++].reference = NULL;
958 }
959 }
960 }
961
962 /* setup java call frame */
963 {
964 size_t offset =
965 env->stack.current_frame->end_offset + frame_info->start_offset;
966 _svmt_stack_frame *frame =
967 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
968 offset);
969
970 frame->previous_offset = offset;
971 frame->end_offset = frame_info->end_offset;
972 frame->method = method;
973 frame->stack_trace_element = NULL;
974 frame->lock_count = 0;
975 frame->this = *this;
976 frame->pc = frame_info->code;
977 frame->stack_size = 0;
978
979 env->stack.current_frame = frame;
980 }
981
982 /* interpret and pop internal call frame */
983 {
984 /* call the interpreter */
985 jint status = _svmf_interpreter (env);
986
987 /* retrieve stack frame */
988 _svmt_stack_frame *frame = env->stack.current_frame;
989
990 assert (frame->method == &vm->vm_initiated_call_method);
991
992 /* pop frame */
993 env->stack.current_frame = (_svmt_stack_frame *) (void *)
994 (((char *) frame) - frame->previous_offset);
995
996 /* rethrow exception */
997 if (status != JNI_OK)
998 {
999 return JNI_ERR;
1000 }
1001
1002 }
1003
1004 return JNI_OK;
1005 }
1006
1007
1008 /*
1009 ----------------------------------------------------------------------
1010 _svmh_invoke_nonvirtual_ArithmeticException_init
1011 ----------------------------------------------------------------------
1012 */
1013
1014 svm_static jint
_svmh_invoke_nonvirtual_ArithmeticException_init(_svmt_JNIEnv * env,jobject this,jobject param_1)1015 _svmh_invoke_nonvirtual_ArithmeticException_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
1016 {
1017 _svmt_JavaVM *vm = env->vm;
1018 _svmt_stack_frame *initial_frame;
1019 _svmt_method_info *method = vm->class_loading.boot_loader.methods.ArithmeticException_init;
1020 _svmt_method_frame_info *frame_info = method->frame_info;
1021
1022 assert (_svmf_is_set_flag
1023 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
1024
1025 if (this == NULL)
1026 {
1027 _svmf_error_NullPointerException (env);
1028 return JNI_ERR;
1029 }
1030
1031 /* syncronized? */
1032 if (method->synchronized)
1033 {
1034 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
1035 {
1036 return JNI_ERR;
1037 }
1038 }
1039
1040 if (_svmf_ensure_stack_capacity
1041 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
1042 {
1043 return JNI_ERR;
1044 }
1045
1046 initial_frame = env->stack.current_frame;
1047
1048 /* setup internal call frame */
1049 {
1050 size_t offset = env->stack.current_frame->end_offset;
1051 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
1052 (((char *) env->stack.current_frame) + offset);
1053
1054 frame->previous_offset = offset;
1055 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
1056 frame->method = &vm->vm_initiated_call_method;
1057 frame->stack_trace_element = NULL;
1058 frame->lock_count = 0;
1059 frame->this = NULL;
1060 frame->pc = vm->vm_initiated_call_method.frame_info->code;
1061 frame->stack_size = 0;
1062
1063 env->stack.current_frame = frame;
1064 }
1065
1066 /* push parameters */
1067 {
1068 _svmt_stack_frame *prev_frame = env->stack.current_frame;
1069 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
1070 (((char *) prev_frame) + prev_frame->end_offset);
1071 jint i = 0;
1072
1073 locals[i++].reference = *this;
1074 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
1075
1076 {
1077 jint ref_count = frame_info->non_parameter_ref_locals_count;
1078 jint j;
1079
1080 for (j = 0; j < ref_count; j++)
1081 {
1082 locals[i++].reference = NULL;
1083 }
1084 }
1085 }
1086
1087 /* setup java call frame */
1088 {
1089 size_t offset =
1090 env->stack.current_frame->end_offset + frame_info->start_offset;
1091 _svmt_stack_frame *frame =
1092 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
1093 offset);
1094
1095 frame->previous_offset = offset;
1096 frame->end_offset = frame_info->end_offset;
1097 frame->method = method;
1098 frame->stack_trace_element = NULL;
1099 frame->lock_count = 0;
1100 frame->this = *this;
1101 frame->pc = frame_info->code;
1102 frame->stack_size = 0;
1103
1104 env->stack.current_frame = frame;
1105 }
1106
1107 /* interpret and pop internal call frame */
1108 {
1109 /* call the interpreter */
1110 jint status = _svmf_interpreter (env);
1111
1112 /* retrieve stack frame */
1113 _svmt_stack_frame *frame = env->stack.current_frame;
1114
1115 assert (frame->method == &vm->vm_initiated_call_method);
1116
1117 /* pop frame */
1118 env->stack.current_frame = (_svmt_stack_frame *) (void *)
1119 (((char *) frame) - frame->previous_offset);
1120
1121 /* rethrow exception */
1122 if (status != JNI_OK)
1123 {
1124 return JNI_ERR;
1125 }
1126
1127 }
1128
1129 return JNI_OK;
1130 }
1131
1132
1133 /*
1134 ----------------------------------------------------------------------
1135 _svmh_invoke_nonvirtual_ArrayIndexOutOfBoundsException_init
1136 ----------------------------------------------------------------------
1137 */
1138
1139 svm_static jint
_svmh_invoke_nonvirtual_ArrayIndexOutOfBoundsException_init(_svmt_JNIEnv * env,jobject this,jobject param_1)1140 _svmh_invoke_nonvirtual_ArrayIndexOutOfBoundsException_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
1141 {
1142 _svmt_JavaVM *vm = env->vm;
1143 _svmt_stack_frame *initial_frame;
1144 _svmt_method_info *method = vm->class_loading.boot_loader.methods.ArrayIndexOutOfBoundsException_init;
1145 _svmt_method_frame_info *frame_info = method->frame_info;
1146
1147 assert (_svmf_is_set_flag
1148 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
1149
1150 if (this == NULL)
1151 {
1152 _svmf_error_NullPointerException (env);
1153 return JNI_ERR;
1154 }
1155
1156 /* syncronized? */
1157 if (method->synchronized)
1158 {
1159 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
1160 {
1161 return JNI_ERR;
1162 }
1163 }
1164
1165 if (_svmf_ensure_stack_capacity
1166 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
1167 {
1168 return JNI_ERR;
1169 }
1170
1171 initial_frame = env->stack.current_frame;
1172
1173 /* setup internal call frame */
1174 {
1175 size_t offset = env->stack.current_frame->end_offset;
1176 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
1177 (((char *) env->stack.current_frame) + offset);
1178
1179 frame->previous_offset = offset;
1180 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
1181 frame->method = &vm->vm_initiated_call_method;
1182 frame->stack_trace_element = NULL;
1183 frame->lock_count = 0;
1184 frame->this = NULL;
1185 frame->pc = vm->vm_initiated_call_method.frame_info->code;
1186 frame->stack_size = 0;
1187
1188 env->stack.current_frame = frame;
1189 }
1190
1191 /* push parameters */
1192 {
1193 _svmt_stack_frame *prev_frame = env->stack.current_frame;
1194 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
1195 (((char *) prev_frame) + prev_frame->end_offset);
1196 jint i = 0;
1197
1198 locals[i++].reference = *this;
1199 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
1200
1201 {
1202 jint ref_count = frame_info->non_parameter_ref_locals_count;
1203 jint j;
1204
1205 for (j = 0; j < ref_count; j++)
1206 {
1207 locals[i++].reference = NULL;
1208 }
1209 }
1210 }
1211
1212 /* setup java call frame */
1213 {
1214 size_t offset =
1215 env->stack.current_frame->end_offset + frame_info->start_offset;
1216 _svmt_stack_frame *frame =
1217 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
1218 offset);
1219
1220 frame->previous_offset = offset;
1221 frame->end_offset = frame_info->end_offset;
1222 frame->method = method;
1223 frame->stack_trace_element = NULL;
1224 frame->lock_count = 0;
1225 frame->this = *this;
1226 frame->pc = frame_info->code;
1227 frame->stack_size = 0;
1228
1229 env->stack.current_frame = frame;
1230 }
1231
1232 /* interpret and pop internal call frame */
1233 {
1234 /* call the interpreter */
1235 jint status = _svmf_interpreter (env);
1236
1237 /* retrieve stack frame */
1238 _svmt_stack_frame *frame = env->stack.current_frame;
1239
1240 assert (frame->method == &vm->vm_initiated_call_method);
1241
1242 /* pop frame */
1243 env->stack.current_frame = (_svmt_stack_frame *) (void *)
1244 (((char *) frame) - frame->previous_offset);
1245
1246 /* rethrow exception */
1247 if (status != JNI_OK)
1248 {
1249 return JNI_ERR;
1250 }
1251
1252 }
1253
1254 return JNI_OK;
1255 }
1256
1257
1258 /*
1259 ----------------------------------------------------------------------
1260 _svmh_invoke_nonvirtual_ArrayStoreException_init
1261 ----------------------------------------------------------------------
1262 */
1263
1264 svm_static jint
_svmh_invoke_nonvirtual_ArrayStoreException_init(_svmt_JNIEnv * env,jobject this,jobject param_1)1265 _svmh_invoke_nonvirtual_ArrayStoreException_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
1266 {
1267 _svmt_JavaVM *vm = env->vm;
1268 _svmt_stack_frame *initial_frame;
1269 _svmt_method_info *method = vm->class_loading.boot_loader.methods.ArrayStoreException_init;
1270 _svmt_method_frame_info *frame_info = method->frame_info;
1271
1272 assert (_svmf_is_set_flag
1273 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
1274
1275 if (this == NULL)
1276 {
1277 _svmf_error_NullPointerException (env);
1278 return JNI_ERR;
1279 }
1280
1281 /* syncronized? */
1282 if (method->synchronized)
1283 {
1284 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
1285 {
1286 return JNI_ERR;
1287 }
1288 }
1289
1290 if (_svmf_ensure_stack_capacity
1291 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
1292 {
1293 return JNI_ERR;
1294 }
1295
1296 initial_frame = env->stack.current_frame;
1297
1298 /* setup internal call frame */
1299 {
1300 size_t offset = env->stack.current_frame->end_offset;
1301 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
1302 (((char *) env->stack.current_frame) + offset);
1303
1304 frame->previous_offset = offset;
1305 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
1306 frame->method = &vm->vm_initiated_call_method;
1307 frame->stack_trace_element = NULL;
1308 frame->lock_count = 0;
1309 frame->this = NULL;
1310 frame->pc = vm->vm_initiated_call_method.frame_info->code;
1311 frame->stack_size = 0;
1312
1313 env->stack.current_frame = frame;
1314 }
1315
1316 /* push parameters */
1317 {
1318 _svmt_stack_frame *prev_frame = env->stack.current_frame;
1319 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
1320 (((char *) prev_frame) + prev_frame->end_offset);
1321 jint i = 0;
1322
1323 locals[i++].reference = *this;
1324 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
1325
1326 {
1327 jint ref_count = frame_info->non_parameter_ref_locals_count;
1328 jint j;
1329
1330 for (j = 0; j < ref_count; j++)
1331 {
1332 locals[i++].reference = NULL;
1333 }
1334 }
1335 }
1336
1337 /* setup java call frame */
1338 {
1339 size_t offset =
1340 env->stack.current_frame->end_offset + frame_info->start_offset;
1341 _svmt_stack_frame *frame =
1342 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
1343 offset);
1344
1345 frame->previous_offset = offset;
1346 frame->end_offset = frame_info->end_offset;
1347 frame->method = method;
1348 frame->stack_trace_element = NULL;
1349 frame->lock_count = 0;
1350 frame->this = *this;
1351 frame->pc = frame_info->code;
1352 frame->stack_size = 0;
1353
1354 env->stack.current_frame = frame;
1355 }
1356
1357 /* interpret and pop internal call frame */
1358 {
1359 /* call the interpreter */
1360 jint status = _svmf_interpreter (env);
1361
1362 /* retrieve stack frame */
1363 _svmt_stack_frame *frame = env->stack.current_frame;
1364
1365 assert (frame->method == &vm->vm_initiated_call_method);
1366
1367 /* pop frame */
1368 env->stack.current_frame = (_svmt_stack_frame *) (void *)
1369 (((char *) frame) - frame->previous_offset);
1370
1371 /* rethrow exception */
1372 if (status != JNI_OK)
1373 {
1374 return JNI_ERR;
1375 }
1376
1377 }
1378
1379 return JNI_OK;
1380 }
1381
1382
1383 /*
1384 ----------------------------------------------------------------------
1385 _svmh_invoke_nonvirtual_ClassCastException_init
1386 ----------------------------------------------------------------------
1387 */
1388
1389 svm_static jint
_svmh_invoke_nonvirtual_ClassCastException_init(_svmt_JNIEnv * env,jobject this,jobject param_1)1390 _svmh_invoke_nonvirtual_ClassCastException_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
1391 {
1392 _svmt_JavaVM *vm = env->vm;
1393 _svmt_stack_frame *initial_frame;
1394 _svmt_method_info *method = vm->class_loading.boot_loader.methods.ClassCastException_init;
1395 _svmt_method_frame_info *frame_info = method->frame_info;
1396
1397 assert (_svmf_is_set_flag
1398 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
1399
1400 if (this == NULL)
1401 {
1402 _svmf_error_NullPointerException (env);
1403 return JNI_ERR;
1404 }
1405
1406 /* syncronized? */
1407 if (method->synchronized)
1408 {
1409 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
1410 {
1411 return JNI_ERR;
1412 }
1413 }
1414
1415 if (_svmf_ensure_stack_capacity
1416 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
1417 {
1418 return JNI_ERR;
1419 }
1420
1421 initial_frame = env->stack.current_frame;
1422
1423 /* setup internal call frame */
1424 {
1425 size_t offset = env->stack.current_frame->end_offset;
1426 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
1427 (((char *) env->stack.current_frame) + offset);
1428
1429 frame->previous_offset = offset;
1430 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
1431 frame->method = &vm->vm_initiated_call_method;
1432 frame->stack_trace_element = NULL;
1433 frame->lock_count = 0;
1434 frame->this = NULL;
1435 frame->pc = vm->vm_initiated_call_method.frame_info->code;
1436 frame->stack_size = 0;
1437
1438 env->stack.current_frame = frame;
1439 }
1440
1441 /* push parameters */
1442 {
1443 _svmt_stack_frame *prev_frame = env->stack.current_frame;
1444 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
1445 (((char *) prev_frame) + prev_frame->end_offset);
1446 jint i = 0;
1447
1448 locals[i++].reference = *this;
1449 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
1450
1451 {
1452 jint ref_count = frame_info->non_parameter_ref_locals_count;
1453 jint j;
1454
1455 for (j = 0; j < ref_count; j++)
1456 {
1457 locals[i++].reference = NULL;
1458 }
1459 }
1460 }
1461
1462 /* setup java call frame */
1463 {
1464 size_t offset =
1465 env->stack.current_frame->end_offset + frame_info->start_offset;
1466 _svmt_stack_frame *frame =
1467 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
1468 offset);
1469
1470 frame->previous_offset = offset;
1471 frame->end_offset = frame_info->end_offset;
1472 frame->method = method;
1473 frame->stack_trace_element = NULL;
1474 frame->lock_count = 0;
1475 frame->this = *this;
1476 frame->pc = frame_info->code;
1477 frame->stack_size = 0;
1478
1479 env->stack.current_frame = frame;
1480 }
1481
1482 /* interpret and pop internal call frame */
1483 {
1484 /* call the interpreter */
1485 jint status = _svmf_interpreter (env);
1486
1487 /* retrieve stack frame */
1488 _svmt_stack_frame *frame = env->stack.current_frame;
1489
1490 assert (frame->method == &vm->vm_initiated_call_method);
1491
1492 /* pop frame */
1493 env->stack.current_frame = (_svmt_stack_frame *) (void *)
1494 (((char *) frame) - frame->previous_offset);
1495
1496 /* rethrow exception */
1497 if (status != JNI_OK)
1498 {
1499 return JNI_ERR;
1500 }
1501
1502 }
1503
1504 return JNI_OK;
1505 }
1506
1507
1508 /*
1509 ----------------------------------------------------------------------
1510 _svmh_invoke_nonvirtual_IllegalMonitorStateException_init
1511 ----------------------------------------------------------------------
1512 */
1513
1514 svm_static jint
_svmh_invoke_nonvirtual_IllegalMonitorStateException_init(_svmt_JNIEnv * env,jobject this,jobject param_1)1515 _svmh_invoke_nonvirtual_IllegalMonitorStateException_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
1516 {
1517 _svmt_JavaVM *vm = env->vm;
1518 _svmt_stack_frame *initial_frame;
1519 _svmt_method_info *method = vm->class_loading.boot_loader.methods.IllegalMonitorStateException_init;
1520 _svmt_method_frame_info *frame_info = method->frame_info;
1521
1522 assert (_svmf_is_set_flag
1523 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
1524
1525 if (this == NULL)
1526 {
1527 _svmf_error_NullPointerException (env);
1528 return JNI_ERR;
1529 }
1530
1531 /* syncronized? */
1532 if (method->synchronized)
1533 {
1534 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
1535 {
1536 return JNI_ERR;
1537 }
1538 }
1539
1540 if (_svmf_ensure_stack_capacity
1541 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
1542 {
1543 return JNI_ERR;
1544 }
1545
1546 initial_frame = env->stack.current_frame;
1547
1548 /* setup internal call frame */
1549 {
1550 size_t offset = env->stack.current_frame->end_offset;
1551 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
1552 (((char *) env->stack.current_frame) + offset);
1553
1554 frame->previous_offset = offset;
1555 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
1556 frame->method = &vm->vm_initiated_call_method;
1557 frame->stack_trace_element = NULL;
1558 frame->lock_count = 0;
1559 frame->this = NULL;
1560 frame->pc = vm->vm_initiated_call_method.frame_info->code;
1561 frame->stack_size = 0;
1562
1563 env->stack.current_frame = frame;
1564 }
1565
1566 /* push parameters */
1567 {
1568 _svmt_stack_frame *prev_frame = env->stack.current_frame;
1569 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
1570 (((char *) prev_frame) + prev_frame->end_offset);
1571 jint i = 0;
1572
1573 locals[i++].reference = *this;
1574 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
1575
1576 {
1577 jint ref_count = frame_info->non_parameter_ref_locals_count;
1578 jint j;
1579
1580 for (j = 0; j < ref_count; j++)
1581 {
1582 locals[i++].reference = NULL;
1583 }
1584 }
1585 }
1586
1587 /* setup java call frame */
1588 {
1589 size_t offset =
1590 env->stack.current_frame->end_offset + frame_info->start_offset;
1591 _svmt_stack_frame *frame =
1592 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
1593 offset);
1594
1595 frame->previous_offset = offset;
1596 frame->end_offset = frame_info->end_offset;
1597 frame->method = method;
1598 frame->stack_trace_element = NULL;
1599 frame->lock_count = 0;
1600 frame->this = *this;
1601 frame->pc = frame_info->code;
1602 frame->stack_size = 0;
1603
1604 env->stack.current_frame = frame;
1605 }
1606
1607 /* interpret and pop internal call frame */
1608 {
1609 /* call the interpreter */
1610 jint status = _svmf_interpreter (env);
1611
1612 /* retrieve stack frame */
1613 _svmt_stack_frame *frame = env->stack.current_frame;
1614
1615 assert (frame->method == &vm->vm_initiated_call_method);
1616
1617 /* pop frame */
1618 env->stack.current_frame = (_svmt_stack_frame *) (void *)
1619 (((char *) frame) - frame->previous_offset);
1620
1621 /* rethrow exception */
1622 if (status != JNI_OK)
1623 {
1624 return JNI_ERR;
1625 }
1626
1627 }
1628
1629 return JNI_OK;
1630 }
1631
1632
1633 /*
1634 ----------------------------------------------------------------------
1635 _svmh_invoke_nonvirtual_NegativeArraySizeException_init
1636 ----------------------------------------------------------------------
1637 */
1638
1639 svm_static jint
_svmh_invoke_nonvirtual_NegativeArraySizeException_init(_svmt_JNIEnv * env,jobject this,jobject param_1)1640 _svmh_invoke_nonvirtual_NegativeArraySizeException_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
1641 {
1642 _svmt_JavaVM *vm = env->vm;
1643 _svmt_stack_frame *initial_frame;
1644 _svmt_method_info *method = vm->class_loading.boot_loader.methods.NegativeArraySizeException_init;
1645 _svmt_method_frame_info *frame_info = method->frame_info;
1646
1647 assert (_svmf_is_set_flag
1648 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
1649
1650 if (this == NULL)
1651 {
1652 _svmf_error_NullPointerException (env);
1653 return JNI_ERR;
1654 }
1655
1656 /* syncronized? */
1657 if (method->synchronized)
1658 {
1659 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
1660 {
1661 return JNI_ERR;
1662 }
1663 }
1664
1665 if (_svmf_ensure_stack_capacity
1666 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
1667 {
1668 return JNI_ERR;
1669 }
1670
1671 initial_frame = env->stack.current_frame;
1672
1673 /* setup internal call frame */
1674 {
1675 size_t offset = env->stack.current_frame->end_offset;
1676 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
1677 (((char *) env->stack.current_frame) + offset);
1678
1679 frame->previous_offset = offset;
1680 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
1681 frame->method = &vm->vm_initiated_call_method;
1682 frame->stack_trace_element = NULL;
1683 frame->lock_count = 0;
1684 frame->this = NULL;
1685 frame->pc = vm->vm_initiated_call_method.frame_info->code;
1686 frame->stack_size = 0;
1687
1688 env->stack.current_frame = frame;
1689 }
1690
1691 /* push parameters */
1692 {
1693 _svmt_stack_frame *prev_frame = env->stack.current_frame;
1694 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
1695 (((char *) prev_frame) + prev_frame->end_offset);
1696 jint i = 0;
1697
1698 locals[i++].reference = *this;
1699 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
1700
1701 {
1702 jint ref_count = frame_info->non_parameter_ref_locals_count;
1703 jint j;
1704
1705 for (j = 0; j < ref_count; j++)
1706 {
1707 locals[i++].reference = NULL;
1708 }
1709 }
1710 }
1711
1712 /* setup java call frame */
1713 {
1714 size_t offset =
1715 env->stack.current_frame->end_offset + frame_info->start_offset;
1716 _svmt_stack_frame *frame =
1717 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
1718 offset);
1719
1720 frame->previous_offset = offset;
1721 frame->end_offset = frame_info->end_offset;
1722 frame->method = method;
1723 frame->stack_trace_element = NULL;
1724 frame->lock_count = 0;
1725 frame->this = *this;
1726 frame->pc = frame_info->code;
1727 frame->stack_size = 0;
1728
1729 env->stack.current_frame = frame;
1730 }
1731
1732 /* interpret and pop internal call frame */
1733 {
1734 /* call the interpreter */
1735 jint status = _svmf_interpreter (env);
1736
1737 /* retrieve stack frame */
1738 _svmt_stack_frame *frame = env->stack.current_frame;
1739
1740 assert (frame->method == &vm->vm_initiated_call_method);
1741
1742 /* pop frame */
1743 env->stack.current_frame = (_svmt_stack_frame *) (void *)
1744 (((char *) frame) - frame->previous_offset);
1745
1746 /* rethrow exception */
1747 if (status != JNI_OK)
1748 {
1749 return JNI_ERR;
1750 }
1751
1752 }
1753
1754 return JNI_OK;
1755 }
1756
1757
1758 /*
1759 ----------------------------------------------------------------------
1760 _svmh_invoke_nonvirtual_NoSuchFieldException_init
1761 ----------------------------------------------------------------------
1762 */
1763
1764 svm_static jint
_svmh_invoke_nonvirtual_NoSuchFieldException_init(_svmt_JNIEnv * env,jobject this,jobject param_1)1765 _svmh_invoke_nonvirtual_NoSuchFieldException_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
1766 {
1767 _svmt_JavaVM *vm = env->vm;
1768 _svmt_stack_frame *initial_frame;
1769 _svmt_method_info *method = vm->class_loading.boot_loader.methods.NoSuchFieldException_init;
1770 _svmt_method_frame_info *frame_info = method->frame_info;
1771
1772 assert (_svmf_is_set_flag
1773 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
1774
1775 if (this == NULL)
1776 {
1777 _svmf_error_NullPointerException (env);
1778 return JNI_ERR;
1779 }
1780
1781 /* syncronized? */
1782 if (method->synchronized)
1783 {
1784 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
1785 {
1786 return JNI_ERR;
1787 }
1788 }
1789
1790 if (_svmf_ensure_stack_capacity
1791 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
1792 {
1793 return JNI_ERR;
1794 }
1795
1796 initial_frame = env->stack.current_frame;
1797
1798 /* setup internal call frame */
1799 {
1800 size_t offset = env->stack.current_frame->end_offset;
1801 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
1802 (((char *) env->stack.current_frame) + offset);
1803
1804 frame->previous_offset = offset;
1805 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
1806 frame->method = &vm->vm_initiated_call_method;
1807 frame->stack_trace_element = NULL;
1808 frame->lock_count = 0;
1809 frame->this = NULL;
1810 frame->pc = vm->vm_initiated_call_method.frame_info->code;
1811 frame->stack_size = 0;
1812
1813 env->stack.current_frame = frame;
1814 }
1815
1816 /* push parameters */
1817 {
1818 _svmt_stack_frame *prev_frame = env->stack.current_frame;
1819 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
1820 (((char *) prev_frame) + prev_frame->end_offset);
1821 jint i = 0;
1822
1823 locals[i++].reference = *this;
1824 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
1825
1826 {
1827 jint ref_count = frame_info->non_parameter_ref_locals_count;
1828 jint j;
1829
1830 for (j = 0; j < ref_count; j++)
1831 {
1832 locals[i++].reference = NULL;
1833 }
1834 }
1835 }
1836
1837 /* setup java call frame */
1838 {
1839 size_t offset =
1840 env->stack.current_frame->end_offset + frame_info->start_offset;
1841 _svmt_stack_frame *frame =
1842 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
1843 offset);
1844
1845 frame->previous_offset = offset;
1846 frame->end_offset = frame_info->end_offset;
1847 frame->method = method;
1848 frame->stack_trace_element = NULL;
1849 frame->lock_count = 0;
1850 frame->this = *this;
1851 frame->pc = frame_info->code;
1852 frame->stack_size = 0;
1853
1854 env->stack.current_frame = frame;
1855 }
1856
1857 /* interpret and pop internal call frame */
1858 {
1859 /* call the interpreter */
1860 jint status = _svmf_interpreter (env);
1861
1862 /* retrieve stack frame */
1863 _svmt_stack_frame *frame = env->stack.current_frame;
1864
1865 assert (frame->method == &vm->vm_initiated_call_method);
1866
1867 /* pop frame */
1868 env->stack.current_frame = (_svmt_stack_frame *) (void *)
1869 (((char *) frame) - frame->previous_offset);
1870
1871 /* rethrow exception */
1872 if (status != JNI_OK)
1873 {
1874 return JNI_ERR;
1875 }
1876
1877 }
1878
1879 return JNI_OK;
1880 }
1881
1882
1883 /*
1884 ----------------------------------------------------------------------
1885 _svmh_invoke_nonvirtual_NoSuchMethodException_init
1886 ----------------------------------------------------------------------
1887 */
1888
1889 svm_static jint
_svmh_invoke_nonvirtual_NoSuchMethodException_init(_svmt_JNIEnv * env,jobject this,jobject param_1)1890 _svmh_invoke_nonvirtual_NoSuchMethodException_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
1891 {
1892 _svmt_JavaVM *vm = env->vm;
1893 _svmt_stack_frame *initial_frame;
1894 _svmt_method_info *method = vm->class_loading.boot_loader.methods.NoSuchMethodException_init;
1895 _svmt_method_frame_info *frame_info = method->frame_info;
1896
1897 assert (_svmf_is_set_flag
1898 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
1899
1900 if (this == NULL)
1901 {
1902 _svmf_error_NullPointerException (env);
1903 return JNI_ERR;
1904 }
1905
1906 /* syncronized? */
1907 if (method->synchronized)
1908 {
1909 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
1910 {
1911 return JNI_ERR;
1912 }
1913 }
1914
1915 if (_svmf_ensure_stack_capacity
1916 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
1917 {
1918 return JNI_ERR;
1919 }
1920
1921 initial_frame = env->stack.current_frame;
1922
1923 /* setup internal call frame */
1924 {
1925 size_t offset = env->stack.current_frame->end_offset;
1926 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
1927 (((char *) env->stack.current_frame) + offset);
1928
1929 frame->previous_offset = offset;
1930 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
1931 frame->method = &vm->vm_initiated_call_method;
1932 frame->stack_trace_element = NULL;
1933 frame->lock_count = 0;
1934 frame->this = NULL;
1935 frame->pc = vm->vm_initiated_call_method.frame_info->code;
1936 frame->stack_size = 0;
1937
1938 env->stack.current_frame = frame;
1939 }
1940
1941 /* push parameters */
1942 {
1943 _svmt_stack_frame *prev_frame = env->stack.current_frame;
1944 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
1945 (((char *) prev_frame) + prev_frame->end_offset);
1946 jint i = 0;
1947
1948 locals[i++].reference = *this;
1949 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
1950
1951 {
1952 jint ref_count = frame_info->non_parameter_ref_locals_count;
1953 jint j;
1954
1955 for (j = 0; j < ref_count; j++)
1956 {
1957 locals[i++].reference = NULL;
1958 }
1959 }
1960 }
1961
1962 /* setup java call frame */
1963 {
1964 size_t offset =
1965 env->stack.current_frame->end_offset + frame_info->start_offset;
1966 _svmt_stack_frame *frame =
1967 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
1968 offset);
1969
1970 frame->previous_offset = offset;
1971 frame->end_offset = frame_info->end_offset;
1972 frame->method = method;
1973 frame->stack_trace_element = NULL;
1974 frame->lock_count = 0;
1975 frame->this = *this;
1976 frame->pc = frame_info->code;
1977 frame->stack_size = 0;
1978
1979 env->stack.current_frame = frame;
1980 }
1981
1982 /* interpret and pop internal call frame */
1983 {
1984 /* call the interpreter */
1985 jint status = _svmf_interpreter (env);
1986
1987 /* retrieve stack frame */
1988 _svmt_stack_frame *frame = env->stack.current_frame;
1989
1990 assert (frame->method == &vm->vm_initiated_call_method);
1991
1992 /* pop frame */
1993 env->stack.current_frame = (_svmt_stack_frame *) (void *)
1994 (((char *) frame) - frame->previous_offset);
1995
1996 /* rethrow exception */
1997 if (status != JNI_OK)
1998 {
1999 return JNI_ERR;
2000 }
2001
2002 }
2003
2004 return JNI_OK;
2005 }
2006
2007
2008 /*
2009 ----------------------------------------------------------------------
2010 _svmh_invoke_nonvirtual_NullPointerException_init
2011 ----------------------------------------------------------------------
2012 */
2013
2014 svm_static jint
_svmh_invoke_nonvirtual_NullPointerException_init(_svmt_JNIEnv * env,jobject this,jobject param_1)2015 _svmh_invoke_nonvirtual_NullPointerException_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
2016 {
2017 _svmt_JavaVM *vm = env->vm;
2018 _svmt_stack_frame *initial_frame;
2019 _svmt_method_info *method = vm->class_loading.boot_loader.methods.NullPointerException_init;
2020 _svmt_method_frame_info *frame_info = method->frame_info;
2021
2022 assert (_svmf_is_set_flag
2023 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
2024
2025 if (this == NULL)
2026 {
2027 _svmf_error_NullPointerException (env);
2028 return JNI_ERR;
2029 }
2030
2031 /* syncronized? */
2032 if (method->synchronized)
2033 {
2034 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
2035 {
2036 return JNI_ERR;
2037 }
2038 }
2039
2040 if (_svmf_ensure_stack_capacity
2041 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
2042 {
2043 return JNI_ERR;
2044 }
2045
2046 initial_frame = env->stack.current_frame;
2047
2048 /* setup internal call frame */
2049 {
2050 size_t offset = env->stack.current_frame->end_offset;
2051 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
2052 (((char *) env->stack.current_frame) + offset);
2053
2054 frame->previous_offset = offset;
2055 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
2056 frame->method = &vm->vm_initiated_call_method;
2057 frame->stack_trace_element = NULL;
2058 frame->lock_count = 0;
2059 frame->this = NULL;
2060 frame->pc = vm->vm_initiated_call_method.frame_info->code;
2061 frame->stack_size = 0;
2062
2063 env->stack.current_frame = frame;
2064 }
2065
2066 /* push parameters */
2067 {
2068 _svmt_stack_frame *prev_frame = env->stack.current_frame;
2069 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
2070 (((char *) prev_frame) + prev_frame->end_offset);
2071 jint i = 0;
2072
2073 locals[i++].reference = *this;
2074 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
2075
2076 {
2077 jint ref_count = frame_info->non_parameter_ref_locals_count;
2078 jint j;
2079
2080 for (j = 0; j < ref_count; j++)
2081 {
2082 locals[i++].reference = NULL;
2083 }
2084 }
2085 }
2086
2087 /* setup java call frame */
2088 {
2089 size_t offset =
2090 env->stack.current_frame->end_offset + frame_info->start_offset;
2091 _svmt_stack_frame *frame =
2092 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
2093 offset);
2094
2095 frame->previous_offset = offset;
2096 frame->end_offset = frame_info->end_offset;
2097 frame->method = method;
2098 frame->stack_trace_element = NULL;
2099 frame->lock_count = 0;
2100 frame->this = *this;
2101 frame->pc = frame_info->code;
2102 frame->stack_size = 0;
2103
2104 env->stack.current_frame = frame;
2105 }
2106
2107 /* interpret and pop internal call frame */
2108 {
2109 /* call the interpreter */
2110 jint status = _svmf_interpreter (env);
2111
2112 /* retrieve stack frame */
2113 _svmt_stack_frame *frame = env->stack.current_frame;
2114
2115 assert (frame->method == &vm->vm_initiated_call_method);
2116
2117 /* pop frame */
2118 env->stack.current_frame = (_svmt_stack_frame *) (void *)
2119 (((char *) frame) - frame->previous_offset);
2120
2121 /* rethrow exception */
2122 if (status != JNI_OK)
2123 {
2124 return JNI_ERR;
2125 }
2126
2127 }
2128
2129 return JNI_OK;
2130 }
2131
2132
2133 /*
2134 ----------------------------------------------------------------------
2135 _svmh_invoke_nonvirtual_InterruptedException_init
2136 ----------------------------------------------------------------------
2137 */
2138
2139 svm_static jint
_svmh_invoke_nonvirtual_InterruptedException_init(_svmt_JNIEnv * env,jobject this,jobject param_1)2140 _svmh_invoke_nonvirtual_InterruptedException_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
2141 {
2142 _svmt_JavaVM *vm = env->vm;
2143 _svmt_stack_frame *initial_frame;
2144 _svmt_method_info *method = vm->class_loading.boot_loader.methods.InterruptedException_init;
2145 _svmt_method_frame_info *frame_info = method->frame_info;
2146
2147 assert (_svmf_is_set_flag
2148 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
2149
2150 if (this == NULL)
2151 {
2152 _svmf_error_NullPointerException (env);
2153 return JNI_ERR;
2154 }
2155
2156 /* syncronized? */
2157 if (method->synchronized)
2158 {
2159 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
2160 {
2161 return JNI_ERR;
2162 }
2163 }
2164
2165 if (_svmf_ensure_stack_capacity
2166 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
2167 {
2168 return JNI_ERR;
2169 }
2170
2171 initial_frame = env->stack.current_frame;
2172
2173 /* setup internal call frame */
2174 {
2175 size_t offset = env->stack.current_frame->end_offset;
2176 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
2177 (((char *) env->stack.current_frame) + offset);
2178
2179 frame->previous_offset = offset;
2180 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
2181 frame->method = &vm->vm_initiated_call_method;
2182 frame->stack_trace_element = NULL;
2183 frame->lock_count = 0;
2184 frame->this = NULL;
2185 frame->pc = vm->vm_initiated_call_method.frame_info->code;
2186 frame->stack_size = 0;
2187
2188 env->stack.current_frame = frame;
2189 }
2190
2191 /* push parameters */
2192 {
2193 _svmt_stack_frame *prev_frame = env->stack.current_frame;
2194 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
2195 (((char *) prev_frame) + prev_frame->end_offset);
2196 jint i = 0;
2197
2198 locals[i++].reference = *this;
2199 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
2200
2201 {
2202 jint ref_count = frame_info->non_parameter_ref_locals_count;
2203 jint j;
2204
2205 for (j = 0; j < ref_count; j++)
2206 {
2207 locals[i++].reference = NULL;
2208 }
2209 }
2210 }
2211
2212 /* setup java call frame */
2213 {
2214 size_t offset =
2215 env->stack.current_frame->end_offset + frame_info->start_offset;
2216 _svmt_stack_frame *frame =
2217 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
2218 offset);
2219
2220 frame->previous_offset = offset;
2221 frame->end_offset = frame_info->end_offset;
2222 frame->method = method;
2223 frame->stack_trace_element = NULL;
2224 frame->lock_count = 0;
2225 frame->this = *this;
2226 frame->pc = frame_info->code;
2227 frame->stack_size = 0;
2228
2229 env->stack.current_frame = frame;
2230 }
2231
2232 /* interpret and pop internal call frame */
2233 {
2234 /* call the interpreter */
2235 jint status = _svmf_interpreter (env);
2236
2237 /* retrieve stack frame */
2238 _svmt_stack_frame *frame = env->stack.current_frame;
2239
2240 assert (frame->method == &vm->vm_initiated_call_method);
2241
2242 /* pop frame */
2243 env->stack.current_frame = (_svmt_stack_frame *) (void *)
2244 (((char *) frame) - frame->previous_offset);
2245
2246 /* rethrow exception */
2247 if (status != JNI_OK)
2248 {
2249 return JNI_ERR;
2250 }
2251
2252 }
2253
2254 return JNI_OK;
2255 }
2256
2257
2258 /*
2259 ----------------------------------------------------------------------
2260 _svmh_invoke_nonvirtual_InliningException_init
2261 ----------------------------------------------------------------------
2262 */
2263
2264 svm_static jint
_svmh_invoke_nonvirtual_InliningException_init(_svmt_JNIEnv * env,jobject this,jobject param_1)2265 _svmh_invoke_nonvirtual_InliningException_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
2266 {
2267 _svmt_JavaVM *vm = env->vm;
2268 _svmt_stack_frame *initial_frame;
2269 _svmt_method_info *method = vm->class_loading.boot_loader.methods.InliningException_init;
2270 _svmt_method_frame_info *frame_info = method->frame_info;
2271
2272 assert (_svmf_is_set_flag
2273 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
2274
2275 if (this == NULL)
2276 {
2277 _svmf_error_NullPointerException (env);
2278 return JNI_ERR;
2279 }
2280
2281 /* syncronized? */
2282 if (method->synchronized)
2283 {
2284 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
2285 {
2286 return JNI_ERR;
2287 }
2288 }
2289
2290 if (_svmf_ensure_stack_capacity
2291 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
2292 {
2293 return JNI_ERR;
2294 }
2295
2296 initial_frame = env->stack.current_frame;
2297
2298 /* setup internal call frame */
2299 {
2300 size_t offset = env->stack.current_frame->end_offset;
2301 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
2302 (((char *) env->stack.current_frame) + offset);
2303
2304 frame->previous_offset = offset;
2305 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
2306 frame->method = &vm->vm_initiated_call_method;
2307 frame->stack_trace_element = NULL;
2308 frame->lock_count = 0;
2309 frame->this = NULL;
2310 frame->pc = vm->vm_initiated_call_method.frame_info->code;
2311 frame->stack_size = 0;
2312
2313 env->stack.current_frame = frame;
2314 }
2315
2316 /* push parameters */
2317 {
2318 _svmt_stack_frame *prev_frame = env->stack.current_frame;
2319 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
2320 (((char *) prev_frame) + prev_frame->end_offset);
2321 jint i = 0;
2322
2323 locals[i++].reference = *this;
2324 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
2325
2326 {
2327 jint ref_count = frame_info->non_parameter_ref_locals_count;
2328 jint j;
2329
2330 for (j = 0; j < ref_count; j++)
2331 {
2332 locals[i++].reference = NULL;
2333 }
2334 }
2335 }
2336
2337 /* setup java call frame */
2338 {
2339 size_t offset =
2340 env->stack.current_frame->end_offset + frame_info->start_offset;
2341 _svmt_stack_frame *frame =
2342 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
2343 offset);
2344
2345 frame->previous_offset = offset;
2346 frame->end_offset = frame_info->end_offset;
2347 frame->method = method;
2348 frame->stack_trace_element = NULL;
2349 frame->lock_count = 0;
2350 frame->this = *this;
2351 frame->pc = frame_info->code;
2352 frame->stack_size = 0;
2353
2354 env->stack.current_frame = frame;
2355 }
2356
2357 /* interpret and pop internal call frame */
2358 {
2359 /* call the interpreter */
2360 jint status = _svmf_interpreter (env);
2361
2362 /* retrieve stack frame */
2363 _svmt_stack_frame *frame = env->stack.current_frame;
2364
2365 assert (frame->method == &vm->vm_initiated_call_method);
2366
2367 /* pop frame */
2368 env->stack.current_frame = (_svmt_stack_frame *) (void *)
2369 (((char *) frame) - frame->previous_offset);
2370
2371 /* rethrow exception */
2372 if (status != JNI_OK)
2373 {
2374 return JNI_ERR;
2375 }
2376
2377 }
2378
2379 return JNI_OK;
2380 }
2381
2382
2383 /*
2384 ----------------------------------------------------------------------
2385 _svmh_invoke_nonvirtual_AbstractMethodError_init
2386 ----------------------------------------------------------------------
2387 */
2388
2389 svm_static jint
_svmh_invoke_nonvirtual_AbstractMethodError_init(_svmt_JNIEnv * env,jobject this,jobject param_1)2390 _svmh_invoke_nonvirtual_AbstractMethodError_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
2391 {
2392 _svmt_JavaVM *vm = env->vm;
2393 _svmt_stack_frame *initial_frame;
2394 _svmt_method_info *method = vm->class_loading.boot_loader.methods.AbstractMethodError_init;
2395 _svmt_method_frame_info *frame_info = method->frame_info;
2396
2397 assert (_svmf_is_set_flag
2398 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
2399
2400 if (this == NULL)
2401 {
2402 _svmf_error_NullPointerException (env);
2403 return JNI_ERR;
2404 }
2405
2406 /* syncronized? */
2407 if (method->synchronized)
2408 {
2409 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
2410 {
2411 return JNI_ERR;
2412 }
2413 }
2414
2415 if (_svmf_ensure_stack_capacity
2416 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
2417 {
2418 return JNI_ERR;
2419 }
2420
2421 initial_frame = env->stack.current_frame;
2422
2423 /* setup internal call frame */
2424 {
2425 size_t offset = env->stack.current_frame->end_offset;
2426 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
2427 (((char *) env->stack.current_frame) + offset);
2428
2429 frame->previous_offset = offset;
2430 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
2431 frame->method = &vm->vm_initiated_call_method;
2432 frame->stack_trace_element = NULL;
2433 frame->lock_count = 0;
2434 frame->this = NULL;
2435 frame->pc = vm->vm_initiated_call_method.frame_info->code;
2436 frame->stack_size = 0;
2437
2438 env->stack.current_frame = frame;
2439 }
2440
2441 /* push parameters */
2442 {
2443 _svmt_stack_frame *prev_frame = env->stack.current_frame;
2444 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
2445 (((char *) prev_frame) + prev_frame->end_offset);
2446 jint i = 0;
2447
2448 locals[i++].reference = *this;
2449 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
2450
2451 {
2452 jint ref_count = frame_info->non_parameter_ref_locals_count;
2453 jint j;
2454
2455 for (j = 0; j < ref_count; j++)
2456 {
2457 locals[i++].reference = NULL;
2458 }
2459 }
2460 }
2461
2462 /* setup java call frame */
2463 {
2464 size_t offset =
2465 env->stack.current_frame->end_offset + frame_info->start_offset;
2466 _svmt_stack_frame *frame =
2467 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
2468 offset);
2469
2470 frame->previous_offset = offset;
2471 frame->end_offset = frame_info->end_offset;
2472 frame->method = method;
2473 frame->stack_trace_element = NULL;
2474 frame->lock_count = 0;
2475 frame->this = *this;
2476 frame->pc = frame_info->code;
2477 frame->stack_size = 0;
2478
2479 env->stack.current_frame = frame;
2480 }
2481
2482 /* interpret and pop internal call frame */
2483 {
2484 /* call the interpreter */
2485 jint status = _svmf_interpreter (env);
2486
2487 /* retrieve stack frame */
2488 _svmt_stack_frame *frame = env->stack.current_frame;
2489
2490 assert (frame->method == &vm->vm_initiated_call_method);
2491
2492 /* pop frame */
2493 env->stack.current_frame = (_svmt_stack_frame *) (void *)
2494 (((char *) frame) - frame->previous_offset);
2495
2496 /* rethrow exception */
2497 if (status != JNI_OK)
2498 {
2499 return JNI_ERR;
2500 }
2501
2502 }
2503
2504 return JNI_OK;
2505 }
2506
2507
2508 /*
2509 ----------------------------------------------------------------------
2510 _svmh_invoke_nonvirtual_ClassCircularityError_init
2511 ----------------------------------------------------------------------
2512 */
2513
2514 svm_static jint
_svmh_invoke_nonvirtual_ClassCircularityError_init(_svmt_JNIEnv * env,jobject this,jobject param_1)2515 _svmh_invoke_nonvirtual_ClassCircularityError_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
2516 {
2517 _svmt_JavaVM *vm = env->vm;
2518 _svmt_stack_frame *initial_frame;
2519 _svmt_method_info *method = vm->class_loading.boot_loader.methods.ClassCircularityError_init;
2520 _svmt_method_frame_info *frame_info = method->frame_info;
2521
2522 assert (_svmf_is_set_flag
2523 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
2524
2525 if (this == NULL)
2526 {
2527 _svmf_error_NullPointerException (env);
2528 return JNI_ERR;
2529 }
2530
2531 /* syncronized? */
2532 if (method->synchronized)
2533 {
2534 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
2535 {
2536 return JNI_ERR;
2537 }
2538 }
2539
2540 if (_svmf_ensure_stack_capacity
2541 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
2542 {
2543 return JNI_ERR;
2544 }
2545
2546 initial_frame = env->stack.current_frame;
2547
2548 /* setup internal call frame */
2549 {
2550 size_t offset = env->stack.current_frame->end_offset;
2551 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
2552 (((char *) env->stack.current_frame) + offset);
2553
2554 frame->previous_offset = offset;
2555 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
2556 frame->method = &vm->vm_initiated_call_method;
2557 frame->stack_trace_element = NULL;
2558 frame->lock_count = 0;
2559 frame->this = NULL;
2560 frame->pc = vm->vm_initiated_call_method.frame_info->code;
2561 frame->stack_size = 0;
2562
2563 env->stack.current_frame = frame;
2564 }
2565
2566 /* push parameters */
2567 {
2568 _svmt_stack_frame *prev_frame = env->stack.current_frame;
2569 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
2570 (((char *) prev_frame) + prev_frame->end_offset);
2571 jint i = 0;
2572
2573 locals[i++].reference = *this;
2574 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
2575
2576 {
2577 jint ref_count = frame_info->non_parameter_ref_locals_count;
2578 jint j;
2579
2580 for (j = 0; j < ref_count; j++)
2581 {
2582 locals[i++].reference = NULL;
2583 }
2584 }
2585 }
2586
2587 /* setup java call frame */
2588 {
2589 size_t offset =
2590 env->stack.current_frame->end_offset + frame_info->start_offset;
2591 _svmt_stack_frame *frame =
2592 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
2593 offset);
2594
2595 frame->previous_offset = offset;
2596 frame->end_offset = frame_info->end_offset;
2597 frame->method = method;
2598 frame->stack_trace_element = NULL;
2599 frame->lock_count = 0;
2600 frame->this = *this;
2601 frame->pc = frame_info->code;
2602 frame->stack_size = 0;
2603
2604 env->stack.current_frame = frame;
2605 }
2606
2607 /* interpret and pop internal call frame */
2608 {
2609 /* call the interpreter */
2610 jint status = _svmf_interpreter (env);
2611
2612 /* retrieve stack frame */
2613 _svmt_stack_frame *frame = env->stack.current_frame;
2614
2615 assert (frame->method == &vm->vm_initiated_call_method);
2616
2617 /* pop frame */
2618 env->stack.current_frame = (_svmt_stack_frame *) (void *)
2619 (((char *) frame) - frame->previous_offset);
2620
2621 /* rethrow exception */
2622 if (status != JNI_OK)
2623 {
2624 return JNI_ERR;
2625 }
2626
2627 }
2628
2629 return JNI_OK;
2630 }
2631
2632
2633 /*
2634 ----------------------------------------------------------------------
2635 _svmh_invoke_nonvirtual_ClassFormatError_init
2636 ----------------------------------------------------------------------
2637 */
2638
2639 svm_static jint
_svmh_invoke_nonvirtual_ClassFormatError_init(_svmt_JNIEnv * env,jobject this,jobject param_1)2640 _svmh_invoke_nonvirtual_ClassFormatError_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
2641 {
2642 _svmt_JavaVM *vm = env->vm;
2643 _svmt_stack_frame *initial_frame;
2644 _svmt_method_info *method = vm->class_loading.boot_loader.methods.ClassFormatError_init;
2645 _svmt_method_frame_info *frame_info = method->frame_info;
2646
2647 assert (_svmf_is_set_flag
2648 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
2649
2650 if (this == NULL)
2651 {
2652 _svmf_error_NullPointerException (env);
2653 return JNI_ERR;
2654 }
2655
2656 /* syncronized? */
2657 if (method->synchronized)
2658 {
2659 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
2660 {
2661 return JNI_ERR;
2662 }
2663 }
2664
2665 if (_svmf_ensure_stack_capacity
2666 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
2667 {
2668 return JNI_ERR;
2669 }
2670
2671 initial_frame = env->stack.current_frame;
2672
2673 /* setup internal call frame */
2674 {
2675 size_t offset = env->stack.current_frame->end_offset;
2676 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
2677 (((char *) env->stack.current_frame) + offset);
2678
2679 frame->previous_offset = offset;
2680 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
2681 frame->method = &vm->vm_initiated_call_method;
2682 frame->stack_trace_element = NULL;
2683 frame->lock_count = 0;
2684 frame->this = NULL;
2685 frame->pc = vm->vm_initiated_call_method.frame_info->code;
2686 frame->stack_size = 0;
2687
2688 env->stack.current_frame = frame;
2689 }
2690
2691 /* push parameters */
2692 {
2693 _svmt_stack_frame *prev_frame = env->stack.current_frame;
2694 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
2695 (((char *) prev_frame) + prev_frame->end_offset);
2696 jint i = 0;
2697
2698 locals[i++].reference = *this;
2699 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
2700
2701 {
2702 jint ref_count = frame_info->non_parameter_ref_locals_count;
2703 jint j;
2704
2705 for (j = 0; j < ref_count; j++)
2706 {
2707 locals[i++].reference = NULL;
2708 }
2709 }
2710 }
2711
2712 /* setup java call frame */
2713 {
2714 size_t offset =
2715 env->stack.current_frame->end_offset + frame_info->start_offset;
2716 _svmt_stack_frame *frame =
2717 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
2718 offset);
2719
2720 frame->previous_offset = offset;
2721 frame->end_offset = frame_info->end_offset;
2722 frame->method = method;
2723 frame->stack_trace_element = NULL;
2724 frame->lock_count = 0;
2725 frame->this = *this;
2726 frame->pc = frame_info->code;
2727 frame->stack_size = 0;
2728
2729 env->stack.current_frame = frame;
2730 }
2731
2732 /* interpret and pop internal call frame */
2733 {
2734 /* call the interpreter */
2735 jint status = _svmf_interpreter (env);
2736
2737 /* retrieve stack frame */
2738 _svmt_stack_frame *frame = env->stack.current_frame;
2739
2740 assert (frame->method == &vm->vm_initiated_call_method);
2741
2742 /* pop frame */
2743 env->stack.current_frame = (_svmt_stack_frame *) (void *)
2744 (((char *) frame) - frame->previous_offset);
2745
2746 /* rethrow exception */
2747 if (status != JNI_OK)
2748 {
2749 return JNI_ERR;
2750 }
2751
2752 }
2753
2754 return JNI_OK;
2755 }
2756
2757
2758 /*
2759 ----------------------------------------------------------------------
2760 _svmh_invoke_nonvirtual_ExceptionInInitializerError_init
2761 ----------------------------------------------------------------------
2762 */
2763
2764 svm_static jint
_svmh_invoke_nonvirtual_ExceptionInInitializerError_init(_svmt_JNIEnv * env,jobject this,jobject param_1)2765 _svmh_invoke_nonvirtual_ExceptionInInitializerError_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
2766 {
2767 _svmt_JavaVM *vm = env->vm;
2768 _svmt_stack_frame *initial_frame;
2769 _svmt_method_info *method = vm->class_loading.boot_loader.methods.ExceptionInInitializerError_init;
2770 _svmt_method_frame_info *frame_info = method->frame_info;
2771
2772 assert (_svmf_is_set_flag
2773 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
2774
2775 if (this == NULL)
2776 {
2777 _svmf_error_NullPointerException (env);
2778 return JNI_ERR;
2779 }
2780
2781 /* syncronized? */
2782 if (method->synchronized)
2783 {
2784 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
2785 {
2786 return JNI_ERR;
2787 }
2788 }
2789
2790 if (_svmf_ensure_stack_capacity
2791 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
2792 {
2793 return JNI_ERR;
2794 }
2795
2796 initial_frame = env->stack.current_frame;
2797
2798 /* setup internal call frame */
2799 {
2800 size_t offset = env->stack.current_frame->end_offset;
2801 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
2802 (((char *) env->stack.current_frame) + offset);
2803
2804 frame->previous_offset = offset;
2805 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
2806 frame->method = &vm->vm_initiated_call_method;
2807 frame->stack_trace_element = NULL;
2808 frame->lock_count = 0;
2809 frame->this = NULL;
2810 frame->pc = vm->vm_initiated_call_method.frame_info->code;
2811 frame->stack_size = 0;
2812
2813 env->stack.current_frame = frame;
2814 }
2815
2816 /* push parameters */
2817 {
2818 _svmt_stack_frame *prev_frame = env->stack.current_frame;
2819 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
2820 (((char *) prev_frame) + prev_frame->end_offset);
2821 jint i = 0;
2822
2823 locals[i++].reference = *this;
2824 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
2825
2826 {
2827 jint ref_count = frame_info->non_parameter_ref_locals_count;
2828 jint j;
2829
2830 for (j = 0; j < ref_count; j++)
2831 {
2832 locals[i++].reference = NULL;
2833 }
2834 }
2835 }
2836
2837 /* setup java call frame */
2838 {
2839 size_t offset =
2840 env->stack.current_frame->end_offset + frame_info->start_offset;
2841 _svmt_stack_frame *frame =
2842 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
2843 offset);
2844
2845 frame->previous_offset = offset;
2846 frame->end_offset = frame_info->end_offset;
2847 frame->method = method;
2848 frame->stack_trace_element = NULL;
2849 frame->lock_count = 0;
2850 frame->this = *this;
2851 frame->pc = frame_info->code;
2852 frame->stack_size = 0;
2853
2854 env->stack.current_frame = frame;
2855 }
2856
2857 /* interpret and pop internal call frame */
2858 {
2859 /* call the interpreter */
2860 jint status = _svmf_interpreter (env);
2861
2862 /* retrieve stack frame */
2863 _svmt_stack_frame *frame = env->stack.current_frame;
2864
2865 assert (frame->method == &vm->vm_initiated_call_method);
2866
2867 /* pop frame */
2868 env->stack.current_frame = (_svmt_stack_frame *) (void *)
2869 (((char *) frame) - frame->previous_offset);
2870
2871 /* rethrow exception */
2872 if (status != JNI_OK)
2873 {
2874 return JNI_ERR;
2875 }
2876
2877 }
2878
2879 return JNI_OK;
2880 }
2881
2882
2883 /*
2884 ----------------------------------------------------------------------
2885 _svmh_invoke_nonvirtual_IncompatibleClassChangeError_init
2886 ----------------------------------------------------------------------
2887 */
2888
2889 svm_static jint
_svmh_invoke_nonvirtual_IncompatibleClassChangeError_init(_svmt_JNIEnv * env,jobject this,jobject param_1)2890 _svmh_invoke_nonvirtual_IncompatibleClassChangeError_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
2891 {
2892 _svmt_JavaVM *vm = env->vm;
2893 _svmt_stack_frame *initial_frame;
2894 _svmt_method_info *method = vm->class_loading.boot_loader.methods.IncompatibleClassChangeError_init;
2895 _svmt_method_frame_info *frame_info = method->frame_info;
2896
2897 assert (_svmf_is_set_flag
2898 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
2899
2900 if (this == NULL)
2901 {
2902 _svmf_error_NullPointerException (env);
2903 return JNI_ERR;
2904 }
2905
2906 /* syncronized? */
2907 if (method->synchronized)
2908 {
2909 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
2910 {
2911 return JNI_ERR;
2912 }
2913 }
2914
2915 if (_svmf_ensure_stack_capacity
2916 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
2917 {
2918 return JNI_ERR;
2919 }
2920
2921 initial_frame = env->stack.current_frame;
2922
2923 /* setup internal call frame */
2924 {
2925 size_t offset = env->stack.current_frame->end_offset;
2926 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
2927 (((char *) env->stack.current_frame) + offset);
2928
2929 frame->previous_offset = offset;
2930 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
2931 frame->method = &vm->vm_initiated_call_method;
2932 frame->stack_trace_element = NULL;
2933 frame->lock_count = 0;
2934 frame->this = NULL;
2935 frame->pc = vm->vm_initiated_call_method.frame_info->code;
2936 frame->stack_size = 0;
2937
2938 env->stack.current_frame = frame;
2939 }
2940
2941 /* push parameters */
2942 {
2943 _svmt_stack_frame *prev_frame = env->stack.current_frame;
2944 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
2945 (((char *) prev_frame) + prev_frame->end_offset);
2946 jint i = 0;
2947
2948 locals[i++].reference = *this;
2949 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
2950
2951 {
2952 jint ref_count = frame_info->non_parameter_ref_locals_count;
2953 jint j;
2954
2955 for (j = 0; j < ref_count; j++)
2956 {
2957 locals[i++].reference = NULL;
2958 }
2959 }
2960 }
2961
2962 /* setup java call frame */
2963 {
2964 size_t offset =
2965 env->stack.current_frame->end_offset + frame_info->start_offset;
2966 _svmt_stack_frame *frame =
2967 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
2968 offset);
2969
2970 frame->previous_offset = offset;
2971 frame->end_offset = frame_info->end_offset;
2972 frame->method = method;
2973 frame->stack_trace_element = NULL;
2974 frame->lock_count = 0;
2975 frame->this = *this;
2976 frame->pc = frame_info->code;
2977 frame->stack_size = 0;
2978
2979 env->stack.current_frame = frame;
2980 }
2981
2982 /* interpret and pop internal call frame */
2983 {
2984 /* call the interpreter */
2985 jint status = _svmf_interpreter (env);
2986
2987 /* retrieve stack frame */
2988 _svmt_stack_frame *frame = env->stack.current_frame;
2989
2990 assert (frame->method == &vm->vm_initiated_call_method);
2991
2992 /* pop frame */
2993 env->stack.current_frame = (_svmt_stack_frame *) (void *)
2994 (((char *) frame) - frame->previous_offset);
2995
2996 /* rethrow exception */
2997 if (status != JNI_OK)
2998 {
2999 return JNI_ERR;
3000 }
3001
3002 }
3003
3004 return JNI_OK;
3005 }
3006
3007
3008 /*
3009 ----------------------------------------------------------------------
3010 _svmh_invoke_nonvirtual_InternalError_init
3011 ----------------------------------------------------------------------
3012 */
3013
3014 svm_static jint
_svmh_invoke_nonvirtual_InternalError_init(_svmt_JNIEnv * env,jobject this,jobject param_1)3015 _svmh_invoke_nonvirtual_InternalError_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
3016 {
3017 _svmt_JavaVM *vm = env->vm;
3018 _svmt_stack_frame *initial_frame;
3019 _svmt_method_info *method = vm->class_loading.boot_loader.methods.InternalError_init;
3020 _svmt_method_frame_info *frame_info = method->frame_info;
3021
3022 assert (_svmf_is_set_flag
3023 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
3024
3025 if (this == NULL)
3026 {
3027 _svmf_error_NullPointerException (env);
3028 return JNI_ERR;
3029 }
3030
3031 /* syncronized? */
3032 if (method->synchronized)
3033 {
3034 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
3035 {
3036 return JNI_ERR;
3037 }
3038 }
3039
3040 if (_svmf_ensure_stack_capacity
3041 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
3042 {
3043 return JNI_ERR;
3044 }
3045
3046 initial_frame = env->stack.current_frame;
3047
3048 /* setup internal call frame */
3049 {
3050 size_t offset = env->stack.current_frame->end_offset;
3051 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
3052 (((char *) env->stack.current_frame) + offset);
3053
3054 frame->previous_offset = offset;
3055 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
3056 frame->method = &vm->vm_initiated_call_method;
3057 frame->stack_trace_element = NULL;
3058 frame->lock_count = 0;
3059 frame->this = NULL;
3060 frame->pc = vm->vm_initiated_call_method.frame_info->code;
3061 frame->stack_size = 0;
3062
3063 env->stack.current_frame = frame;
3064 }
3065
3066 /* push parameters */
3067 {
3068 _svmt_stack_frame *prev_frame = env->stack.current_frame;
3069 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
3070 (((char *) prev_frame) + prev_frame->end_offset);
3071 jint i = 0;
3072
3073 locals[i++].reference = *this;
3074 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
3075
3076 {
3077 jint ref_count = frame_info->non_parameter_ref_locals_count;
3078 jint j;
3079
3080 for (j = 0; j < ref_count; j++)
3081 {
3082 locals[i++].reference = NULL;
3083 }
3084 }
3085 }
3086
3087 /* setup java call frame */
3088 {
3089 size_t offset =
3090 env->stack.current_frame->end_offset + frame_info->start_offset;
3091 _svmt_stack_frame *frame =
3092 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
3093 offset);
3094
3095 frame->previous_offset = offset;
3096 frame->end_offset = frame_info->end_offset;
3097 frame->method = method;
3098 frame->stack_trace_element = NULL;
3099 frame->lock_count = 0;
3100 frame->this = *this;
3101 frame->pc = frame_info->code;
3102 frame->stack_size = 0;
3103
3104 env->stack.current_frame = frame;
3105 }
3106
3107 /* interpret and pop internal call frame */
3108 {
3109 /* call the interpreter */
3110 jint status = _svmf_interpreter (env);
3111
3112 /* retrieve stack frame */
3113 _svmt_stack_frame *frame = env->stack.current_frame;
3114
3115 assert (frame->method == &vm->vm_initiated_call_method);
3116
3117 /* pop frame */
3118 env->stack.current_frame = (_svmt_stack_frame *) (void *)
3119 (((char *) frame) - frame->previous_offset);
3120
3121 /* rethrow exception */
3122 if (status != JNI_OK)
3123 {
3124 return JNI_ERR;
3125 }
3126
3127 }
3128
3129 return JNI_OK;
3130 }
3131
3132
3133 /*
3134 ----------------------------------------------------------------------
3135 _svmh_invoke_nonvirtual_LinkageError_init
3136 ----------------------------------------------------------------------
3137 */
3138
3139 svm_static jint
_svmh_invoke_nonvirtual_LinkageError_init(_svmt_JNIEnv * env,jobject this,jobject param_1)3140 _svmh_invoke_nonvirtual_LinkageError_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
3141 {
3142 _svmt_JavaVM *vm = env->vm;
3143 _svmt_stack_frame *initial_frame;
3144 _svmt_method_info *method = vm->class_loading.boot_loader.methods.LinkageError_init;
3145 _svmt_method_frame_info *frame_info = method->frame_info;
3146
3147 assert (_svmf_is_set_flag
3148 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
3149
3150 if (this == NULL)
3151 {
3152 _svmf_error_NullPointerException (env);
3153 return JNI_ERR;
3154 }
3155
3156 /* syncronized? */
3157 if (method->synchronized)
3158 {
3159 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
3160 {
3161 return JNI_ERR;
3162 }
3163 }
3164
3165 if (_svmf_ensure_stack_capacity
3166 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
3167 {
3168 return JNI_ERR;
3169 }
3170
3171 initial_frame = env->stack.current_frame;
3172
3173 /* setup internal call frame */
3174 {
3175 size_t offset = env->stack.current_frame->end_offset;
3176 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
3177 (((char *) env->stack.current_frame) + offset);
3178
3179 frame->previous_offset = offset;
3180 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
3181 frame->method = &vm->vm_initiated_call_method;
3182 frame->stack_trace_element = NULL;
3183 frame->lock_count = 0;
3184 frame->this = NULL;
3185 frame->pc = vm->vm_initiated_call_method.frame_info->code;
3186 frame->stack_size = 0;
3187
3188 env->stack.current_frame = frame;
3189 }
3190
3191 /* push parameters */
3192 {
3193 _svmt_stack_frame *prev_frame = env->stack.current_frame;
3194 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
3195 (((char *) prev_frame) + prev_frame->end_offset);
3196 jint i = 0;
3197
3198 locals[i++].reference = *this;
3199 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
3200
3201 {
3202 jint ref_count = frame_info->non_parameter_ref_locals_count;
3203 jint j;
3204
3205 for (j = 0; j < ref_count; j++)
3206 {
3207 locals[i++].reference = NULL;
3208 }
3209 }
3210 }
3211
3212 /* setup java call frame */
3213 {
3214 size_t offset =
3215 env->stack.current_frame->end_offset + frame_info->start_offset;
3216 _svmt_stack_frame *frame =
3217 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
3218 offset);
3219
3220 frame->previous_offset = offset;
3221 frame->end_offset = frame_info->end_offset;
3222 frame->method = method;
3223 frame->stack_trace_element = NULL;
3224 frame->lock_count = 0;
3225 frame->this = *this;
3226 frame->pc = frame_info->code;
3227 frame->stack_size = 0;
3228
3229 env->stack.current_frame = frame;
3230 }
3231
3232 /* interpret and pop internal call frame */
3233 {
3234 /* call the interpreter */
3235 jint status = _svmf_interpreter (env);
3236
3237 /* retrieve stack frame */
3238 _svmt_stack_frame *frame = env->stack.current_frame;
3239
3240 assert (frame->method == &vm->vm_initiated_call_method);
3241
3242 /* pop frame */
3243 env->stack.current_frame = (_svmt_stack_frame *) (void *)
3244 (((char *) frame) - frame->previous_offset);
3245
3246 /* rethrow exception */
3247 if (status != JNI_OK)
3248 {
3249 return JNI_ERR;
3250 }
3251
3252 }
3253
3254 return JNI_OK;
3255 }
3256
3257
3258 /*
3259 ----------------------------------------------------------------------
3260 _svmh_invoke_nonvirtual_NoClassDefFoundError_init
3261 ----------------------------------------------------------------------
3262 */
3263
3264 svm_static jint
_svmh_invoke_nonvirtual_NoClassDefFoundError_init(_svmt_JNIEnv * env,jobject this,jobject param_1)3265 _svmh_invoke_nonvirtual_NoClassDefFoundError_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
3266 {
3267 _svmt_JavaVM *vm = env->vm;
3268 _svmt_stack_frame *initial_frame;
3269 _svmt_method_info *method = vm->class_loading.boot_loader.methods.NoClassDefFoundError_init;
3270 _svmt_method_frame_info *frame_info = method->frame_info;
3271
3272 assert (_svmf_is_set_flag
3273 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
3274
3275 if (this == NULL)
3276 {
3277 _svmf_error_NullPointerException (env);
3278 return JNI_ERR;
3279 }
3280
3281 /* syncronized? */
3282 if (method->synchronized)
3283 {
3284 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
3285 {
3286 return JNI_ERR;
3287 }
3288 }
3289
3290 if (_svmf_ensure_stack_capacity
3291 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
3292 {
3293 return JNI_ERR;
3294 }
3295
3296 initial_frame = env->stack.current_frame;
3297
3298 /* setup internal call frame */
3299 {
3300 size_t offset = env->stack.current_frame->end_offset;
3301 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
3302 (((char *) env->stack.current_frame) + offset);
3303
3304 frame->previous_offset = offset;
3305 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
3306 frame->method = &vm->vm_initiated_call_method;
3307 frame->stack_trace_element = NULL;
3308 frame->lock_count = 0;
3309 frame->this = NULL;
3310 frame->pc = vm->vm_initiated_call_method.frame_info->code;
3311 frame->stack_size = 0;
3312
3313 env->stack.current_frame = frame;
3314 }
3315
3316 /* push parameters */
3317 {
3318 _svmt_stack_frame *prev_frame = env->stack.current_frame;
3319 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
3320 (((char *) prev_frame) + prev_frame->end_offset);
3321 jint i = 0;
3322
3323 locals[i++].reference = *this;
3324 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
3325
3326 {
3327 jint ref_count = frame_info->non_parameter_ref_locals_count;
3328 jint j;
3329
3330 for (j = 0; j < ref_count; j++)
3331 {
3332 locals[i++].reference = NULL;
3333 }
3334 }
3335 }
3336
3337 /* setup java call frame */
3338 {
3339 size_t offset =
3340 env->stack.current_frame->end_offset + frame_info->start_offset;
3341 _svmt_stack_frame *frame =
3342 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
3343 offset);
3344
3345 frame->previous_offset = offset;
3346 frame->end_offset = frame_info->end_offset;
3347 frame->method = method;
3348 frame->stack_trace_element = NULL;
3349 frame->lock_count = 0;
3350 frame->this = *this;
3351 frame->pc = frame_info->code;
3352 frame->stack_size = 0;
3353
3354 env->stack.current_frame = frame;
3355 }
3356
3357 /* interpret and pop internal call frame */
3358 {
3359 /* call the interpreter */
3360 jint status = _svmf_interpreter (env);
3361
3362 /* retrieve stack frame */
3363 _svmt_stack_frame *frame = env->stack.current_frame;
3364
3365 assert (frame->method == &vm->vm_initiated_call_method);
3366
3367 /* pop frame */
3368 env->stack.current_frame = (_svmt_stack_frame *) (void *)
3369 (((char *) frame) - frame->previous_offset);
3370
3371 /* rethrow exception */
3372 if (status != JNI_OK)
3373 {
3374 return JNI_ERR;
3375 }
3376
3377 }
3378
3379 return JNI_OK;
3380 }
3381
3382
3383 /*
3384 ----------------------------------------------------------------------
3385 _svmh_invoke_nonvirtual_NoSuchFieldError_init
3386 ----------------------------------------------------------------------
3387 */
3388
3389 svm_static jint
_svmh_invoke_nonvirtual_NoSuchFieldError_init(_svmt_JNIEnv * env,jobject this,jobject param_1)3390 _svmh_invoke_nonvirtual_NoSuchFieldError_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
3391 {
3392 _svmt_JavaVM *vm = env->vm;
3393 _svmt_stack_frame *initial_frame;
3394 _svmt_method_info *method = vm->class_loading.boot_loader.methods.NoSuchFieldError_init;
3395 _svmt_method_frame_info *frame_info = method->frame_info;
3396
3397 assert (_svmf_is_set_flag
3398 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
3399
3400 if (this == NULL)
3401 {
3402 _svmf_error_NullPointerException (env);
3403 return JNI_ERR;
3404 }
3405
3406 /* syncronized? */
3407 if (method->synchronized)
3408 {
3409 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
3410 {
3411 return JNI_ERR;
3412 }
3413 }
3414
3415 if (_svmf_ensure_stack_capacity
3416 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
3417 {
3418 return JNI_ERR;
3419 }
3420
3421 initial_frame = env->stack.current_frame;
3422
3423 /* setup internal call frame */
3424 {
3425 size_t offset = env->stack.current_frame->end_offset;
3426 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
3427 (((char *) env->stack.current_frame) + offset);
3428
3429 frame->previous_offset = offset;
3430 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
3431 frame->method = &vm->vm_initiated_call_method;
3432 frame->stack_trace_element = NULL;
3433 frame->lock_count = 0;
3434 frame->this = NULL;
3435 frame->pc = vm->vm_initiated_call_method.frame_info->code;
3436 frame->stack_size = 0;
3437
3438 env->stack.current_frame = frame;
3439 }
3440
3441 /* push parameters */
3442 {
3443 _svmt_stack_frame *prev_frame = env->stack.current_frame;
3444 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
3445 (((char *) prev_frame) + prev_frame->end_offset);
3446 jint i = 0;
3447
3448 locals[i++].reference = *this;
3449 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
3450
3451 {
3452 jint ref_count = frame_info->non_parameter_ref_locals_count;
3453 jint j;
3454
3455 for (j = 0; j < ref_count; j++)
3456 {
3457 locals[i++].reference = NULL;
3458 }
3459 }
3460 }
3461
3462 /* setup java call frame */
3463 {
3464 size_t offset =
3465 env->stack.current_frame->end_offset + frame_info->start_offset;
3466 _svmt_stack_frame *frame =
3467 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
3468 offset);
3469
3470 frame->previous_offset = offset;
3471 frame->end_offset = frame_info->end_offset;
3472 frame->method = method;
3473 frame->stack_trace_element = NULL;
3474 frame->lock_count = 0;
3475 frame->this = *this;
3476 frame->pc = frame_info->code;
3477 frame->stack_size = 0;
3478
3479 env->stack.current_frame = frame;
3480 }
3481
3482 /* interpret and pop internal call frame */
3483 {
3484 /* call the interpreter */
3485 jint status = _svmf_interpreter (env);
3486
3487 /* retrieve stack frame */
3488 _svmt_stack_frame *frame = env->stack.current_frame;
3489
3490 assert (frame->method == &vm->vm_initiated_call_method);
3491
3492 /* pop frame */
3493 env->stack.current_frame = (_svmt_stack_frame *) (void *)
3494 (((char *) frame) - frame->previous_offset);
3495
3496 /* rethrow exception */
3497 if (status != JNI_OK)
3498 {
3499 return JNI_ERR;
3500 }
3501
3502 }
3503
3504 return JNI_OK;
3505 }
3506
3507
3508 /*
3509 ----------------------------------------------------------------------
3510 _svmh_invoke_nonvirtual_NoSuchMethodError_init
3511 ----------------------------------------------------------------------
3512 */
3513
3514 svm_static jint
_svmh_invoke_nonvirtual_NoSuchMethodError_init(_svmt_JNIEnv * env,jobject this,jobject param_1)3515 _svmh_invoke_nonvirtual_NoSuchMethodError_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
3516 {
3517 _svmt_JavaVM *vm = env->vm;
3518 _svmt_stack_frame *initial_frame;
3519 _svmt_method_info *method = vm->class_loading.boot_loader.methods.NoSuchMethodError_init;
3520 _svmt_method_frame_info *frame_info = method->frame_info;
3521
3522 assert (_svmf_is_set_flag
3523 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
3524
3525 if (this == NULL)
3526 {
3527 _svmf_error_NullPointerException (env);
3528 return JNI_ERR;
3529 }
3530
3531 /* syncronized? */
3532 if (method->synchronized)
3533 {
3534 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
3535 {
3536 return JNI_ERR;
3537 }
3538 }
3539
3540 if (_svmf_ensure_stack_capacity
3541 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
3542 {
3543 return JNI_ERR;
3544 }
3545
3546 initial_frame = env->stack.current_frame;
3547
3548 /* setup internal call frame */
3549 {
3550 size_t offset = env->stack.current_frame->end_offset;
3551 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
3552 (((char *) env->stack.current_frame) + offset);
3553
3554 frame->previous_offset = offset;
3555 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
3556 frame->method = &vm->vm_initiated_call_method;
3557 frame->stack_trace_element = NULL;
3558 frame->lock_count = 0;
3559 frame->this = NULL;
3560 frame->pc = vm->vm_initiated_call_method.frame_info->code;
3561 frame->stack_size = 0;
3562
3563 env->stack.current_frame = frame;
3564 }
3565
3566 /* push parameters */
3567 {
3568 _svmt_stack_frame *prev_frame = env->stack.current_frame;
3569 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
3570 (((char *) prev_frame) + prev_frame->end_offset);
3571 jint i = 0;
3572
3573 locals[i++].reference = *this;
3574 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
3575
3576 {
3577 jint ref_count = frame_info->non_parameter_ref_locals_count;
3578 jint j;
3579
3580 for (j = 0; j < ref_count; j++)
3581 {
3582 locals[i++].reference = NULL;
3583 }
3584 }
3585 }
3586
3587 /* setup java call frame */
3588 {
3589 size_t offset =
3590 env->stack.current_frame->end_offset + frame_info->start_offset;
3591 _svmt_stack_frame *frame =
3592 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
3593 offset);
3594
3595 frame->previous_offset = offset;
3596 frame->end_offset = frame_info->end_offset;
3597 frame->method = method;
3598 frame->stack_trace_element = NULL;
3599 frame->lock_count = 0;
3600 frame->this = *this;
3601 frame->pc = frame_info->code;
3602 frame->stack_size = 0;
3603
3604 env->stack.current_frame = frame;
3605 }
3606
3607 /* interpret and pop internal call frame */
3608 {
3609 /* call the interpreter */
3610 jint status = _svmf_interpreter (env);
3611
3612 /* retrieve stack frame */
3613 _svmt_stack_frame *frame = env->stack.current_frame;
3614
3615 assert (frame->method == &vm->vm_initiated_call_method);
3616
3617 /* pop frame */
3618 env->stack.current_frame = (_svmt_stack_frame *) (void *)
3619 (((char *) frame) - frame->previous_offset);
3620
3621 /* rethrow exception */
3622 if (status != JNI_OK)
3623 {
3624 return JNI_ERR;
3625 }
3626
3627 }
3628
3629 return JNI_OK;
3630 }
3631
3632
3633 /*
3634 ----------------------------------------------------------------------
3635 _svmh_invoke_nonvirtual_OutOfMemoryError_init
3636 ----------------------------------------------------------------------
3637 */
3638
3639 svm_static jint
_svmh_invoke_nonvirtual_OutOfMemoryError_init(_svmt_JNIEnv * env,jobject this,jobject param_1)3640 _svmh_invoke_nonvirtual_OutOfMemoryError_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
3641 {
3642 _svmt_JavaVM *vm = env->vm;
3643 _svmt_stack_frame *initial_frame;
3644 _svmt_method_info *method = vm->class_loading.boot_loader.methods.OutOfMemoryError_init;
3645 _svmt_method_frame_info *frame_info = method->frame_info;
3646
3647 assert (_svmf_is_set_flag
3648 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
3649
3650 if (this == NULL)
3651 {
3652 _svmf_error_NullPointerException (env);
3653 return JNI_ERR;
3654 }
3655
3656 /* syncronized? */
3657 if (method->synchronized)
3658 {
3659 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
3660 {
3661 return JNI_ERR;
3662 }
3663 }
3664
3665 if (_svmf_ensure_stack_capacity
3666 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
3667 {
3668 return JNI_ERR;
3669 }
3670
3671 initial_frame = env->stack.current_frame;
3672
3673 /* setup internal call frame */
3674 {
3675 size_t offset = env->stack.current_frame->end_offset;
3676 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
3677 (((char *) env->stack.current_frame) + offset);
3678
3679 frame->previous_offset = offset;
3680 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
3681 frame->method = &vm->vm_initiated_call_method;
3682 frame->stack_trace_element = NULL;
3683 frame->lock_count = 0;
3684 frame->this = NULL;
3685 frame->pc = vm->vm_initiated_call_method.frame_info->code;
3686 frame->stack_size = 0;
3687
3688 env->stack.current_frame = frame;
3689 }
3690
3691 /* push parameters */
3692 {
3693 _svmt_stack_frame *prev_frame = env->stack.current_frame;
3694 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
3695 (((char *) prev_frame) + prev_frame->end_offset);
3696 jint i = 0;
3697
3698 locals[i++].reference = *this;
3699 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
3700
3701 {
3702 jint ref_count = frame_info->non_parameter_ref_locals_count;
3703 jint j;
3704
3705 for (j = 0; j < ref_count; j++)
3706 {
3707 locals[i++].reference = NULL;
3708 }
3709 }
3710 }
3711
3712 /* setup java call frame */
3713 {
3714 size_t offset =
3715 env->stack.current_frame->end_offset + frame_info->start_offset;
3716 _svmt_stack_frame *frame =
3717 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
3718 offset);
3719
3720 frame->previous_offset = offset;
3721 frame->end_offset = frame_info->end_offset;
3722 frame->method = method;
3723 frame->stack_trace_element = NULL;
3724 frame->lock_count = 0;
3725 frame->this = *this;
3726 frame->pc = frame_info->code;
3727 frame->stack_size = 0;
3728
3729 env->stack.current_frame = frame;
3730 }
3731
3732 /* interpret and pop internal call frame */
3733 {
3734 /* call the interpreter */
3735 jint status = _svmf_interpreter (env);
3736
3737 /* retrieve stack frame */
3738 _svmt_stack_frame *frame = env->stack.current_frame;
3739
3740 assert (frame->method == &vm->vm_initiated_call_method);
3741
3742 /* pop frame */
3743 env->stack.current_frame = (_svmt_stack_frame *) (void *)
3744 (((char *) frame) - frame->previous_offset);
3745
3746 /* rethrow exception */
3747 if (status != JNI_OK)
3748 {
3749 return JNI_ERR;
3750 }
3751
3752 }
3753
3754 return JNI_OK;
3755 }
3756
3757
3758 /*
3759 ----------------------------------------------------------------------
3760 _svmh_invoke_nonvirtual_UnsatisfiedLinkError_init
3761 ----------------------------------------------------------------------
3762 */
3763
3764 svm_static jint
_svmh_invoke_nonvirtual_UnsatisfiedLinkError_init(_svmt_JNIEnv * env,jobject this,jobject param_1)3765 _svmh_invoke_nonvirtual_UnsatisfiedLinkError_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
3766 {
3767 _svmt_JavaVM *vm = env->vm;
3768 _svmt_stack_frame *initial_frame;
3769 _svmt_method_info *method = vm->class_loading.boot_loader.methods.UnsatisfiedLinkError_init;
3770 _svmt_method_frame_info *frame_info = method->frame_info;
3771
3772 assert (_svmf_is_set_flag
3773 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
3774
3775 if (this == NULL)
3776 {
3777 _svmf_error_NullPointerException (env);
3778 return JNI_ERR;
3779 }
3780
3781 /* syncronized? */
3782 if (method->synchronized)
3783 {
3784 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
3785 {
3786 return JNI_ERR;
3787 }
3788 }
3789
3790 if (_svmf_ensure_stack_capacity
3791 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
3792 {
3793 return JNI_ERR;
3794 }
3795
3796 initial_frame = env->stack.current_frame;
3797
3798 /* setup internal call frame */
3799 {
3800 size_t offset = env->stack.current_frame->end_offset;
3801 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
3802 (((char *) env->stack.current_frame) + offset);
3803
3804 frame->previous_offset = offset;
3805 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
3806 frame->method = &vm->vm_initiated_call_method;
3807 frame->stack_trace_element = NULL;
3808 frame->lock_count = 0;
3809 frame->this = NULL;
3810 frame->pc = vm->vm_initiated_call_method.frame_info->code;
3811 frame->stack_size = 0;
3812
3813 env->stack.current_frame = frame;
3814 }
3815
3816 /* push parameters */
3817 {
3818 _svmt_stack_frame *prev_frame = env->stack.current_frame;
3819 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
3820 (((char *) prev_frame) + prev_frame->end_offset);
3821 jint i = 0;
3822
3823 locals[i++].reference = *this;
3824 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
3825
3826 {
3827 jint ref_count = frame_info->non_parameter_ref_locals_count;
3828 jint j;
3829
3830 for (j = 0; j < ref_count; j++)
3831 {
3832 locals[i++].reference = NULL;
3833 }
3834 }
3835 }
3836
3837 /* setup java call frame */
3838 {
3839 size_t offset =
3840 env->stack.current_frame->end_offset + frame_info->start_offset;
3841 _svmt_stack_frame *frame =
3842 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
3843 offset);
3844
3845 frame->previous_offset = offset;
3846 frame->end_offset = frame_info->end_offset;
3847 frame->method = method;
3848 frame->stack_trace_element = NULL;
3849 frame->lock_count = 0;
3850 frame->this = *this;
3851 frame->pc = frame_info->code;
3852 frame->stack_size = 0;
3853
3854 env->stack.current_frame = frame;
3855 }
3856
3857 /* interpret and pop internal call frame */
3858 {
3859 /* call the interpreter */
3860 jint status = _svmf_interpreter (env);
3861
3862 /* retrieve stack frame */
3863 _svmt_stack_frame *frame = env->stack.current_frame;
3864
3865 assert (frame->method == &vm->vm_initiated_call_method);
3866
3867 /* pop frame */
3868 env->stack.current_frame = (_svmt_stack_frame *) (void *)
3869 (((char *) frame) - frame->previous_offset);
3870
3871 /* rethrow exception */
3872 if (status != JNI_OK)
3873 {
3874 return JNI_ERR;
3875 }
3876
3877 }
3878
3879 return JNI_OK;
3880 }
3881
3882
3883 /*
3884 ----------------------------------------------------------------------
3885 _svmh_invoke_nonvirtual_UnsupportedClassVersionError_init
3886 ----------------------------------------------------------------------
3887 */
3888
3889 svm_static jint
_svmh_invoke_nonvirtual_UnsupportedClassVersionError_init(_svmt_JNIEnv * env,jobject this,jobject param_1)3890 _svmh_invoke_nonvirtual_UnsupportedClassVersionError_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
3891 {
3892 _svmt_JavaVM *vm = env->vm;
3893 _svmt_stack_frame *initial_frame;
3894 _svmt_method_info *method = vm->class_loading.boot_loader.methods.UnsupportedClassVersionError_init;
3895 _svmt_method_frame_info *frame_info = method->frame_info;
3896
3897 assert (_svmf_is_set_flag
3898 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
3899
3900 if (this == NULL)
3901 {
3902 _svmf_error_NullPointerException (env);
3903 return JNI_ERR;
3904 }
3905
3906 /* syncronized? */
3907 if (method->synchronized)
3908 {
3909 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
3910 {
3911 return JNI_ERR;
3912 }
3913 }
3914
3915 if (_svmf_ensure_stack_capacity
3916 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
3917 {
3918 return JNI_ERR;
3919 }
3920
3921 initial_frame = env->stack.current_frame;
3922
3923 /* setup internal call frame */
3924 {
3925 size_t offset = env->stack.current_frame->end_offset;
3926 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
3927 (((char *) env->stack.current_frame) + offset);
3928
3929 frame->previous_offset = offset;
3930 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
3931 frame->method = &vm->vm_initiated_call_method;
3932 frame->stack_trace_element = NULL;
3933 frame->lock_count = 0;
3934 frame->this = NULL;
3935 frame->pc = vm->vm_initiated_call_method.frame_info->code;
3936 frame->stack_size = 0;
3937
3938 env->stack.current_frame = frame;
3939 }
3940
3941 /* push parameters */
3942 {
3943 _svmt_stack_frame *prev_frame = env->stack.current_frame;
3944 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
3945 (((char *) prev_frame) + prev_frame->end_offset);
3946 jint i = 0;
3947
3948 locals[i++].reference = *this;
3949 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
3950
3951 {
3952 jint ref_count = frame_info->non_parameter_ref_locals_count;
3953 jint j;
3954
3955 for (j = 0; j < ref_count; j++)
3956 {
3957 locals[i++].reference = NULL;
3958 }
3959 }
3960 }
3961
3962 /* setup java call frame */
3963 {
3964 size_t offset =
3965 env->stack.current_frame->end_offset + frame_info->start_offset;
3966 _svmt_stack_frame *frame =
3967 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
3968 offset);
3969
3970 frame->previous_offset = offset;
3971 frame->end_offset = frame_info->end_offset;
3972 frame->method = method;
3973 frame->stack_trace_element = NULL;
3974 frame->lock_count = 0;
3975 frame->this = *this;
3976 frame->pc = frame_info->code;
3977 frame->stack_size = 0;
3978
3979 env->stack.current_frame = frame;
3980 }
3981
3982 /* interpret and pop internal call frame */
3983 {
3984 /* call the interpreter */
3985 jint status = _svmf_interpreter (env);
3986
3987 /* retrieve stack frame */
3988 _svmt_stack_frame *frame = env->stack.current_frame;
3989
3990 assert (frame->method == &vm->vm_initiated_call_method);
3991
3992 /* pop frame */
3993 env->stack.current_frame = (_svmt_stack_frame *) (void *)
3994 (((char *) frame) - frame->previous_offset);
3995
3996 /* rethrow exception */
3997 if (status != JNI_OK)
3998 {
3999 return JNI_ERR;
4000 }
4001
4002 }
4003
4004 return JNI_OK;
4005 }
4006
4007
4008 /*
4009 ----------------------------------------------------------------------
4010 _svmh_invoke_nonvirtual_VerifyError_init
4011 ----------------------------------------------------------------------
4012 */
4013
4014 svm_static jint
_svmh_invoke_nonvirtual_VerifyError_init(_svmt_JNIEnv * env,jobject this,jobject param_1)4015 _svmh_invoke_nonvirtual_VerifyError_init (_svmt_JNIEnv *env, jobject this, jobject param_1)
4016 {
4017 _svmt_JavaVM *vm = env->vm;
4018 _svmt_stack_frame *initial_frame;
4019 _svmt_method_info *method = vm->class_loading.boot_loader.methods.VerifyError_init;
4020 _svmt_method_frame_info *frame_info = method->frame_info;
4021
4022 assert (_svmf_is_set_flag
4023 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
4024
4025 if (this == NULL)
4026 {
4027 _svmf_error_NullPointerException (env);
4028 return JNI_ERR;
4029 }
4030
4031 /* syncronized? */
4032 if (method->synchronized)
4033 {
4034 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
4035 {
4036 return JNI_ERR;
4037 }
4038 }
4039
4040 if (_svmf_ensure_stack_capacity
4041 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
4042 {
4043 return JNI_ERR;
4044 }
4045
4046 initial_frame = env->stack.current_frame;
4047
4048 /* setup internal call frame */
4049 {
4050 size_t offset = env->stack.current_frame->end_offset;
4051 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
4052 (((char *) env->stack.current_frame) + offset);
4053
4054 frame->previous_offset = offset;
4055 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
4056 frame->method = &vm->vm_initiated_call_method;
4057 frame->stack_trace_element = NULL;
4058 frame->lock_count = 0;
4059 frame->this = NULL;
4060 frame->pc = vm->vm_initiated_call_method.frame_info->code;
4061 frame->stack_size = 0;
4062
4063 env->stack.current_frame = frame;
4064 }
4065
4066 /* push parameters */
4067 {
4068 _svmt_stack_frame *prev_frame = env->stack.current_frame;
4069 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
4070 (((char *) prev_frame) + prev_frame->end_offset);
4071 jint i = 0;
4072
4073 locals[i++].reference = *this;
4074 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
4075
4076 {
4077 jint ref_count = frame_info->non_parameter_ref_locals_count;
4078 jint j;
4079
4080 for (j = 0; j < ref_count; j++)
4081 {
4082 locals[i++].reference = NULL;
4083 }
4084 }
4085 }
4086
4087 /* setup java call frame */
4088 {
4089 size_t offset =
4090 env->stack.current_frame->end_offset + frame_info->start_offset;
4091 _svmt_stack_frame *frame =
4092 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
4093 offset);
4094
4095 frame->previous_offset = offset;
4096 frame->end_offset = frame_info->end_offset;
4097 frame->method = method;
4098 frame->stack_trace_element = NULL;
4099 frame->lock_count = 0;
4100 frame->this = *this;
4101 frame->pc = frame_info->code;
4102 frame->stack_size = 0;
4103
4104 env->stack.current_frame = frame;
4105 }
4106
4107 /* interpret and pop internal call frame */
4108 {
4109 /* call the interpreter */
4110 jint status = _svmf_interpreter (env);
4111
4112 /* retrieve stack frame */
4113 _svmt_stack_frame *frame = env->stack.current_frame;
4114
4115 assert (frame->method == &vm->vm_initiated_call_method);
4116
4117 /* pop frame */
4118 env->stack.current_frame = (_svmt_stack_frame *) (void *)
4119 (((char *) frame) - frame->previous_offset);
4120
4121 /* rethrow exception */
4122 if (status != JNI_OK)
4123 {
4124 return JNI_ERR;
4125 }
4126
4127 }
4128
4129 return JNI_OK;
4130 }
4131
4132
4133 /*
4134 ----------------------------------------------------------------------
4135 _svmh_invoke_specific_nonvirtual_throwinit
4136 ----------------------------------------------------------------------
4137 */
4138
4139 svm_static jint
_svmh_invoke_specific_nonvirtual_throwinit(_svmt_JNIEnv * env,_svmt_method_info * method,jobject this,jobject param_1)4140 _svmh_invoke_specific_nonvirtual_throwinit (_svmt_JNIEnv *env,
4141 _svmt_method_info *method,
4142 jobject this, jobject param_1)
4143 {
4144 _svmt_JavaVM *vm = env->vm;
4145 _svmt_stack_frame *initial_frame;
4146 _svmt_method_frame_info *frame_info = method->frame_info;
4147
4148 assert (_svmf_is_set_flag
4149 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
4150
4151 if (this == NULL)
4152 {
4153 _svmf_error_NullPointerException (env);
4154 return JNI_ERR;
4155 }
4156
4157 /* syncronized? */
4158 if (method->synchronized)
4159 {
4160 if (_svmf_enter_object_monitor (env, *this) != JNI_OK)
4161 {
4162 return JNI_ERR;
4163 }
4164 }
4165
4166 if (_svmf_ensure_stack_capacity
4167 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
4168 {
4169 return JNI_ERR;
4170 }
4171
4172 initial_frame = env->stack.current_frame;
4173
4174 /* setup internal call frame */
4175 {
4176 size_t offset = env->stack.current_frame->end_offset;
4177 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
4178 (((char *) env->stack.current_frame) + offset);
4179
4180 frame->previous_offset = offset;
4181 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
4182 frame->method = &vm->vm_initiated_call_method;
4183 frame->stack_trace_element = NULL;
4184 frame->lock_count = 0;
4185 frame->this = NULL;
4186 frame->pc = vm->vm_initiated_call_method.frame_info->code;
4187 frame->stack_size = 0;
4188
4189 env->stack.current_frame = frame;
4190 }
4191
4192 /* push parameters */
4193 {
4194 _svmt_stack_frame *prev_frame = env->stack.current_frame;
4195 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
4196 (((char *) prev_frame) + prev_frame->end_offset);
4197 jint i = 0;
4198
4199 locals[i++].reference = *this;
4200 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
4201
4202 {
4203 jint ref_count = frame_info->non_parameter_ref_locals_count;
4204 jint j;
4205
4206 for (j = 0; j < ref_count; j++)
4207 {
4208 locals[i++].reference = NULL;
4209 }
4210 }
4211 }
4212
4213 /* setup java call frame */
4214 {
4215 size_t offset =
4216 env->stack.current_frame->end_offset + frame_info->start_offset;
4217 _svmt_stack_frame *frame =
4218 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
4219 offset);
4220
4221 frame->previous_offset = offset;
4222 frame->end_offset = frame_info->end_offset;
4223 frame->method = method;
4224 frame->stack_trace_element = NULL;
4225 frame->lock_count = 0;
4226 frame->this = *this;
4227 frame->pc = frame_info->code;
4228 frame->stack_size = 0;
4229
4230 env->stack.current_frame = frame;
4231 }
4232
4233 /* interpret and pop internal call frame */
4234 {
4235 /* call the interpreter */
4236 jint status = _svmf_interpreter (env);
4237
4238 /* retrieve stack frame */
4239 _svmt_stack_frame *frame = env->stack.current_frame;
4240
4241 assert (frame->method == &vm->vm_initiated_call_method);
4242
4243 /* pop frame */
4244 env->stack.current_frame = (_svmt_stack_frame *) (void *)
4245 (((char *) frame) - frame->previous_offset);
4246
4247 /* rethrow exception */
4248 if (status != JNI_OK)
4249 {
4250 return JNI_ERR;
4251 }
4252
4253 }
4254
4255 return JNI_OK;
4256 }
4257
4258
4259 /*
4260 ----------------------------------------------------------------------
4261 _svmh_invoke_static_stringcreator_createinternedstring
4262 ----------------------------------------------------------------------
4263 */
4264
4265 svm_static jint
_svmh_invoke_static_stringcreator_createinternedstring(_svmt_JNIEnv * env,jobject param_1,jobject ret)4266 _svmh_invoke_static_stringcreator_createinternedstring (_svmt_JNIEnv *env, jobject param_1, jobject ret)
4267 {
4268 _svmt_JavaVM *vm = env->vm;
4269 _svmt_stack_frame *initial_frame;
4270 _svmt_method_info *method = vm->class_loading.boot_loader.methods.stringcreator_createinternedstring;
4271 _svmt_method_frame_info *frame_info = method->frame_info;
4272
4273 assert (_svmf_is_set_flag
4274 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
4275
4276 /* syncronized? */
4277 if (method->synchronized)
4278 {
4279 if (_svmf_enter_object_monitor
4280 (env, *(method->class_info->class_instance)) != JNI_OK)
4281 {
4282 return JNI_ERR;
4283 }
4284 }
4285
4286 if (_svmf_ensure_stack_capacity
4287 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
4288 {
4289 return JNI_ERR;
4290 }
4291
4292 initial_frame = env->stack.current_frame;
4293
4294 /* setup internal call frame */
4295 {
4296 size_t offset = env->stack.current_frame->end_offset;
4297 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
4298 (((char *) env->stack.current_frame) + offset);
4299
4300 frame->previous_offset = offset;
4301 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
4302 frame->method = &vm->vm_initiated_call_method;
4303 frame->stack_trace_element = NULL;
4304 frame->lock_count = 0;
4305 frame->this = NULL;
4306 frame->pc = vm->vm_initiated_call_method.frame_info->code;
4307 frame->stack_size = 0;
4308
4309 env->stack.current_frame = frame;
4310 }
4311
4312 /* push parameters */
4313 {
4314 _svmt_stack_frame *prev_frame = env->stack.current_frame;
4315 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
4316 (((char *) prev_frame) + prev_frame->end_offset);
4317 jint i = 0;
4318
4319 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
4320
4321 {
4322 jint ref_count = frame_info->non_parameter_ref_locals_count;
4323 jint j;
4324
4325 for (j = 0; j < ref_count; j++)
4326 {
4327 locals[i++].reference = NULL;
4328 }
4329 }
4330 }
4331
4332 /* setup java call frame */
4333 {
4334 size_t offset =
4335 env->stack.current_frame->end_offset + frame_info->start_offset;
4336 _svmt_stack_frame *frame =
4337 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
4338 offset);
4339
4340 frame->previous_offset = offset;
4341 frame->end_offset = frame_info->end_offset;
4342 frame->method = method;
4343 frame->stack_trace_element = NULL;
4344 frame->lock_count = 0;
4345 frame->this = *(method->class_info->class_instance);
4346 frame->pc = frame_info->code;
4347 frame->stack_size = 0;
4348
4349 env->stack.current_frame = frame;
4350 }
4351
4352 /* interpret and pop internal call frame */
4353 {
4354 /* call the interpreter */
4355 jint status = _svmf_interpreter (env);
4356
4357 /* retrieve stack frame */
4358 _svmt_stack_frame *frame = env->stack.current_frame;
4359
4360 assert (frame->method == &vm->vm_initiated_call_method);
4361
4362 /* pop frame */
4363 env->stack.current_frame = (_svmt_stack_frame *) (void *)
4364 (((char *) frame) - frame->previous_offset);
4365
4366 /* rethrow exception */
4367 if (status != JNI_OK)
4368 {
4369 return JNI_ERR;
4370 }
4371
4372 /* set the return value */
4373 {
4374 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
4375 (((char *) frame) + frame->end_offset);
4376
4377 *ret = ptr_ret->reference;
4378 }
4379 }
4380
4381 return JNI_OK;
4382 }
4383
4384
4385 /*
4386 ----------------------------------------------------------------------
4387 _svmh_invoke_static_stringcreator_createstring
4388 ----------------------------------------------------------------------
4389 */
4390
4391 svm_static jint
_svmh_invoke_static_stringcreator_createstring(_svmt_JNIEnv * env,jobject param_1,jobject ret)4392 _svmh_invoke_static_stringcreator_createstring (_svmt_JNIEnv *env, jobject param_1, jobject ret)
4393 {
4394 _svmt_JavaVM *vm = env->vm;
4395 _svmt_stack_frame *initial_frame;
4396 _svmt_method_info *method = vm->class_loading.boot_loader.methods.stringcreator_createstring;
4397 _svmt_method_frame_info *frame_info = method->frame_info;
4398
4399 assert (_svmf_is_set_flag
4400 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
4401
4402 /* syncronized? */
4403 if (method->synchronized)
4404 {
4405 if (_svmf_enter_object_monitor
4406 (env, *(method->class_info->class_instance)) != JNI_OK)
4407 {
4408 return JNI_ERR;
4409 }
4410 }
4411
4412 if (_svmf_ensure_stack_capacity
4413 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
4414 {
4415 return JNI_ERR;
4416 }
4417
4418 initial_frame = env->stack.current_frame;
4419
4420 /* setup internal call frame */
4421 {
4422 size_t offset = env->stack.current_frame->end_offset;
4423 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
4424 (((char *) env->stack.current_frame) + offset);
4425
4426 frame->previous_offset = offset;
4427 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
4428 frame->method = &vm->vm_initiated_call_method;
4429 frame->stack_trace_element = NULL;
4430 frame->lock_count = 0;
4431 frame->this = NULL;
4432 frame->pc = vm->vm_initiated_call_method.frame_info->code;
4433 frame->stack_size = 0;
4434
4435 env->stack.current_frame = frame;
4436 }
4437
4438 /* push parameters */
4439 {
4440 _svmt_stack_frame *prev_frame = env->stack.current_frame;
4441 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
4442 (((char *) prev_frame) + prev_frame->end_offset);
4443 jint i = 0;
4444
4445 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
4446
4447 {
4448 jint ref_count = frame_info->non_parameter_ref_locals_count;
4449 jint j;
4450
4451 for (j = 0; j < ref_count; j++)
4452 {
4453 locals[i++].reference = NULL;
4454 }
4455 }
4456 }
4457
4458 /* setup java call frame */
4459 {
4460 size_t offset =
4461 env->stack.current_frame->end_offset + frame_info->start_offset;
4462 _svmt_stack_frame *frame =
4463 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
4464 offset);
4465
4466 frame->previous_offset = offset;
4467 frame->end_offset = frame_info->end_offset;
4468 frame->method = method;
4469 frame->stack_trace_element = NULL;
4470 frame->lock_count = 0;
4471 frame->this = *(method->class_info->class_instance);
4472 frame->pc = frame_info->code;
4473 frame->stack_size = 0;
4474
4475 env->stack.current_frame = frame;
4476 }
4477
4478 /* interpret and pop internal call frame */
4479 {
4480 /* call the interpreter */
4481 jint status = _svmf_interpreter (env);
4482
4483 /* retrieve stack frame */
4484 _svmt_stack_frame *frame = env->stack.current_frame;
4485
4486 assert (frame->method == &vm->vm_initiated_call_method);
4487
4488 /* pop frame */
4489 env->stack.current_frame = (_svmt_stack_frame *) (void *)
4490 (((char *) frame) - frame->previous_offset);
4491
4492 /* rethrow exception */
4493 if (status != JNI_OK)
4494 {
4495 return JNI_ERR;
4496 }
4497
4498 /* set the return value */
4499 {
4500 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
4501 (((char *) frame) + frame->end_offset);
4502
4503 *ret = ptr_ret->reference;
4504 }
4505 }
4506
4507 return JNI_OK;
4508 }
4509
4510
4511 /*
4512 ----------------------------------------------------------------------
4513 _svmh_invoke_static_stringcreator_createstringfromchars
4514 ----------------------------------------------------------------------
4515 */
4516
4517 svm_static jint
_svmh_invoke_static_stringcreator_createstringfromchars(_svmt_JNIEnv * env,jobject param_1,jobject ret)4518 _svmh_invoke_static_stringcreator_createstringfromchars (_svmt_JNIEnv *env, jobject param_1, jobject ret)
4519 {
4520 _svmt_JavaVM *vm = env->vm;
4521 _svmt_stack_frame *initial_frame;
4522 _svmt_method_info *method = vm->class_loading.boot_loader.methods.stringcreator_createstringfromchars;
4523 _svmt_method_frame_info *frame_info = method->frame_info;
4524
4525 assert (_svmf_is_set_flag
4526 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
4527
4528 /* syncronized? */
4529 if (method->synchronized)
4530 {
4531 if (_svmf_enter_object_monitor
4532 (env, *(method->class_info->class_instance)) != JNI_OK)
4533 {
4534 return JNI_ERR;
4535 }
4536 }
4537
4538 if (_svmf_ensure_stack_capacity
4539 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
4540 {
4541 return JNI_ERR;
4542 }
4543
4544 initial_frame = env->stack.current_frame;
4545
4546 /* setup internal call frame */
4547 {
4548 size_t offset = env->stack.current_frame->end_offset;
4549 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
4550 (((char *) env->stack.current_frame) + offset);
4551
4552 frame->previous_offset = offset;
4553 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
4554 frame->method = &vm->vm_initiated_call_method;
4555 frame->stack_trace_element = NULL;
4556 frame->lock_count = 0;
4557 frame->this = NULL;
4558 frame->pc = vm->vm_initiated_call_method.frame_info->code;
4559 frame->stack_size = 0;
4560
4561 env->stack.current_frame = frame;
4562 }
4563
4564 /* push parameters */
4565 {
4566 _svmt_stack_frame *prev_frame = env->stack.current_frame;
4567 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
4568 (((char *) prev_frame) + prev_frame->end_offset);
4569 jint i = 0;
4570
4571 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
4572
4573 {
4574 jint ref_count = frame_info->non_parameter_ref_locals_count;
4575 jint j;
4576
4577 for (j = 0; j < ref_count; j++)
4578 {
4579 locals[i++].reference = NULL;
4580 }
4581 }
4582 }
4583
4584 /* setup java call frame */
4585 {
4586 size_t offset =
4587 env->stack.current_frame->end_offset + frame_info->start_offset;
4588 _svmt_stack_frame *frame =
4589 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
4590 offset);
4591
4592 frame->previous_offset = offset;
4593 frame->end_offset = frame_info->end_offset;
4594 frame->method = method;
4595 frame->stack_trace_element = NULL;
4596 frame->lock_count = 0;
4597 frame->this = *(method->class_info->class_instance);
4598 frame->pc = frame_info->code;
4599 frame->stack_size = 0;
4600
4601 env->stack.current_frame = frame;
4602 }
4603
4604 /* interpret and pop internal call frame */
4605 {
4606 /* call the interpreter */
4607 jint status = _svmf_interpreter (env);
4608
4609 /* retrieve stack frame */
4610 _svmt_stack_frame *frame = env->stack.current_frame;
4611
4612 assert (frame->method == &vm->vm_initiated_call_method);
4613
4614 /* pop frame */
4615 env->stack.current_frame = (_svmt_stack_frame *) (void *)
4616 (((char *) frame) - frame->previous_offset);
4617
4618 /* rethrow exception */
4619 if (status != JNI_OK)
4620 {
4621 return JNI_ERR;
4622 }
4623
4624 /* set the return value */
4625 {
4626 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
4627 (((char *) frame) + frame->end_offset);
4628
4629 *ret = ptr_ret->reference;
4630 }
4631 }
4632
4633 return JNI_OK;
4634 }
4635
4636
4637 /*
4638 ----------------------------------------------------------------------
4639 _svmh_invoke_static_stringcreator_getchars
4640 ----------------------------------------------------------------------
4641 */
4642
4643 svm_static jint
_svmh_invoke_static_stringcreator_getchars(_svmt_JNIEnv * env,jobject param_1,jobject ret)4644 _svmh_invoke_static_stringcreator_getchars (_svmt_JNIEnv *env, jobject param_1, jobject ret)
4645 {
4646 _svmt_JavaVM *vm = env->vm;
4647 _svmt_stack_frame *initial_frame;
4648 _svmt_method_info *method = vm->class_loading.boot_loader.methods.stringcreator_getchars;
4649 _svmt_method_frame_info *frame_info = method->frame_info;
4650
4651 assert (_svmf_is_set_flag
4652 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
4653
4654 /* syncronized? */
4655 if (method->synchronized)
4656 {
4657 if (_svmf_enter_object_monitor
4658 (env, *(method->class_info->class_instance)) != JNI_OK)
4659 {
4660 return JNI_ERR;
4661 }
4662 }
4663
4664 if (_svmf_ensure_stack_capacity
4665 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
4666 {
4667 return JNI_ERR;
4668 }
4669
4670 initial_frame = env->stack.current_frame;
4671
4672 /* setup internal call frame */
4673 {
4674 size_t offset = env->stack.current_frame->end_offset;
4675 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
4676 (((char *) env->stack.current_frame) + offset);
4677
4678 frame->previous_offset = offset;
4679 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
4680 frame->method = &vm->vm_initiated_call_method;
4681 frame->stack_trace_element = NULL;
4682 frame->lock_count = 0;
4683 frame->this = NULL;
4684 frame->pc = vm->vm_initiated_call_method.frame_info->code;
4685 frame->stack_size = 0;
4686
4687 env->stack.current_frame = frame;
4688 }
4689
4690 /* push parameters */
4691 {
4692 _svmt_stack_frame *prev_frame = env->stack.current_frame;
4693 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
4694 (((char *) prev_frame) + prev_frame->end_offset);
4695 jint i = 0;
4696
4697 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
4698
4699 {
4700 jint ref_count = frame_info->non_parameter_ref_locals_count;
4701 jint j;
4702
4703 for (j = 0; j < ref_count; j++)
4704 {
4705 locals[i++].reference = NULL;
4706 }
4707 }
4708 }
4709
4710 /* setup java call frame */
4711 {
4712 size_t offset =
4713 env->stack.current_frame->end_offset + frame_info->start_offset;
4714 _svmt_stack_frame *frame =
4715 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
4716 offset);
4717
4718 frame->previous_offset = offset;
4719 frame->end_offset = frame_info->end_offset;
4720 frame->method = method;
4721 frame->stack_trace_element = NULL;
4722 frame->lock_count = 0;
4723 frame->this = *(method->class_info->class_instance);
4724 frame->pc = frame_info->code;
4725 frame->stack_size = 0;
4726
4727 env->stack.current_frame = frame;
4728 }
4729
4730 /* interpret and pop internal call frame */
4731 {
4732 /* call the interpreter */
4733 jint status = _svmf_interpreter (env);
4734
4735 /* retrieve stack frame */
4736 _svmt_stack_frame *frame = env->stack.current_frame;
4737
4738 assert (frame->method == &vm->vm_initiated_call_method);
4739
4740 /* pop frame */
4741 env->stack.current_frame = (_svmt_stack_frame *) (void *)
4742 (((char *) frame) - frame->previous_offset);
4743
4744 /* rethrow exception */
4745 if (status != JNI_OK)
4746 {
4747 return JNI_ERR;
4748 }
4749
4750 /* set the return value */
4751 {
4752 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
4753 (((char *) frame) + frame->end_offset);
4754
4755 *ret = ptr_ret->reference;
4756 }
4757 }
4758
4759 return JNI_OK;
4760 }
4761
4762
4763 /*
4764 ----------------------------------------------------------------------
4765 _svmh_invoke_static_stringcreator_getlength
4766 ----------------------------------------------------------------------
4767 */
4768
4769 svm_static jint
_svmh_invoke_static_stringcreator_getlength(_svmt_JNIEnv * env,jobject param_1,jint * ret)4770 _svmh_invoke_static_stringcreator_getlength (_svmt_JNIEnv *env, jobject param_1, jint *ret)
4771 {
4772 _svmt_JavaVM *vm = env->vm;
4773 _svmt_stack_frame *initial_frame;
4774 _svmt_method_info *method = vm->class_loading.boot_loader.methods.stringcreator_getlength;
4775 _svmt_method_frame_info *frame_info = method->frame_info;
4776
4777 assert (_svmf_is_set_flag
4778 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
4779
4780 /* syncronized? */
4781 if (method->synchronized)
4782 {
4783 if (_svmf_enter_object_monitor
4784 (env, *(method->class_info->class_instance)) != JNI_OK)
4785 {
4786 return JNI_ERR;
4787 }
4788 }
4789
4790 if (_svmf_ensure_stack_capacity
4791 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
4792 {
4793 return JNI_ERR;
4794 }
4795
4796 initial_frame = env->stack.current_frame;
4797
4798 /* setup internal call frame */
4799 {
4800 size_t offset = env->stack.current_frame->end_offset;
4801 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
4802 (((char *) env->stack.current_frame) + offset);
4803
4804 frame->previous_offset = offset;
4805 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
4806 frame->method = &vm->vm_initiated_call_method;
4807 frame->stack_trace_element = NULL;
4808 frame->lock_count = 0;
4809 frame->this = NULL;
4810 frame->pc = vm->vm_initiated_call_method.frame_info->code;
4811 frame->stack_size = 0;
4812
4813 env->stack.current_frame = frame;
4814 }
4815
4816 /* push parameters */
4817 {
4818 _svmt_stack_frame *prev_frame = env->stack.current_frame;
4819 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
4820 (((char *) prev_frame) + prev_frame->end_offset);
4821 jint i = 0;
4822
4823 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
4824
4825 {
4826 jint ref_count = frame_info->non_parameter_ref_locals_count;
4827 jint j;
4828
4829 for (j = 0; j < ref_count; j++)
4830 {
4831 locals[i++].reference = NULL;
4832 }
4833 }
4834 }
4835
4836 /* setup java call frame */
4837 {
4838 size_t offset =
4839 env->stack.current_frame->end_offset + frame_info->start_offset;
4840 _svmt_stack_frame *frame =
4841 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
4842 offset);
4843
4844 frame->previous_offset = offset;
4845 frame->end_offset = frame_info->end_offset;
4846 frame->method = method;
4847 frame->stack_trace_element = NULL;
4848 frame->lock_count = 0;
4849 frame->this = *(method->class_info->class_instance);
4850 frame->pc = frame_info->code;
4851 frame->stack_size = 0;
4852
4853 env->stack.current_frame = frame;
4854 }
4855
4856 /* interpret and pop internal call frame */
4857 {
4858 /* call the interpreter */
4859 jint status = _svmf_interpreter (env);
4860
4861 /* retrieve stack frame */
4862 _svmt_stack_frame *frame = env->stack.current_frame;
4863
4864 assert (frame->method == &vm->vm_initiated_call_method);
4865
4866 /* pop frame */
4867 env->stack.current_frame = (_svmt_stack_frame *) (void *)
4868 (((char *) frame) - frame->previous_offset);
4869
4870 /* rethrow exception */
4871 if (status != JNI_OK)
4872 {
4873 return JNI_ERR;
4874 }
4875
4876 /* set the return value */
4877 {
4878 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
4879 (((char *) frame) + frame->end_offset);
4880
4881 *ret = ptr_ret->jint;
4882 }
4883 }
4884
4885 return JNI_OK;
4886 }
4887
4888
4889 /*
4890 ----------------------------------------------------------------------
4891 _svmh_invoke_static_stringcreator_getutfchars
4892 ----------------------------------------------------------------------
4893 */
4894
4895 svm_static jint
_svmh_invoke_static_stringcreator_getutfchars(_svmt_JNIEnv * env,jobject param_1,jobject ret)4896 _svmh_invoke_static_stringcreator_getutfchars (_svmt_JNIEnv *env, jobject param_1, jobject ret)
4897 {
4898 _svmt_JavaVM *vm = env->vm;
4899 _svmt_stack_frame *initial_frame;
4900 _svmt_method_info *method = vm->class_loading.boot_loader.methods.stringcreator_getutfchars;
4901 _svmt_method_frame_info *frame_info = method->frame_info;
4902
4903 assert (_svmf_is_set_flag
4904 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
4905
4906 /* syncronized? */
4907 if (method->synchronized)
4908 {
4909 if (_svmf_enter_object_monitor
4910 (env, *(method->class_info->class_instance)) != JNI_OK)
4911 {
4912 return JNI_ERR;
4913 }
4914 }
4915
4916 if (_svmf_ensure_stack_capacity
4917 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
4918 {
4919 return JNI_ERR;
4920 }
4921
4922 initial_frame = env->stack.current_frame;
4923
4924 /* setup internal call frame */
4925 {
4926 size_t offset = env->stack.current_frame->end_offset;
4927 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
4928 (((char *) env->stack.current_frame) + offset);
4929
4930 frame->previous_offset = offset;
4931 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
4932 frame->method = &vm->vm_initiated_call_method;
4933 frame->stack_trace_element = NULL;
4934 frame->lock_count = 0;
4935 frame->this = NULL;
4936 frame->pc = vm->vm_initiated_call_method.frame_info->code;
4937 frame->stack_size = 0;
4938
4939 env->stack.current_frame = frame;
4940 }
4941
4942 /* push parameters */
4943 {
4944 _svmt_stack_frame *prev_frame = env->stack.current_frame;
4945 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
4946 (((char *) prev_frame) + prev_frame->end_offset);
4947 jint i = 0;
4948
4949 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
4950
4951 {
4952 jint ref_count = frame_info->non_parameter_ref_locals_count;
4953 jint j;
4954
4955 for (j = 0; j < ref_count; j++)
4956 {
4957 locals[i++].reference = NULL;
4958 }
4959 }
4960 }
4961
4962 /* setup java call frame */
4963 {
4964 size_t offset =
4965 env->stack.current_frame->end_offset + frame_info->start_offset;
4966 _svmt_stack_frame *frame =
4967 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
4968 offset);
4969
4970 frame->previous_offset = offset;
4971 frame->end_offset = frame_info->end_offset;
4972 frame->method = method;
4973 frame->stack_trace_element = NULL;
4974 frame->lock_count = 0;
4975 frame->this = *(method->class_info->class_instance);
4976 frame->pc = frame_info->code;
4977 frame->stack_size = 0;
4978
4979 env->stack.current_frame = frame;
4980 }
4981
4982 /* interpret and pop internal call frame */
4983 {
4984 /* call the interpreter */
4985 jint status = _svmf_interpreter (env);
4986
4987 /* retrieve stack frame */
4988 _svmt_stack_frame *frame = env->stack.current_frame;
4989
4990 assert (frame->method == &vm->vm_initiated_call_method);
4991
4992 /* pop frame */
4993 env->stack.current_frame = (_svmt_stack_frame *) (void *)
4994 (((char *) frame) - frame->previous_offset);
4995
4996 /* rethrow exception */
4997 if (status != JNI_OK)
4998 {
4999 return JNI_ERR;
5000 }
5001
5002 /* set the return value */
5003 {
5004 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
5005 (((char *) frame) + frame->end_offset);
5006
5007 *ret = ptr_ret->reference;
5008 }
5009 }
5010
5011 return JNI_OK;
5012 }
5013
5014
5015 /*
5016 ----------------------------------------------------------------------
5017 _svmh_invoke_static_stringcreator_getutflength
5018 ----------------------------------------------------------------------
5019 */
5020
5021 svm_static jint
_svmh_invoke_static_stringcreator_getutflength(_svmt_JNIEnv * env,jobject param_1,jint * ret)5022 _svmh_invoke_static_stringcreator_getutflength (_svmt_JNIEnv *env, jobject param_1, jint *ret)
5023 {
5024 _svmt_JavaVM *vm = env->vm;
5025 _svmt_stack_frame *initial_frame;
5026 _svmt_method_info *method = vm->class_loading.boot_loader.methods.stringcreator_getutflength;
5027 _svmt_method_frame_info *frame_info = method->frame_info;
5028
5029 assert (_svmf_is_set_flag
5030 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
5031
5032 /* syncronized? */
5033 if (method->synchronized)
5034 {
5035 if (_svmf_enter_object_monitor
5036 (env, *(method->class_info->class_instance)) != JNI_OK)
5037 {
5038 return JNI_ERR;
5039 }
5040 }
5041
5042 if (_svmf_ensure_stack_capacity
5043 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
5044 {
5045 return JNI_ERR;
5046 }
5047
5048 initial_frame = env->stack.current_frame;
5049
5050 /* setup internal call frame */
5051 {
5052 size_t offset = env->stack.current_frame->end_offset;
5053 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
5054 (((char *) env->stack.current_frame) + offset);
5055
5056 frame->previous_offset = offset;
5057 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
5058 frame->method = &vm->vm_initiated_call_method;
5059 frame->stack_trace_element = NULL;
5060 frame->lock_count = 0;
5061 frame->this = NULL;
5062 frame->pc = vm->vm_initiated_call_method.frame_info->code;
5063 frame->stack_size = 0;
5064
5065 env->stack.current_frame = frame;
5066 }
5067
5068 /* push parameters */
5069 {
5070 _svmt_stack_frame *prev_frame = env->stack.current_frame;
5071 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
5072 (((char *) prev_frame) + prev_frame->end_offset);
5073 jint i = 0;
5074
5075 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
5076
5077 {
5078 jint ref_count = frame_info->non_parameter_ref_locals_count;
5079 jint j;
5080
5081 for (j = 0; j < ref_count; j++)
5082 {
5083 locals[i++].reference = NULL;
5084 }
5085 }
5086 }
5087
5088 /* setup java call frame */
5089 {
5090 size_t offset =
5091 env->stack.current_frame->end_offset + frame_info->start_offset;
5092 _svmt_stack_frame *frame =
5093 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
5094 offset);
5095
5096 frame->previous_offset = offset;
5097 frame->end_offset = frame_info->end_offset;
5098 frame->method = method;
5099 frame->stack_trace_element = NULL;
5100 frame->lock_count = 0;
5101 frame->this = *(method->class_info->class_instance);
5102 frame->pc = frame_info->code;
5103 frame->stack_size = 0;
5104
5105 env->stack.current_frame = frame;
5106 }
5107
5108 /* interpret and pop internal call frame */
5109 {
5110 /* call the interpreter */
5111 jint status = _svmf_interpreter (env);
5112
5113 /* retrieve stack frame */
5114 _svmt_stack_frame *frame = env->stack.current_frame;
5115
5116 assert (frame->method == &vm->vm_initiated_call_method);
5117
5118 /* pop frame */
5119 env->stack.current_frame = (_svmt_stack_frame *) (void *)
5120 (((char *) frame) - frame->previous_offset);
5121
5122 /* rethrow exception */
5123 if (status != JNI_OK)
5124 {
5125 return JNI_ERR;
5126 }
5127
5128 /* set the return value */
5129 {
5130 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
5131 (((char *) frame) + frame->end_offset);
5132
5133 *ret = ptr_ret->jint;
5134 }
5135 }
5136
5137 return JNI_OK;
5138 }
5139
5140
5141 /*
5142 ----------------------------------------------------------------------
5143 _svmh_invoke_static_virtualmachine_createarray
5144 ----------------------------------------------------------------------
5145 */
5146
5147 svm_static jint
_svmh_invoke_static_virtualmachine_createarray(_svmt_JNIEnv * env,jobject param_1,jobject param_2,jobject ret)5148 _svmh_invoke_static_virtualmachine_createarray (_svmt_JNIEnv *env, jobject param_1, jobject param_2, jobject ret)
5149 {
5150 _svmt_JavaVM *vm = env->vm;
5151 _svmt_stack_frame *initial_frame;
5152 _svmt_method_info *method = vm->class_loading.boot_loader.methods.virtualmachine_createarray;
5153 _svmt_method_frame_info *frame_info = method->frame_info;
5154
5155 assert (_svmf_is_set_flag
5156 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
5157
5158 /* syncronized? */
5159 if (method->synchronized)
5160 {
5161 if (_svmf_enter_object_monitor
5162 (env, *(method->class_info->class_instance)) != JNI_OK)
5163 {
5164 return JNI_ERR;
5165 }
5166 }
5167
5168 if (_svmf_ensure_stack_capacity
5169 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
5170 {
5171 return JNI_ERR;
5172 }
5173
5174 initial_frame = env->stack.current_frame;
5175
5176 /* setup internal call frame */
5177 {
5178 size_t offset = env->stack.current_frame->end_offset;
5179 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
5180 (((char *) env->stack.current_frame) + offset);
5181
5182 frame->previous_offset = offset;
5183 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
5184 frame->method = &vm->vm_initiated_call_method;
5185 frame->stack_trace_element = NULL;
5186 frame->lock_count = 0;
5187 frame->this = NULL;
5188 frame->pc = vm->vm_initiated_call_method.frame_info->code;
5189 frame->stack_size = 0;
5190
5191 env->stack.current_frame = frame;
5192 }
5193
5194 /* push parameters */
5195 {
5196 _svmt_stack_frame *prev_frame = env->stack.current_frame;
5197 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
5198 (((char *) prev_frame) + prev_frame->end_offset);
5199 jint i = 0;
5200
5201 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
5202 locals[i++].reference = (param_2 == NULL) ? NULL : *param_2;
5203
5204 {
5205 jint ref_count = frame_info->non_parameter_ref_locals_count;
5206 jint j;
5207
5208 for (j = 0; j < ref_count; j++)
5209 {
5210 locals[i++].reference = NULL;
5211 }
5212 }
5213 }
5214
5215 /* setup java call frame */
5216 {
5217 size_t offset =
5218 env->stack.current_frame->end_offset + frame_info->start_offset;
5219 _svmt_stack_frame *frame =
5220 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
5221 offset);
5222
5223 frame->previous_offset = offset;
5224 frame->end_offset = frame_info->end_offset;
5225 frame->method = method;
5226 frame->stack_trace_element = NULL;
5227 frame->lock_count = 0;
5228 frame->this = *(method->class_info->class_instance);
5229 frame->pc = frame_info->code;
5230 frame->stack_size = 0;
5231
5232 env->stack.current_frame = frame;
5233 }
5234
5235 /* interpret and pop internal call frame */
5236 {
5237 /* call the interpreter */
5238 jint status = _svmf_interpreter (env);
5239
5240 /* retrieve stack frame */
5241 _svmt_stack_frame *frame = env->stack.current_frame;
5242
5243 assert (frame->method == &vm->vm_initiated_call_method);
5244
5245 /* pop frame */
5246 env->stack.current_frame = (_svmt_stack_frame *) (void *)
5247 (((char *) frame) - frame->previous_offset);
5248
5249 /* rethrow exception */
5250 if (status != JNI_OK)
5251 {
5252 return JNI_ERR;
5253 }
5254
5255 /* set the return value */
5256 {
5257 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
5258 (((char *) frame) + frame->end_offset);
5259
5260 *ret = ptr_ret->reference;
5261 }
5262 }
5263
5264 return JNI_OK;
5265 }
5266
5267
5268 /*
5269 ----------------------------------------------------------------------
5270 _svmh_invoke_static_virtualmachine_createclass
5271 ----------------------------------------------------------------------
5272 */
5273
5274 svm_static jint
_svmh_invoke_static_virtualmachine_createclass(_svmt_JNIEnv * env,jobject param_1,jobject param_2,jobject ret)5275 _svmh_invoke_static_virtualmachine_createclass (_svmt_JNIEnv *env, jobject param_1, jobject param_2, jobject ret)
5276 {
5277 _svmt_JavaVM *vm = env->vm;
5278 _svmt_stack_frame *initial_frame;
5279 _svmt_method_info *method = vm->class_loading.boot_loader.methods.virtualmachine_createclass;
5280 _svmt_method_frame_info *frame_info = method->frame_info;
5281
5282 assert (_svmf_is_set_flag
5283 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
5284
5285 /* syncronized? */
5286 if (method->synchronized)
5287 {
5288 if (_svmf_enter_object_monitor
5289 (env, *(method->class_info->class_instance)) != JNI_OK)
5290 {
5291 return JNI_ERR;
5292 }
5293 }
5294
5295 if (_svmf_ensure_stack_capacity
5296 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
5297 {
5298 return JNI_ERR;
5299 }
5300
5301 initial_frame = env->stack.current_frame;
5302
5303 /* setup internal call frame */
5304 {
5305 size_t offset = env->stack.current_frame->end_offset;
5306 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
5307 (((char *) env->stack.current_frame) + offset);
5308
5309 frame->previous_offset = offset;
5310 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
5311 frame->method = &vm->vm_initiated_call_method;
5312 frame->stack_trace_element = NULL;
5313 frame->lock_count = 0;
5314 frame->this = NULL;
5315 frame->pc = vm->vm_initiated_call_method.frame_info->code;
5316 frame->stack_size = 0;
5317
5318 env->stack.current_frame = frame;
5319 }
5320
5321 /* push parameters */
5322 {
5323 _svmt_stack_frame *prev_frame = env->stack.current_frame;
5324 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
5325 (((char *) prev_frame) + prev_frame->end_offset);
5326 jint i = 0;
5327
5328 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
5329 locals[i++].reference = (param_2 == NULL) ? NULL : *param_2;
5330
5331 {
5332 jint ref_count = frame_info->non_parameter_ref_locals_count;
5333 jint j;
5334
5335 for (j = 0; j < ref_count; j++)
5336 {
5337 locals[i++].reference = NULL;
5338 }
5339 }
5340 }
5341
5342 /* setup java call frame */
5343 {
5344 size_t offset =
5345 env->stack.current_frame->end_offset + frame_info->start_offset;
5346 _svmt_stack_frame *frame =
5347 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
5348 offset);
5349
5350 frame->previous_offset = offset;
5351 frame->end_offset = frame_info->end_offset;
5352 frame->method = method;
5353 frame->stack_trace_element = NULL;
5354 frame->lock_count = 0;
5355 frame->this = *(method->class_info->class_instance);
5356 frame->pc = frame_info->code;
5357 frame->stack_size = 0;
5358
5359 env->stack.current_frame = frame;
5360 }
5361
5362 /* interpret and pop internal call frame */
5363 {
5364 /* call the interpreter */
5365 jint status = _svmf_interpreter (env);
5366
5367 /* retrieve stack frame */
5368 _svmt_stack_frame *frame = env->stack.current_frame;
5369
5370 assert (frame->method == &vm->vm_initiated_call_method);
5371
5372 /* pop frame */
5373 env->stack.current_frame = (_svmt_stack_frame *) (void *)
5374 (((char *) frame) - frame->previous_offset);
5375
5376 /* rethrow exception */
5377 if (status != JNI_OK)
5378 {
5379 return JNI_ERR;
5380 }
5381
5382 /* set the return value */
5383 {
5384 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
5385 (((char *) frame) + frame->end_offset);
5386
5387 *ret = ptr_ret->reference;
5388 }
5389 }
5390
5391 return JNI_OK;
5392 }
5393
5394
5395 /*
5396 ----------------------------------------------------------------------
5397 _svmh_invoke_static_virtualmachine_createrootthread
5398 ----------------------------------------------------------------------
5399 */
5400
5401 svm_static jint
_svmh_invoke_static_virtualmachine_createrootthread(_svmt_JNIEnv * env,jobject param_1,jobject ret)5402 _svmh_invoke_static_virtualmachine_createrootthread (_svmt_JNIEnv *env, jobject param_1, jobject ret)
5403 {
5404 _svmt_JavaVM *vm = env->vm;
5405 _svmt_stack_frame *initial_frame;
5406 _svmt_method_info *method = vm->class_loading.boot_loader.methods.virtualmachine_createrootthread;
5407 _svmt_method_frame_info *frame_info = method->frame_info;
5408
5409 assert (_svmf_is_set_flag
5410 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
5411
5412 /* syncronized? */
5413 if (method->synchronized)
5414 {
5415 if (_svmf_enter_object_monitor
5416 (env, *(method->class_info->class_instance)) != JNI_OK)
5417 {
5418 return JNI_ERR;
5419 }
5420 }
5421
5422 if (_svmf_ensure_stack_capacity
5423 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
5424 {
5425 return JNI_ERR;
5426 }
5427
5428 initial_frame = env->stack.current_frame;
5429
5430 /* setup internal call frame */
5431 {
5432 size_t offset = env->stack.current_frame->end_offset;
5433 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
5434 (((char *) env->stack.current_frame) + offset);
5435
5436 frame->previous_offset = offset;
5437 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
5438 frame->method = &vm->vm_initiated_call_method;
5439 frame->stack_trace_element = NULL;
5440 frame->lock_count = 0;
5441 frame->this = NULL;
5442 frame->pc = vm->vm_initiated_call_method.frame_info->code;
5443 frame->stack_size = 0;
5444
5445 env->stack.current_frame = frame;
5446 }
5447
5448 /* push parameters */
5449 {
5450 _svmt_stack_frame *prev_frame = env->stack.current_frame;
5451 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
5452 (((char *) prev_frame) + prev_frame->end_offset);
5453 jint i = 0;
5454
5455 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
5456
5457 {
5458 jint ref_count = frame_info->non_parameter_ref_locals_count;
5459 jint j;
5460
5461 for (j = 0; j < ref_count; j++)
5462 {
5463 locals[i++].reference = NULL;
5464 }
5465 }
5466 }
5467
5468 /* setup java call frame */
5469 {
5470 size_t offset =
5471 env->stack.current_frame->end_offset + frame_info->start_offset;
5472 _svmt_stack_frame *frame =
5473 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
5474 offset);
5475
5476 frame->previous_offset = offset;
5477 frame->end_offset = frame_info->end_offset;
5478 frame->method = method;
5479 frame->stack_trace_element = NULL;
5480 frame->lock_count = 0;
5481 frame->this = *(method->class_info->class_instance);
5482 frame->pc = frame_info->code;
5483 frame->stack_size = 0;
5484
5485 env->stack.current_frame = frame;
5486 }
5487
5488 /* interpret and pop internal call frame */
5489 {
5490 /* call the interpreter */
5491 jint status = _svmf_interpreter (env);
5492
5493 /* retrieve stack frame */
5494 _svmt_stack_frame *frame = env->stack.current_frame;
5495
5496 assert (frame->method == &vm->vm_initiated_call_method);
5497
5498 /* pop frame */
5499 env->stack.current_frame = (_svmt_stack_frame *) (void *)
5500 (((char *) frame) - frame->previous_offset);
5501
5502 /* rethrow exception */
5503 if (status != JNI_OK)
5504 {
5505 return JNI_ERR;
5506 }
5507
5508 /* set the return value */
5509 {
5510 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
5511 (((char *) frame) + frame->end_offset);
5512
5513 *ret = ptr_ret->reference;
5514 }
5515 }
5516
5517 return JNI_OK;
5518 }
5519
5520
5521 /*
5522 ----------------------------------------------------------------------
5523 _svmh_invoke_static_virtualmachine_exceptiondescribe
5524 ----------------------------------------------------------------------
5525 */
5526
5527 svm_static jint
_svmh_invoke_static_virtualmachine_exceptiondescribe(_svmt_JNIEnv * env,jobject param_1)5528 _svmh_invoke_static_virtualmachine_exceptiondescribe (_svmt_JNIEnv *env, jobject param_1)
5529 {
5530 _svmt_JavaVM *vm = env->vm;
5531 _svmt_stack_frame *initial_frame;
5532 _svmt_method_info *method = vm->class_loading.boot_loader.methods.virtualmachine_exceptiondescribe;
5533 _svmt_method_frame_info *frame_info = method->frame_info;
5534
5535 assert (_svmf_is_set_flag
5536 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
5537
5538 /* syncronized? */
5539 if (method->synchronized)
5540 {
5541 if (_svmf_enter_object_monitor
5542 (env, *(method->class_info->class_instance)) != JNI_OK)
5543 {
5544 return JNI_ERR;
5545 }
5546 }
5547
5548 if (_svmf_ensure_stack_capacity
5549 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
5550 {
5551 return JNI_ERR;
5552 }
5553
5554 initial_frame = env->stack.current_frame;
5555
5556 /* setup internal call frame */
5557 {
5558 size_t offset = env->stack.current_frame->end_offset;
5559 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
5560 (((char *) env->stack.current_frame) + offset);
5561
5562 frame->previous_offset = offset;
5563 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
5564 frame->method = &vm->vm_initiated_call_method;
5565 frame->stack_trace_element = NULL;
5566 frame->lock_count = 0;
5567 frame->this = NULL;
5568 frame->pc = vm->vm_initiated_call_method.frame_info->code;
5569 frame->stack_size = 0;
5570
5571 env->stack.current_frame = frame;
5572 }
5573
5574 /* push parameters */
5575 {
5576 _svmt_stack_frame *prev_frame = env->stack.current_frame;
5577 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
5578 (((char *) prev_frame) + prev_frame->end_offset);
5579 jint i = 0;
5580
5581 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
5582
5583 {
5584 jint ref_count = frame_info->non_parameter_ref_locals_count;
5585 jint j;
5586
5587 for (j = 0; j < ref_count; j++)
5588 {
5589 locals[i++].reference = NULL;
5590 }
5591 }
5592 }
5593
5594 /* setup java call frame */
5595 {
5596 size_t offset =
5597 env->stack.current_frame->end_offset + frame_info->start_offset;
5598 _svmt_stack_frame *frame =
5599 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
5600 offset);
5601
5602 frame->previous_offset = offset;
5603 frame->end_offset = frame_info->end_offset;
5604 frame->method = method;
5605 frame->stack_trace_element = NULL;
5606 frame->lock_count = 0;
5607 frame->this = *(method->class_info->class_instance);
5608 frame->pc = frame_info->code;
5609 frame->stack_size = 0;
5610
5611 env->stack.current_frame = frame;
5612 }
5613
5614 /* interpret and pop internal call frame */
5615 {
5616 /* call the interpreter */
5617 jint status = _svmf_interpreter (env);
5618
5619 /* retrieve stack frame */
5620 _svmt_stack_frame *frame = env->stack.current_frame;
5621
5622 assert (frame->method == &vm->vm_initiated_call_method);
5623
5624 /* pop frame */
5625 env->stack.current_frame = (_svmt_stack_frame *) (void *)
5626 (((char *) frame) - frame->previous_offset);
5627
5628 /* rethrow exception */
5629 if (status != JNI_OK)
5630 {
5631 return JNI_ERR;
5632 }
5633
5634 }
5635
5636 return JNI_OK;
5637 }
5638
5639
5640 /*
5641 ----------------------------------------------------------------------
5642 _svmh_invoke_static_virtualmachine_exceptiondescription
5643 ----------------------------------------------------------------------
5644 */
5645
5646 svm_static jint
_svmh_invoke_static_virtualmachine_exceptiondescription(_svmt_JNIEnv * env,jobject param_1,jobject ret)5647 _svmh_invoke_static_virtualmachine_exceptiondescription (_svmt_JNIEnv *env, jobject param_1, jobject ret)
5648 {
5649 _svmt_JavaVM *vm = env->vm;
5650 _svmt_stack_frame *initial_frame;
5651 _svmt_method_info *method = vm->class_loading.boot_loader.methods.virtualmachine_exceptiondescription;
5652 _svmt_method_frame_info *frame_info = method->frame_info;
5653
5654 assert (_svmf_is_set_flag
5655 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
5656
5657 /* syncronized? */
5658 if (method->synchronized)
5659 {
5660 if (_svmf_enter_object_monitor
5661 (env, *(method->class_info->class_instance)) != JNI_OK)
5662 {
5663 return JNI_ERR;
5664 }
5665 }
5666
5667 if (_svmf_ensure_stack_capacity
5668 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
5669 {
5670 return JNI_ERR;
5671 }
5672
5673 initial_frame = env->stack.current_frame;
5674
5675 /* setup internal call frame */
5676 {
5677 size_t offset = env->stack.current_frame->end_offset;
5678 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
5679 (((char *) env->stack.current_frame) + offset);
5680
5681 frame->previous_offset = offset;
5682 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
5683 frame->method = &vm->vm_initiated_call_method;
5684 frame->stack_trace_element = NULL;
5685 frame->lock_count = 0;
5686 frame->this = NULL;
5687 frame->pc = vm->vm_initiated_call_method.frame_info->code;
5688 frame->stack_size = 0;
5689
5690 env->stack.current_frame = frame;
5691 }
5692
5693 /* push parameters */
5694 {
5695 _svmt_stack_frame *prev_frame = env->stack.current_frame;
5696 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
5697 (((char *) prev_frame) + prev_frame->end_offset);
5698 jint i = 0;
5699
5700 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
5701
5702 {
5703 jint ref_count = frame_info->non_parameter_ref_locals_count;
5704 jint j;
5705
5706 for (j = 0; j < ref_count; j++)
5707 {
5708 locals[i++].reference = NULL;
5709 }
5710 }
5711 }
5712
5713 /* setup java call frame */
5714 {
5715 size_t offset =
5716 env->stack.current_frame->end_offset + frame_info->start_offset;
5717 _svmt_stack_frame *frame =
5718 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
5719 offset);
5720
5721 frame->previous_offset = offset;
5722 frame->end_offset = frame_info->end_offset;
5723 frame->method = method;
5724 frame->stack_trace_element = NULL;
5725 frame->lock_count = 0;
5726 frame->this = *(method->class_info->class_instance);
5727 frame->pc = frame_info->code;
5728 frame->stack_size = 0;
5729
5730 env->stack.current_frame = frame;
5731 }
5732
5733 /* interpret and pop internal call frame */
5734 {
5735 /* call the interpreter */
5736 jint status = _svmf_interpreter (env);
5737
5738 /* retrieve stack frame */
5739 _svmt_stack_frame *frame = env->stack.current_frame;
5740
5741 assert (frame->method == &vm->vm_initiated_call_method);
5742
5743 /* pop frame */
5744 env->stack.current_frame = (_svmt_stack_frame *) (void *)
5745 (((char *) frame) - frame->previous_offset);
5746
5747 /* rethrow exception */
5748 if (status != JNI_OK)
5749 {
5750 return JNI_ERR;
5751 }
5752
5753 /* set the return value */
5754 {
5755 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
5756 (((char *) frame) + frame->end_offset);
5757
5758 *ret = ptr_ret->reference;
5759 }
5760 }
5761
5762 return JNI_OK;
5763 }
5764
5765
5766 /*
5767 ----------------------------------------------------------------------
5768 _svmh_invoke_static_virtualmachine_exceptiontruncateddescription
5769 ----------------------------------------------------------------------
5770 */
5771
5772 svm_static jint
_svmh_invoke_static_virtualmachine_exceptiontruncateddescription(_svmt_JNIEnv * env,jobject param_1,jobject ret)5773 _svmh_invoke_static_virtualmachine_exceptiontruncateddescription (_svmt_JNIEnv *env, jobject param_1, jobject ret)
5774 {
5775 _svmt_JavaVM *vm = env->vm;
5776 _svmt_stack_frame *initial_frame;
5777 _svmt_method_info *method = vm->class_loading.boot_loader.methods.virtualmachine_exceptiontruncateddescription;
5778 _svmt_method_frame_info *frame_info = method->frame_info;
5779
5780 assert (_svmf_is_set_flag
5781 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
5782
5783 /* syncronized? */
5784 if (method->synchronized)
5785 {
5786 if (_svmf_enter_object_monitor
5787 (env, *(method->class_info->class_instance)) != JNI_OK)
5788 {
5789 return JNI_ERR;
5790 }
5791 }
5792
5793 if (_svmf_ensure_stack_capacity
5794 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
5795 {
5796 return JNI_ERR;
5797 }
5798
5799 initial_frame = env->stack.current_frame;
5800
5801 /* setup internal call frame */
5802 {
5803 size_t offset = env->stack.current_frame->end_offset;
5804 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
5805 (((char *) env->stack.current_frame) + offset);
5806
5807 frame->previous_offset = offset;
5808 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
5809 frame->method = &vm->vm_initiated_call_method;
5810 frame->stack_trace_element = NULL;
5811 frame->lock_count = 0;
5812 frame->this = NULL;
5813 frame->pc = vm->vm_initiated_call_method.frame_info->code;
5814 frame->stack_size = 0;
5815
5816 env->stack.current_frame = frame;
5817 }
5818
5819 /* push parameters */
5820 {
5821 _svmt_stack_frame *prev_frame = env->stack.current_frame;
5822 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
5823 (((char *) prev_frame) + prev_frame->end_offset);
5824 jint i = 0;
5825
5826 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
5827
5828 {
5829 jint ref_count = frame_info->non_parameter_ref_locals_count;
5830 jint j;
5831
5832 for (j = 0; j < ref_count; j++)
5833 {
5834 locals[i++].reference = NULL;
5835 }
5836 }
5837 }
5838
5839 /* setup java call frame */
5840 {
5841 size_t offset =
5842 env->stack.current_frame->end_offset + frame_info->start_offset;
5843 _svmt_stack_frame *frame =
5844 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
5845 offset);
5846
5847 frame->previous_offset = offset;
5848 frame->end_offset = frame_info->end_offset;
5849 frame->method = method;
5850 frame->stack_trace_element = NULL;
5851 frame->lock_count = 0;
5852 frame->this = *(method->class_info->class_instance);
5853 frame->pc = frame_info->code;
5854 frame->stack_size = 0;
5855
5856 env->stack.current_frame = frame;
5857 }
5858
5859 /* interpret and pop internal call frame */
5860 {
5861 /* call the interpreter */
5862 jint status = _svmf_interpreter (env);
5863
5864 /* retrieve stack frame */
5865 _svmt_stack_frame *frame = env->stack.current_frame;
5866
5867 assert (frame->method == &vm->vm_initiated_call_method);
5868
5869 /* pop frame */
5870 env->stack.current_frame = (_svmt_stack_frame *) (void *)
5871 (((char *) frame) - frame->previous_offset);
5872
5873 /* rethrow exception */
5874 if (status != JNI_OK)
5875 {
5876 return JNI_ERR;
5877 }
5878
5879 /* set the return value */
5880 {
5881 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
5882 (((char *) frame) + frame->end_offset);
5883
5884 *ret = ptr_ret->reference;
5885 }
5886 }
5887
5888 return JNI_OK;
5889 }
5890
5891
5892 /*
5893 ----------------------------------------------------------------------
5894 _svmh_invoke_static_virtualmachine_getsystemcl
5895 ----------------------------------------------------------------------
5896 */
5897
5898 svm_static jint
_svmh_invoke_static_virtualmachine_getsystemcl(_svmt_JNIEnv * env,jobject ret)5899 _svmh_invoke_static_virtualmachine_getsystemcl (_svmt_JNIEnv *env, jobject ret)
5900 {
5901 _svmt_JavaVM *vm = env->vm;
5902 _svmt_stack_frame *initial_frame;
5903 _svmt_method_info *method = vm->class_loading.boot_loader.methods.virtualmachine_getsystemcl;
5904 _svmt_method_frame_info *frame_info = method->frame_info;
5905
5906 assert (_svmf_is_set_flag
5907 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
5908
5909 /* syncronized? */
5910 if (method->synchronized)
5911 {
5912 if (_svmf_enter_object_monitor
5913 (env, *(method->class_info->class_instance)) != JNI_OK)
5914 {
5915 return JNI_ERR;
5916 }
5917 }
5918
5919 if (_svmf_ensure_stack_capacity
5920 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
5921 {
5922 return JNI_ERR;
5923 }
5924
5925 initial_frame = env->stack.current_frame;
5926
5927 /* setup internal call frame */
5928 {
5929 size_t offset = env->stack.current_frame->end_offset;
5930 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
5931 (((char *) env->stack.current_frame) + offset);
5932
5933 frame->previous_offset = offset;
5934 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
5935 frame->method = &vm->vm_initiated_call_method;
5936 frame->stack_trace_element = NULL;
5937 frame->lock_count = 0;
5938 frame->this = NULL;
5939 frame->pc = vm->vm_initiated_call_method.frame_info->code;
5940 frame->stack_size = 0;
5941
5942 env->stack.current_frame = frame;
5943 }
5944
5945 /* push parameters */
5946 {
5947 _svmt_stack_frame *prev_frame = env->stack.current_frame;
5948 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
5949 (((char *) prev_frame) + prev_frame->end_offset);
5950 jint i = 0;
5951
5952
5953 {
5954 jint ref_count = frame_info->non_parameter_ref_locals_count;
5955 jint j;
5956
5957 for (j = 0; j < ref_count; j++)
5958 {
5959 locals[i++].reference = NULL;
5960 }
5961 }
5962 }
5963
5964 /* setup java call frame */
5965 {
5966 size_t offset =
5967 env->stack.current_frame->end_offset + frame_info->start_offset;
5968 _svmt_stack_frame *frame =
5969 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
5970 offset);
5971
5972 frame->previous_offset = offset;
5973 frame->end_offset = frame_info->end_offset;
5974 frame->method = method;
5975 frame->stack_trace_element = NULL;
5976 frame->lock_count = 0;
5977 frame->this = *(method->class_info->class_instance);
5978 frame->pc = frame_info->code;
5979 frame->stack_size = 0;
5980
5981 env->stack.current_frame = frame;
5982 }
5983
5984 /* interpret and pop internal call frame */
5985 {
5986 /* call the interpreter */
5987 jint status = _svmf_interpreter (env);
5988
5989 /* retrieve stack frame */
5990 _svmt_stack_frame *frame = env->stack.current_frame;
5991
5992 assert (frame->method == &vm->vm_initiated_call_method);
5993
5994 /* pop frame */
5995 env->stack.current_frame = (_svmt_stack_frame *) (void *)
5996 (((char *) frame) - frame->previous_offset);
5997
5998 /* rethrow exception */
5999 if (status != JNI_OK)
6000 {
6001 return JNI_ERR;
6002 }
6003
6004 /* set the return value */
6005 {
6006 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
6007 (((char *) frame) + frame->end_offset);
6008
6009 *ret = ptr_ret->reference;
6010 }
6011 }
6012
6013 return JNI_OK;
6014 }
6015
6016
6017 /*
6018 ----------------------------------------------------------------------
6019 _svmh_invoke_static_virtualmachine_runthread
6020 ----------------------------------------------------------------------
6021 */
6022
6023 svm_static jint
_svmh_invoke_static_virtualmachine_runthread(_svmt_JNIEnv * env)6024 _svmh_invoke_static_virtualmachine_runthread (_svmt_JNIEnv *env)
6025 {
6026 _svmt_JavaVM *vm = env->vm;
6027 _svmt_stack_frame *initial_frame;
6028 _svmt_method_info *method = vm->class_loading.boot_loader.methods.virtualmachine_runthread;
6029 _svmt_method_frame_info *frame_info = method->frame_info;
6030
6031 assert (_svmf_is_set_flag
6032 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
6033
6034 /* syncronized? */
6035 if (method->synchronized)
6036 {
6037 if (_svmf_enter_object_monitor
6038 (env, *(method->class_info->class_instance)) != JNI_OK)
6039 {
6040 return JNI_ERR;
6041 }
6042 }
6043
6044 if (_svmf_ensure_stack_capacity
6045 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
6046 {
6047 return JNI_ERR;
6048 }
6049
6050 initial_frame = env->stack.current_frame;
6051
6052 /* setup internal call frame */
6053 {
6054 size_t offset = env->stack.current_frame->end_offset;
6055 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
6056 (((char *) env->stack.current_frame) + offset);
6057
6058 frame->previous_offset = offset;
6059 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
6060 frame->method = &vm->vm_initiated_call_method;
6061 frame->stack_trace_element = NULL;
6062 frame->lock_count = 0;
6063 frame->this = NULL;
6064 frame->pc = vm->vm_initiated_call_method.frame_info->code;
6065 frame->stack_size = 0;
6066
6067 env->stack.current_frame = frame;
6068 }
6069
6070 /* push parameters */
6071 {
6072 _svmt_stack_frame *prev_frame = env->stack.current_frame;
6073 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
6074 (((char *) prev_frame) + prev_frame->end_offset);
6075 jint i = 0;
6076
6077
6078 {
6079 jint ref_count = frame_info->non_parameter_ref_locals_count;
6080 jint j;
6081
6082 for (j = 0; j < ref_count; j++)
6083 {
6084 locals[i++].reference = NULL;
6085 }
6086 }
6087 }
6088
6089 /* setup java call frame */
6090 {
6091 size_t offset =
6092 env->stack.current_frame->end_offset + frame_info->start_offset;
6093 _svmt_stack_frame *frame =
6094 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
6095 offset);
6096
6097 frame->previous_offset = offset;
6098 frame->end_offset = frame_info->end_offset;
6099 frame->method = method;
6100 frame->stack_trace_element = NULL;
6101 frame->lock_count = 0;
6102 frame->this = *(method->class_info->class_instance);
6103 frame->pc = frame_info->code;
6104 frame->stack_size = 0;
6105
6106 env->stack.current_frame = frame;
6107 }
6108
6109 /* interpret and pop internal call frame */
6110 {
6111 /* call the interpreter */
6112 jint status = _svmf_interpreter (env);
6113
6114 /* retrieve stack frame */
6115 _svmt_stack_frame *frame = env->stack.current_frame;
6116
6117 assert (frame->method == &vm->vm_initiated_call_method);
6118
6119 /* pop frame */
6120 env->stack.current_frame = (_svmt_stack_frame *) (void *)
6121 (((char *) frame) - frame->previous_offset);
6122
6123 /* rethrow exception */
6124 if (status != JNI_OK)
6125 {
6126 return JNI_ERR;
6127 }
6128
6129 }
6130
6131 return JNI_OK;
6132 }
6133
6134
6135 /*
6136 ----------------------------------------------------------------------
6137 _svmh_invoke_static_niobytebuffervm_getcapacity
6138 ----------------------------------------------------------------------
6139 */
6140
6141 svm_static jint
_svmh_invoke_static_niobytebuffervm_getcapacity(_svmt_JNIEnv * env,jobject param_1,jlong * ret)6142 _svmh_invoke_static_niobytebuffervm_getcapacity (_svmt_JNIEnv *env, jobject param_1, jlong *ret)
6143 {
6144 _svmt_JavaVM *vm = env->vm;
6145 _svmt_stack_frame *initial_frame;
6146 _svmt_method_info *method = vm->class_loading.boot_loader.methods.niobytebuffervm_getcapacity;
6147 _svmt_method_frame_info *frame_info = method->frame_info;
6148
6149 assert (_svmf_is_set_flag
6150 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
6151
6152 /* syncronized? */
6153 if (method->synchronized)
6154 {
6155 if (_svmf_enter_object_monitor
6156 (env, *(method->class_info->class_instance)) != JNI_OK)
6157 {
6158 return JNI_ERR;
6159 }
6160 }
6161
6162 if (_svmf_ensure_stack_capacity
6163 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
6164 {
6165 return JNI_ERR;
6166 }
6167
6168 initial_frame = env->stack.current_frame;
6169
6170 /* setup internal call frame */
6171 {
6172 size_t offset = env->stack.current_frame->end_offset;
6173 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
6174 (((char *) env->stack.current_frame) + offset);
6175
6176 frame->previous_offset = offset;
6177 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
6178 frame->method = &vm->vm_initiated_call_method;
6179 frame->stack_trace_element = NULL;
6180 frame->lock_count = 0;
6181 frame->this = NULL;
6182 frame->pc = vm->vm_initiated_call_method.frame_info->code;
6183 frame->stack_size = 0;
6184
6185 env->stack.current_frame = frame;
6186 }
6187
6188 /* push parameters */
6189 {
6190 _svmt_stack_frame *prev_frame = env->stack.current_frame;
6191 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
6192 (((char *) prev_frame) + prev_frame->end_offset);
6193 jint i = 0;
6194
6195 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
6196
6197 {
6198 jint ref_count = frame_info->non_parameter_ref_locals_count;
6199 jint j;
6200
6201 for (j = 0; j < ref_count; j++)
6202 {
6203 locals[i++].reference = NULL;
6204 }
6205 }
6206 }
6207
6208 /* setup java call frame */
6209 {
6210 size_t offset =
6211 env->stack.current_frame->end_offset + frame_info->start_offset;
6212 _svmt_stack_frame *frame =
6213 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
6214 offset);
6215
6216 frame->previous_offset = offset;
6217 frame->end_offset = frame_info->end_offset;
6218 frame->method = method;
6219 frame->stack_trace_element = NULL;
6220 frame->lock_count = 0;
6221 frame->this = *(method->class_info->class_instance);
6222 frame->pc = frame_info->code;
6223 frame->stack_size = 0;
6224
6225 env->stack.current_frame = frame;
6226 }
6227
6228 /* interpret and pop internal call frame */
6229 {
6230 /* call the interpreter */
6231 jint status = _svmf_interpreter (env);
6232
6233 /* retrieve stack frame */
6234 _svmt_stack_frame *frame = env->stack.current_frame;
6235
6236 assert (frame->method == &vm->vm_initiated_call_method);
6237
6238 /* pop frame */
6239 env->stack.current_frame = (_svmt_stack_frame *) (void *)
6240 (((char *) frame) - frame->previous_offset);
6241
6242 /* rethrow exception */
6243 if (status != JNI_OK)
6244 {
6245 return JNI_ERR;
6246 }
6247
6248 /* set the return value */
6249 {
6250 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
6251 (((char *) frame) + frame->end_offset);
6252
6253 *ret = *((jlong *) ptr_ret);
6254 }
6255 }
6256
6257 return JNI_OK;
6258 }
6259
6260
6261 #if SVM_WORD_BIT_COUNT == 32
6262
6263 /*
6264 ----------------------------------------------------------------------
6265 _svmh_invoke_static_niobytebuffervm_newbuffer32
6266 ----------------------------------------------------------------------
6267 */
6268
6269 svm_static jint
_svmh_invoke_static_niobytebuffervm_newbuffer32(_svmt_JNIEnv * env,jint param_1,jlong param_2,jobject ret)6270 _svmh_invoke_static_niobytebuffervm_newbuffer32 (_svmt_JNIEnv *env, jint param_1, jlong param_2, jobject ret)
6271 {
6272 _svmt_JavaVM *vm = env->vm;
6273 _svmt_stack_frame *initial_frame;
6274 _svmt_method_info *method = vm->class_loading.boot_loader.methods.niobytebuffervm_newbuffer32;
6275 _svmt_method_frame_info *frame_info = method->frame_info;
6276
6277 assert (_svmf_is_set_flag
6278 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
6279
6280 /* syncronized? */
6281 if (method->synchronized)
6282 {
6283 if (_svmf_enter_object_monitor
6284 (env, *(method->class_info->class_instance)) != JNI_OK)
6285 {
6286 return JNI_ERR;
6287 }
6288 }
6289
6290 if (_svmf_ensure_stack_capacity
6291 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
6292 {
6293 return JNI_ERR;
6294 }
6295
6296 initial_frame = env->stack.current_frame;
6297
6298 /* setup internal call frame */
6299 {
6300 size_t offset = env->stack.current_frame->end_offset;
6301 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
6302 (((char *) env->stack.current_frame) + offset);
6303
6304 frame->previous_offset = offset;
6305 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
6306 frame->method = &vm->vm_initiated_call_method;
6307 frame->stack_trace_element = NULL;
6308 frame->lock_count = 0;
6309 frame->this = NULL;
6310 frame->pc = vm->vm_initiated_call_method.frame_info->code;
6311 frame->stack_size = 0;
6312
6313 env->stack.current_frame = frame;
6314 }
6315
6316 /* push parameters */
6317 {
6318 _svmt_stack_frame *prev_frame = env->stack.current_frame;
6319 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
6320 (((char *) prev_frame) + prev_frame->end_offset);
6321 jint i = 0;
6322
6323 locals[i++].jint = param_1;
6324 *((jlong *) &locals[i]) = param_2;
6325 i += 2;
6326
6327 {
6328 jint ref_count = frame_info->non_parameter_ref_locals_count;
6329 jint j;
6330
6331 for (j = 0; j < ref_count; j++)
6332 {
6333 locals[i++].reference = NULL;
6334 }
6335 }
6336 }
6337
6338 /* setup java call frame */
6339 {
6340 size_t offset =
6341 env->stack.current_frame->end_offset + frame_info->start_offset;
6342 _svmt_stack_frame *frame =
6343 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
6344 offset);
6345
6346 frame->previous_offset = offset;
6347 frame->end_offset = frame_info->end_offset;
6348 frame->method = method;
6349 frame->stack_trace_element = NULL;
6350 frame->lock_count = 0;
6351 frame->this = *(method->class_info->class_instance);
6352 frame->pc = frame_info->code;
6353 frame->stack_size = 0;
6354
6355 env->stack.current_frame = frame;
6356 }
6357
6358 /* interpret and pop internal call frame */
6359 {
6360 /* call the interpreter */
6361 jint status = _svmf_interpreter (env);
6362
6363 /* retrieve stack frame */
6364 _svmt_stack_frame *frame = env->stack.current_frame;
6365
6366 assert (frame->method == &vm->vm_initiated_call_method);
6367
6368 /* pop frame */
6369 env->stack.current_frame = (_svmt_stack_frame *) (void *)
6370 (((char *) frame) - frame->previous_offset);
6371
6372 /* rethrow exception */
6373 if (status != JNI_OK)
6374 {
6375 return JNI_ERR;
6376 }
6377
6378 /* set the return value */
6379 {
6380 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
6381 (((char *) frame) + frame->end_offset);
6382
6383 *ret = ptr_ret->reference;
6384 }
6385 }
6386
6387 return JNI_OK;
6388 }
6389
6390
6391 /*
6392 ----------------------------------------------------------------------
6393 _svmh_invoke_static_niobytebuffervm_getaddress32
6394 ----------------------------------------------------------------------
6395 */
6396
6397 svm_static jint
_svmh_invoke_static_niobytebuffervm_getaddress32(_svmt_JNIEnv * env,jobject param_1,jint * ret)6398 _svmh_invoke_static_niobytebuffervm_getaddress32 (_svmt_JNIEnv *env, jobject param_1, jint *ret)
6399 {
6400 _svmt_JavaVM *vm = env->vm;
6401 _svmt_stack_frame *initial_frame;
6402 _svmt_method_info *method = vm->class_loading.boot_loader.methods.niobytebuffervm_getaddress32;
6403 _svmt_method_frame_info *frame_info = method->frame_info;
6404
6405 assert (_svmf_is_set_flag
6406 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
6407
6408 /* syncronized? */
6409 if (method->synchronized)
6410 {
6411 if (_svmf_enter_object_monitor
6412 (env, *(method->class_info->class_instance)) != JNI_OK)
6413 {
6414 return JNI_ERR;
6415 }
6416 }
6417
6418 if (_svmf_ensure_stack_capacity
6419 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
6420 {
6421 return JNI_ERR;
6422 }
6423
6424 initial_frame = env->stack.current_frame;
6425
6426 /* setup internal call frame */
6427 {
6428 size_t offset = env->stack.current_frame->end_offset;
6429 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
6430 (((char *) env->stack.current_frame) + offset);
6431
6432 frame->previous_offset = offset;
6433 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
6434 frame->method = &vm->vm_initiated_call_method;
6435 frame->stack_trace_element = NULL;
6436 frame->lock_count = 0;
6437 frame->this = NULL;
6438 frame->pc = vm->vm_initiated_call_method.frame_info->code;
6439 frame->stack_size = 0;
6440
6441 env->stack.current_frame = frame;
6442 }
6443
6444 /* push parameters */
6445 {
6446 _svmt_stack_frame *prev_frame = env->stack.current_frame;
6447 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
6448 (((char *) prev_frame) + prev_frame->end_offset);
6449 jint i = 0;
6450
6451 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
6452
6453 {
6454 jint ref_count = frame_info->non_parameter_ref_locals_count;
6455 jint j;
6456
6457 for (j = 0; j < ref_count; j++)
6458 {
6459 locals[i++].reference = NULL;
6460 }
6461 }
6462 }
6463
6464 /* setup java call frame */
6465 {
6466 size_t offset =
6467 env->stack.current_frame->end_offset + frame_info->start_offset;
6468 _svmt_stack_frame *frame =
6469 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
6470 offset);
6471
6472 frame->previous_offset = offset;
6473 frame->end_offset = frame_info->end_offset;
6474 frame->method = method;
6475 frame->stack_trace_element = NULL;
6476 frame->lock_count = 0;
6477 frame->this = *(method->class_info->class_instance);
6478 frame->pc = frame_info->code;
6479 frame->stack_size = 0;
6480
6481 env->stack.current_frame = frame;
6482 }
6483
6484 /* interpret and pop internal call frame */
6485 {
6486 /* call the interpreter */
6487 jint status = _svmf_interpreter (env);
6488
6489 /* retrieve stack frame */
6490 _svmt_stack_frame *frame = env->stack.current_frame;
6491
6492 assert (frame->method == &vm->vm_initiated_call_method);
6493
6494 /* pop frame */
6495 env->stack.current_frame = (_svmt_stack_frame *) (void *)
6496 (((char *) frame) - frame->previous_offset);
6497
6498 /* rethrow exception */
6499 if (status != JNI_OK)
6500 {
6501 return JNI_ERR;
6502 }
6503
6504 /* set the return value */
6505 {
6506 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
6507 (((char *) frame) + frame->end_offset);
6508
6509 *ret = ptr_ret->jint;
6510 }
6511 }
6512
6513 return JNI_OK;
6514 }
6515
6516
6517 #elif SVM_WORD_BIT_COUNT == 64
6518
6519 /*
6520 ----------------------------------------------------------------------
6521 _svmh_invoke_static_niobytebuffervm_newbuffer64
6522 ----------------------------------------------------------------------
6523 */
6524
6525 svm_static jint
_svmh_invoke_static_niobytebuffervm_newbuffer64(_svmt_JNIEnv * env,jlong param_1,jlong param_2,jobject ret)6526 _svmh_invoke_static_niobytebuffervm_newbuffer64 (_svmt_JNIEnv *env, jlong param_1, jlong param_2, jobject ret)
6527 {
6528 _svmt_JavaVM *vm = env->vm;
6529 _svmt_stack_frame *initial_frame;
6530 _svmt_method_info *method = vm->class_loading.boot_loader.methods.niobytebuffervm_newbuffer64;
6531 _svmt_method_frame_info *frame_info = method->frame_info;
6532
6533 assert (_svmf_is_set_flag
6534 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
6535
6536 /* syncronized? */
6537 if (method->synchronized)
6538 {
6539 if (_svmf_enter_object_monitor
6540 (env, *(method->class_info->class_instance)) != JNI_OK)
6541 {
6542 return JNI_ERR;
6543 }
6544 }
6545
6546 if (_svmf_ensure_stack_capacity
6547 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
6548 {
6549 return JNI_ERR;
6550 }
6551
6552 initial_frame = env->stack.current_frame;
6553
6554 /* setup internal call frame */
6555 {
6556 size_t offset = env->stack.current_frame->end_offset;
6557 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
6558 (((char *) env->stack.current_frame) + offset);
6559
6560 frame->previous_offset = offset;
6561 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
6562 frame->method = &vm->vm_initiated_call_method;
6563 frame->stack_trace_element = NULL;
6564 frame->lock_count = 0;
6565 frame->this = NULL;
6566 frame->pc = vm->vm_initiated_call_method.frame_info->code;
6567 frame->stack_size = 0;
6568
6569 env->stack.current_frame = frame;
6570 }
6571
6572 /* push parameters */
6573 {
6574 _svmt_stack_frame *prev_frame = env->stack.current_frame;
6575 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
6576 (((char *) prev_frame) + prev_frame->end_offset);
6577 jint i = 0;
6578
6579 *((jlong *) &locals[i]) = param_1;
6580 i += 2;
6581 *((jlong *) &locals[i]) = param_2;
6582 i += 2;
6583
6584 {
6585 jint ref_count = frame_info->non_parameter_ref_locals_count;
6586 jint j;
6587
6588 for (j = 0; j < ref_count; j++)
6589 {
6590 locals[i++].reference = NULL;
6591 }
6592 }
6593 }
6594
6595 /* setup java call frame */
6596 {
6597 size_t offset =
6598 env->stack.current_frame->end_offset + frame_info->start_offset;
6599 _svmt_stack_frame *frame =
6600 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
6601 offset);
6602
6603 frame->previous_offset = offset;
6604 frame->end_offset = frame_info->end_offset;
6605 frame->method = method;
6606 frame->stack_trace_element = NULL;
6607 frame->lock_count = 0;
6608 frame->this = *(method->class_info->class_instance);
6609 frame->pc = frame_info->code;
6610 frame->stack_size = 0;
6611
6612 env->stack.current_frame = frame;
6613 }
6614
6615 /* interpret and pop internal call frame */
6616 {
6617 /* call the interpreter */
6618 jint status = _svmf_interpreter (env);
6619
6620 /* retrieve stack frame */
6621 _svmt_stack_frame *frame = env->stack.current_frame;
6622
6623 assert (frame->method == &vm->vm_initiated_call_method);
6624
6625 /* pop frame */
6626 env->stack.current_frame = (_svmt_stack_frame *) (void *)
6627 (((char *) frame) - frame->previous_offset);
6628
6629 /* rethrow exception */
6630 if (status != JNI_OK)
6631 {
6632 return JNI_ERR;
6633 }
6634
6635 /* set the return value */
6636 {
6637 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
6638 (((char *) frame) + frame->end_offset);
6639
6640 *ret = ptr_ret->reference;
6641 }
6642 }
6643
6644 return JNI_OK;
6645 }
6646
6647
6648 /*
6649 ----------------------------------------------------------------------
6650 _svmh_invoke_static_niobytebuffervm_getaddress64
6651 ----------------------------------------------------------------------
6652 */
6653
6654 svm_static jint
_svmh_invoke_static_niobytebuffervm_getaddress64(_svmt_JNIEnv * env,jobject param_1,jlong * ret)6655 _svmh_invoke_static_niobytebuffervm_getaddress64 (_svmt_JNIEnv *env, jobject param_1, jlong *ret)
6656 {
6657 _svmt_JavaVM *vm = env->vm;
6658 _svmt_stack_frame *initial_frame;
6659 _svmt_method_info *method = vm->class_loading.boot_loader.methods.niobytebuffervm_getaddress64;
6660 _svmt_method_frame_info *frame_info = method->frame_info;
6661
6662 assert (_svmf_is_set_flag
6663 (method->class_info->state, SVM_TYPE_STATE_INITIALIZED));
6664
6665 /* syncronized? */
6666 if (method->synchronized)
6667 {
6668 if (_svmf_enter_object_monitor
6669 (env, *(method->class_info->class_instance)) != JNI_OK)
6670 {
6671 return JNI_ERR;
6672 }
6673 }
6674
6675 if (_svmf_ensure_stack_capacity
6676 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
6677 {
6678 return JNI_ERR;
6679 }
6680
6681 initial_frame = env->stack.current_frame;
6682
6683 /* setup internal call frame */
6684 {
6685 size_t offset = env->stack.current_frame->end_offset;
6686 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
6687 (((char *) env->stack.current_frame) + offset);
6688
6689 frame->previous_offset = offset;
6690 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
6691 frame->method = &vm->vm_initiated_call_method;
6692 frame->stack_trace_element = NULL;
6693 frame->lock_count = 0;
6694 frame->this = NULL;
6695 frame->pc = vm->vm_initiated_call_method.frame_info->code;
6696 frame->stack_size = 0;
6697
6698 env->stack.current_frame = frame;
6699 }
6700
6701 /* push parameters */
6702 {
6703 _svmt_stack_frame *prev_frame = env->stack.current_frame;
6704 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
6705 (((char *) prev_frame) + prev_frame->end_offset);
6706 jint i = 0;
6707
6708 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
6709
6710 {
6711 jint ref_count = frame_info->non_parameter_ref_locals_count;
6712 jint j;
6713
6714 for (j = 0; j < ref_count; j++)
6715 {
6716 locals[i++].reference = NULL;
6717 }
6718 }
6719 }
6720
6721 /* setup java call frame */
6722 {
6723 size_t offset =
6724 env->stack.current_frame->end_offset + frame_info->start_offset;
6725 _svmt_stack_frame *frame =
6726 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
6727 offset);
6728
6729 frame->previous_offset = offset;
6730 frame->end_offset = frame_info->end_offset;
6731 frame->method = method;
6732 frame->stack_trace_element = NULL;
6733 frame->lock_count = 0;
6734 frame->this = *(method->class_info->class_instance);
6735 frame->pc = frame_info->code;
6736 frame->stack_size = 0;
6737
6738 env->stack.current_frame = frame;
6739 }
6740
6741 /* interpret and pop internal call frame */
6742 {
6743 /* call the interpreter */
6744 jint status = _svmf_interpreter (env);
6745
6746 /* retrieve stack frame */
6747 _svmt_stack_frame *frame = env->stack.current_frame;
6748
6749 assert (frame->method == &vm->vm_initiated_call_method);
6750
6751 /* pop frame */
6752 env->stack.current_frame = (_svmt_stack_frame *) (void *)
6753 (((char *) frame) - frame->previous_offset);
6754
6755 /* rethrow exception */
6756 if (status != JNI_OK)
6757 {
6758 return JNI_ERR;
6759 }
6760
6761 /* set the return value */
6762 {
6763 _svmt_stack_value *ptr_ret = (_svmt_stack_value *) (void *)
6764 (((char *) frame) + frame->end_offset);
6765
6766 *ret = *((jlong *) ptr_ret);
6767 }
6768 }
6769
6770 return JNI_OK;
6771 }
6772
6773
6774 #endif
6775
6776 /*
6777 ----------------------------------------------------------------------
6778 _svmh_invoke_specific_static_clinit
6779 ----------------------------------------------------------------------
6780 */
6781
6782 svm_static jint
_svmh_invoke_specific_static_clinit(_svmt_JNIEnv * env,_svmt_method_info * method)6783 _svmh_invoke_specific_static_clinit (_svmt_JNIEnv *env,
6784 _svmt_method_info *method)
6785 {
6786 _svmt_JavaVM *vm = env->vm;
6787 _svmt_stack_frame *initial_frame;
6788 _svmt_method_frame_info *frame_info = method->frame_info;
6789
6790 assert (_svmf_is_set_flag
6791 (method->class_info->state, SVM_TYPE_STATE_PREPARED));
6792 assert (strcmp (DREF (method->name, value), "<clinit>") == 0
6793 || _svmf_is_set_flag (method->class_info->state,
6794 SVM_TYPE_STATE_INITIALIZED));
6795
6796 /* syncronized? */
6797 if (method->synchronized)
6798 {
6799 if (_svmf_enter_object_monitor
6800 (env, *(method->class_info->class_instance)) != JNI_OK)
6801 {
6802 return JNI_ERR;
6803 }
6804 }
6805
6806 if (_svmf_ensure_stack_capacity
6807 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
6808 {
6809 return JNI_ERR;
6810 }
6811
6812 initial_frame = env->stack.current_frame;
6813
6814 /* setup internal call frame */
6815 {
6816 size_t offset = env->stack.current_frame->end_offset;
6817 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
6818 (((char *) env->stack.current_frame) + offset);
6819
6820 frame->previous_offset = offset;
6821 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
6822 frame->method = &vm->vm_initiated_call_method;
6823 frame->stack_trace_element = NULL;
6824 frame->lock_count = 0;
6825 frame->this = NULL;
6826 frame->pc = vm->vm_initiated_call_method.frame_info->code;
6827 frame->stack_size = 0;
6828
6829 env->stack.current_frame = frame;
6830 }
6831
6832 /* push parameters */
6833 {
6834 _svmt_stack_frame *prev_frame = env->stack.current_frame;
6835 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
6836 (((char *) prev_frame) + prev_frame->end_offset);
6837 jint i = 0;
6838
6839
6840 {
6841 jint ref_count = frame_info->non_parameter_ref_locals_count;
6842 jint j;
6843
6844 for (j = 0; j < ref_count; j++)
6845 {
6846 locals[i++].reference = NULL;
6847 }
6848 }
6849 }
6850
6851 /* setup java call frame */
6852 {
6853 size_t offset =
6854 env->stack.current_frame->end_offset + frame_info->start_offset;
6855 _svmt_stack_frame *frame =
6856 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
6857 offset);
6858
6859 frame->previous_offset = offset;
6860 frame->end_offset = frame_info->end_offset;
6861 frame->method = method;
6862 frame->stack_trace_element = NULL;
6863 frame->lock_count = 0;
6864 frame->this = *(method->class_info->class_instance);
6865 frame->pc = frame_info->code;
6866 frame->stack_size = 0;
6867
6868 env->stack.current_frame = frame;
6869 }
6870
6871 /* interpret and pop internal call frame */
6872 {
6873 /* call the interpreter */
6874 jint status = _svmf_interpreter (env);
6875
6876 /* retrieve stack frame */
6877 _svmt_stack_frame *frame = env->stack.current_frame;
6878
6879 assert (frame->method == &vm->vm_initiated_call_method);
6880
6881 /* pop frame */
6882 env->stack.current_frame = (_svmt_stack_frame *) (void *)
6883 (((char *) frame) - frame->previous_offset);
6884
6885 /* rethrow exception */
6886 if (status != JNI_OK)
6887 {
6888 return JNI_ERR;
6889 }
6890
6891 }
6892
6893 return JNI_OK;
6894 }
6895
6896
6897 /*
6898 ----------------------------------------------------------------------
6899 _svmh_invoke_specific_static_main
6900 ----------------------------------------------------------------------
6901 */
6902
6903 svm_static jint
_svmh_invoke_specific_static_main(_svmt_JNIEnv * env,_svmt_method_info * method,jobject param_1)6904 _svmh_invoke_specific_static_main (_svmt_JNIEnv *env,
6905 _svmt_method_info *method, jobject param_1)
6906 {
6907 _svmt_JavaVM *vm = env->vm;
6908 _svmt_stack_frame *initial_frame;
6909 _svmt_method_frame_info *frame_info = method->frame_info;
6910
6911 assert (_svmf_is_set_flag
6912 (method->class_info->state, SVM_TYPE_STATE_PREPARED));
6913 assert (strcmp (DREF (method->name, value), "<clinit>") == 0
6914 || _svmf_is_set_flag (method->class_info->state,
6915 SVM_TYPE_STATE_INITIALIZED));
6916
6917 /* syncronized? */
6918 if (method->synchronized)
6919 {
6920 if (_svmf_enter_object_monitor
6921 (env, *(method->class_info->class_instance)) != JNI_OK)
6922 {
6923 return JNI_ERR;
6924 }
6925 }
6926
6927 if (_svmf_ensure_stack_capacity
6928 (env, frame_info->internal_invoke_frame_size) != JNI_OK)
6929 {
6930 return JNI_ERR;
6931 }
6932
6933 initial_frame = env->stack.current_frame;
6934
6935 /* setup internal call frame */
6936 {
6937 size_t offset = env->stack.current_frame->end_offset;
6938 _svmt_stack_frame *frame = (_svmt_stack_frame *) (void *)
6939 (((char *) env->stack.current_frame) + offset);
6940
6941 frame->previous_offset = offset;
6942 frame->end_offset = _svmf_aligned_size_t (sizeof (_svmt_stack_frame));
6943 frame->method = &vm->vm_initiated_call_method;
6944 frame->stack_trace_element = NULL;
6945 frame->lock_count = 0;
6946 frame->this = NULL;
6947 frame->pc = vm->vm_initiated_call_method.frame_info->code;
6948 frame->stack_size = 0;
6949
6950 env->stack.current_frame = frame;
6951 }
6952
6953 /* push parameters */
6954 {
6955 _svmt_stack_frame *prev_frame = env->stack.current_frame;
6956 _svmt_stack_value *locals = (_svmt_stack_value *) (void *)
6957 (((char *) prev_frame) + prev_frame->end_offset);
6958 jint i = 0;
6959
6960 locals[i++].reference = (param_1 == NULL) ? NULL : *param_1;
6961
6962 {
6963 jint ref_count = frame_info->non_parameter_ref_locals_count;
6964 jint j;
6965
6966 for (j = 0; j < ref_count; j++)
6967 {
6968 locals[i++].reference = NULL;
6969 }
6970 }
6971 }
6972
6973 /* setup java call frame */
6974 {
6975 size_t offset =
6976 env->stack.current_frame->end_offset + frame_info->start_offset;
6977 _svmt_stack_frame *frame =
6978 (_svmt_stack_frame *) (void *) (((char *) env->stack.current_frame) +
6979 offset);
6980
6981 frame->previous_offset = offset;
6982 frame->end_offset = frame_info->end_offset;
6983 frame->method = method;
6984 frame->stack_trace_element = NULL;
6985 frame->lock_count = 0;
6986 frame->this = *(method->class_info->class_instance);
6987 frame->pc = frame_info->code;
6988 frame->stack_size = 0;
6989
6990 env->stack.current_frame = frame;
6991 }
6992
6993 /* interpret and pop internal call frame */
6994 {
6995 /* call the interpreter */
6996 jint status = _svmf_interpreter (env);
6997
6998 /* retrieve stack frame */
6999 _svmt_stack_frame *frame = env->stack.current_frame;
7000
7001 assert (frame->method == &vm->vm_initiated_call_method);
7002
7003 /* pop frame */
7004 env->stack.current_frame = (_svmt_stack_frame *) (void *)
7005 (((char *) frame) - frame->previous_offset);
7006
7007 /* rethrow exception */
7008 if (status != JNI_OK)
7009 {
7010 return JNI_ERR;
7011 }
7012
7013 }
7014
7015 return JNI_OK;
7016 }
7017
7018