diff options
| author | Drahflow <drahflow@gmx.de> | 2013-09-29 11:42:23 +0200 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2013-09-29 11:42:23 +0200 |
| commit | be69490cb101c8cc8093bd0562eca3197269a2cf (patch) | |
| tree | e9fc249d5d25fae4565b664d1ffde7cb4de6298d /elymas | |
| parent | 8a2fd3c81f1c5b8c72bdeb99f9516f89edd42f2c (diff) | |
Rewriting array executions
Diffstat (limited to 'elymas')
| -rw-r--r-- | elymas/lib/sys/opt.ey | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/elymas/lib/sys/opt.ey b/elymas/lib/sys/opt.ey index 4afda2e..a1c835f 100644 --- a/elymas/lib/sys/opt.ey +++ b/elymas/lib/sys/opt.ey @@ -127,6 +127,7 @@ /STATICWRITE ==:STATICWRITE /STATICDOT ==:STATICDOT /NATIVE ==:NATIVE + /ARRAYSTAR ==:ARRAYSTAR /UNTYPEDSCOPEDSTAR ==:UNTYPEDSCOPEDSTAR /UNTYPEDUNSCOPEDSTAR ==:UNTYPEDUNSCOPEDSTAR @@ -272,7 +273,9 @@ } ? * } { "failed to optimize 'execution' of raw function opcodes object" die } - { } # TODO array code + { + [ ARRAYSTAR ] i logic =[] + } { "failed to optimize 'execution' of function type descriptor" die } { "objects of type 09 should not appear" die } { "objects of type 10 should not appear" die } @@ -310,7 +313,7 @@ 0 "0" * sub largestNumber max =largestNumber } each - [ /rax /rcx /rdx /rbp /rsi /rdi ] =*:availableRegisters + [ /rax /rcx /rdx /rbx /rbp /rsi /rdi ] =*:availableRegisters #"starUsed: " dump starUsed dump #"largestNumber: " dump starUsed dump @@ -523,10 +526,12 @@ newLogic testScopeModifications - containsScopeModifications not |rewriteConstantPipe rep - containsScopeModifications not |rewriteConstantEquals rep - containsScopeModifications not |rewriteConstantDot rep - containsScopeModifications not |rewriteConstantStar rep + containsScopeModifications not { + rewriteConstantPipe + rewriteConstantEquals + } rep + rewriteConstantDot + rewriteConstantStar rewriteStackOps { =*entry 0 entry ==action [ @@ -658,6 +663,22 @@ ] emitOpcodes } + { action ARRAYSTAR streq }' { + [ + /rsi :popqReg + /rax :popqReg + 63 /rax :btrqImm8Reg + [ 8 /rax /rax :movqMemDisp8Reg ] len :jcRel8 + 8 /rax /rax :movqMemDisp8Reg + /rsi /ecx :movlMemReg + 3 /rcx :shrqImm8Reg + /rcx :decqReg + /rdx /rdx :xorqRegReg + /rcx :divqReg + 8 8 /rdx /rsi :pushqMemIndexScaleDisp8 + ] emitOpcodes + } + { action NATIVE streq }' { 1 entry emitOpcodes } |
