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
fa30790c
Commit
fa30790c
authored
Jun 20, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sum() was failing its ics by running out of instruction space
parent
a1d9091d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
4 deletions
+22
-4
src/asm_writing/icinfo.h
src/asm_writing/icinfo.h
+2
-0
src/asm_writing/rewriter.cpp
src/asm_writing/rewriter.cpp
+10
-2
src/asm_writing/rewriter.h
src/asm_writing/rewriter.h
+2
-0
src/runtime/ics.h
src/runtime/ics.h
+1
-1
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+7
-1
No files found.
src/asm_writing/icinfo.h
View file @
fa30790c
...
...
@@ -80,6 +80,8 @@ public:
const
ICInfo
*
getICInfo
()
{
return
ic
;
}
const
char
*
debugName
()
{
return
debug_name
;
}
friend
class
ICInfo
;
};
...
...
src/asm_writing/rewriter.cpp
View file @
fa30790c
...
...
@@ -888,15 +888,22 @@ void Rewriter::commit() {
assert
(
!
finished
);
initPhaseEmitting
();
static
StatCounter
ic_rewrites_aborted_assemblyfail
(
"ic_rewrites_aborted_assemblyfail"
);
static
StatCounter
ic_rewrites_aborted_failed
(
"ic_rewrites_aborted_failed"
);
if
(
failed
)
{
ic_rewrites_aborted_failed
.
log
();
this
->
abort
();
return
;
}
static
StatCounter
ic_rewrites_aborted_assemblyfail
(
"ic_rewrites_aborted_assemblyfail"
);
auto
on_assemblyfail
=
[
&
]()
{
ic_rewrites_aborted_assemblyfail
.
log
();
#if 0
std::string per_name_stat_name = "ic_rewrites_aborted_assemblyfail_" + std::string(debugName());
uint64_t* counter = Stats::getStatCounter(per_name_stat_name);
Stats::log(counter);
#endif
this
->
abort
();
};
...
...
@@ -944,6 +951,7 @@ void Rewriter::commit() {
actions
[
i
].
action
();
if
(
failed
)
{
ic_rewrites_aborted_failed
.
log
();
this
->
abort
();
return
;
}
...
...
src/asm_writing/rewriter.h
View file @
fa30790c
...
...
@@ -474,6 +474,8 @@ public:
TypeRecorder
*
getTypeRecorder
();
const
char
*
debugName
()
{
return
rewrite
->
debugName
();
}
void
trap
();
RewriterVar
*
loadConst
(
int64_t
val
,
Location
loc
=
Location
::
any
());
// can_call_into_python: whether this call could result in arbitrary Python code being called.
...
...
src/runtime/ics.h
View file @
fa30790c
...
...
@@ -78,7 +78,7 @@ public:
class
BinopIC
:
public
RuntimeIC
{
public:
BinopIC
()
:
RuntimeIC
((
void
*
)
binop
,
2
,
16
0
)
{}
BinopIC
()
:
RuntimeIC
((
void
*
)
binop
,
2
,
24
0
)
{}
Box
*
call
(
Box
*
lhs
,
Box
*
rhs
,
int
op_type
)
{
return
(
Box
*
)
call_ptr
(
lhs
,
rhs
,
op_type
);
}
};
...
...
src/runtime/objmodel.cpp
View file @
fa30790c
...
...
@@ -3731,6 +3731,13 @@ extern "C" Box* binopInternal(Box* lhs, Box* rhs, int op_type, bool inplace, Bin
extern
"C"
Box
*
binop
(
Box
*
lhs
,
Box
*
rhs
,
int
op_type
)
{
STAT_TIMER
(
t0
,
"us_timer_slowpath_binop"
,
10
);
bool
can_patchpoint
=
!
isUserDefined
(
lhs
->
cls
)
&&
!
isUserDefined
(
rhs
->
cls
);
#if 0
static uint64_t* st_id = Stats::getStatCounter("us_timer_slowpath_binop_patchable");
static uint64_t* st_id_nopatch = Stats::getStatCounter("us_timer_slowpath_binop_nopatch");
bool havepatch = (bool)getICInfo(__builtin_extract_return_addr(__builtin_return_address(0)));
ScopedStatTimer st((havepatch && can_patchpoint)? st_id : st_id_nopatch, 10);
#endif
static
StatCounter
slowpath_binop
(
"slowpath_binop"
);
slowpath_binop
.
log
();
...
...
@@ -3744,7 +3751,6 @@ extern "C" Box* binop(Box* lhs, Box* rhs, int op_type) {
// resolving it one way right now (ex, using the value from lhs.__add__) means that later
// we'll resolve it the same way, even for the same argument types.
// TODO implement full resolving semantics inside the rewrite?
bool
can_patchpoint
=
!
isUserDefined
(
lhs
->
cls
)
&&
!
isUserDefined
(
rhs
->
cls
);
if
(
can_patchpoint
)
rewriter
.
reset
(
Rewriter
::
createRewriter
(
__builtin_extract_return_addr
(
__builtin_return_address
(
0
)),
3
,
"binop"
));
...
...
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