diff options
| author | Drahflow <drahflow@gmx.de> | 2015-06-18 14:15:18 +0200 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2015-06-18 14:15:18 +0200 |
| commit | 6e2135a5d28d215af7c0570613ce562199bdd690 (patch) | |
| tree | 0d75c04376b22ecd2df7f0ff5e181700d1a40917 /elymas | |
| parent | 380911d0b8e8a92df6205d4ee180caa95eb2acb8 (diff) | |
Optimize scoped calls to constants
Diffstat (limited to 'elymas')
| -rw-r--r-- | elymas/lib/sys/opt.ey | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/elymas/lib/sys/opt.ey b/elymas/lib/sys/opt.ey index de88359..a66b393 100644 --- a/elymas/lib/sys/opt.ey +++ b/elymas/lib/sys/opt.ey @@ -1628,10 +1628,11 @@ # TODO think about handling typed functions executedObject sys .typed .inputs len { } { # handle untyped function - executedObject sys .capturedScope { - -- # ignore concrete scope - [ UNTYPEDSCOPEDSTAR ] i logic =[] # TODO: scope will stay constant, optimize further - /UNTYPEDSCOPEDSTAR_suboptimal dump + executedObject sys .capturedScope { ==scope + [ NOP ] i 1 sub logic =[] + [ CALLSCOPED executedObject ::rawCodeAddress scope ::rawAddress ] i logic =[] + /CALLSCOPED_case_optimized dump + scope dump } { [ NOP ] i 1 sub logic =[] [ CALL executedObject ::rawCodeAddress ] i logic =[] @@ -1709,7 +1710,6 @@ # the captured scope of the function is the same one rep is called in, no need to change scope [ NOP ] i 1 sub logic =[] [ RAWCONSTREPTHISSCOPE functionBody 16 add ] i logic =[] - /RAWCONSTREP_on_FUNCTIONCREATE dump } ] conds } each |
