src/share/vm/interpreter/interpreterRuntime.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hs25_8011661 Sdiff src/share/vm/interpreter

src/share/vm/interpreter/interpreterRuntime.cpp

Print this page




1035 
1036 
1037 // Implementation of SignatureHandlerLibrary
1038 
1039 address SignatureHandlerLibrary::set_handler_blob() {
1040   BufferBlob* handler_blob = BufferBlob::create("native signature handlers", blob_size);
1041   if (handler_blob == NULL) {
1042     return NULL;
1043   }
1044   address handler = handler_blob->code_begin();
1045   _handler_blob = handler_blob;
1046   _handler = handler;
1047   return handler;
1048 }
1049 
1050 void SignatureHandlerLibrary::initialize() {
1051   if (_fingerprints != NULL) {
1052     return;
1053   }
1054   if (set_handler_blob() == NULL) {
1055     vm_exit_out_of_memory(blob_size, "native signature handlers");
1056   }
1057 
1058   BufferBlob* bb = BufferBlob::create("Signature Handler Temp Buffer",
1059                                       SignatureHandlerLibrary::buffer_size);
1060   _buffer = bb->code_begin();
1061 
1062   _fingerprints = new(ResourceObj::C_HEAP, mtCode)GrowableArray<uint64_t>(32, true);
1063   _handlers     = new(ResourceObj::C_HEAP, mtCode)GrowableArray<address>(32, true);
1064 }
1065 
1066 address SignatureHandlerLibrary::set_handler(CodeBuffer* buffer) {
1067   address handler   = _handler;
1068   int     insts_size = buffer->pure_insts_size();
1069   if (handler + insts_size > _handler_blob->code_end()) {
1070     // get a new handler blob
1071     handler = set_handler_blob();
1072   }
1073   if (handler != NULL) {
1074     memcpy(handler, buffer->insts_begin(), insts_size);
1075     pd_set_handler(handler);




1035 
1036 
1037 // Implementation of SignatureHandlerLibrary
1038 
1039 address SignatureHandlerLibrary::set_handler_blob() {
1040   BufferBlob* handler_blob = BufferBlob::create("native signature handlers", blob_size);
1041   if (handler_blob == NULL) {
1042     return NULL;
1043   }
1044   address handler = handler_blob->code_begin();
1045   _handler_blob = handler_blob;
1046   _handler = handler;
1047   return handler;
1048 }
1049 
1050 void SignatureHandlerLibrary::initialize() {
1051   if (_fingerprints != NULL) {
1052     return;
1053   }
1054   if (set_handler_blob() == NULL) {
1055     vm_exit_out_of_memory(blob_size, OOM_MALLOC_ERROR, "native signature handlers");
1056   }
1057 
1058   BufferBlob* bb = BufferBlob::create("Signature Handler Temp Buffer",
1059                                       SignatureHandlerLibrary::buffer_size);
1060   _buffer = bb->code_begin();
1061 
1062   _fingerprints = new(ResourceObj::C_HEAP, mtCode)GrowableArray<uint64_t>(32, true);
1063   _handlers     = new(ResourceObj::C_HEAP, mtCode)GrowableArray<address>(32, true);
1064 }
1065 
1066 address SignatureHandlerLibrary::set_handler(CodeBuffer* buffer) {
1067   address handler   = _handler;
1068   int     insts_size = buffer->pure_insts_size();
1069   if (handler + insts_size > _handler_blob->code_end()) {
1070     // get a new handler blob
1071     handler = set_handler_blob();
1072   }
1073   if (handler != NULL) {
1074     memcpy(handler, buffer->insts_begin(), insts_size);
1075     pd_set_handler(handler);


src/share/vm/interpreter/interpreterRuntime.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File