Wed, 27 Nov 2013 16:16:21 -0800
8029015: PPC64 (part 216): opto: trap based null and range checks
Summary: On PPC64 use tdi instruction that does a compare and raises SIGTRAP for NULL and range checks.
Reviewed-by: kvn
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. |
aoqi@0 | 3 | * Copyright 2012, 2013 SAP AG. All rights reserved. |
aoqi@0 | 4 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
aoqi@0 | 5 | * |
aoqi@0 | 6 | * This code is free software; you can redistribute it and/or modify it |
aoqi@0 | 7 | * under the terms of the GNU General Public License version 2 only, as |
aoqi@0 | 8 | * published by the Free Software Foundation. |
aoqi@0 | 9 | * |
aoqi@0 | 10 | * This code is distributed in the hope that it will be useful, but WITHOUT |
aoqi@0 | 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
aoqi@0 | 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
aoqi@0 | 13 | * version 2 for more details (a copy is included in the LICENSE file that |
aoqi@0 | 14 | * accompanied this code). |
aoqi@0 | 15 | * |
aoqi@0 | 16 | * You should have received a copy of the GNU General Public License version |
aoqi@0 | 17 | * 2 along with this work; if not, write to the Free Software Foundation, |
aoqi@0 | 18 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
aoqi@0 | 19 | * |
aoqi@0 | 20 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
aoqi@0 | 21 | * or visit www.oracle.com if you need additional information or have any |
aoqi@0 | 22 | * questions. |
aoqi@0 | 23 | * |
aoqi@0 | 24 | */ |
aoqi@0 | 25 | |
aoqi@0 | 26 | // Platform-specific definitions for method handles. |
aoqi@0 | 27 | // These definitions are inlined into class MethodHandles. |
aoqi@0 | 28 | |
aoqi@0 | 29 | // Adapters |
aoqi@0 | 30 | //static unsigned int adapter_code_size() { |
aoqi@0 | 31 | // return 32*K DEBUG_ONLY(+ 16*K) + (TraceMethodHandles ? 16*K : 0) + (VerifyMethodHandles ? 32*K : 0); |
aoqi@0 | 32 | //} |
aoqi@0 | 33 | enum /* platform_dependent_constants */ { |
aoqi@0 | 34 | adapter_code_size = NOT_LP64(16000 DEBUG_ONLY(+ 25000)) LP64_ONLY(32000 DEBUG_ONLY(+ 150000)) |
aoqi@0 | 35 | }; |
aoqi@0 | 36 | |
aoqi@0 | 37 | // Additional helper methods for MethodHandles code generation: |
aoqi@0 | 38 | public: |
aoqi@0 | 39 | static void load_klass_from_Class(MacroAssembler* _masm, Register klass_reg, Register temp_reg, Register temp2_reg); |
aoqi@0 | 40 | |
aoqi@0 | 41 | static void verify_klass(MacroAssembler* _masm, |
aoqi@0 | 42 | Register obj_reg, SystemDictionary::WKID klass_id, |
aoqi@0 | 43 | Register temp_reg, Register temp2_reg, |
aoqi@0 | 44 | const char* error_message = "wrong klass") NOT_DEBUG_RETURN; |
aoqi@0 | 45 | |
aoqi@0 | 46 | static void verify_method_handle(MacroAssembler* _masm, Register mh_reg, |
aoqi@0 | 47 | Register temp_reg, Register temp2_reg) { |
aoqi@0 | 48 | Unimplemented(); |
aoqi@0 | 49 | } |
aoqi@0 | 50 | |
aoqi@0 | 51 | static void verify_ref_kind(MacroAssembler* _masm, int ref_kind, Register member_reg, Register temp) NOT_DEBUG_RETURN; |
aoqi@0 | 52 | |
aoqi@0 | 53 | // Similar to InterpreterMacroAssembler::jump_from_interpreted. |
aoqi@0 | 54 | // Takes care of special dispatch from single stepping too. |
aoqi@0 | 55 | static void jump_from_method_handle(MacroAssembler* _masm, Register method, |
aoqi@0 | 56 | Register temp, Register temp2, |
aoqi@0 | 57 | bool for_compiler_entry); |
aoqi@0 | 58 | |
aoqi@0 | 59 | static void jump_to_lambda_form(MacroAssembler* _masm, |
aoqi@0 | 60 | Register recv, Register method_temp, |
aoqi@0 | 61 | Register temp2, Register temp3, |
aoqi@0 | 62 | bool for_compiler_entry); |