From c4cdb1847e09d1153a6044d7a6aac05db4fad515 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 25 Apr 2014 23:02:26 +0200 Subject: erts: Fix global tracing of beam function when called from hipe code Make hipe to beam calls use export entry. Makes it a lot easier to handle global tracing correctly (breakpoints in export entry). A beam function should now be traced correctly regardless how it is called. This will also fix a SEGV crash when a hipe stub is made pointing into a traced export entry and tracing is then stopped which clears the export entry causing the hipe stub to execute beam instruction NULL. This commit assumes that hipe code never calls local beam functions, which should be the case nowadays as we only hipe compile entire modules. --- erts/emulator/hipe/hipe_ppc_glue.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'erts/emulator/hipe/hipe_ppc_glue.S') diff --git a/erts/emulator/hipe/hipe_ppc_glue.S b/erts/emulator/hipe/hipe_ppc_glue.S index 6f0217c738..0c337a14df 100644 --- a/erts/emulator/hipe/hipe_ppc_glue.S +++ b/erts/emulator/hipe/hipe_ppc_glue.S @@ -296,7 +296,7 @@ CSYM(hipe_ppc_throw_to_native): * which should look as follows: * * stub for f/N: - * + * * * b nbif_callemu * @@ -312,10 +312,10 @@ CSYM(hipe_ppc_throw_to_native): */ GLOBAL(ASYM(nbif_callemu)) ASYM(nbif_callemu): - STORE r12, P_BEAM_IP(P) + STORE r12, P_CALLEE_EXP(P) STORE r0, P_ARITY(P) STORE_ARG_REGS - li r3, HIPE_MODE_SWITCH_RES_CALL + li r3, HIPE_MODE_SWITCH_RES_CALL_EXPORTED b .suspend_exit /* -- cgit v1.2.3 From da3073e8d3d26ec6c63979a22c913d7758eeed71 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 13 Oct 2014 20:09:19 +0200 Subject: erts: Extend usage of ASM macro to avoid including asm macros in C code and reduce the probability of macro name collisions Catalyst: ppc macro "r0" conflicting with local variable in external.c --- erts/emulator/hipe/hipe_ppc_glue.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'erts/emulator/hipe/hipe_ppc_glue.S') diff --git a/erts/emulator/hipe/hipe_ppc_glue.S b/erts/emulator/hipe/hipe_ppc_glue.S index 6f0217c738..5c98f75d0b 100644 --- a/erts/emulator/hipe/hipe_ppc_glue.S +++ b/erts/emulator/hipe/hipe_ppc_glue.S @@ -17,10 +17,9 @@ * %CopyrightEnd% */ - +#define ASM #include "hipe_ppc_asm.h" #include "hipe_literals.h" -#define ASM #include "hipe_mode_switch.h" .text -- cgit v1.2.3 From 0ec91ff571518e199aac7a4da961a80c153483b9 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 9 May 2014 16:00:54 +0200 Subject: Allow 4-ary BIFs --- erts/emulator/hipe/hipe_ppc_glue.S | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'erts/emulator/hipe/hipe_ppc_glue.S') diff --git a/erts/emulator/hipe/hipe_ppc_glue.S b/erts/emulator/hipe/hipe_ppc_glue.S index c48fb150af..b07f4bc9c8 100644 --- a/erts/emulator/hipe/hipe_ppc_glue.S +++ b/erts/emulator/hipe/hipe_ppc_glue.S @@ -462,10 +462,12 @@ ASYM(nbif_fail): OPD(nbif_1_gc_after_bif) OPD(nbif_2_gc_after_bif) OPD(nbif_3_gc_after_bif) + OPD(nbif_4_gc_after_bif) GLOBAL(CSYM(nbif_0_gc_after_bif)) GLOBAL(CSYM(nbif_1_gc_after_bif)) GLOBAL(CSYM(nbif_2_gc_after_bif)) GLOBAL(CSYM(nbif_3_gc_after_bif)) + GLOBAL(CSYM(nbif_4_gc_after_bif)) CSYM(nbif_0_gc_after_bif): li r4, 0 b .gc_after_bif @@ -477,6 +479,9 @@ CSYM(nbif_2_gc_after_bif): b .gc_after_bif CSYM(nbif_3_gc_after_bif): li r4, 3 + b .gc_after_bif +CSYM(nbif_4_gc_after_bif): + li r4, 4 /*FALLTHROUGH*/ .gc_after_bif: stw r4, P_NARITY(P) /* Note: narity is a 32-bit field */ @@ -519,6 +524,11 @@ CSYM(nbif_2_simple_exception): GLOBAL(CSYM(nbif_3_simple_exception)) CSYM(nbif_3_simple_exception): li r4, 3 + b .nbif_simple_exception + OPD(nbif_3_simple_exception) + GLOBAL(CSYM(nbif_4_simple_exception)) +CSYM(nbif_4_simple_exception): + li r4, 4 /*FALLTHROUGH*/ .nbif_simple_exception: LOAD r3, P_FREASON(P) -- cgit v1.2.3 From 086af2a9f8fffefd8fb8330cc45bdf1e698809df Mon Sep 17 00:00:00 2001 From: Mikael Pettersson Date: Fri, 27 Mar 2015 13:13:00 +0100 Subject: erts/hipe: unbreak arity 4 BIFs This fixes arity 4 BIF support in HiPE, following its introduction on master (OTP 18) via the nox/ets-update_counter-4 merge. - define standard_bif_interface_4, nbif_4_gc_after_bif, and nbif_4_simple_exception on ARM: unbreaks the build on ARM - remove bogus stack re-alignment from standard_bif_interface_4 on AMD64: for 4-arg BIFs the stack is already aligned, and the code would misalign the C stack which violates the ABI and may cause alignment faults in vectorized code - the nbif_4_simple_exception OPD name on PPC64 was incorrectly using the nbif_3_simple_exception OPD name: this would have caused a multiple definition error in the assembler or linker In addition there are a few cleanups: - fix standard_bif_interface_N comment on x86 - fix standard_bif_interface_4 comment on SPARC - separate nbif_N_simple_exception blocks by empty lines on PPC, like on ARM, to clearly show which things belong together - fix standard_bif_interface_N comment on ARM - fix standard_bif_interface_4 on AMD64 to match the indentation and spacing conventions of the rest of that file --- erts/emulator/hipe/hipe_ppc_glue.S | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'erts/emulator/hipe/hipe_ppc_glue.S') diff --git a/erts/emulator/hipe/hipe_ppc_glue.S b/erts/emulator/hipe/hipe_ppc_glue.S index b07f4bc9c8..109289116b 100644 --- a/erts/emulator/hipe/hipe_ppc_glue.S +++ b/erts/emulator/hipe/hipe_ppc_glue.S @@ -510,22 +510,26 @@ CSYM(nbif_4_gc_after_bif): CSYM(nbif_0_simple_exception): li r4, 0 b .nbif_simple_exception + OPD(nbif_1_simple_exception) GLOBAL(CSYM(nbif_1_simple_exception)) CSYM(nbif_1_simple_exception): li r4, 1 b .nbif_simple_exception + OPD(nbif_2_simple_exception) GLOBAL(CSYM(nbif_2_simple_exception)) CSYM(nbif_2_simple_exception): li r4, 2 b .nbif_simple_exception + OPD(nbif_3_simple_exception) GLOBAL(CSYM(nbif_3_simple_exception)) CSYM(nbif_3_simple_exception): li r4, 3 b .nbif_simple_exception - OPD(nbif_3_simple_exception) + + OPD(nbif_4_simple_exception) GLOBAL(CSYM(nbif_4_simple_exception)) CSYM(nbif_4_simple_exception): li r4, 4 -- cgit v1.2.3 From 738c34d4bb8f1a3811acd00af8c6c12107f8315b Mon Sep 17 00:00:00 2001 From: Bruce Yinhe Date: Thu, 18 Jun 2015 11:31:02 +0200 Subject: Change license text to APLv2 --- erts/emulator/hipe/hipe_ppc_glue.S | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'erts/emulator/hipe/hipe_ppc_glue.S') diff --git a/erts/emulator/hipe/hipe_ppc_glue.S b/erts/emulator/hipe/hipe_ppc_glue.S index 109289116b..6e2022603c 100644 --- a/erts/emulator/hipe/hipe_ppc_glue.S +++ b/erts/emulator/hipe/hipe_ppc_glue.S @@ -3,16 +3,17 @@ * * Copyright Ericsson AB 2004-2011. All Rights Reserved. * - * The contents of this file are subject to the Erlang Public License, - * Version 1.1, (the "License"); you may not use this file except in - * compliance with the License. You should have received a copy of the - * Erlang Public License along with this software. If not, it can be - * retrieved online at http://www.erlang.org/. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and limitations - * under the License. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * * %CopyrightEnd% */ -- cgit v1.2.3