aboutsummaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2013-09-04 11:34:26 +0200
committerDrahflow <drahflow@gmx.de>2013-09-04 11:34:26 +0200
commit4900a0d4845a67afeed28c7b8a1e3662425c838b (patch)
treeedeef6d51e13c81c4f72f80a14a35214dec1a3ab /compiler
parent3fb7dd375ada97b9413abfecccd8a889c53dc93a (diff)
16% faster library built time (regex optimization)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/elymasAsmLib.ey5
-rw-r--r--compiler/standardClient.ey61
2 files changed, 25 insertions, 41 deletions
diff --git a/compiler/elymasAsmLib.ey b/compiler/elymasAsmLib.ey
index 1c04d4e..a2eba57 100644
--- a/compiler/elymasAsmLib.ey
+++ b/compiler/elymasAsmLib.ey
@@ -633,13 +633,18 @@
/rdi /ecx :movlMemReg
8 /rdi :addqImm8Reg
16 /rcx :subqImm8Reg
+
@markFunctionCodeLoop
+ /rdi /r11 :cmpqMemReg
+ /codePartNotObject :jbeLbl32 # pointing above the heap
/rdi :pushqReg
/rcx :pushqReg
/rdi /rdi :movqMemReg
/markObject :callqLbl32
/rcx :popqReg
/rdi :popqReg
+
+ @codePartNotObject
/rdi :incqReg
/markFunctionCodeLoop :loopLbl8
:retn
diff --git a/compiler/standardClient.ey b/compiler/standardClient.ey
index 3d93aa5..7c7415f 100644
--- a/compiler/standardClient.ey
+++ b/compiler/standardClient.ey
@@ -226,37 +226,13 @@
|add /origadd deffd
# TODO think about implementation efficiency
- { < ==maxSize
- 0 ==size
- [ maxSize { 0 }" rep ] =*get
- [ maxSize { 1 }" rep ] =*pcFree
-
- { # ==thread
- _ threadGetPC pcFree {
- _ size |get =[]
- 0 -01 threadGetPC |pcFree =[]
- size 1 origadd =size
- }" { -- }" ? *
- }' /add deffst
-
- { ==i # ==thread
- _ threadGetPC pcFree {
- _ i |get =[]
- 0 -01 threadGetPC |pcFree =[]
- 1
- }" { -- 0 }" ? *
- } /update deffst
-
- {
- 0 =size
- [ maxSize { 1 }" rep ] =pcFree
- }' /clear deffst
- > } /threadList deffd
+ { ==maxSize
+ [ maxSize { 1 }" rep ] ==fullOne
- { < ==maxSize
+ <
0 ==size
[ maxSize { 0 }" rep ] =*get
- [ maxSize { 1 }" rep ] =*pcFree
+ [ fullOne _ len dearray ] =*pcFree
{ # ==thread
_ threadGetPC pcFree {
@@ -264,7 +240,7 @@
0 -01 threadGetPC |pcFree =[]
size 1 origadd =size
}" { -- }" ? *
- }' /push deffst
+ }' /add deffst
{
size 1 sub _ =size
@@ -273,9 +249,9 @@
{
0 =size
- [ maxSize { 1 }" rep ] =pcFree
+ [ fullOne _ len dearray ] =pcFree
}' /clear deffst
- > } /threadStack deffd
+ > } /threadList deffd
# TODO: reconsider clist/ilist and also reconsider optimisation potential
{ ==prog ==string
@@ -286,13 +262,16 @@
prog len _ threadList ==clist
_ threadList ==nlist
- threadStack ==ilist
+ threadList ==ilist
newThread _ ==thread clist .add
0 ==pc
{ } =*code
+ ilist .|add =*iPush
+ ilist .|pop =*iPop
+
[
{ # MATCH
1 =matched
@@ -303,18 +282,18 @@
position string * 1 code * { pc 1 add thread cloneThread nlist .add }" rep
}" rep
}" { # JUMP
- pc 1 code add thread cloneThread ilist .push
+ pc 1 code add thread cloneThread iPush
}" { # SPLIT
- pc 2 code add thread cloneThread ilist .push
- pc 1 code add thread cloneThread ilist .push
+ pc 2 code add thread cloneThread iPush
+ pc 1 code add thread cloneThread iPush
}" { # SAVE
pc 1 add thread fullCloneThread
position 1 code -2102 threadGetCaptures =[]
- ilist .push
+ iPush
}" { # FIRST
- position 0 eq { pc 1 add thread cloneThread ilist .push }" rep
+ position 0 eq { pc 1 add thread cloneThread iPush }" rep
}" { # LAST
- position maxPosition eq { pc 1 add thread cloneThread ilist .push }" rep
+ position maxPosition eq { pc 1 add thread cloneThread iPush }" rep
}"
] =*codeSemantics
@@ -329,9 +308,9 @@
i 1 add =i
{ ilist .size }" {
- ilist .pop _ =thread
- threadGetPC _ =pc
- prog * =code
+ iPop _ =thread
+ threadGetPC _ =pc
+ prog * =code
0 code codeSemantics *
}" loop
}" loop