[csa] Load the stack limit from smi roots

Loading a root generates a kRootRegister-relative load on all
architectures but ia32 (where we currently don't have a root
register).

This is preferable to loading an external reference, which will
usually embed an absolute pointer into the generated code, or add an
indirection when within an embedded builtin.

Bug: v8:6666
Change-Id: I1a93b1325b375bfcf3547977760e1d9ada1d0ee4
Reviewed-on: https://chromium-review.googlesource.com/1095260
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53656}
This commit is contained in:
jgruber 2018-06-12 08:30:35 +02:00 committed by Commit Bot
parent 7465739816
commit 507c29c940

View File

@ -11902,9 +11902,7 @@ void CodeStubAssembler::PerformStackCheck(Node* context) {
Label ok(this), stack_check_interrupt(this, Label::kDeferred);
Node* sp = LoadStackPointer();
Node* stack_limit = Load(
MachineType::Pointer(),
ExternalConstant(ExternalReference::address_of_stack_limit(isolate())));
Node* stack_limit = BitcastTaggedToWord(LoadRoot(Heap::kStackLimitRootIndex));
Node* interrupt = UintPtrLessThan(sp, stack_limit);
Branch(interrupt, &stack_check_interrupt, &ok);