Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mu-impl-fast
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
40
Issues
40
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
mu
mu-impl-fast
Commits
cd2fd327
Commit
cd2fd327
authored
Feb 03, 2017
by
qinsoon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make sure when we adjust frame size, stack pointer is 16-bytes aligned
(for calling convention)
parent
bf5b86a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
src/compiler/backend/arch/x86_64/asm_backend.rs
src/compiler/backend/arch/x86_64/asm_backend.rs
+9
-1
src/compiler/backend/reg_alloc/graph_coloring/mod.rs
src/compiler/backend/reg_alloc/graph_coloring/mod.rs
+1
-1
src/compiler/machine_code.rs
src/compiler/machine_code.rs
+1
-1
No files found.
src/compiler/backend/arch/x86_64/asm_backend.rs
View file @
cd2fd327
...
...
@@ -633,7 +633,15 @@ impl MachineCode for ASMCode {
regs_to_remove
}
fn
patch_frame_size
(
&
mut
self
,
size
:
usize
)
{
fn
patch_frame_size
(
&
mut
self
,
size
:
usize
,
size_used
:
usize
)
{
// calling convention requires stack pointer to be 16 bytes aligned before a call
// we make frame size a multipl of 16 bytes
let
size
=
if
(
size
+
size_used
)
%
16
==
0
{
size
}
else
{
(
(
size
+
size_used
)
/
16
+
1
)
*
16
-
size_used
};
let
size
=
size
.to_string
();
debug_assert!
(
size
.len
()
<=
FRAME_SIZE_PLACEHOLDER_LEN
);
...
...
src/compiler/backend/reg_alloc/graph_coloring/mod.rs
View file @
cd2fd327
...
...
@@ -95,7 +95,7 @@ impl RegisterAllocation {
let
size_to_patch
=
total_frame_size
-
size_for_callee_saved_regs
;
trace!
(
"patching the code to grow/shrink size of {} bytes"
,
size_to_patch
);
coloring
.cf
.mc_mut
()
.patch_frame_size
(
size_to_patch
);
coloring
.cf
.mc_mut
()
.patch_frame_size
(
size_to_patch
,
size_for_callee_saved_regs
);
}
coloring
.cf
.mc
()
.trace_mc
();
...
...
src/compiler/machine_code.rs
View file @
cd2fd327
...
...
@@ -192,7 +192,7 @@ pub trait MachineCode {
/// returns what registers push/pop have been deleted
fn
remove_unnecessary_callee_saved
(
&
mut
self
,
used_callee_saved
:
Vec
<
MuID
>
)
->
Vec
<
MuID
>
;
/// patch frame size
fn
patch_frame_size
(
&
mut
self
,
size
:
usize
);
fn
patch_frame_size
(
&
mut
self
,
size
:
usize
,
size_used
:
usize
);
fn
as_any
(
&
self
)
->
&
Any
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment