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
4da376b5
Commit
4da376b5
authored
Jun 16, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make format
parent
8a3a1792
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
30 deletions
+20
-30
src/codegen/llvm_interpreter.cpp
src/codegen/llvm_interpreter.cpp
+7
-6
src/core/stats.h
src/core/stats.h
+0
-1
src/core/thread_utils.h
src/core/thread_utils.h
+7
-14
src/gc/collector.cpp
src/gc/collector.cpp
+4
-4
src/gc/heap.h
src/gc/heap.h
+2
-5
No files found.
src/codegen/llvm_interpreter.cpp
View file @
4da376b5
...
@@ -214,12 +214,13 @@ threading::PerThreadSet<root_stack_t> root_stack_set;
...
@@ -214,12 +214,13 @@ threading::PerThreadSet<root_stack_t> root_stack_set;
void
gatherInterpreterRoots
(
GCVisitor
*
visitor
)
{
void
gatherInterpreterRoots
(
GCVisitor
*
visitor
)
{
root_stack_set
.
forEachValue
(
std
::
function
<
void
(
root_stack_t
*
,
GCVisitor
*
)
>
([](
root_stack_t
*
v
,
GCVisitor
*
visitor
)
{
root_stack_set
.
forEachValue
(
std
::
function
<
void
(
root_stack_t
*
,
GCVisitor
*
)
>
([](
root_stack_t
*
v
,
GCVisitor
*
visitor
)
{
for
(
const
SymMap
*
sym_map
:
*
v
)
{
for
(
const
SymMap
*
sym_map
:
*
v
)
{
for
(
const
auto
&
p2
:
*
sym_map
)
{
for
(
const
auto
&
p2
:
*
sym_map
)
{
visitor
->
visitPotential
(
p2
.
second
.
o
);
visitor
->
visitPotential
(
p2
.
second
.
o
);
}
}
}
}
}),
visitor
);
}),
visitor
);
}
}
class
UnregisterHelper
{
class
UnregisterHelper
{
...
...
src/core/stats.h
View file @
4da376b5
...
@@ -56,7 +56,6 @@ public:
...
@@ -56,7 +56,6 @@ public:
void
log
(
int
count
=
1
)
{
Stats
::
log
(
id
,
count
);
}
void
log
(
int
count
=
1
)
{
Stats
::
log
(
id
,
count
);
}
};
};
}
}
#endif
#endif
src/core/thread_utils.h
View file @
4da376b5
...
@@ -123,16 +123,11 @@ public:
...
@@ -123,16 +123,11 @@ public:
namespace
impl
{
namespace
impl
{
// From http://stackoverflow.com/questions/7858817/unpacking-a-tuple-to-call-a-matching-function-pointer
// From http://stackoverflow.com/questions/7858817/unpacking-a-tuple-to-call-a-matching-function-pointer
template
<
int
...>
template
<
int
...>
struct
seq
{};
struct
seq
{
};
template
<
int
N
,
int
...
S
>
template
<
int
N
,
int
...
S
>
struct
gens
:
gens
<
N
-
1
,
N
-
1
,
S
...
>
{};
struct
gens
:
gens
<
N
-
1
,
N
-
1
,
S
...
>
{
};
template
<
int
...
S
>
template
<
int
...
S
>
struct
gens
<
0
,
S
...
>
{
typedef
seq
<
S
...
>
type
;
};
struct
gens
<
0
,
S
...
>
{
typedef
seq
<
S
...
>
type
;
};
}
}
template
<
typename
T
,
typename
...
CtorArgs
>
class
PerThreadSet
{
template
<
typename
T
,
typename
...
CtorArgs
>
class
PerThreadSet
{
...
@@ -141,7 +136,7 @@ private:
...
@@ -141,7 +136,7 @@ private:
PthreadFastMutex
lock
;
PthreadFastMutex
lock
;
struct
Storage
{
struct
Storage
{
PerThreadSet
<
T
,
CtorArgs
...
>
*
self
;
PerThreadSet
<
T
,
CtorArgs
...
>
*
self
;
T
val
;
T
val
;
};
};
...
@@ -163,9 +158,8 @@ private:
...
@@ -163,9 +158,8 @@ private:
delete
s
;
delete
s
;
}
}
template
<
int
...
S
>
template
<
int
...
S
>
Storage
*
make
(
impl
::
seq
<
S
...
>
)
{
Storage
*
make
(
impl
::
seq
<
S
...
>
)
{
return
new
Storage
{
.
self
=
this
,
.
val
=
T
(
std
::
get
<
S
>
(
ctor_args
)...)
};
return
new
Storage
{.
self
=
this
,
.
val
=
T
(
std
::
get
<
S
>
(
ctor_args
)...)
};
}
}
public:
public:
...
@@ -181,8 +175,7 @@ public:
...
@@ -181,8 +175,7 @@ public:
}
}
}
}
template
<
typename
...
Arguments
>
template
<
typename
...
Arguments
>
void
forEachValue
(
std
::
function
<
void
(
T
*
,
Arguments
...)
>
f
,
Arguments
...
args
)
{
void
forEachValue
(
std
::
function
<
void
(
T
*
,
Arguments
...)
>
f
,
Arguments
...
args
)
{
LOCK_REGION
(
&
lock
);
LOCK_REGION
(
&
lock
);
for
(
auto
&
p
:
map
)
{
for
(
auto
&
p
:
map
)
{
...
...
src/gc/collector.cpp
View file @
4da376b5
...
@@ -160,13 +160,13 @@ void runCollection() {
...
@@ -160,13 +160,13 @@ void runCollection() {
if
(
VERBOSITY
(
"gc"
)
>=
2
)
if
(
VERBOSITY
(
"gc"
)
>=
2
)
printf
(
"Collection #%d
\n
"
,
++
ncollections
);
printf
(
"Collection #%d
\n
"
,
++
ncollections
);
//Timer _t2("promoting", /*min_usec=*/10000);
//
Timer _t2("promoting", /*min_usec=*/10000);
threading
::
GLPromoteRegion
_lock
;
threading
::
GLPromoteRegion
_lock
;
//long promote_us = _t2.end();
//
long promote_us = _t2.end();
//static thread_local StatPerThreadCounter sc_promoting_us("gc_promoting_us");
//
static thread_local StatPerThreadCounter sc_promoting_us("gc_promoting_us");
//sc_promoting_us.log(promote_us);
//
sc_promoting_us.log(promote_us);
Timer
_t
(
"collecting"
,
/*min_usec=*/
10000
);
Timer
_t
(
"collecting"
,
/*min_usec=*/
10000
);
...
...
src/gc/heap.h
View file @
4da376b5
...
@@ -90,9 +90,7 @@ private:
...
@@ -90,9 +90,7 @@ private:
Heap
*
heap
;
Heap
*
heap
;
Block
*
cache_heads
[
NUM_BUCKETS
];
Block
*
cache_heads
[
NUM_BUCKETS
];
ThreadBlockCache
(
Heap
*
heap
)
:
heap
(
heap
)
{
ThreadBlockCache
(
Heap
*
heap
)
:
heap
(
heap
)
{
memset
(
cache_heads
,
0
,
sizeof
(
cache_heads
));
}
memset
(
cache_heads
,
0
,
sizeof
(
cache_heads
));
}
~
ThreadBlockCache
();
~
ThreadBlockCache
();
};
};
friend
class
ThreadBlockCache
;
friend
class
ThreadBlockCache
;
...
@@ -100,8 +98,7 @@ private:
...
@@ -100,8 +98,7 @@ private:
threading
::
PerThreadSet
<
ThreadBlockCache
,
Heap
*>
thread_caches
;
threading
::
PerThreadSet
<
ThreadBlockCache
,
Heap
*>
thread_caches
;
public:
public:
Heap
()
:
thread_caches
(
this
)
{
Heap
()
:
thread_caches
(
this
)
{}
}
void
*
realloc
(
void
*
ptr
,
size_t
bytes
);
void
*
realloc
(
void
*
ptr
,
size_t
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