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

omit frame for leaf functions on Linux, FreeBSD and OSX #5040

Merged
merged 1 commit into from Sep 9, 2015

Conversation

WalterBright
Copy link
Member

Omitting the setup and teardown of the BP stack frame can speed up small functions.

Currently, this is done only for Win32. Unfortunately for other platforms, the exception unwinding system relies on there being a BP stack frame. So it is only possible to do this for 'leaf' functions which do not throw (not even throwing Errors).

Only doing this for Linux at the moment, will extend if successful.

@WalterBright
Copy link
Member Author

Ready to rock.

@WalterBright WalterBright changed the title omit frame for leaf functions on Linux omit frame for leaf functions on Linux, FreeBSD and OSX Sep 6, 2015
@WalterBright
Copy link
Member Author

This is an important optimization. Pls pull.

@WalterBright
Copy link
Member Author

ping @yebblies @MartinNowak

@WalterBright
Copy link
Member Author

Why isn't this being pulled? I want to do more optimizations.

@WalterBright
Copy link
Member Author

Looks like FreeBSD is randomly failing. Why can't we have a test suite that runs reliably?

@yebblies
Copy link
Member

yebblies commented Sep 8, 2015

Because you're the only one that understands this code.

@WalterBright
Copy link
Member Author

All it is is not generating a BP stack frame if the function does not throw Exceptions or Errors.

/* Look for __va_argsave
*/
for (SYMIDX si = 0; si < globsym.top; si++)
{ symbol *s = globsym.tab[si];
Copy link
Member

Choose a reason for hiding this comment

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

code after { is bleh

@andralex
Copy link
Member

andralex commented Sep 9, 2015

Auto-merge toggled on

andralex added a commit that referenced this pull request Sep 9, 2015
omit frame for leaf functions on Linux, FreeBSD and OSX
@andralex andralex merged commit 1fcabd1 into dlang:master Sep 9, 2015
@WalterBright WalterBright deleted the noframe branch September 9, 2015 05:18
andralex added a commit that referenced this pull request Sep 9, 2015
omit frame for leaf functions on Linux, FreeBSD and OSX
@CyberShadow
Copy link
Member

Question, -gs still overrides this, correct?

@WalterBright
Copy link
Member Author

yes

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
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants