Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move parameters to stack instead of pushing #5100

Merged
merged 1 commit into from
Sep 21, 2015

Conversation

WalterBright
Copy link
Member

I've been thinking of doing this for a long time, it's what other compilers do. Instead of PUSHing parameters on the stack, it MOVes them. Space for it all is preallocated on the stack upon function entry. It's turned on only when -O is used.

The advantage is when there are many function calls, no stack adjustments are done.

There's room for improvement with this, like in how the moves are actually done. This initial support is basic. But it does validate the rather complex changes to make it work. Getting it working enables further optimizations that would be otherwise closed to dmd.

@WalterBright
Copy link
Member Author

It's green! Pull it quick!

@andralex
Copy link
Member

Yep, much better. thanks!

@andralex
Copy link
Member

I see Travis is failing. What gives? cc @MartinNowak, @CyberShadow

@WalterBright
Copy link
Member Author

I have no idea.

@CyberShadow
Copy link
Member

No idea, I don't know anything about the Travis tester. I think it is for testing integration for GDC/LDC? I'm not sure.

@yebblies
Copy link
Member

Travis is checking that the last DMD, GDC and LDC releases(ish) can built DMD master.

@@ -267,6 +267,7 @@ void WRFL(enum FL fl)
"bprel ","frameh","blocko","alloca",
"stack ","dsym ",
"got ","gotoff",
"funcar",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"funcarg"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has a limit of 6 chars to fit in the array.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably time to remove that limit then, it's only debug code after all.

andralex added a commit that referenced this pull request Sep 21, 2015
move parameters to stack instead of pushing
@andralex andralex merged commit 039e230 into dlang:master Sep 21, 2015
@ibuclaw
Copy link
Member

ibuclaw commented Sep 21, 2015

Don't ignore failures in the travis autotester. :-)

@CyberShadow
Copy link
Member

Don't ignore failures in the travis autotester. :-)

It seems that in this case it was an error with GDC's website:

$ curl http://gdcproject.org/downloads/binaries/x86_64-linux-gnu/gdc-${LATEST_GDC}.tar.xz | tar --strip-components=1 -C ~/gdc -Jxf -

curl: (7) Failed to connect to 2a01:7e00::f03c:91ff:fedf:7d23: Network is unreachable

I'm not sure what Andrei or Walter could've done here :)

@ibuclaw
Copy link
Member

ibuclaw commented Sep 21, 2015

Looks like travis had routing problems on that particular VM. Retry the build?

mihails-strasuns-sociomantic added a commit to mihails-strasuns-sociomantic/dmd that referenced this pull request Oct 28, 2015
* upstream/dmd-1.x: (37 commits)
  Add ddoc support for 'Template Params' section
  sync up with D2's backend
  fold in D2 changes
  fix build break
  Merge pull request dlang#5100 from WalterBright/movParams
  refactor: use LocalSection for alloca data
  Merge pull request dlang#5076 from WalterBright/AllocOff
  Merge pull request dlang#5064 from WalterBright/frame
  Merge pull request dlang#5070 from WalterBright/params
  Merge pull request dlang#5069 from WalterBright/go4
  Merge pull request dlang#5067 from WalterBright/go3
  Merge pull request dlang#5066 from WalterBright/go2
  Merge pull request dlang#5065 from WalterBright/go
  Merge pull request dlang#5060 from WalterBright/floatalign
  Merge pull request dlang#5059 from WalterBright/cstop
  Merge pull request dlang#5040 from WalterBright/noframe
  Merge pull request dlang#5051 from WalterBright/movsx
  Merge pull request dlang#5024 from WalterBright/fakeeh
  Merge pull request dlang#4978 from WalterBright/rmVBTABLES
  Merge pull request dlang#4976 from WalterBright/backendgetRtlsym
  ...
@9rnsr
Copy link
Contributor

9rnsr commented Apr 8, 2016

This pull request has introduced a regression:
https://issues.dlang.org/show_bug.cgi?id=15898

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants