[builtins] Perform stack check on entry of all TFJ builtins
Bug: v8:7239 Change-Id: I25d2926a974bdb99a45fe4df79c6a62a363f67cf Reviewed-on: https://chromium-review.googlesource.com/867237 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Peter Wong <peter.wm.wong@gmail.com> Cr-Commit-Position: refs/heads/master@{#50651}
This commit is contained in:
parent
0bfc1b2562
commit
760ed28b76
@ -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) \
|
||||
|
Loading…
Reference in New Issue
Block a user