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
247869a5
Commit
247869a5
authored
Nov 24, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I think this decreffing is better wrt bumpUse
parent
17f1f320
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
src/codegen/baseline_jit.cpp
src/codegen/baseline_jit.cpp
+21
-6
No files found.
src/codegen/baseline_jit.cpp
View file @
247869a5
...
...
@@ -473,6 +473,11 @@ void JitFragmentWriter::emitExec(RewriterVar* code, RewriterVar* globals, Rewrit
}
void
JitFragmentWriter
::
emitJump
(
CFGBlock
*
b
)
{
for
(
auto
v
:
local_syms
)
{
if
(
v
.
second
)
v
.
second
->
decref
();
// xdecref?
}
RewriterVar
*
next
=
imm
(
b
);
addAction
([
=
]()
{
_emitJump
(
b
,
next
,
exit_info
);
},
{
next
},
ActionType
::
NORMAL
);
}
...
...
@@ -560,9 +565,18 @@ void JitFragmentWriter::emitSetLocal(InternedString s, int vreg, bool set_closur
}
void
JitFragmentWriter
::
emitSideExit
(
RewriterVar
*
v
,
Box
*
cmp_value
,
CFGBlock
*
next_block
)
{
assert
(
0
&&
"need to decref any local syms"
);
RewriterVar
*
var
=
imm
(
cmp_value
);
RewriterVar
*
next_block_var
=
imm
(
next_block
);
llvm
::
SmallVector
<
RewriterVar
*
,
16
>
vars
;
vars
.
push_back
(
v
);
vars
.
push_back
(
var
);
vars
.
push_back
(
next_block_var
);
for
(
auto
v
:
local_syms
)
{
if
(
v
.
second
)
vars
.
push_back
(
v
.
second
);
}
addAction
([
=
]()
{
_emitSideExit
(
v
,
var
,
next_block
,
next_block_var
);
},
{
v
,
var
,
next_block_var
},
ActionType
::
NORMAL
);
}
...
...
@@ -812,11 +826,6 @@ void JitFragmentWriter::_emitGetLocal(RewriterVar* val_var, const char* name) {
}
void
JitFragmentWriter
::
_emitJump
(
CFGBlock
*
b
,
RewriterVar
*
block_next
,
ExitInfo
&
exit_info
)
{
for
(
auto
v
:
local_syms
)
{
if
(
v
.
second
)
v
.
second
->
decref
();
// xdecref?
}
assert
(
exit_info
.
num_bytes
==
0
);
assert
(
exit_info
.
exit_start
==
NULL
);
if
(
b
->
code
)
{
...
...
@@ -976,6 +985,12 @@ void JitFragmentWriter::_emitSideExit(RewriterVar* var, RewriterVar* val_constan
{
assembler
::
ForwardJump
jne
(
*
assembler
,
assembler
::
COND_EQUAL
);
for
(
auto
v
:
local_syms
)
{
if
(
v
.
second
)
_decref
(
v
.
second
);
}
ExitInfo
exit_info
;
_emitJump
(
next_block
,
next_block_var
,
exit_info
);
if
(
exit_info
.
num_bytes
)
{
...
...
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