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
b830092a
Commit
b830092a
authored
Mar 16, 2016
by
Marius Wachtler
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deopt: support deserializing instance methods
parent
9a8eaf07
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
4 deletions
+37
-4
src/codegen/compvars.cpp
src/codegen/compvars.cpp
+8
-4
test/tests/deopt_tests2.py
test/tests/deopt_tests2.py
+29
-0
No files found.
src/codegen/compvars.cpp
View file @
b830092a
...
...
@@ -109,7 +109,7 @@ public:
}
static
InstanceMethodType
*
get
(
CompilerType
*
obj_type
,
CompilerType
*
function_type
)
{
InstanceMethodType
*
rtn
=
made
[
std
::
make_pair
(
obj_type
,
function_type
)];
InstanceMethodType
*
&
rtn
=
made
[
std
::
make_pair
(
obj_type
,
function_type
)];
if
(
rtn
==
NULL
)
rtn
=
new
InstanceMethodType
(
obj_type
,
function_type
);
return
rtn
;
...
...
@@ -195,14 +195,18 @@ public:
void
serializeToFrame
(
VAR
*
var
,
std
::
vector
<
llvm
::
Value
*>&
stackmap_args
)
override
{
var
->
getValue
()
->
obj
->
serializeToFrame
(
stackmap_args
);
var
->
getValue
()
->
func
->
serializeToFrame
(
stackmap_args
);
var
->
getValue
()
->
im_class
->
serializeToFrame
(
stackmap_args
);
}
Box
*
deserializeFromFrame
(
const
FrameVals
&
vals
)
override
{
assert
(
vals
.
size
()
==
numFrameArgs
());
abort
();
assert
(
vals
.
size
()
==
numFrameArgs
()
&&
vals
.
size
()
==
3
);
Box
*
obj
=
reinterpret_cast
<
Box
*>
(
vals
[
0
]);
Box
*
func
=
reinterpret_cast
<
Box
*>
(
vals
[
1
]);
Box
*
im_class
=
reinterpret_cast
<
Box
*>
(
vals
[
2
]);
return
boxInstanceMethod
(
obj
,
func
,
im_class
);
}
int
numFrameArgs
()
override
{
return
obj_type
->
numFrameArgs
()
+
function_type
->
numFrameArgs
();
}
int
numFrameArgs
()
override
{
return
obj_type
->
numFrameArgs
()
+
function_type
->
numFrameArgs
()
+
1
/* im_class */
;
}
};
std
::
unordered_map
<
std
::
pair
<
CompilerType
*
,
CompilerType
*>
,
InstanceMethodType
*>
InstanceMethodType
::
made
;
...
...
test/tests/deopt_tests2.py
0 → 100644
View file @
b830092a
# skip-if: '-O' in EXTRA_JIT_ARGS or '-n' in EXTRA_JIT_ARGS
# statcheck: 4 == noninit_count('num_deopt')
# this used to hit an abort in our LLVM tier codegen
try
:
import
__pyston__
__pyston__
.
setOption
(
"OSR_THRESHOLD_BASELINE"
,
50
)
__pyston__
.
setOption
(
"REOPT_THRESHOLD_BASELINE"
,
50
)
__pyston__
.
setOption
(
"SPECULATION_THRESHOLD"
,
10
)
except
ImportError
:
pass
from
thread
import
allocate_lock
def
triggers_deopt
(
x
):
if
x
<
90
:
return
""
return
unicode
(
""
)
class
C
():
def
__init__
(
self
):
self
.
l
=
allocate_lock
()
def
f
(
self
,
x
):
with
self
.
l
:
triggers_deopt
(
x
).
isalnum
c
=
C
()
for
i
in
range
(
100
):
c
.
f
(
i
)
Boxiang Sun
@Daetalus
mentioned in commit
d0b63f26
·
Sep 08, 2016
mentioned in commit
d0b63f26
mentioned in commit d0b63f2660aeabec192d0b83e8db32f4fa32dec0
Toggle commit list
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