Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(157)

Issue 11551044: code review 11551044: runtime: reclaim another word in cgocallback_gofunc (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 8 months ago by rsc
Modified:
11 years, 8 months ago
Reviewers:
brainman, dvyukov
CC:
dvyukov, brainman, golang-dev
Visibility:
Public.

Description

runtime: more cgocallback_gofunc work Debugging the Windows breakage I noticed that SEH only exists on 386, so we can balance the two stacks a little more on amd64 and reclaim another word. Now we're down to just one word consumed by cgocallback_gofunc, having reclaimed 25% of the overall budget (4 words out of 16). Separately, fix windows/386 - the SEH must be on the m0 stack, as must the saved SP, so we are forced to have a three-word frame for 386. It matters much less for 386, because there 128 bytes gives 32 words to use.

Patch Set 1 #

Patch Set 2 : diff -r fe3401660c1c https://code.google.com/p/go/ #

Patch Set 3 : diff -r fe3401660c1c https://code.google.com/p/go/ #

Patch Set 4 : diff -r fe3401660c1c https://code.google.com/p/go/ #

Patch Set 5 : diff -r fe3401660c1c https://code.google.com/p/go/ #

Total comments: 5

Patch Set 6 : diff -r 84cafba689b1 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -20 lines) Patch
M src/pkg/runtime/asm_386.s View 1 2 3 4 5 chunks +13 lines, -9 lines 0 comments Download
M src/pkg/runtime/asm_amd64.s View 1 4 chunks +11 lines, -9 lines 0 comments Download
M src/pkg/runtime/cgocall.c View 1 2 3 1 chunk +18 lines, -1 line 0 comments Download
M src/pkg/runtime/proc.c View 1 2 3 4 5 3 chunks +14 lines, -1 line 0 comments Download

Messages

Total messages: 9
rsc
Hello dvyukov (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
11 years, 8 months ago (2013-07-24 03:10:55 UTC) #1
brainman
Test passes on windows/amd64, but windows/386 is broken in misc/cgo/test/TestCthread. I can have a look ...
11 years, 8 months ago (2013-07-24 03:28:39 UTC) #2
rsc
Sorry about that. I cannot read, apparently. I have updated this CL to include a ...
11 years, 8 months ago (2013-07-24 04:32:35 UTC) #3
brainman
LGTM. Both windows/386 and windows/amd64 builds are fine. It is really complicated. :-( Alex https://codereview.appspot.com/11551044/diff/13001/src/pkg/runtime/asm_386.s ...
11 years, 8 months ago (2013-07-24 04:47:10 UTC) #4
rsc
https://codereview.appspot.com/11551044/diff/13001/src/pkg/runtime/asm_386.s File src/pkg/runtime/asm_386.s (right): https://codereview.appspot.com/11551044/diff/13001/src/pkg/runtime/asm_386.s#newcode557 src/pkg/runtime/asm_386.s:557: // On Windows, the SEH is at 4(SP) and ...
11 years, 8 months ago (2013-07-24 04:50:47 UTC) #5
brainman
Thank you. Alex https://codereview.appspot.com/11551044/diff/13001/src/pkg/runtime/asm_386.s File src/pkg/runtime/asm_386.s (right): https://codereview.appspot.com/11551044/diff/13001/src/pkg/runtime/asm_386.s#newcode557 src/pkg/runtime/asm_386.s:557: // On Windows, the SEH is ...
11 years, 8 months ago (2013-07-24 05:18:34 UTC) #6
dvyukov
LGTM I think I even understand what happens here https://codereview.appspot.com/11551044/diff/13001/src/pkg/runtime/proc.c File src/pkg/runtime/proc.c (right): https://codereview.appspot.com/11551044/diff/13001/src/pkg/runtime/proc.c#newcode659 src/pkg/runtime/proc.c:659: ...
11 years, 8 months ago (2013-07-24 05:31:28 UTC) #7
rsc
https://codereview.appspot.com/11551044/diff/13001/src/pkg/runtime/proc.c File src/pkg/runtime/proc.c (right): https://codereview.appspot.com/11551044/diff/13001/src/pkg/runtime/proc.c#newcode659 src/pkg/runtime/proc.c:659: m->seh = (SEH*)((uintptr*)&x + 1); On 2013/07/24 05:31:29, dvyukov ...
11 years, 8 months ago (2013-07-24 13:01:11 UTC) #8
rsc
11 years, 8 months ago (2013-07-24 13:02:04 UTC) #9
*** Submitted as https://code.google.com/p/go/source/detail?r=e7b0d65f9e5b ***

runtime: more cgocallback_gofunc work

Debugging the Windows breakage I noticed that SEH
only exists on 386, so we can balance the two stacks
a little more on amd64 and reclaim another word.

Now we're down to just one word consumed by
cgocallback_gofunc, having reclaimed 25% of the
overall budget (4 words out of 16).

Separately, fix windows/386 - the SEH must be on the
m0 stack, as must the saved SP, so we are forced to have
a three-word frame for 386. It matters much less for
386, because there 128 bytes gives 32 words to use.

R=dvyukov, alex.brainman
CC=golang-dev
https://codereview.appspot.com/11551044
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b