Skip to content

Commit

Permalink
Merge pull request #5024 from WalterBright/fakeeh
Browse files Browse the repository at this point in the history
eliminate unnecessary SCfastpar allocations
  • Loading branch information
MartinNowak committed Sep 2, 2015
2 parents d44cda0 + ab4b229 commit 194a151
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/backend/cgcod.c
Expand Up @@ -677,9 +677,11 @@ code *prolog()
#if NTEXCEPTIONS == 2
Fast.size -= nteh_contextsym_size();
#if MARS
#if TARGET_WINDOS
if (funcsym_p->Sfunc->Fflags3 & Ffakeeh && nteh_contextsym_size() == 0)
Fast.size -= 5 * 4;
#endif
#endif
#endif

/* Despite what the comment above says, aligning Fast section to size greater
Expand Down Expand Up @@ -1049,6 +1051,10 @@ void stackoffsets(int flags)
switch (s->Sclass)
{
case SCfastpar:
if (!(funcsym_p->Sfunc->Fflags3 & Ffakeeh))
continue; // don't need consistent stack frame
break;

case SCshadowreg:
case SCparameter:
break; // have to allocate space for parameters
Expand Down
2 changes: 0 additions & 2 deletions src/glue.c
Expand Up @@ -845,15 +845,13 @@ void FuncDeclaration_toObjFile(FuncDeclaration *fd, bool multiobj)
f->Fclass = (Classsym *)t;
}

#if TARGET_WINDOS
/* This is done so that the 'this' pointer on the stack is the same
* distance away from the function parameters, so that an overriding
* function can call the nested fdensure or fdrequire of its overridden function
* and the stack offsets are the same.
*/
if (fd->isVirtual() && (fd->fensure || fd->frequire))
f->Fflags3 |= Ffakeeh;
#endif

#if TARGET_OSX
s->Sclass = SCcomdat;
Expand Down

0 comments on commit 194a151

Please sign in to comment.