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
592f854c
Commit
592f854c
authored
Aug 26, 2015
by
Rudi Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redundantly visit some fields of hidden classes that weren't visited.
parent
ee5286c1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
5 deletions
+20
-5
src/gc/collector.h
src/gc/collector.h
+1
-0
src/gc/gc.h
src/gc/gc.h
+4
-0
src/runtime/hiddenclass.cpp
src/runtime/hiddenclass.cpp
+15
-5
No files found.
src/gc/collector.h
View file @
592f854c
...
...
@@ -68,6 +68,7 @@ class GCVisitorNoRedundancy : public GCVisitor {
virtual
void
visitRangeRedundant
(
void
*
const
*
start
,
void
*
const
*
end
)
{
visitRange
(
start
,
end
);
}
virtual
void
visitPotentialRedundant
(
void
*
p
)
{
visitPotential
(
p
);
}
virtual
void
visitPotentialRangeRedundant
(
void
*
const
*
start
,
void
*
const
*
end
)
{
visitPotentialRange
(
start
,
end
);
}
virtual
bool
shouldVisitRedundants
()
{
return
true
;
}
};
}
}
...
...
src/gc/gc.h
View file @
592f854c
...
...
@@ -22,6 +22,10 @@
// Files outside of the gc/ folder should only import gc.h or gc_alloc.h
// which are the "public" memory management interface.
// Some code is only useful towards an effort to implement a
// moving gc, gate behind this flag for now.
#define MOVING_GC 0
#define GC_KEEP_ALIVE(t) asm volatile("" : : "X"(t))
#define TRACE_GC_MARKING 0
...
...
src/runtime/hiddenclass.cpp
View file @
592f854c
...
...
@@ -32,13 +32,23 @@ void HiddenClass::gc_visit(GCVisitor* visitor) {
visitor
->
visitRange
((
void
*
const
*
)
&
children
.
vector
()[
0
],
(
void
*
const
*
)
&
children
.
vector
()[
children
.
size
()]);
visitor
->
visit
(
attrwrapper_child
);
// We don't need to visit the keys of the 'children' map, since the children should have those as entries
// in the attr_offssets map.
// Also, if we have any children, we can skip scanning our attr_offsets map, since it will be a subset
// of our child's map.
if
(
children
.
empty
())
if
(
children
.
empty
())
{
for
(
auto
p
:
attr_offsets
)
visitor
->
visit
(
p
.
first
);
}
else
{
#if MOVING_GC
// If we have any children, the attr_offsets map will be a subset of the child's map.
for
(
const
auto
&
p
:
attr_offsets
)
visitor
->
visitRedundant
(
p
.
first
);
#endif
}
#if MOVING_GC
// The children should have the entries of the keys of the 'children' map in the attr_offsets map.
for
(
const
auto
&
p
:
children
)
{
visitor
->
visitRedundant
(
p
.
first
);
}
#endif
}
void
HiddenClass
::
appendAttribute
(
BoxedString
*
attr
)
{
...
...
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