diff options
| author | Drahflow <drahflow@gmx.de> | 2015-06-23 14:38:08 +0200 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2015-06-23 14:38:08 +0200 |
| commit | c6dee8052a326989e319cf1fcfdc0c215d7d7cc8 (patch) | |
| tree | b4b9b68492727724af87a3119ce8d1b38a125b9a /elymas | |
| parent | f2d3dd3ce83f27f7f2903e80d2d863684942bbf9 (diff) | |
Correctly optimize non-integer args to ARRAYSTAR
Diffstat (limited to 'elymas')
| -rw-r--r-- | elymas/lib/sys/opt.ey | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/elymas/lib/sys/opt.ey b/elymas/lib/sys/opt.ey index e71a6fc..0253235 100644 --- a/elymas/lib/sys/opt.ey +++ b/elymas/lib/sys/opt.ey @@ -2544,12 +2544,22 @@ } { action ARRAYSTAR eq }' { - [ + [[ /rsi :popqReg /rax :popqReg 63 /rax :btrqImm8Reg - [ 8 /rax /rax :movqMemDisp8Reg ] len :jcRel8 + /unboxedInteger :jcLbl8 + %f0 7 /rax :andbImmMemDisp8 + /boxedInteger :jzLbl8 + /rax :pushqReg + /rsi :pushqReg + "*" | ::rawCodeAddress /rax :movqImmReg + /rax :callqReg + /done :jmpLbl8 + + @boxedInteger 8 /rax /rax :movqMemDisp8Reg + @unboxedInteger /rsi /ecx :movlMemReg 3 /rcx :shrqImm8Reg /rcx :decqReg @@ -2559,16 +2569,28 @@ [ /rcx /rdx :addqRegReg ] len :jgeRel8 /rcx /rdx :addqRegReg 8 8 /rdx /rsi :pushqMemIndexScaleDisp8 - ] emitOpcodes + + @done + ]] emitOpcodes } { action STRINGSTAR eq }' { - [ + [[ /rsi :popqReg /rax :popqReg 63 /rax :btrqImm8Reg - [ 8 /rax /rax :movqMemDisp8Reg ] len :jcRel8 + /unboxedInteger :jcLbl8 + %f0 7 /rax :andbImmMemDisp8 + /boxedInteger :jzLbl8 + /rax :pushqReg + /rsi :pushqReg + "*" | ::rawCodeAddress /rax :movqImmReg + /rax :callqReg + /done :jmpLbl8 + + @boxedInteger 8 /rax /rax :movqMemDisp8Reg + @unboxedInteger 16 /rsi /rcx :movqMemDisp8Reg :cqo /rcx :idivqReg @@ -2578,7 +2600,9 @@ 24 1 /rdx /rsi /rbx :movzxMem8IndexScaleDisp8Reg64 63 /rbx :btsqImm8Reg /rbx :pushqReg - ] emitOpcodes + + @done + ]] emitOpcodes } { action [ NATIVE NATIVENOSCOPE ] eq any }' { |
