aboutsummaryrefslogtreecommitdiff
path: root/compiler/elymasAsmLib.ey
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2015-05-13 15:05:07 +0200
committerDrahflow <drahflow@gmx.de>2015-05-13 15:05:07 +0200
commitec762220e5ec0785b8860af226fa517aac8494bc (patch)
treed30db40fc45ccdd8bf4c3d00aa6b9abb894c737d /compiler/elymasAsmLib.ey
parent505524b45f59263fb29057e829b9a39ef86e0e99 (diff)
Now with 57% less runtime
Diffstat (limited to 'compiler/elymasAsmLib.ey')
-rw-r--r--compiler/elymasAsmLib.ey19
1 files changed, 16 insertions, 3 deletions
diff --git a/compiler/elymasAsmLib.ey b/compiler/elymasAsmLib.ey
index fdf97b8..ce5ffcf 100644
--- a/compiler/elymasAsmLib.ey
+++ b/compiler/elymasAsmLib.ey
@@ -938,8 +938,17 @@
@allocateFromSystem
heapSize /rax :movqImmReg
/rax /rdi :movqMemReg
- ALLOCCHUNKSIZE /rsi :movqImmReg # size of new block
+ ALLOCCHUNKSIZE /rax :movqImmReg # minimum size of new block
+ /rdi /rcx :movqRegReg
+ 24 /rcx :shrqImm8Reg
+ /rcx :incqReg
+ /rdx /rdx :xorqRegReg
+ /rcx :mulqReg # allocate more if heap is already large
+ /rax /rsi :movqRegReg
+ /rsi :pushqReg
+
/rsi /rdi :addqRegReg
+ heapSize /rax :movqImmReg
/rdi /rax :movqRegMem
/rsi /rdi :subqRegReg
/rax :movqImmOOBReg HEAPBASE
@@ -950,7 +959,11 @@
heapSize /rax :movqImmReg
/rax /rdi :movqMemReg
7 /rdi :shrqImm8Reg
- ALLOCCHUNKSIZE 128 udiv /rsi :movqImmReg
+
+ /rsi :popqReg
+ 7 /rsi :shrqImm8Reg
+ /rsi :pushqReg
+
/rsi /rdi :subqRegReg
/rax :movqImmOOBReg BLOCKBASE
/rax /rdi :addqRegReg
@@ -959,7 +972,7 @@
heapSize /rax :movqImmReg
/rax /rdi :movqMemReg
7 /rdi :shrqImm8Reg
- ALLOCCHUNKSIZE 128 udiv /rsi :movqImmReg
+ /rsi :popqReg
/rsi /rdi :subqRegReg
/rax :movqImmOOBReg MARKBASE
/rax /rdi :addqRegReg