Skip to content

Commit

Permalink
Merge pull request #688 from ELENA-LANG/develop
Browse files Browse the repository at this point in the history
Iteration 31
  • Loading branch information
arakov authored Sep 4, 2024
2 parents 9bbf8fc + 7736283 commit c7b2496
Show file tree
Hide file tree
Showing 168 changed files with 7,144 additions and 5,122 deletions.
10 changes: 9 additions & 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.0
BUILD_TAG: 6.3.1

permissions:
contents: read
Expand Down Expand Up @@ -52,6 +52,14 @@ jobs:
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} /p:platform=${{ matrix.platform }} /m:2

- name: Generate Data
shell: cmd
run: build\rebuild_data60_${{matrix.platform}}.bat

- name: Run Tests
shell: cmd
run: bin\elena-tests-${{matrix.platform}}.exe

- name: Compile Lib
shell: cmd
run: build\rebuild_lib60_${{matrix.platform}}.bat
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.0
6.3.1
11 changes: 11 additions & 0 deletions asm/aarch64/core60.asm
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ end
// ; NOTE : the table is tailed with GCMGSize,GCYGSize and MaxThread fields
structure %SYSTEM_ENV

dq 0
dq 0
dq data : %CORE_GC_TABLE
dq data : %CORE_SINGLE_CONTENT
Expand Down Expand Up @@ -2149,6 +2150,16 @@ labEnd:
end

// ; peektls
inline %0BBh

end

// ; storetls
inline %0BCh

end

// ; cmpr
inline %0C0h

Expand Down
104 changes: 26 additions & 78 deletions asm/amd64/core60.asm
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ end
// ; NOTE : the table is tailed with GCMGSize,GCYGSize and MaxThread fields
structure %SYSTEM_ENV

dq 0
dq 0
dq data : %CORE_GC_TABLE
dq data : %CORE_SINGLE_CONTENT
Expand Down Expand Up @@ -160,103 +161,31 @@ inline % GC_ALLOC
labYGCollect:
// ; save registers
sub rcx, rax
push r10
push r11
push rbp

// ; lock frame
mov [data : %CORE_SINGLE_CONTENT + tt_stack_frame], rsp

push rcx

// ; create set of roots
mov rbp, rsp
xor ecx, ecx
push rcx // ; reserve place
push rcx
push rcx

// ; save static roots
mov rax, rdata : %SYSTEM_ENV
mov rsi, stat : %0
mov ecx, dword ptr [rax]
shl ecx, 3
push rsi
push rcx

// ; save perm roots
mov rsi, [data : %CORE_GC_TABLE + gc_perm_start]
mov rcx, [data : %CORE_GC_TABLE + gc_perm_current]
sub rcx, rsi
push rsi
push rcx

// ; collect frames
mov rax, [data : %CORE_SINGLE_CONTENT + tt_stack_frame]
mov rcx, rax

labYGNextFrame:
mov rsi, rax
mov rax, [rsi]
test rax, rax
jnz short labYGNextFrame

push rcx
sub rcx, rsi
neg rcx
push rcx

mov rax, [rsi + 8]
test rax, rax
mov rcx, rax
jnz short labYGNextFrame

mov [rbp-8], rsp // ; save position for roots

mov rdx, [rbp]
mov rcx, rsp

// ; restore frame to correctly display a call stack
mov rax, rbp
mov rbp, [rax+8]

// ; call GC routine
sub rsp, 30h
mov [rsp+28h], rax
call extern "$rt.CollectGCLA"

mov rbp, [rsp+28h]
add rsp, 30h
mov rbx, rax

mov rsp, rbp
pop rcx
pop rbp
pop r11
pop r10

xor edx, edx
call %GC_COLLECT
ret

end

// ; --- GC_COLLECT ---
// ; in: ecx - fullmode (0, 1)
// ; in: ecx - size, edx - 1 - full collect, 0 - normal one
inline % GC_COLLECT

// ; save registers
push r10
push r11
push rbp

// ; lock frame
mov [data : %CORE_SINGLE_CONTENT + tt_stack_frame], rsp

push rdx
push rcx

// ; create set of roots
mov rbp, rsp
xor ecx, ecx
push rcx // ; reserve place
push rcx
push rcx
push rcx

Expand All @@ -268,6 +197,13 @@ inline % GC_COLLECT
push rsi
push rcx

// ; save perm roots
mov rsi, [data : %CORE_GC_TABLE + gc_perm_start]
mov rcx, [data : %CORE_GC_TABLE + gc_perm_current]
sub rcx, rsi
push rsi
push rcx

// ; collect frames
mov rax, [data : %CORE_SINGLE_CONTENT + tt_stack_frame]
mov rcx, rax
Expand All @@ -290,12 +226,13 @@ labYGNextFrame:

mov [rbp-8], rsp // ; save position for roots

mov r8, [rbp+8]
mov rdx, [rbp]
mov rcx, rsp

// ; restore frame to correctly display a call stack
mov rax, rbp
mov rbp, [rax+8]
mov rbp, [rax+16]

// ; call GC routine
sub rsp, 30h
Expand All @@ -308,6 +245,7 @@ labYGNextFrame:

mov rsp, rbp
pop rcx
pop rdx
pop rbp
pop r11
pop r10
Expand Down Expand Up @@ -1844,6 +1782,16 @@ labEnd:
end

// ; peektls
inline %0BBh

end

// ; storetls
inline %0BCh

end

// ; cmpr r
inline %0C0h

Expand Down
30 changes: 14 additions & 16 deletions asm/amd64/core60_lnx.asm
Original file line number Diff line number Diff line change
Expand Up @@ -84,36 +84,25 @@ procedure % VEH_HANDLER

end

// ; --- GC_ALLOC ---
// ; in: rcx - size ; out: ebx - created object
// ; note for linux - there is a separate copy
inline % GC_ALLOC

mov rax, [data : %CORE_GC_TABLE + gc_yg_current]
mov r12, [data : %CORE_GC_TABLE + gc_yg_end]
add rcx, rax
cmp rcx, r12
jae short labYGCollect
mov [data : %CORE_GC_TABLE + gc_yg_current], rcx
lea rbx, [rax + elObjectOffset]
ret
// ; --- GC_COLLECT ---
// ; in: ecx - size, edx - 1 - full collect, 0 - normal one
inline % GC_COLLECT

labYGCollect:
// ; save registers
sub rcx, rax
push r10
push r11
push rbp

// ; lock frame
mov [data : %CORE_SINGLE_CONTENT + tt_stack_frame], rsp

push rdx
push rcx

// ; create set of roots
mov rbp, rsp
xor ecx, ecx
push rcx // ; reserve place
push rcx
push rcx
push rcx

Expand All @@ -125,6 +114,13 @@ labYGCollect:
push rsi
push rcx

// ; save perm roots
mov rsi, [data : %CORE_GC_TABLE + gc_perm_start]
mov rcx, [data : %CORE_GC_TABLE + gc_perm_current]
sub rcx, rsi
push rsi
push rcx

// ; collect frames
mov rax, [data : %CORE_SINGLE_CONTENT + tt_stack_frame]
mov rcx, rax
Expand All @@ -147,6 +143,7 @@ labYGNextFrame:

mov [rbp-8], rsp // ; save position for roots

mov rdx, [rbp+8]
mov rsi, [rbp]
mov rdi, rsp

Expand All @@ -165,6 +162,7 @@ labYGNextFrame:

mov rsp, rbp
pop rcx
pop rdx
pop rbp
pop r11
pop r10
Expand Down
Loading

0 comments on commit c7b2496

Please sign in to comment.