Commit 760ed28b authored by peterwmwong's avatar peterwmwong Committed by Commit Bot

[builtins] Perform stack check on entry of all TFJ builtins

Bug: v8:7239
Change-Id: I25d2926a974bdb99a45fe4df79c6a62a363f67cf
Reviewed-on: https://chromium-review.googlesource.com/867237Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Peter Wong <peter.wm.wong@gmail.com>
Cr-Commit-Position: refs/heads/master@{#50651}
parent 0bfc1b25
......@@ -386,8 +386,6 @@ TF_BUILTIN(ObjectPrototypeToLocaleString, CodeStubAssembler) {
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver));
PerformStackCheck(context);
Label if_null_or_undefined(this, Label::kDeferred);
GotoIf(IsNullOrUndefined(receiver), &if_null_or_undefined);
......
......@@ -1666,12 +1666,6 @@ Node* RegExpBuiltinsAssembler::RegExpExec(Node* context, Node* regexp,
BIND(&if_iscallable);
{
// TFJ builtin recursion can only be introduced within RegExp builtins by
// modifying the RegExp prototype, in which case all exec calls go through
// this path.
// TODO(7239): A general solution for TFJ recursion & stack checks.
PerformStackCheck(context);
Callable call_callable = CodeFactory::Call(isolate());
Node* const result = CallJS(call_callable, context, exec, regexp, string);
......
......@@ -47,6 +47,9 @@ class CodeAssemblerState;
void Builtins::Generate_##Name(compiler::CodeAssemblerState* state) { \
Name##Assembler assembler(state); \
state->SetInitialDebugInformation(#Name, __FILE__, __LINE__); \
if (Builtins::KindOf(Builtins::k##Name) == Builtins::TFJ) { \
assembler.PerformStackCheck(assembler.GetJSContextParameter()); \
} \
assembler.Generate##Name##Impl(); \
} \
void Name##Assembler::Generate##Name##Impl()
......
......@@ -359,6 +359,7 @@ bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) {
V(ThrowRangeError) \
V(ToName) \
V(GetOwnPropertyDescriptor) \
V(StackGuard) \
/* Misc. */ \
V(Call) \
V(MaxSmi) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment