Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
b871bc10
Commit
b871bc10
authored
Oct 14, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #964 from kmod/rewrite_failed
Fix a rare 'assert R11 is not used' crash
parents
00b022aa
d3b4a490
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
src/asm_writing/rewriter.cpp
src/asm_writing/rewriter.cpp
+9
-7
src/asm_writing/rewriter.h
src/asm_writing/rewriter.h
+2
-1
No files found.
src/asm_writing/rewriter.cpp
View file @
b871bc10
...
...
@@ -619,7 +619,7 @@ assembler::Register RewriterVar::getInReg(Location dest, bool allow_constant_in_
assembler
::
Register
dest_reg
=
dest
.
asRegister
();
assert
(
dest_reg
!=
reg
);
// should have been caught by the previous case
rewriter
->
allocReg
(
dest
);
rewriter
->
allocReg
(
dest
,
otherThan
);
rewriter
->
assembler
->
mov
(
reg
,
dest_reg
);
rewriter
->
addLocationToVar
(
this
,
dest_reg
);
...
...
@@ -858,7 +858,7 @@ RewriterVar* Rewriter::call(bool has_side_effects, void* func_addr, const Rewrit
}
void
Rewriter
::
_setupCall
(
bool
has_side_effects
,
llvm
::
ArrayRef
<
RewriterVar
*>
args
,
llvm
::
ArrayRef
<
RewriterVar
*>
args_xmm
)
{
llvm
::
ArrayRef
<
RewriterVar
*>
args_xmm
,
Location
preserve
)
{
if
(
has_side_effects
)
assert
(
done_guarding
);
...
...
@@ -879,7 +879,7 @@ void Rewriter::_setupCall(bool has_side_effects, llvm::ArrayRef<RewriterVar*> ar
if
(
!
marked_inside_ic
)
{
uintptr_t
counter_addr
=
(
uintptr_t
)(
&
picked_slot
->
num_inside
);
if
(
isLargeConstant
(
counter_addr
))
{
assembler
::
Register
reg
=
allocReg
(
Location
::
any
(),
getReturnDestination
()
);
assembler
::
Register
reg
=
allocReg
(
Location
::
any
(),
preserve
);
assembler
->
mov
(
assembler
::
Immediate
(
counter_addr
),
reg
);
assembler
->
incl
(
assembler
::
Indirect
(
reg
,
0
));
}
else
{
...
...
@@ -900,7 +900,7 @@ void Rewriter::_setupCall(bool has_side_effects, llvm::ArrayRef<RewriterVar*> ar
{
// this forces the register allocator to spill this register:
assembler
::
Register
r2
=
allocReg
(
l
);
assembler
::
Register
r2
=
allocReg
(
l
,
preserve
);
if
(
failed
)
return
;
assert
(
r
==
r2
);
...
...
@@ -977,7 +977,7 @@ void Rewriter::_setupCall(bool has_side_effects, llvm::ArrayRef<RewriterVar*> ar
if
(
need_to_spill
)
{
if
(
check_reg
.
type
==
Location
::
Register
)
{
spillRegister
(
check_reg
.
asRegister
());
spillRegister
(
check_reg
.
asRegister
()
,
preserve
);
if
(
failed
)
return
;
}
else
{
...
...
@@ -1012,8 +1012,10 @@ void Rewriter::_call(RewriterVar* result, bool has_side_effects, void* func_addr
// RewriterVarUsage scratch = createNewVar(Location::any());
assembler
::
Register
r
=
allocReg
(
assembler
::
R11
);
if
(
failed
)
return
;
_setupCall
(
has_side_effects
,
args
,
args_xmm
);
_setupCall
(
has_side_effects
,
args
,
args_xmm
,
assembler
::
R11
);
for
(
RewriterVar
*
arg
:
args
)
{
arg
->
bumpUse
();
...
...
@@ -1699,7 +1701,7 @@ assembler::Register Rewriter::allocReg(Location dest, Location otherThan) {
assembler
::
Register
reg
(
dest
.
regnum
);
if
(
vars_by_location
.
count
(
reg
))
{
spillRegister
(
reg
);
spillRegister
(
reg
,
otherThan
);
}
assert
(
failed
||
vars_by_location
.
count
(
reg
)
==
0
);
...
...
src/asm_writing/rewriter.h
View file @
b871bc10
...
...
@@ -489,7 +489,8 @@ protected:
void
_slowpathJump
(
bool
condition_eq
);
void
_trap
();
void
_loadConst
(
RewriterVar
*
result
,
int64_t
val
);
void
_setupCall
(
bool
has_side_effects
,
llvm
::
ArrayRef
<
RewriterVar
*>
args
,
llvm
::
ArrayRef
<
RewriterVar
*>
args_xmm
);
void
_setupCall
(
bool
has_side_effects
,
llvm
::
ArrayRef
<
RewriterVar
*>
args
,
llvm
::
ArrayRef
<
RewriterVar
*>
args_xmm
,
Location
preserve
=
Location
::
any
());
void
_call
(
RewriterVar
*
result
,
bool
has_side_effects
,
void
*
func_addr
,
llvm
::
ArrayRef
<
RewriterVar
*>
args
,
llvm
::
ArrayRef
<
RewriterVar
*>
args_xmm
);
void
_add
(
RewriterVar
*
result
,
RewriterVar
*
a
,
int64_t
b
,
Location
dest
);
...
...
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