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
15230c41
Commit
15230c41
authored
Sep 08, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #149 from tjhance/disable-rewriting
disable rewriting
parents
8e5ed2ad
e986613d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
src/asm_writing/icinfo.cpp
src/asm_writing/icinfo.cpp
+9
-1
src/asm_writing/icinfo.h
src/asm_writing/icinfo.h
+4
-0
src/asm_writing/rewriter.cpp
src/asm_writing/rewriter.cpp
+2
-1
No files found.
src/asm_writing/icinfo.cpp
View file @
15230c41
...
...
@@ -67,6 +67,10 @@ ICSlotRewrite::~ICSlotRewrite() {
free
(
buf
);
}
void
ICSlotRewrite
::
abort
()
{
ic
->
failed
=
true
;
}
void
ICSlotRewrite
::
commit
(
uint64_t
decision_path
,
CommitHook
*
hook
)
{
bool
still_valid
=
true
;
for
(
int
i
=
0
;
i
<
dependencies
.
size
();
i
++
)
{
...
...
@@ -187,7 +191,7 @@ ICInfo::ICInfo(void* start_addr, void* continue_addr, StackInfo stack_info, int
assembler
::
GenericRegister
return_register
,
TypeRecorder
*
type_recorder
)
:
next_slot_to_try
(
0
),
stack_info
(
stack_info
),
num_slots
(
num_slots
),
slot_size
(
slot_size
),
calling_conv
(
calling_conv
),
live_outs
(
live_outs
.
begin
(),
live_outs
.
end
()),
return_register
(
return_register
),
type_recorder
(
type_recorder
),
start_addr
(
start_addr
),
continue_addr
(
continue_addr
)
{
type_recorder
(
type_recorder
),
failed
(
false
),
start_addr
(
start_addr
),
continue_addr
(
continue_addr
)
{
for
(
int
i
=
0
;
i
<
num_slots
;
i
++
)
{
slots
.
push_back
(
SlotInfo
(
this
,
i
));
}
...
...
@@ -281,4 +285,8 @@ void ICInfo::clear(ICSlotInfo* icentry) {
// writer->endWithSlowpath();
llvm
::
sys
::
Memory
::
InvalidateInstructionCache
(
start
,
getSlotSize
());
}
bool
ICInfo
::
shouldAttempt
()
{
return
!
failed
;
}
}
src/asm_writing/icinfo.h
View file @
15230c41
...
...
@@ -73,6 +73,7 @@ public:
void
addDependenceOn
(
ICInvalidator
&
);
void
commit
(
uint64_t
decision_path
,
CommitHook
*
hook
);
void
abort
();
friend
class
ICInfo
;
};
...
...
@@ -100,6 +101,7 @@ private:
const
std
::
vector
<
int
>
live_outs
;
const
assembler
::
GenericRegister
return_register
;
TypeRecorder
*
const
type_recorder
;
bool
failed
;
// for ICSlotRewrite:
ICSlotInfo
*
pickEntryForRewrite
(
uint64_t
decision_path
,
const
char
*
debug_name
);
...
...
@@ -120,6 +122,8 @@ public:
ICSlotRewrite
*
startRewrite
(
const
char
*
debug_name
);
void
clear
(
ICSlotInfo
*
entry
);
bool
shouldAttempt
();
friend
class
ICSlotRewrite
;
};
...
...
src/asm_writing/rewriter.cpp
View file @
15230c41
...
...
@@ -649,6 +649,7 @@ RewriterVarUsage Rewriter::call(bool can_call_into_python, void* func_addr, std:
void
Rewriter
::
abort
()
{
assert
(
!
finished
);
finished
=
true
;
rewrite
->
abort
();
for
(
auto
v
:
args
)
{
v
->
decUse
();
...
...
@@ -1009,7 +1010,7 @@ Rewriter* Rewriter::createRewriter(void* rtn_addr, int num_args, const char* deb
static
StatCounter
rewriter_nopatch
(
"rewriter_nopatch"
);
if
(
!
ic
)
{
if
(
!
ic
||
!
ic
->
shouldAttempt
()
)
{
rewriter_nopatch
.
log
();
return
NULL
;
}
...
...
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