]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: simplify constant strings in asm
authorJosh Bleecher Snyder <josharian@gmail.com>
Wed, 27 Feb 2019 18:14:44 +0000 (10:14 -0800)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 14 Mar 2019 00:12:28 +0000 (00:12 +0000)
As of CL 163747, we can write arbitrary length strings
in assembly DATA instructions.

Make use of it here to improve readability.

Change-Id: I556279ca893f527874e3b26112c43573834ccd9c
Reviewed-on: https://go-review.googlesource.com/c/go/+/167386
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/asm_386.s
src/runtime/asm_amd64.s

index 48a959aad108107be57bdb7f26c3d7099036ee6c..51103928b3533c33a64fdbd7ca3758bff8b63b53 100644 (file)
@@ -248,16 +248,8 @@ ok:
        CALL    runtime·abort(SB)
        RET
 
-DATA   bad_proc_msg<>+0x00(SB)/8, $"This pro"
-DATA   bad_proc_msg<>+0x08(SB)/8, $"gram can"
-DATA   bad_proc_msg<>+0x10(SB)/8, $" only be"
-DATA   bad_proc_msg<>+0x18(SB)/8, $" run on "
-DATA   bad_proc_msg<>+0x20(SB)/8, $"processo"
-DATA   bad_proc_msg<>+0x28(SB)/8, $"rs with "
-DATA   bad_proc_msg<>+0x30(SB)/8, $"MMX supp"
-DATA   bad_proc_msg<>+0x38(SB)/4, $"ort."
-DATA   bad_proc_msg<>+0x3c(SB)/1, $0xa
-GLOBL  bad_proc_msg<>(SB), RODATA, $0x3d
+DATA   bad_proc_msg<>+0x00(SB)/61, $"This program can only be run on processors with MMX support.\n"
+GLOBL  bad_proc_msg<>(SB), RODATA, $61
 
 DATA   runtime·mainPC+0(SB)/4,$runtime·main(SB)
 GLOBL  runtime·mainPC(SB),RODATA,$4
index 6339dc000022cdb5dcea40527c4b8ab5041cb1a9..85133bf2dfc6ea815d8872b02f8f7dd18e0cfb3c 100644 (file)
@@ -1438,10 +1438,8 @@ flush:
        MOVQ    96(SP), R15
        JMP     ret
 
-DATA   debugCallFrameTooLarge<>+0x00(SB)/8, $"call fra"
-DATA   debugCallFrameTooLarge<>+0x08(SB)/8, $"me too l"
-DATA   debugCallFrameTooLarge<>+0x10(SB)/4, $"arge"
-GLOBL  debugCallFrameTooLarge<>(SB), RODATA, $0x14     // Size duplicated below
+DATA   debugCallFrameTooLarge<>+0x00(SB)/20, $"call frame too large"
+GLOBL  debugCallFrameTooLarge<>(SB), RODATA, $20       // Size duplicated below
 
 // debugCallV1 is the entry point for debugger-injected function
 // calls on running goroutines. It informs the runtime that a
@@ -1565,7 +1563,7 @@ good:
        // The frame size is too large. Report the error.
        MOVQ    $debugCallFrameTooLarge<>(SB), AX
        MOVQ    AX, 0(SP)
-       MOVQ    $0x14, 8(SP)
+       MOVQ    $20, 8(SP) // length of debugCallFrameTooLarge string
        MOVQ    $8, AX
        BYTE    $0xcc
        JMP     restore