Skip to content

Commit

Permalink
Merge pull request #694 from ELENA-LANG/develop
Browse files Browse the repository at this point in the history
Iteration33 (#693)
  • Loading branch information
arakov authored Oct 7, 2024
2 parents ed725c6 + 8938a86 commit 581458e
Show file tree
Hide file tree
Showing 189 changed files with 13,435 additions and 11,733 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release

BUILD_TAG: 6.3.2
BUILD_TAG: 6.4.3

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.2
6.4.3
310 changes: 310 additions & 0 deletions asm/aarch64/core60.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3438,6 +3438,21 @@ inline %0ECh

end

// ; vjumpmr
inline %6ECh

sub x14, x10, elVMTOffset
ldr x14, [x14]
add x17, x14, __arg12_1
sub x14, x14, elVMTSizeOffset
ldr x14, [x14]
lsl x14, x14, #4
add x17, x17, x14
ldr x17, [x17]
br x17

end

// ; jumpmr
inline %0EDh

Expand Down Expand Up @@ -4661,6 +4676,285 @@ labNextBaseClass:

end


// ; dispatchmr (alt mode)
// ; NOTE : __arg32_1 - message; __n_1 - arg count; __ptr32_2 - list, __n_2 - argument list offset
inline % 6FBh

str x0, [sp] // ; saving arg0
//; lea rax, [rsp + __n_2]
add x17, sp, __n12_2
//; mov [rsp+16], r11 // ; saving arg0
str x1, [sp, #8]

sub x17, x17, #8 // ; HOTFIX : caller address is not in the stack

//; mov rsi, __ptr64_2
movz x21, __ptr32lo_2
movk x21, __ptr32hi_2, lsl #16

//; xor edx, edx
mov x25, #0
//; mov rbx, [rsi] // ; message from overload list
ldr x22, [x21, #0]

labNextOverloadlist:
//; mov r9, mdata : %0
movz x24, mdata_ptr32lo : #0 //;--
movk x24, mdata_ptr32hi : #0, lsl #16

//; shr ebx, ACTION_ORDER
lsr x22, x22, # ACTION_ORDER
//; lea r13, [rbx*8]
lsl x23, x22, #4

//; mov r13, [r9 + r13 * 2 + 8]
add x23, x23, x24
ldr x23, [x23, #8]

//; mov ecx, __n_1
mov x16, __n16_1

//; lea rbx, [r13 - 8]
sub x22, x23, #8

labNextParam:
//; sub ecx, 1
sub x16, x16, #1

//; jnz short labMatching
cmp x16, #0
bne labMatching

//; mov r9, __ptr64_2 - r21

lsl x23, x25, #4
add x25, x21, x23
ldr x9, [x25]
ldr x23, [x25, #8]

sub x16, x10, elVMTOffset
ldr x16, [x16, #0]

sub x20, x16, elVMTSizeOffset
ldr x20, [x20, #0]
lsl x20, x20, #4
add x16, x16, x20

//; jmp [rcx + rax + 8] // rax - 0
add x20, x16, x23

ldr x17, [x20, #8]
br x17

labMatching:
//; mov rdi, [rax + rcx * 8]
lsl x19, x16, #3
add x18, x19, x17
ldr x18, [x18]

//; check nil
//; mov rsi, rdata : %VOIDPTR + elObjectOffset
movz x20, rdata_ptr32lo : %VOIDPTR
movk x20, rdata_ptr32hi : %VOIDPTR, lsl #16
add x20, x20, elObjectOffset

//; test rdi, rdi
cmp x18, #0

//; cmovz rdi, rsi
csel x18, x20, x18, eq

//; mov rdi, [rdi - elVMTOffset]
sub x18, x18, elVMTOffset
ldr x18, [x18, #0]

//; mov rsi, [rbx + rcx * 8]
add x20, x22, x19
ldr x20, [x20]

labNextBaseClass:
//; cmp rsi, rdi
cmp x20, x18

//; jz labNextParam
beq labNextParam
//; mov rdi, [rdi - elPackageOffset]
sub x18, x18, elPackageOffset
ldr x18, [x18]

//; and rdi, rdi
cmp x18, #0
//; jnz short labNextBaseClass
bne labNextBaseClass

//; add rdx, 1
add x25, x25, #1
//; mov r13, __ptr32_2
mov x23, x21

//; lea r9, [rdx * 8]
lsl x24, x25, 4

//; mov rbx, [r13 + r9 * 2] // ; message from overload list
add x22, x24, x23
ldr x22, [x22]

//; and rbx, rbx
cmp x22, 0
//; jnz labNextOverloadlist
bne labNextOverloadlist

end

// ; dispatchmr
// ; NOTE : __arg32_1 - message; __n_1 - arg count; __ptr32_2 - list, __n_2 - argument list offset
inline % 0BFBh

str x0, [sp] // ; saving arg0
//; lea rax, [rsp + __n_2]
add x17, sp, __n12_2
//; mov [rsp+16], r11 // ; saving arg0
str x1, [sp, #8]

sub x17, x17, #8 // ; HOTFIX : caller address is not in the stack

//; mov rsi, __ptr64_2
movz x21, __ptr32lo_2
movk x21, __ptr32hi_2, lsl #16

//; xor edx, edx
mov x25, #0
mov x11, #0

// ; count the number of args
mov x22, x17
mov x23, #0
sub x23, x23, #1 // ; define the terminator
labCountParam:
add x22, x22, #8
ldr x24, [x22]
add x16, x16, 1
cmp x24, x23
bne labCountParam
mov x17, x11

//; mov rbx, [rsi] // ; message from overload list
ldr x22, [x21, #0]

labNextOverloadlist:
//; mov r9, mdata : %0
movz x24, mdata_ptr32lo : #0 //;--
movk x24, mdata_ptr32hi : #0, lsl #16

//; shr ebx, ACTION_ORDER
lsr x22, x22, # ACTION_ORDER
//; lea r13, [rbx*8]
lsl x23, x22, #4

//; mov r13, [r9 + r13 * 2 + 8]
add x23, x23, x24
ldr x23, [x23, #8]

//; mov ecx, __n_1
mov x16, x17

//; lea rbx, [r13 - 8]
sub x22, x23, #8

labNextParam:
//; sub ecx, 1
sub x16, x16, #1

//; jnz short labMatching
cmp x16, x17
bne labMatching

//; mov r9, __ptr64_2 - r21

lsl x23, x25, #4
add x25, x21, x23
ldr x9, [x25]
ldr x23, [x25, #8]

sub x16, x10, elVMTOffset
ldr x16, [x16, #0]

sub x20, x16, elVMTSizeOffset
ldr x20, [x20, #0]
lsl x20, x20, #4
add x16, x16, x20

//; jmp [rcx + rax + 8] // rax - 0
add x20, x16, x23

ldr x17, [x20, #8]
br x17

labMatching:
add x20, x26, #8
ldr x18, [x20]
cmp x18, #0
csel x26, x26, x20, eq

//; mov rdi, [rax + rcx * 8]
lsl x19, x16, #3
add x18, x19, x17
ldr x18, [x18]

//; check nil
//; mov rsi, rdata : %VOIDPTR + elObjectOffset
movz x20, rdata_ptr32lo : %VOIDPTR
movk x20, rdata_ptr32hi : %VOIDPTR, lsl #16
add x20, x20, elObjectOffset

//; test rdi, rdi
cmp x18, #0

//; cmovz rdi, rsi
csel x18, x20, x18, eq

//; mov rdi, [rdi - elVMTOffset]
sub x18, x18, elVMTOffset
ldr x18, [x18, #0]

//; mov rsi, [rbx + rcx * 8]
ldr x20, [x26]

labNextBaseClass:
//; cmp rsi, rdi
cmp x20, x18

//; jz labNextParam
beq labNextParam
//; mov rdi, [rdi - elPackageOffset]
sub x18, x18, elPackageOffset
ldr x18, [x18]

//; and rdi, rdi
cmp x18, #0
//; jnz short labNextBaseClass
bne labNextBaseClass

//; add rdx, 1
add x25, x25, #1
//; mov r13, __ptr32_2
mov x23, x21

//; lea r9, [rdx * 8]
lsl x24, x25, 4

//; mov rbx, [r13 + r9 * 2] // ; message from overload list
add x22, x24, x23
ldr x22, [x22]

//; and rbx, rbx
cmp x22, 0
//; jnz labNextOverloadlist
bne labNextOverloadlist

end

// ; vcallmr
inline %0FCh

Expand All @@ -4673,6 +4967,22 @@ inline %0FCh

end

// ; vcallmr
inline %06FCh

mov x18, __arg16_1
sub x14, x10, elVMTOffset
ldr x14, [x14]
add x17, x14, x18
sub x14, x14, elVMTSizeOffset
ldr x14, [x14]
lsl x14, x14, #4
add x17, x17, x14
ldr x17, [x17, #8]
blr x17

end

// ; callmr
inline %0FDh

Expand Down
Loading

0 comments on commit 581458e

Please sign in to comment.