Skip to content

Commit

Permalink
Use ldloc.0-3, stloc.0-3 for the first four locals.
Browse files Browse the repository at this point in the history
Memory usage analysis in the sim suggests that they are compiled that way.
  • Loading branch information
Sei-Lisa committed May 7, 2017
1 parent 91a74a4 commit db19132
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lscript_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4175,7 4175,7 @@ void LLScriptLValue::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePa
else
{
// Local, load by index.
fprintf(fp, "ldloc.s %d\n", mIdentifier->mScopeEntry->mCount);
fprintf(fp, "ldloc%s%d\n", (mIdentifier->mScopeEntry->mCount > 3 ? ".s ":"."), mIdentifier->mScopeEntry->mCount);
}
}
else if (mIdentifier->mScopeEntry->mIDType == LIT_GLOBAL)
Expand Down Expand Up @@ -4260,7 4260,7 @@ static void print_cil_assignment(LLFILE *fp, LLScriptExpression *exp, LLScriptSc
else
{
// Local, store by index.
fprintf(fp, "stloc.s %d\n", ident->mScopeEntry->mCount);
fprintf(fp, "stloc%s%d\n", (ident->mScopeEntry->mCount > 3 ? ".s " : "."), ident->mScopeEntry->mCount);
}
}
else if (ident->mScopeEntry->mIDType == LIT_GLOBAL)
Expand Down Expand Up @@ -7974,7 7974,7 @@ void LLScriptDeclaration::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTComp
{
print_cil_init_variable(fp, mIdentifier->mScopeEntry->mType);
}
fprintf(fp, "stloc.s %d\n", mIdentifier->mScopeEntry->mCount);
fprintf(fp, "stloc%s%d\n", (mIdentifier->mScopeEntry->mCount > 3 ? ".s " : "."), mIdentifier->mScopeEntry->mCount);
break;
default:
if (mExpression)
Expand Down

0 comments on commit db19132

Please sign in to comment.