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
4f485b7a
Commit
4f485b7a
authored
Feb 09, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #291 from undingen/faster_unwinding
Unwinding: remember the bounds of the interpreter function
parents
0085a363
b5dc6d03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
src/codegen/unwinding.cpp
src/codegen/unwinding.cpp
+19
-7
No files found.
src/codegen/unwinding.cpp
View file @
4f485b7a
...
...
@@ -328,6 +328,24 @@ public:
return
rtn
;
}
bool
isMainInterpreterFunc
(
unw_word_t
ip
)
{
// Remember the addr of the end of the interpreter function because unw_get_proc_info is slow and if we know
// the bounds we can replace it with pointer comparisons.
static
intptr_t
interpreter_instr_end
=
0
;
// first ip NOT covered by interpreter func
if
(
interpreter_instr_end
==
0
)
{
unw_proc_info_t
pip
;
int
code
=
unw_get_proc_info
(
&
this
->
cursor
,
&
pip
);
RELEASE_ASSERT
(
code
==
0
,
"%d"
,
code
);
if
(
pip
.
start_ip
==
(
intptr_t
)
interpreter_instr_addr
)
{
interpreter_instr_end
=
pip
.
end_ip
;
return
true
;
}
}
else
if
(
ip
>=
(
intptr_t
)
interpreter_instr_addr
&&
ip
<
interpreter_instr_end
)
{
return
true
;
}
return
false
;
}
bool
incr
()
{
bool
was_osr
=
cur_is_osr
;
...
...
@@ -359,13 +377,7 @@ public:
return
true
;
}
// TODO shouldn't need to do this expensive-looking query, if we
// knew the bounds of the interpretFunction() function:
unw_proc_info_t
pip
;
int
code
=
unw_get_proc_info
(
&
this
->
cursor
,
&
pip
);
RELEASE_ASSERT
(
code
==
0
,
"%d"
,
code
);
if
(
pip
.
start_ip
==
(
intptr_t
)
interpreter_instr_addr
)
{
if
(
isMainInterpreterFunc
(
ip
))
{
unw_word_t
bp
;
unw_get_reg
(
&
this
->
cursor
,
UNW_TDEP_BP
,
&
bp
);
...
...
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