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
db67a4ab
Commit
db67a4ab
authored
Apr 22, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I think passing by value is better than rvalue reference here
parent
ff91268a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
14 deletions
+14
-14
src/analysis/function_analysis.cpp
src/analysis/function_analysis.cpp
+2
-2
src/analysis/function_analysis.h
src/analysis/function_analysis.h
+2
-2
src/codegen/unwinding.cpp
src/codegen/unwinding.cpp
+8
-8
src/codegen/unwinding.h
src/codegen/unwinding.h
+1
-1
src/runtime/traceback.h
src/runtime/traceback.h
+1
-1
No files found.
src/analysis/function_analysis.cpp
View file @
db67a4ab
...
...
@@ -359,7 +359,7 @@ void DefinednessBBAnalyzer::processBB(Map& starting, CFGBlock* block) const {
}
}
void
DefinednessAnalysis
::
run
(
llvm
::
DenseMap
<
InternedString
,
DefinednessAnalysis
::
DefinitionLevel
>
&&
initial_map
,
void
DefinednessAnalysis
::
run
(
llvm
::
DenseMap
<
InternedString
,
DefinednessAnalysis
::
DefinitionLevel
>
initial_map
,
CFGBlock
*
initial_block
,
ScopeInfo
*
scope_info
)
{
Timer
_t
(
"DefinednessAnalysis()"
,
10
);
...
...
@@ -397,7 +397,7 @@ const DefinednessAnalysis::RequiredSet& DefinednessAnalysis::getDefinedNamesAtEn
return
defined_at_end_sets
[
block
];
}
PhiAnalysis
::
PhiAnalysis
(
llvm
::
DenseMap
<
InternedString
,
DefinednessAnalysis
::
DefinitionLevel
>
&&
initial_map
,
PhiAnalysis
::
PhiAnalysis
(
llvm
::
DenseMap
<
InternedString
,
DefinednessAnalysis
::
DefinitionLevel
>
initial_map
,
CFGBlock
*
initial_block
,
bool
initials_need_phis
,
LivenessAnalysis
*
liveness
,
ScopeInfo
*
scope_info
)
:
definedness
(),
liveness
(
liveness
)
{
...
...
src/analysis/function_analysis.h
View file @
db67a4ab
...
...
@@ -70,7 +70,7 @@ private:
public:
DefinednessAnalysis
()
{}
void
run
(
llvm
::
DenseMap
<
InternedString
,
DefinitionLevel
>
&&
initial_map
,
CFGBlock
*
initial_block
,
void
run
(
llvm
::
DenseMap
<
InternedString
,
DefinitionLevel
>
initial_map
,
CFGBlock
*
initial_block
,
ScopeInfo
*
scope_info
);
DefinitionLevel
isDefinedAtEnd
(
InternedString
name
,
CFGBlock
*
block
);
...
...
@@ -92,7 +92,7 @@ private:
public:
// Initials_need_phis specifies that initial_map should count as an additional entry point
// that may require phis.
PhiAnalysis
(
llvm
::
DenseMap
<
InternedString
,
DefinednessAnalysis
::
DefinitionLevel
>
&&
initial_map
,
PhiAnalysis
(
llvm
::
DenseMap
<
InternedString
,
DefinednessAnalysis
::
DefinitionLevel
>
initial_map
,
CFGBlock
*
initial_block
,
bool
initials_need_phis
,
LivenessAnalysis
*
liveness
,
ScopeInfo
*
scope_info
);
bool
isRequired
(
InternedString
name
,
CFGBlock
*
block
);
...
...
src/codegen/unwinding.cpp
View file @
db67a4ab
...
...
@@ -387,7 +387,7 @@ static unw_word_t getFunctionEnd(unw_word_t ip) {
// the stack frame that they were created in, so we need to use this approach (as opposed to
// C++11 range loops, for example).
// Return true from the handler to stop iteration at that frame.
void
unwindPythonStack
(
std
::
function
<
bool
(
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
&&
)
>
func
)
{
void
unwindPythonStack
(
std
::
function
<
bool
(
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
)
>
func
)
{
static
unw_word_t
interpreter_instr_end
=
getFunctionEnd
((
unw_word_t
)
interpreter_instr_addr
);
static
unw_word_t
generator_entry_end
=
getFunctionEnd
((
unw_word_t
)
generatorEntry
);
...
...
@@ -485,7 +485,7 @@ void unwindPythonStack(std::function<bool(std::unique_ptr<PythonFrameIteratorImp
static
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
getTopPythonFrame
()
{
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
rtn
(
nullptr
);
unwindPythonStack
([
&
](
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
&&
iter
)
{
unwindPythonStack
([
&
](
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
iter
)
{
rtn
=
std
::
move
(
iter
);
return
true
;
});
...
...
@@ -525,7 +525,7 @@ BoxedTraceback* getTraceback() {
Timer
_t
(
"getTraceback"
,
1000
);
std
::
vector
<
const
LineInfo
*>
entries
;
unwindPythonStack
([
&
](
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
&&
frame_iter
)
{
unwindPythonStack
([
&
](
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
frame_iter
)
{
const
LineInfo
*
line_info
=
lineInfoForFrame
(
*
frame_iter
.
get
());
if
(
line_info
)
entries
.
push_back
(
line_info
);
...
...
@@ -545,7 +545,7 @@ ExcInfo* getFrameExcInfo() {
ExcInfo
*
copy_from_exc
=
NULL
;
ExcInfo
*
cur_exc
=
NULL
;
unwindPythonStack
([
&
](
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
&&
frame_iter
)
{
unwindPythonStack
([
&
](
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
frame_iter
)
{
FrameInfo
*
frame_info
=
frame_iter
->
getFrameInfo
();
copy_from_exc
=
&
frame_info
->
exc
;
...
...
@@ -609,7 +609,7 @@ BoxedModule* getCurrentModule() {
PythonFrameIterator
getPythonFrame
(
int
depth
)
{
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
rtn
(
nullptr
);
unwindPythonStack
([
&
](
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
&&
frame_iter
)
{
unwindPythonStack
([
&
](
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
frame_iter
)
{
if
(
depth
==
0
)
{
rtn
=
std
::
move
(
frame_iter
);
return
true
;
...
...
@@ -631,7 +631,7 @@ void PythonFrameIterator::operator=(PythonFrameIterator&& rhs) {
std
::
swap
(
this
->
impl
,
rhs
.
impl
);
}
PythonFrameIterator
::
PythonFrameIterator
(
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
&&
impl
)
{
PythonFrameIterator
::
PythonFrameIterator
(
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
impl
)
{
std
::
swap
(
this
->
impl
,
impl
);
}
...
...
@@ -641,7 +641,7 @@ PythonFrameIterator::PythonFrameIterator(std::unique_ptr<PythonFrameIteratorImpl
FrameStackState
getFrameStackState
()
{
FrameStackState
rtn
(
NULL
,
NULL
);
bool
found
=
false
;
unwindPythonStack
([
&
](
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
&&
frame_iter
)
{
unwindPythonStack
([
&
](
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
frame_iter
)
{
BoxedDict
*
d
;
BoxedClosure
*
closure
;
CompiledFunction
*
cf
;
...
...
@@ -897,7 +897,7 @@ FrameInfo* PythonFrameIterator::getFrameInfo() {
PythonFrameIterator
PythonFrameIterator
::
getCurrentVersion
()
{
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
rtn
(
nullptr
);
auto
&
impl
=
this
->
impl
;
unwindPythonStack
([
&
](
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
&&
frame_iter
)
{
unwindPythonStack
([
&
](
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
frame_iter
)
{
if
(
frame_iter
->
pointsToTheSameAs
(
*
impl
.
get
()))
{
rtn
=
std
::
move
(
frame_iter
);
return
true
;
...
...
src/codegen/unwinding.h
View file @
db67a4ab
...
...
@@ -64,7 +64,7 @@ public:
PythonFrameIterator
(
PythonFrameIterator
&&
rhs
);
void
operator
=
(
PythonFrameIterator
&&
rhs
);
PythonFrameIterator
(
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
&&
impl
);
PythonFrameIterator
(
std
::
unique_ptr
<
PythonFrameIteratorImpl
>
impl
);
~
PythonFrameIterator
();
};
...
...
src/runtime/traceback.h
View file @
db67a4ab
...
...
@@ -30,7 +30,7 @@ public:
std
::
vector
<
const
LineInfo
*>
lines
;
Box
*
py_lines
;
BoxedTraceback
(
std
::
vector
<
const
LineInfo
*>
&&
lines
)
:
lines
(
std
::
move
(
lines
)),
py_lines
(
NULL
)
{}
BoxedTraceback
(
std
::
vector
<
const
LineInfo
*>
lines
)
:
lines
(
std
::
move
(
lines
)),
py_lines
(
NULL
)
{}
BoxedTraceback
()
:
py_lines
(
NULL
)
{}
DEFAULT_CLASS
(
traceback_cls
);
...
...
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