diff options
| author | Drahflow <drahflow@gmx.de> | 2015-06-22 13:26:49 +0200 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2015-06-22 13:26:49 +0200 |
| commit | c928ded416dd1cd5ef01df1e5768c07868000e86 (patch) | |
| tree | 721204394f46f6b2f11f2830a85ab2359c18079e /compiler | |
| parent | 483c65f6132fb81113227c67da79bf5fe66166ec (diff) | |
Finally rewrite extension area access to constant scope size
... also fixes a nasty bug when STATICWRITE from PUSH
in rewriteIntegerTrace
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/elymasAsmLib.ey | 4 | ||||
| -rw-r--r-- | compiler/elymasGlobal.ey | 7 | ||||
| -rw-r--r-- | compiler/elymasGlobalSys.ey | 2 |
3 files changed, 6 insertions, 7 deletions
diff --git a/compiler/elymasAsmLib.ey b/compiler/elymasAsmLib.ey index 4d51ce5..a8f0987 100644 --- a/compiler/elymasAsmLib.ey +++ b/compiler/elymasAsmLib.ey @@ -1398,7 +1398,7 @@ # rdi <- number of parent pointers followed # rsi <- entry index * 8 within scope # rbp <- 0 if within scope data area - # 1 if within extension area + # scope object length if within extension area [[ /rax /rax :xorqRegReg /rax :pushqReg @@ -1529,11 +1529,11 @@ /ecx /rdi :cmplRegMem # TODO this fails for > 4 GB scopes /inDataArea :jaLbl8 + /rdi /ebp :movlMemReg # load scope length /rdi /ecx :sublMemReg # substract scope length 24 /rdi /rdi :movqMemDisp8Reg # load extension area pointer /rdi /rdi :testqRegReg /outsideExtensionArea :jzLbl8 - /rbp :incqReg 8 /rcx :addqImm8Reg # add extension area header length @inDataArea diff --git a/compiler/elymasGlobal.ey b/compiler/elymasGlobal.ey index 77fcb0e..cfa58cf 100644 --- a/compiler/elymasGlobal.ey +++ b/compiler/elymasGlobal.ey @@ -1623,7 +1623,7 @@ /patchStaticFollowParents :loopLbl8 @patchStaticNoFollowParents - %01 /bpl :testbImmReg + /rbp /rbp :testqRegReg /patchStaticLoadFromExtensionArea :jnzLbl8 # @patchStaticLoadFromScope @@ -1639,11 +1639,10 @@ 40 /rsi :addqImm8Reg # now: rsi == offset of entry in extension area + scope length [ 24 /rax /rcx :movqMemDisp8Reg # load extension area pointer - /rax /edx :movlMemReg # load scope length - /rdx :negqReg # prepare for substraction /rbx :popqReg - %EE 1 /rdx /rcx /rax :movqMemIndexScaleDisp32Reg # load entry + %EE /rcx /rax :movqMemDisp32Reg # load entry ] ::loadToRdi + /rbp /rsi :subqRegReg # substract scope object length /esi 4 neg /rdi :movlRegMemDisp8 # patch offset @patchStaticLoadTail diff --git a/compiler/elymasGlobalSys.ey b/compiler/elymasGlobalSys.ey index b44de09..e00009c 100644 --- a/compiler/elymasGlobalSys.ey +++ b/compiler/elymasGlobalSys.ey @@ -49,7 +49,7 @@ # 2 <- memory address of entry (only present if resolution successful) # 3 <- number of parent pointers followed (only present if resolution successful) # 4 <- entry index * 8 within scope (only present if resolution successful) - # 5 <- 0 if within scope data area, 1 if within extension area (only present if resolution successful) + # 5 <- 0 if within scope data area, scope object size if within extension area (only present if resolution successful) # TODO simplify by returning unboxed ints where appropriate maybe [[ 8 /r15 :subqImm8Reg |
