summaryrefslogtreecommitdiff
path: root/deps/v8/src/builtins/builtins-regexp-gen.cc
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-10-23 15:01:12 +0200
committerMichaël Zasso <targos@protonmail.com>2019-11-08 15:53:20 +0100
commita9bed0b72b088b5ae8eef625a41b76225686c3f7 (patch)
treef8ea194ed1f9896c36c8c1805041b7149ec075b4 /deps/v8/src/builtins/builtins-regexp-gen.cc
parentd9fab1fdb76ae3a69b5812a7f2190cf3e58f6d75 (diff)
downloadandroid-node-v8-a9bed0b72b088b5ae8eef625a41b76225686c3f7.tar.gz
android-node-v8-a9bed0b72b088b5ae8eef625a41b76225686c3f7.tar.bz2
android-node-v8-a9bed0b72b088b5ae8eef625a41b76225686c3f7.zip
deps: V8: backport 07ee86a5a28b
Original commit message: PPC: allow for calling CFunctions without function descriptors on AIX. The calling conventions on AIX uses function descriptors, which means that pointers to functions do not point to code, but instead point to metadata about them. When calling JITed code, we must assure to use function descriptors instead of raw pointers when needed. Before this CL 213504b, all CallCFunction on AIX were guaranteed to have function descriptors. Starting form the CL mentioned above, CallCFunction can also Jump to a Trampoline which does not have a function descriptor, hence a new "CallCFunctionWithoutFunctionDescriptor" method is proposed to deal with this issue. BUG= v8:9766 Change-Id: I9343c31c812f5d4dda8503a5adf024b24dbde072 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1825961 Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#64357} Refs: https://github.com/v8/v8/commit/07ee86a5a28b7f9526748ca8f765c1b704f93c0c PR-URL: https://github.com/nodejs/node/pull/30020 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'deps/v8/src/builtins/builtins-regexp-gen.cc')
-rw-r--r--deps/v8/src/builtins/builtins-regexp-gen.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/deps/v8/src/builtins/builtins-regexp-gen.cc b/deps/v8/src/builtins/builtins-regexp-gen.cc
index 4bc0b6ad74..b333f2a820 100644
--- a/deps/v8/src/builtins/builtins-regexp-gen.cc
+++ b/deps/v8/src/builtins/builtins-regexp-gen.cc
@@ -605,13 +605,18 @@ TNode<HeapObject> RegExpBuiltinsAssembler::RegExpExecInternal(
TNode<RawPtrT> code_entry = LoadCodeObjectEntry(code);
- TNode<Int32T> result = UncheckedCast<Int32T>(CallCFunction(
- code_entry, retval_type, std::make_pair(arg0_type, arg0),
- std::make_pair(arg1_type, arg1), std::make_pair(arg2_type, arg2),
- std::make_pair(arg3_type, arg3), std::make_pair(arg4_type, arg4),
- std::make_pair(arg5_type, arg5), std::make_pair(arg6_type, arg6),
- std::make_pair(arg7_type, arg7), std::make_pair(arg8_type, arg8),
- std::make_pair(arg9_type, arg9)));
+ // AIX uses function descriptors on CFunction calls. code_entry in this case
+ // may also point to a Regex interpreter entry trampoline which does not
+ // have a function descriptor. This method is ineffective on other platforms
+ // and is equivalent to CallCFunction.
+ TNode<Int32T> result =
+ UncheckedCast<Int32T>(CallCFunctionWithoutFunctionDescriptor(
+ code_entry, retval_type, std::make_pair(arg0_type, arg0),
+ std::make_pair(arg1_type, arg1), std::make_pair(arg2_type, arg2),
+ std::make_pair(arg3_type, arg3), std::make_pair(arg4_type, arg4),
+ std::make_pair(arg5_type, arg5), std::make_pair(arg6_type, arg6),
+ std::make_pair(arg7_type, arg7), std::make_pair(arg8_type, arg8),
+ std::make_pair(arg9_type, arg9)));
// Check the result.
// We expect exactly one result since we force the called regexp to behave