Skip to content
This repository has been archived by the owner on May 11, 2020. It is now read-only.

Boilerplate implementing #121 native bailout - thoughts? #124

Merged
merged 9 commits into from
Apr 25, 2019
Merged

Boilerplate implementing #121 native bailout - thoughts? #124

merged 9 commits into from
Apr 25, 2019

Conversation

twitchyliquid64
Copy link
Contributor

This is the beginning of the bailout system.

@codecov-io
Copy link

codecov-io commented Apr 18, 2019

Codecov Report

Merging #124 into master will increase coverage by 0.54%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #124      +/-   ##
==========================================
+ Coverage   66.01%   66.55%   +0.54%     
==========================================
  Files          41       41              
  Lines        4172     4246      +74     
==========================================
+ Hits         2754     2826      +72     
- Misses       1147     1149       +2     
  Partials      271      271
Impacted Files Coverage Δ
exec/internal/compile/native.go 54.54% <100%> (+54.54%) ⬆️
exec/internal/compile/native_exec.go 100% <100%> (ø) ⬆️
exec/native_compile_nogae.go 100% <100%> (ø) ⬆️
exec/native_compile.go 55.35% <42.85%> (-2.65%) ⬇️
exec/internal/compile/backend_amd64.go 79.81% <84.48%> (+3.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c39bd4...f7c4ef3. Read the comment docs.

@twitchyliquid64
Copy link
Contributor Author

PTAL :)

@twitchyliquid64
Copy link
Contributor Author

Note: For now I've enabled native bounds-checking only when tag debugstack is set - my intention is to expose this as a VM option as well.

Main benefit of this is having bounds checking over native stack push/pops in the CI test runs.

jmp.To.Type = obj.TYPE_BRANCH
builder.AddInstruction(jmp)

b.emitExit(builder, &dirtyRegs{}, CompletionBadBounds|makeExitIndex(ci.idx))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would there be any usefulness to pass down regs there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No - given the registers tracking the stack are now out of bounds, passing the value of regs would cause a flush of the stack to memory (corrupting it).

exec/internal/compile/backend_amd64.go Outdated Show resolved Hide resolved
exec/internal/compile/backend_amd64.go Outdated Show resolved Hide resolved
exec/internal/compile/backend_amd64_test.go Show resolved Hide resolved
exec/internal/compile/native.go Outdated Show resolved Hide resolved
exec/internal/compile/native.go Outdated Show resolved Hide resolved
exec/native_compile.go Outdated Show resolved Hide resolved
@sbinet sbinet merged commit 41ac96a into go-interpreter:master Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants