Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 07b2baf

Browse files
Mike KleinSkia Commit-Bot
authored andcommitted
build conservative stack frame on x86-64
Should be a behavior no-op, and effective perf no-op. Change-Id: Iaf755c6938ae5060f11b1ccb83a9273fa53896b2 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282176 Commit-Queue: Mike Klein <[email protected]> Reviewed-by: Herb Derby <[email protected]>
1 parent 5e9f0ee commit 07b2baf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/SkVM.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3421,7 +3421,8 @@ namespace skvm {
34213421
auto add = [&](A::GP64 gp, int imm) { a->add(gp, imm); };
34223422
auto sub = [&](A::GP64 gp, int imm) { a->sub(gp, imm); };
34233423

3424-
auto exit = [&]{ a->vzeroupper(); a->ret(); };
3424+
auto enter = [&]{ a->sub(A::rsp, instructions.size()*K*4); };
3425+
auto exit = [&]{ a->add(A::rsp, instructions.size()*K*4); a->vzeroupper(); a->ret(); };
34253426
#elif defined(__aarch64__)
34263427
const int K = 4;
34273428
auto jump_if_less = [&](A::Label* l) { a->blt(l); };
@@ -3430,13 +3431,15 @@ namespace skvm {
34303431
auto add = [&](A::X gp, int imm) { a->add(gp, gp, imm); };
34313432
auto sub = [&](A::X gp, int imm) { a->sub(gp, gp, imm); };
34323433

3433-
auto exit = [&]{ a->ret(A::x30); };
3434+
auto enter = [&]{};
3435+
auto exit = [&]{ a->ret(A::x30); };
34343436
#endif
34353437

34363438
A::Label body,
34373439
tail,
34383440
done;
34393441

3442+
enter();
34403443
for (Val id = 0; id < (Val)instructions.size(); id++) {
34413444
if (hoisted(id) && !emit(id, /*scalar=*/false)) {
34423445
return false;

0 commit comments

Comments
 (0)