src/cpu/zero/vm/cppInterpreter_zero.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7017732_incremental Sdiff src/cpu/zero/vm

src/cpu/zero/vm/cppInterpreter_zero.cpp

Print this page




 264   address function;
 265   function = method->native_function();
 266   assert(function != NULL, "should be set if signature handler is");
 267 
 268   // Build the argument list
 269   stack->overflow_check(handler->argument_count() * 2, THREAD);
 270   if (HAS_PENDING_EXCEPTION)
 271     goto unlock_unwind_and_return;
 272 
 273   void **arguments;
 274   void *mirror; {
 275     arguments =
 276       (void **) stack->alloc(handler->argument_count() * sizeof(void **));
 277     void **dst = arguments;
 278 
 279     void *env = thread->jni_environment();
 280     *(dst++) = &env;
 281 
 282     if (method->is_static()) {
 283       istate->set_oop_temp(
 284         method->constants()->pool_holder()->klass_part()->java_mirror());
 285       mirror = istate->oop_temp_addr();
 286       *(dst++) = &mirror;
 287     }
 288 
 289     intptr_t *src = locals;
 290     for (int i = dst - arguments; i < handler->argument_count(); i++) {
 291       ffi_type *type = handler->argument_type(i);
 292       if (type == &ffi_type_pointer) {
 293         if (*src) {
 294           stack->push((intptr_t) src);
 295           *(dst++) = stack->sp();
 296         }
 297         else {
 298           *(dst++) = src;
 299         }
 300         src--;
 301       }
 302       else if (type->size == 4) {
 303         *(dst++) = src--;
 304       }


 650   assert(fp - stack->sp() == istate_off, "should be");
 651 
 652   istate->set_locals(locals);
 653   istate->set_method(method);
 654   istate->set_self_link(istate);
 655   istate->set_prev_link(NULL);
 656   istate->set_thread(thread);
 657   istate->set_bcp(method->is_native() ? NULL : method->code_base());
 658   istate->set_constants(method->constants()->cache());
 659   istate->set_msg(BytecodeInterpreter::method_entry);
 660   istate->set_oop_temp(NULL);
 661   istate->set_mdx(NULL);
 662   istate->set_callee(NULL);
 663 
 664   istate->set_monitor_base((BasicObjectLock *) stack->sp());
 665   if (method->is_synchronized()) {
 666     BasicObjectLock *monitor =
 667       (BasicObjectLock *) stack->alloc(monitor_words * wordSize);
 668     oop object;
 669     if (method->is_static())
 670       object = method->constants()->pool_holder()->klass_part()->java_mirror();
 671     else
 672       object = (oop) locals[0];
 673     monitor->set_obj(object);
 674   }
 675 
 676   istate->set_stack_base(stack->sp());
 677   istate->set_stack(stack->sp() - 1);
 678   if (stack_words)
 679     stack->alloc(stack_words * wordSize);
 680   istate->set_stack_limit(stack->sp() - 1);
 681 
 682   return (InterpreterFrame *) fp;
 683 }
 684 
 685 int AbstractInterpreter::BasicType_as_index(BasicType type) {
 686   int i = 0;
 687   switch (type) {
 688     case T_BOOLEAN: i = 0; break;
 689     case T_CHAR   : i = 1; break;
 690     case T_BYTE   : i = 2; break;




 264   address function;
 265   function = method->native_function();
 266   assert(function != NULL, "should be set if signature handler is");
 267 
 268   // Build the argument list
 269   stack->overflow_check(handler->argument_count() * 2, THREAD);
 270   if (HAS_PENDING_EXCEPTION)
 271     goto unlock_unwind_and_return;
 272 
 273   void **arguments;
 274   void *mirror; {
 275     arguments =
 276       (void **) stack->alloc(handler->argument_count() * sizeof(void **));
 277     void **dst = arguments;
 278 
 279     void *env = thread->jni_environment();
 280     *(dst++) = &env;
 281 
 282     if (method->is_static()) {
 283       istate->set_oop_temp(
 284         method->constants()->pool_holder()->java_mirror());
 285       mirror = istate->oop_temp_addr();
 286       *(dst++) = &mirror;
 287     }
 288 
 289     intptr_t *src = locals;
 290     for (int i = dst - arguments; i < handler->argument_count(); i++) {
 291       ffi_type *type = handler->argument_type(i);
 292       if (type == &ffi_type_pointer) {
 293         if (*src) {
 294           stack->push((intptr_t) src);
 295           *(dst++) = stack->sp();
 296         }
 297         else {
 298           *(dst++) = src;
 299         }
 300         src--;
 301       }
 302       else if (type->size == 4) {
 303         *(dst++) = src--;
 304       }


 650   assert(fp - stack->sp() == istate_off, "should be");
 651 
 652   istate->set_locals(locals);
 653   istate->set_method(method);
 654   istate->set_self_link(istate);
 655   istate->set_prev_link(NULL);
 656   istate->set_thread(thread);
 657   istate->set_bcp(method->is_native() ? NULL : method->code_base());
 658   istate->set_constants(method->constants()->cache());
 659   istate->set_msg(BytecodeInterpreter::method_entry);
 660   istate->set_oop_temp(NULL);
 661   istate->set_mdx(NULL);
 662   istate->set_callee(NULL);
 663 
 664   istate->set_monitor_base((BasicObjectLock *) stack->sp());
 665   if (method->is_synchronized()) {
 666     BasicObjectLock *monitor =
 667       (BasicObjectLock *) stack->alloc(monitor_words * wordSize);
 668     oop object;
 669     if (method->is_static())
 670       object = method->constants()->pool_holder()->java_mirror();
 671     else
 672       object = (oop) locals[0];
 673     monitor->set_obj(object);
 674   }
 675 
 676   istate->set_stack_base(stack->sp());
 677   istate->set_stack(stack->sp() - 1);
 678   if (stack_words)
 679     stack->alloc(stack_words * wordSize);
 680   istate->set_stack_limit(stack->sp() - 1);
 681 
 682   return (InterpreterFrame *) fp;
 683 }
 684 
 685 int AbstractInterpreter::BasicType_as_index(BasicType type) {
 686   int i = 0;
 687   switch (type) {
 688     case T_BOOLEAN: i = 0; break;
 689     case T_CHAR   : i = 1; break;
 690     case T_BYTE   : i = 2; break;


src/cpu/zero/vm/cppInterpreter_zero.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File