Mercurial > hg > graal-jvmci-8
comparison src/share/vm/interpreter/interpreter.cpp @ 11080:b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
Summary: add intrinsics using new instruction to interpreter, C1, C2, for suitable x86; add test
Reviewed-by: kvn, twisti
author | drchase |
---|---|
date | Tue, 02 Jul 2013 20:42:12 -0400 |
parents | a5de0cc2f91c |
children | 6b0fd0964b87 bd3237e0e18d |
comparison
equal
deleted
inserted
replaced
11079:738e04fb1232 | 11080:b800986664f4 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
193 ((int)id - vmIntrinsics::FIRST_MH_SIG_POLY) ); | 193 ((int)id - vmIntrinsics::FIRST_MH_SIG_POLY) ); |
194 assert(kind <= method_handle_invoke_LAST, "parallel enum ranges"); | 194 assert(kind <= method_handle_invoke_LAST, "parallel enum ranges"); |
195 return kind; | 195 return kind; |
196 } | 196 } |
197 | 197 |
198 #ifndef CC_INTERP | |
199 if (UseCRC32Intrinsics && m->is_native()) { | |
200 // Use optimized stub code for CRC32 native methods. | |
201 switch (m->intrinsic_id()) { | |
202 case vmIntrinsics::_updateCRC32 : return java_util_zip_CRC32_update; | |
203 case vmIntrinsics::_updateBytesCRC32 : return java_util_zip_CRC32_updateBytes; | |
204 case vmIntrinsics::_updateByteBufferCRC32 : return java_util_zip_CRC32_updateByteBuffer; | |
205 } | |
206 } | |
207 #endif | |
208 | |
198 // Native method? | 209 // Native method? |
199 // Note: This test must come _before_ the test for intrinsic | 210 // Note: This test must come _before_ the test for intrinsic |
200 // methods. See also comments below. | 211 // methods. See also comments below. |
201 if (m->is_native()) { | 212 if (m->is_native()) { |
202 assert(!m->is_method_handle_intrinsic(), "overlapping bits here, watch out"); | 213 assert(!m->is_method_handle_intrinsic(), "overlapping bits here, watch out"); |
295 case java_lang_math_tan : tty->print("java_lang_math_tan" ); break; | 306 case java_lang_math_tan : tty->print("java_lang_math_tan" ); break; |
296 case java_lang_math_abs : tty->print("java_lang_math_abs" ); break; | 307 case java_lang_math_abs : tty->print("java_lang_math_abs" ); break; |
297 case java_lang_math_sqrt : tty->print("java_lang_math_sqrt" ); break; | 308 case java_lang_math_sqrt : tty->print("java_lang_math_sqrt" ); break; |
298 case java_lang_math_log : tty->print("java_lang_math_log" ); break; | 309 case java_lang_math_log : tty->print("java_lang_math_log" ); break; |
299 case java_lang_math_log10 : tty->print("java_lang_math_log10" ); break; | 310 case java_lang_math_log10 : tty->print("java_lang_math_log10" ); break; |
311 case java_util_zip_CRC32_update : tty->print("java_util_zip_CRC32_update"); break; | |
312 case java_util_zip_CRC32_updateBytes : tty->print("java_util_zip_CRC32_updateBytes"); break; | |
313 case java_util_zip_CRC32_updateByteBuffer : tty->print("java_util_zip_CRC32_updateByteBuffer"); break; | |
300 default: | 314 default: |
301 if (kind >= method_handle_invoke_FIRST && | 315 if (kind >= method_handle_invoke_FIRST && |
302 kind <= method_handle_invoke_LAST) { | 316 kind <= method_handle_invoke_LAST) { |
303 const char* kind_name = vmIntrinsics::name_at(method_handle_intrinsic(kind)); | 317 const char* kind_name = vmIntrinsics::name_at(method_handle_intrinsic(kind)); |
304 if (kind_name[0] == '_') kind_name = &kind_name[1]; // '_invokeExact' => 'invokeExact' | 318 if (kind_name[0] == '_') kind_name = &kind_name[1]; // '_invokeExact' => 'invokeExact' |