)]}'
{
  "commit": "64ef16e77795957d47e3889bca9483d6f3099bbf",
  "tree": "2bddc87d36076445f042b6935f4419a77265acd9",
  "parents": [
    "0750107074c39f7b846515de47c2857cbdb7e3d6"
  ],
  "author": {
    "name": "Cherry Mui",
    "email": "cherryyz@google.com",
    "time": "Wed Jun 15 15:09:24 2022 -0400"
  },
  "committer": {
    "name": "Cherry Mui",
    "email": "cherryyz@google.com",
    "time": "Wed Jun 29 22:26:58 2022 +0000"
  },
  "message": "cmd/internal/obj/arm64: save LR and SP in one instruction for small frames\n\nWhen we create a thread with signals blocked. But glibc\u0027s\npthread_sigmask doesn\u0027t really allow us to block SIGSETXID. So we\nmay get a signal early on before the signal stack is set. If we\nget a signal on the current stack, it will clobber anything below\nthe SP. This CL makes it to save LR and decrement SP in a single\nMOVD.W instruction for small frames, so we don\u0027t write below the\nSP.\n\nWe used to use a single MOVD.W instruction before CL 379075.\nCL 379075 changed to use an STP instruction to save the LR and FP,\nthen decrementing the SP. This CL changes it back, just this part\n(epilogues and large frame prologues are unchanged). For small\nframes, it is the same number of instructions either way.\n\nThis decreases the size of a \"small\" frame from 0x1f0 to 0xf0.\nFor frame sizes in between, it could benefit from using an\nSTP instruction instead of using the prologue for the \"large\"\nframe case. We don\u0027t bother it for now as this is a stop-gap\nsolution anyway.\n\nThis only addresses the issue with small frames. Luckily, all\nfunctions from thread entry to setting up the signal stack have\nsamll frames.\n\nOther possible ideas:\n- Expand the unwind info metadata, separate SP delta and the\n  location of the return address, so we can express \"SP is\n  decremented but the return address is in the LR register\". Then\n  we can always create the frame first then write the LR, without\n  writing anything below the SP (except the frame pointer at SP-8,\n  which is minor because it doesn\u0027t really affect program\n  execution).\n- Set up the signal stack immediately in mstart in assembly.\n\nFor Go 1.19 we do this simple fix. We plan to do the metadata fix\nin Go 1.20 ( #53609 ).\n\nOther LR architectures are addressed in CL 413428.\n\nFix #53374.\n\nChange-Id: I9d6582ab14ccb06ac61ad43852943d9555e22ae5\nReviewed-on: https://go-review.googlesource.com/c/go/+/412474\nRun-TryBot: Cherry Mui \u003ccherryyz@google.com\u003e\nTryBot-Result: Gopher Robot \u003cgobot@golang.org\u003e\nReviewed-by: Austin Clements \u003caustin@google.com\u003e\nReviewed-by: Eric Fang \u003ceric.fang@arm.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a9746b552ee3f57677d1cca71cc5320fad1b932e",
      "old_mode": 33188,
      "old_path": "misc/cgo/test/cgo_linux_test.go",
      "new_id": "7c4628c49330c004cb93d597c42c11d3eb27fbcf",
      "new_mode": 33188,
      "new_path": "misc/cgo/test/cgo_linux_test.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "d239893f43ed2f8a1a61875a23beec0ea17e42f2",
      "new_mode": 33188,
      "new_path": "misc/cgo/test/setgid2_linux.go"
    },
    {
      "type": "modify",
      "old_id": "1f2625d54f85d44b7cc0064ede38472dfab280b8",
      "old_mode": 33188,
      "old_path": "src/cmd/internal/obj/arm64/obj7.go",
      "new_id": "83ae64a19b8e6787023ecf074158f2618cd7910a",
      "new_mode": 33188,
      "new_path": "src/cmd/internal/obj/arm64/obj7.go"
    }
  ]
}
