1352 address handler = _handler;
1353 int insts_size = buffer->pure_insts_size();
1354 if (handler + insts_size > _handler_blob->code_end()) {
1355 // get a new handler blob
1356 handler = set_handler_blob();
1357 }
1358 if (handler != NULL) {
1359 memcpy(handler, buffer->insts_begin(), insts_size);
1360 pd_set_handler(handler);
1361 ICache::invalidate_range(handler, insts_size);
1362 _handler = handler + insts_size;
1363 }
1364 return handler;
1365 }
1366
1367 void SignatureHandlerLibrary::add(const methodHandle& method) {
1368 if (method->signature_handler() == NULL) {
1369 // use slow signature handler if we can't do better
1370 int handler_index = -1;
1371 // check if we can use customized (fast) signature handler
1372 if (UseFastSignatureHandlers && method->size_of_parameters() <= Fingerprinter::max_size_of_parameters) {
1373 // use customized signature handler
1374 MutexLocker mu(SignatureHandlerLibrary_lock);
1375 // make sure data structure is initialized
1376 initialize();
1377 // lookup method signature's fingerprint
1378 uint64_t fingerprint = Fingerprinter(method).fingerprint();
1379 // allow CPU dependant code to optimize the fingerprints for the fast handler
1380 fingerprint = InterpreterRuntime::normalize_fast_native_fingerprint(fingerprint);
1381 handler_index = _fingerprints->find(fingerprint);
1382 // create handler if necessary
1383 if (handler_index < 0) {
1384 ResourceMark rm;
1385 ptrdiff_t align_offset = align_up(_buffer, CodeEntryAlignment) - (address)_buffer;
1386 CodeBuffer buffer((address)(_buffer + align_offset),
1387 SignatureHandlerLibrary::buffer_size - align_offset);
1388 InterpreterRuntime::SignatureHandlerGenerator(method, &buffer).generate(fingerprint);
1389 // copy into code heap
1390 address handler = set_handler(&buffer);
1391 if (handler == NULL) {
1392 // use slow signature handler (without memorizing it in the fingerprints)
|
1352 address handler = _handler;
1353 int insts_size = buffer->pure_insts_size();
1354 if (handler + insts_size > _handler_blob->code_end()) {
1355 // get a new handler blob
1356 handler = set_handler_blob();
1357 }
1358 if (handler != NULL) {
1359 memcpy(handler, buffer->insts_begin(), insts_size);
1360 pd_set_handler(handler);
1361 ICache::invalidate_range(handler, insts_size);
1362 _handler = handler + insts_size;
1363 }
1364 return handler;
1365 }
1366
1367 void SignatureHandlerLibrary::add(const methodHandle& method) {
1368 if (method->signature_handler() == NULL) {
1369 // use slow signature handler if we can't do better
1370 int handler_index = -1;
1371 // check if we can use customized (fast) signature handler
1372 if (UseFastSignatureHandlers && method->size_of_parameters() <= Fingerprinter::fp_max_size_of_parameters) {
1373 // use customized signature handler
1374 MutexLocker mu(SignatureHandlerLibrary_lock);
1375 // make sure data structure is initialized
1376 initialize();
1377 // lookup method signature's fingerprint
1378 uint64_t fingerprint = Fingerprinter(method).fingerprint();
1379 // allow CPU dependant code to optimize the fingerprints for the fast handler
1380 fingerprint = InterpreterRuntime::normalize_fast_native_fingerprint(fingerprint);
1381 handler_index = _fingerprints->find(fingerprint);
1382 // create handler if necessary
1383 if (handler_index < 0) {
1384 ResourceMark rm;
1385 ptrdiff_t align_offset = align_up(_buffer, CodeEntryAlignment) - (address)_buffer;
1386 CodeBuffer buffer((address)(_buffer + align_offset),
1387 SignatureHandlerLibrary::buffer_size - align_offset);
1388 InterpreterRuntime::SignatureHandlerGenerator(method, &buffer).generate(fingerprint);
1389 // copy into code heap
1390 address handler = set_handler(&buffer);
1391 if (handler == NULL) {
1392 // use slow signature handler (without memorizing it in the fingerprints)
|