< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java

Print this page
rev 56282 : [mq]: graal

*** 1,7 **** /* ! * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 22,31 **** --- 22,33 ---- */ package org.graalvm.compiler.hotspot.replacements; + import static org.graalvm.compiler.api.directives.GraalDirectives.SLOWPATH_PROBABILITY; + import static org.graalvm.compiler.api.directives.GraalDirectives.injectBranchProbability; import static org.graalvm.compiler.replacements.SnippetTemplate.DEFAULT_REPLACER; import static org.graalvm.compiler.replacements.nodes.CStringConstant.cstring; import org.graalvm.compiler.api.replacements.Snippet; import org.graalvm.compiler.api.replacements.Snippet.ConstantParameter;
*** 56,73 **** */ public static final ForeignCallDescriptor ASSERTION_VM_MESSAGE_C = new ForeignCallDescriptor("assertionVmMessageC", void.class, boolean.class, Word.class, long.class, long.class, long.class); @Snippet public static void assertion(boolean condition, @ConstantParameter String message) { ! if (!condition) { vmMessageC(ASSERTION_VM_MESSAGE_C, true, cstring(message), 0L, 0L, 0L); } } @Snippet public static void stubAssertion(boolean condition, @ConstantParameter String message) { ! if (!condition) { vmMessageC(ASSERTION_VM_MESSAGE_C, true, cstring(message), 0L, 0L, 0L); } } @NodeIntrinsic(ForeignCallNode.class) --- 58,75 ---- */ public static final ForeignCallDescriptor ASSERTION_VM_MESSAGE_C = new ForeignCallDescriptor("assertionVmMessageC", void.class, boolean.class, Word.class, long.class, long.class, long.class); @Snippet public static void assertion(boolean condition, @ConstantParameter String message) { ! if (injectBranchProbability(SLOWPATH_PROBABILITY, !condition)) { vmMessageC(ASSERTION_VM_MESSAGE_C, true, cstring(message), 0L, 0L, 0L); } } @Snippet public static void stubAssertion(boolean condition, @ConstantParameter String message) { ! if (injectBranchProbability(SLOWPATH_PROBABILITY, !condition)) { vmMessageC(ASSERTION_VM_MESSAGE_C, true, cstring(message), 0L, 0L, 0L); } } @NodeIntrinsic(ForeignCallNode.class)
< prev index next >