diff options
| author | Drahflow <drahflow@gmx.de> | 2013-09-28 21:54:36 +0200 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2013-09-28 21:54:36 +0200 |
| commit | 99e0fad4803fa1b36b3b65ad5dfa1f2abdd3b418 (patch) | |
| tree | 00fe8b524e578ac7380586a6240af11ab2a117b7 /compiler | |
| parent | 55cb8cb3c9c768f9f088dabe47e8939b2b8d4d1b (diff) | |
Rewriting * when types are predictable
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/elymasAsm.ey | 9 | ||||
| -rw-r--r-- | compiler/elymasGlobalSys.ey | 30 |
2 files changed, 39 insertions, 0 deletions
diff --git a/compiler/elymasAsm.ey b/compiler/elymasAsm.ey index dcd5797..a27f34e 100644 --- a/compiler/elymasAsm.ey +++ b/compiler/elymasAsm.ey @@ -531,6 +531,15 @@ /two reg modrm11 } /callqReg deff + memoryAddressingVariants keys { ==variant memoryAddressingVariants variant . =*parse + { parse ==mem + mem .base regno %07 gt mem .idx regno %07 gt or + { 0 /none mem .idx mem .base rex } rep + %FF + /two mem .encode + } /callq variant defOp + } each + { %FC } /cld deff diff --git a/compiler/elymasGlobalSys.ey b/compiler/elymasGlobalSys.ey index 1f95e0b..912d5c0 100644 --- a/compiler/elymasGlobalSys.ey +++ b/compiler/elymasGlobalSys.ey @@ -81,6 +81,36 @@ 8 /r15 :addqImm8Reg :retn ]] /eyresolveInfo defv + + # return information about the captured scope of a function + # 0 -> function object + # 0 <- any scope captured + # 1 <- if any scope was caputered, that scope + [[ + 8 /r15 :subqImm8Reg + /r15 :popqMem + + /rsi :popqReg + 8 /rsi /rsi :movqMemDisp8Reg + /rsi /rsi :testqRegReg + /noScopeCaptured :jzLbl8 + + /rsi :pushqReg # push scope + 1 /rax :movqImmReg + 63 /rax :btsqImm8Reg + /rax :pushqReg + + /done :jmpLbl8 + + @noScopeCaptured + 63 /rsi :btsqImm8Reg + /rsi :pushqReg + + @done + /r15 :pushqMem + 8 /r15 :addqImm8Reg + :retn + ]] /eycapturedScope defv > _ ==globalFunctions { defv }' ::allocateOffsetStruct [ |
