aboutsummaryrefslogtreecommitdiff
path: root/elymas/lib
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2013-09-27 22:41:44 +0200
committerDrahflow <drahflow@gmx.de>2013-09-27 22:41:44 +0200
commit7bac36eb5770408963b97f183dd8214c698f41a8 (patch)
tree15a4aeb35d1a80a8133d1fba69f4b95a005b2ef2 /elymas/lib
parentf6af44d6742d96ecf002eb24475ecc23bf3d2d72 (diff)
Direct static access by offset /r14 :pushqMemDisp8
Diffstat (limited to 'elymas/lib')
-rw-r--r--elymas/lib/sys/opt.ey45
1 files changed, 36 insertions, 9 deletions
diff --git a/elymas/lib/sys/opt.ey b/elymas/lib/sys/opt.ey
index c693f7f..28faa9b 100644
--- a/elymas/lib/sys/opt.ey
+++ b/elymas/lib/sys/opt.ey
@@ -106,6 +106,16 @@
[
8 /r15 :subqImm8Reg
/r15 :popqMem
+ 0 /rax :movqImmReg
+ /rax :pushqReg
+ /r15 :pushqMem
+ 8 /r15 :addqImm8Reg
+ :retn
+ ] ==:customFunctionConstantPassivePattern
+
+ [
+ 8 /r15 :subqImm8Reg
+ /r15 :popqMem
] ==:customFunctionHeaderPattern
/NOP ==:NOP
@@ -409,6 +419,12 @@
] conds
}
+ { customFunctionConstantPassivePattern callTargetMatch }' {
+ [ calledAddress 9 add _ 8 add range peek each ] 256 math .unbase ==pushedConstant
+
+ [ PUSH pushedConstant ] emitLogic
+ }
+
{ customFunctionHeaderPattern callTargetMatch }' {
[ CALL calledAddress ] emitLogic
}
@@ -504,16 +520,27 @@
{ action [ STATIC STATICTYPED ] streq any }' {
[
- /r14 /rax :movqRegReg
- 2 entry { 16 /rax /rax :movqMemDisp8Reg } rep
-
- 3 entry {
- 24 /rax /rcx :movqMemDisp8Reg # load extension area pointer
- /rax /edx :movlMemReg # load scope length
- /rdx :negqReg # prepare for substraction # TODO the length calculation could be done beforehand
- 1 entry 1 /rdx /rcx :pushqMemIndexScaleDisp32 # push loaded entry to stack
+ 2 entry {
+ 16 /r14 /rax :movqMemDisp8Reg
+ 2 entry 1 sub { 16 /rax /rax :movqMemDisp8Reg } rep
+
+ 3 entry {
+ 24 /rax /rcx :movqMemDisp8Reg # load extension area pointer
+ /rax /edx :movlMemReg # load scope length
+ /rdx :negqReg # prepare for substraction # TODO the length calculation could be done beforehand
+ 1 entry 1 /rdx /rcx :pushqMemIndexScaleDisp32 # push loaded entry to stack
+ } {
+ 1 entry /rax :pushqMemDisp32
+ } ? *
} {
- 1 entry /rax :pushqMemDisp32
+ 3 entry {
+ 24 /r14 /rcx :movqMemDisp8Reg # load extension area pointer
+ /r14 /edx :movlMemReg # load scope length
+ /rdx :negqReg # prepare for substraction # TODO the length calculation could be done beforehand
+ 1 entry 1 /rdx /rcx :pushqMemIndexScaleDisp32 # push loaded entry to stack
+ } {
+ 1 entry /r14 :pushqMemDisp32
+ } ? *
} ? *
] emitOpcodes
}