Skip to content

Commit

Permalink
doc: use "high address/low address" instead of "top/bottom"
Browse files Browse the repository at this point in the history
The current document uses the "top" and "bottom" when talking
about the address within a frame, which may easily lead to
misunderstandings. This patch directly uses "high address"
and "low address" to make the expression clearer.

Change-Id: I7469330bbdc158672d7f0314fe6680ebdd9ab79a
Reviewed-on: https://go-review.googlesource.com/c/go/+/339369
Trust: fannie zhang <Fannie.Zhang@arm.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
  • Loading branch information
zhangfannie committed Aug 10, 2021
1 parent f1dce31 commit 1f9c9d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions doc/asm.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ <h3 id="symbols">Symbols</h3>
</li>

<li>
<code>SP</code>: Stack pointer: top of stack.
<code>SP</code>: Stack pointer: the highest address within the local stack frame.
</li>

</ul>
Expand Down Expand Up @@ -216,7 +216,7 @@ <h3 id="symbols">Symbols</h3>
The <code>SP</code> pseudo-register is a virtual stack pointer
used to refer to frame-local variables and the arguments being
prepared for function calls.
It points to the top of the local stack frame, so references should use negative offsets
It points to the highest address within the local stack frame, so references should use negative offsets
in the range [−framesize, 0):
<code>x-8(SP)</code>, <code>y-4(SP)</code>, and so on.
</p>
Expand Down Expand Up @@ -409,7 +409,7 @@ <h3 id="directives">Directives</h3>
(For <code>TEXT</code> items.)
Don't insert the preamble to check if the stack must be split.
The frame for the routine, plus anything it calls, must fit in the
spare space at the top of the stack segment.
spare space remaining in the current stack segment.
Used to protect routines such as the stack splitting code itself.
</li>
<li>
Expand Down Expand Up @@ -460,7 +460,7 @@ <h3 id="directives">Directives</h3>
<code>TOPFRAME</code> = 2048
<br>
(For <code>TEXT</code> items.)
Function is the top of the call stack. Traceback should stop at this function.
Function is the outermost frame of the call stack. Traceback should stop at this function.
</li>
</ul>

Expand Down
4 changes: 2 additions & 2 deletions src/cmd/internal/obj/textflag.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const (
// Function can call reflect.Type.Method or reflect.Type.MethodByName.
REFLECTMETHOD = 1024

// Function is the top of the call stack. Call stack unwinders should stop
// at this function.
// Function is the outermost frame of the call stack. Call stack unwinders
// should stop at this function.
TOPFRAME = 2048

// Function is an ABI wrapper.
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/textflag.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#define NOFRAME 512
// Function can call reflect.Type.Method or reflect.Type.MethodByName.
#define REFLECTMETHOD 1024
// Function is the top of the call stack. Call stack unwinders should stop
// at this function.
// Function is the outermost frame of the call stack. Call stack unwinders
// should stop at this function.
#define TOPFRAME 2048
// Function is an ABI wrapper.
#define ABIWRAPPER 4096

0 comments on commit 1f9c9d8

Please sign in to comment.