< prev index next >

src/cpu/zero/vm/interpreterRT_zero.cpp

Print this page




 131 
 132 void InterpreterRuntime::SignatureHandler::finalize() {
 133   ffi_status status =
 134     ffi_prep_cif(cif(),
 135                  FFI_DEFAULT_ABI,
 136                  argument_count(),
 137                  result_type(),
 138                  argument_types());
 139 
 140   assert(status == FFI_OK, "should be");
 141 }
 142 
 143 IRT_ENTRY(address,
 144           InterpreterRuntime::slow_signature_handler(JavaThread* thread,
 145                                                      Method*     method,
 146                                                      intptr_t*   unused1,
 147                                                      intptr_t*   unused2))
 148   ZeroStack *stack = thread->zero_stack();
 149 
 150   int required_words =
 151     (align_size_up(sizeof(ffi_cif), wordSize) >> LogBytesPerWord) +
 152     (method->is_static() ? 2 : 1) + method->size_of_parameters() + 1;
 153 
 154   stack->overflow_check(required_words, CHECK_NULL);
 155 
 156   intptr_t *buf = (intptr_t *) stack->alloc(required_words * wordSize);
 157   SlowSignatureHandlerGenerator sshg(methodHandle(thread, method), buf);
 158   sshg.generate((uint64_t)CONST64(-1));
 159 
 160   SignatureHandler *handler = sshg.handler();
 161   handler->finalize();
 162 
 163   return (address) handler;
 164 IRT_END
 165 
 166 void SignatureHandlerLibrary::pd_set_handler(address handlerAddr) {
 167   InterpreterRuntime::SignatureHandler *handler =
 168     InterpreterRuntime::SignatureHandler::from_handlerAddr(handlerAddr);
 169 
 170   handler->finalize();
 171 }


 131 
 132 void InterpreterRuntime::SignatureHandler::finalize() {
 133   ffi_status status =
 134     ffi_prep_cif(cif(),
 135                  FFI_DEFAULT_ABI,
 136                  argument_count(),
 137                  result_type(),
 138                  argument_types());
 139 
 140   assert(status == FFI_OK, "should be");
 141 }
 142 
 143 IRT_ENTRY(address,
 144           InterpreterRuntime::slow_signature_handler(JavaThread* thread,
 145                                                      Method*     method,
 146                                                      intptr_t*   unused1,
 147                                                      intptr_t*   unused2))
 148   ZeroStack *stack = thread->zero_stack();
 149 
 150   int required_words =
 151     (align_up(sizeof(ffi_cif), wordSize) >> LogBytesPerWord) +
 152     (method->is_static() ? 2 : 1) + method->size_of_parameters() + 1;
 153 
 154   stack->overflow_check(required_words, CHECK_NULL);
 155 
 156   intptr_t *buf = (intptr_t *) stack->alloc(required_words * wordSize);
 157   SlowSignatureHandlerGenerator sshg(methodHandle(thread, method), buf);
 158   sshg.generate((uint64_t)CONST64(-1));
 159 
 160   SignatureHandler *handler = sshg.handler();
 161   handler->finalize();
 162 
 163   return (address) handler;
 164 IRT_END
 165 
 166 void SignatureHandlerLibrary::pd_set_handler(address handlerAddr) {
 167   InterpreterRuntime::SignatureHandler *handler =
 168     InterpreterRuntime::SignatureHandler::from_handlerAddr(handlerAddr);
 169 
 170   handler->finalize();
 171 }
< prev index next >