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

## src/share/vm/runtime/sharedRuntime.cpp

Print this page

    2344   }
    2345 };
    2346
    2347
    2348 // ---------------------------------------------------------------------------
    2349 // Implementation of AdapterHandlerLibrary
    2350 AdapterHandlerTable* AdapterHandlerLibrary::_adapters = NULL;
    2351 AdapterHandlerEntry* AdapterHandlerLibrary::_abstract_method_handler = NULL;
    2352 const int AdapterHandlerLibrary_size = 16*K;
    2353 BufferBlob* AdapterHandlerLibrary::_buffer = NULL;
    2354
    2355 BufferBlob* AdapterHandlerLibrary::buffer_blob() {
    2356   // Should be called only when AdapterHandlerLibrary_lock is active.
    2357   if (_buffer == NULL) // Initialize lazily
    2358       _buffer = BufferBlob::create("adapters", AdapterHandlerLibrary_size);
    2359   return _buffer;
    2360 }
    2361
    2362 void AdapterHandlerLibrary::initialize() {
    2363   if (_adapters != NULL) return;

    2364   _adapters = new AdapterHandlerTable();
    2365
    2366   // Create a special handler for abstract methods.  Abstract methods
    2367   // are never compiled so an i2c entry is somewhat meaningless, but
    2368   // throw AbstractMethodError just in case.
    2369   // Pass wrong_method_abstract for the c2i transitions to return
    2370   // AbstractMethodError for invalid invocations.
    2371   address wrong_method_abstract = SharedRuntime::get_handle_wrong_method_abstract_stub();
    2372   _abstract_method_handler = AdapterHandlerLibrary::new_entry(new AdapterFingerPrint(0, NULL),
    2373                                                               StubRoutines::throw_AbstractMethodError_entry(),
    2374                                                               wrong_method_abstract, wrong_method_abstract);
    2375 }
    2376
    2377 AdapterHandlerEntry* AdapterHandlerLibrary::new_entry(AdapterFingerPrint* fingerprint,
    2378                                                       address i2c_entry,
    2379                                                       address c2i_entry,
    2380                                                       address c2i_unverified_entry) {
    2381   return _adapters->new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry);
    2382 }
    2383
    2344   }
    2345 };
    2346
    2347
    2348 // ---------------------------------------------------------------------------
    2349 // Implementation of AdapterHandlerLibrary
    2350 AdapterHandlerTable* AdapterHandlerLibrary::_adapters = NULL;
    2351 AdapterHandlerEntry* AdapterHandlerLibrary::_abstract_method_handler = NULL;
    2352 const int AdapterHandlerLibrary_size = 16*K;
    2353 BufferBlob* AdapterHandlerLibrary::_buffer = NULL;
    2354
    2355 BufferBlob* AdapterHandlerLibrary::buffer_blob() {
    2356   // Should be called only when AdapterHandlerLibrary_lock is active.
    2357   if (_buffer == NULL) // Initialize lazily
    2358       _buffer = BufferBlob::create("adapters", AdapterHandlerLibrary_size);
    2359   return _buffer;
    2360 }
    2361
    2362 void AdapterHandlerLibrary::initialize() {
    2363   if (_adapters != NULL) return;
    2364 #ifdef PRINT_HASHTABLES_CREATION
    2365   fprintf(stderr, ">>>>> Creating AdapterHandlerTable\n");
    2366 #endif
    2367   _adapters = new AdapterHandlerTable();
    2368
    2369   // Create a special handler for abstract methods.  Abstract methods
    2370   // are never compiled so an i2c entry is somewhat meaningless, but
    2371   // throw AbstractMethodError just in case.
    2372   // Pass wrong_method_abstract for the c2i transitions to return
    2373   // AbstractMethodError for invalid invocations.
    2374   address wrong_method_abstract = SharedRuntime::get_handle_wrong_method_abstract_stub();
    2375   _abstract_method_handler = AdapterHandlerLibrary::new_entry(new AdapterFingerPrint(0, NULL),
    2376                                                               StubRoutines::throw_AbstractMethodError_entry(),
    2377                                                               wrong_method_abstract, wrong_method_abstract);
    2378 }
    2379
    2380 AdapterHandlerEntry* AdapterHandlerLibrary::new_entry(AdapterFingerPrint* fingerprint,
    2381                                                       address i2c_entry,
    2382                                                       address c2i_entry,
    2383                                                       address c2i_unverified_entry) {
    2384   return _adapters->new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry);
    2385 }
    2386

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