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() {
...
@@ -67,6 +67,10 @@ ICSlotRewrite::~ICSlotRewrite() {
free
(
buf
);
free
(
buf
);
}
}
void
ICSlotRewrite
::
abort
()
{
ic
->
failed
=
true
;
}
void
ICSlotRewrite
::
commit
(
uint64_t
decision_path
,
CommitHook
*
hook
)
{
void
ICSlotRewrite
::
commit
(
uint64_t
decision_path
,
CommitHook
*
hook
)
{
bool
still_valid
=
true
;
bool
still_valid
=
true
;
for
(
int
i
=
0
;
i
<
dependencies
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
dependencies
.
size
();
i
++
)
{
...
@@ -187,7 +191,7 @@ ICInfo::ICInfo(void* start_addr, void* continue_addr, StackInfo stack_info, int
...
@@ -187,7 +191,7 @@ ICInfo::ICInfo(void* start_addr, void* continue_addr, StackInfo stack_info, int
assembler
::
GenericRegister
return_register
,
TypeRecorder
*
type_recorder
)
assembler
::
GenericRegister
return_register
,
TypeRecorder
*
type_recorder
)
:
next_slot_to_try
(
0
),
stack_info
(
stack_info
),
num_slots
(
num_slots
),
slot_size
(
slot_size
),
:
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
),
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
++
)
{
for
(
int
i
=
0
;
i
<
num_slots
;
i
++
)
{
slots
.
push_back
(
SlotInfo
(
this
,
i
));
slots
.
push_back
(
SlotInfo
(
this
,
i
));
}
}
...
@@ -281,4 +285,8 @@ void ICInfo::clear(ICSlotInfo* icentry) {
...
@@ -281,4 +285,8 @@ void ICInfo::clear(ICSlotInfo* icentry) {
// writer->endWithSlowpath();
// writer->endWithSlowpath();
llvm
::
sys
::
Memory
::
InvalidateInstructionCache
(
start
,
getSlotSize
());
llvm
::
sys
::
Memory
::
InvalidateInstructionCache
(
start
,
getSlotSize
());
}
}
bool
ICInfo
::
shouldAttempt
()
{
return
!
failed
;
}
}
}
src/asm_writing/icinfo.h
View file @
15230c41
...
@@ -73,6 +73,7 @@ public:
...
@@ -73,6 +73,7 @@ public:
void
addDependenceOn
(
ICInvalidator
&
);
void
addDependenceOn
(
ICInvalidator
&
);
void
commit
(
uint64_t
decision_path
,
CommitHook
*
hook
);
void
commit
(
uint64_t
decision_path
,
CommitHook
*
hook
);
void
abort
();
friend
class
ICInfo
;
friend
class
ICInfo
;
};
};
...
@@ -100,6 +101,7 @@ private:
...
@@ -100,6 +101,7 @@ private:
const
std
::
vector
<
int
>
live_outs
;
const
std
::
vector
<
int
>
live_outs
;
const
assembler
::
GenericRegister
return_register
;
const
assembler
::
GenericRegister
return_register
;
TypeRecorder
*
const
type_recorder
;
TypeRecorder
*
const
type_recorder
;
bool
failed
;
// for ICSlotRewrite:
// for ICSlotRewrite:
ICSlotInfo
*
pickEntryForRewrite
(
uint64_t
decision_path
,
const
char
*
debug_name
);
ICSlotInfo
*
pickEntryForRewrite
(
uint64_t
decision_path
,
const
char
*
debug_name
);
...
@@ -120,6 +122,8 @@ public:
...
@@ -120,6 +122,8 @@ public:
ICSlotRewrite
*
startRewrite
(
const
char
*
debug_name
);
ICSlotRewrite
*
startRewrite
(
const
char
*
debug_name
);
void
clear
(
ICSlotInfo
*
entry
);
void
clear
(
ICSlotInfo
*
entry
);
bool
shouldAttempt
();
friend
class
ICSlotRewrite
;
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:
...
@@ -649,6 +649,7 @@ RewriterVarUsage Rewriter::call(bool can_call_into_python, void* func_addr, std:
void
Rewriter
::
abort
()
{
void
Rewriter
::
abort
()
{
assert
(
!
finished
);
assert
(
!
finished
);
finished
=
true
;
finished
=
true
;
rewrite
->
abort
();
for
(
auto
v
:
args
)
{
for
(
auto
v
:
args
)
{
v
->
decUse
();
v
->
decUse
();
...
@@ -1009,7 +1010,7 @@ Rewriter* Rewriter::createRewriter(void* rtn_addr, int num_args, const char* deb
...
@@ -1009,7 +1010,7 @@ Rewriter* Rewriter::createRewriter(void* rtn_addr, int num_args, const char* deb
static
StatCounter
rewriter_nopatch
(
"rewriter_nopatch"
);
static
StatCounter
rewriter_nopatch
(
"rewriter_nopatch"
);
if
(
!
ic
)
{
if
(
!
ic
||
!
ic
->
shouldAttempt
()
)
{
rewriter_nopatch
.
log
();
rewriter_nopatch
.
log
();
return
NULL
;
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