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
ad568495
Commit
ad568495
authored
Apr 30, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Have the boxed versions just box the output of the unboxed versions
parent
cf211158
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
14 deletions
+6
-14
src/runtime/inline/xrange.cpp
src/runtime/inline/xrange.cpp
+6
-14
No files found.
src/runtime/inline/xrange.cpp
View file @
ad568495
...
...
@@ -52,13 +52,6 @@ class BoxedXrangeIterator : public Box {
BoxedXrangeIterator
*
self
=
static_cast
<
BoxedXrangeIterator
*>
(
s
);
}
static
Box
*
xrangeIteratorHasnext
(
Box
*
s
)
__attribute__
((
visibility
(
"default"
)))
{
assert
(
s
->
cls
==
xrange_iterator_cls
);
BoxedXrangeIterator
*
self
=
static_cast
<
BoxedXrangeIterator
*>
(
s
);
assert
(
self
->
xrange
->
step
>
0
);
return
boxBool
(
self
->
cur
<
self
->
xrange
->
stop
);
}
static
bool
xrangeIteratorHasnextUnboxed
(
Box
*
s
)
__attribute__
((
visibility
(
"default"
)))
{
assert
(
s
->
cls
==
xrange_iterator_cls
);
BoxedXrangeIterator
*
self
=
static_cast
<
BoxedXrangeIterator
*>
(
s
);
...
...
@@ -66,13 +59,8 @@ class BoxedXrangeIterator : public Box {
return
self
->
cur
<
self
->
xrange
->
stop
;
}
static
Box
*
xrangeIteratorNext
(
Box
*
s
)
__attribute__
((
visibility
(
"default"
)))
{
assert
(
s
->
cls
==
xrange_iterator_cls
);
BoxedXrangeIterator
*
self
=
static_cast
<
BoxedXrangeIterator
*>
(
s
);
i64
rtn
=
self
->
cur
;
self
->
cur
+=
self
->
xrange
->
step
;
return
boxInt
(
rtn
);
static
Box
*
xrangeIteratorHasnext
(
Box
*
s
)
__attribute__
((
visibility
(
"default"
)))
{
return
boxBool
(
xrangeIteratorHasnextUnboxed
(
s
));
}
static
i64
xrangeIteratorNextUnboxed
(
Box
*
s
)
__attribute__
((
visibility
(
"default"
)))
{
...
...
@@ -84,6 +72,10 @@ class BoxedXrangeIterator : public Box {
return
rtn
;
}
static
Box
*
xrangeIteratorNext
(
Box
*
s
)
__attribute__
((
visibility
(
"default"
)))
{
return
boxInt
(
xrangeIteratorNextUnboxed
(
s
));
}
static
void
xrangeIteratorGCHandler
(
GCVisitor
*
v
,
void
*
p
)
{
boxGCHandler
(
v
,
p
);
...
...
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