src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 52910 583fd71c47d6
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2019, 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.
    27 import static jdk.vm.ci.aarch64.AArch64.r0;
    27 import static jdk.vm.ci.aarch64.AArch64.r0;
    28 import static jdk.vm.ci.aarch64.AArch64.r3;
    28 import static jdk.vm.ci.aarch64.AArch64.r3;
    29 import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.NativeCall;
    29 import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.NativeCall;
    30 import static jdk.vm.ci.meta.Value.ILLEGAL;
    30 import static jdk.vm.ci.meta.Value.ILLEGAL;
    31 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.JUMP_ADDRESS;
    31 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.JUMP_ADDRESS;
    32 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Reexecutability.REEXECUTABLE_ONLY_AFTER_EXCEPTION;
    32 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Reexecutability.NOT_REEXECUTABLE;
    33 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.PRESERVES_REGISTERS;
    33 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.DESTROYS_ALL_CALLER_SAVE_REGISTERS;
    34 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.LEAF;
    34 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.LEAF;
    35 import static org.graalvm.compiler.hotspot.replacements.CRC32CSubstitutions.UPDATE_BYTES_CRC32C;
    35 import static org.graalvm.compiler.hotspot.replacements.CRC32CSubstitutions.UPDATE_BYTES_CRC32C;
    36 import static org.graalvm.compiler.hotspot.replacements.CRC32Substitutions.UPDATE_BYTES_CRC32;
    36 import static org.graalvm.compiler.hotspot.replacements.CRC32Substitutions.UPDATE_BYTES_CRC32;
    37 import static jdk.internal.vm.compiler.word.LocationIdentity.any;
    37 import static jdk.internal.vm.compiler.word.LocationIdentity.any;
    38 
    38 
    74         // The calling convention for the exception handler stub is (only?) defined in
    74         // The calling convention for the exception handler stub is (only?) defined in
    75         // TemplateInterpreterGenerator::generate_throw_exception()
    75         // TemplateInterpreterGenerator::generate_throw_exception()
    76         RegisterValue exception = r0.asValue(LIRKind.reference(word));
    76         RegisterValue exception = r0.asValue(LIRKind.reference(word));
    77         RegisterValue exceptionPc = r3.asValue(LIRKind.value(word));
    77         RegisterValue exceptionPc = r3.asValue(LIRKind.value(word));
    78         CallingConvention exceptionCc = new CallingConvention(0, ILLEGAL, exception, exceptionPc);
    78         CallingConvention exceptionCc = new CallingConvention(0, ILLEGAL, exception, exceptionPc);
    79         register(new HotSpotForeignCallLinkageImpl(HotSpotBackend.EXCEPTION_HANDLER, 0L, PRESERVES_REGISTERS, LEAF, REEXECUTABLE_ONLY_AFTER_EXCEPTION, exceptionCc, null, any()));
    79         register(new HotSpotForeignCallLinkageImpl(HotSpotBackend.EXCEPTION_HANDLER, 0L, DESTROYS_ALL_CALLER_SAVE_REGISTERS, LEAF, NOT_REEXECUTABLE, exceptionCc, null, any()));
    80         register(new HotSpotForeignCallLinkageImpl(HotSpotBackend.EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, PRESERVES_REGISTERS, LEAF, REEXECUTABLE_ONLY_AFTER_EXCEPTION, exceptionCc, null, any()));
    80         register(new HotSpotForeignCallLinkageImpl(HotSpotBackend.EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, DESTROYS_ALL_CALLER_SAVE_REGISTERS, LEAF, NOT_REEXECUTABLE, exceptionCc,
       
    81                         null,
       
    82                         any()));
    81 
    83 
    82         // These stubs do callee saving
    84         // These stubs do callee saving
    83         if (config.useCRC32Intrinsics) {
    85         if (config.useCRC32Intrinsics) {
    84             registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, PRESERVES_REGISTERS, LEAF, REEXECUTABLE_ONLY_AFTER_EXCEPTION, any());
    86             registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, LEAF, NOT_REEXECUTABLE, any());
    85         }
    87         }
    86         if (config.useCRC32CIntrinsics) {
    88         if (config.useCRC32CIntrinsics) {
    87             registerForeignCall(UPDATE_BYTES_CRC32C, config.updateBytesCRC32C, NativeCall, PRESERVES_REGISTERS, LEAF, REEXECUTABLE_ONLY_AFTER_EXCEPTION, any());
    89             registerForeignCall(UPDATE_BYTES_CRC32C, config.updateBytesCRC32C, NativeCall, LEAF, NOT_REEXECUTABLE, any());
    88         }
    90         }
    89 
    91 
    90         super.initialize(providers, options);
    92         super.initialize(providers, options);
    91     }
    93     }
    92 
    94