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
28df5108
Commit
28df5108
authored
Jun 03, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the static computation out of the hot areas; thought this would help more
parent
4bde2afd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
4 deletions
+24
-4
src/gc/gc_alloc.cpp
src/gc/gc_alloc.cpp
+4
-0
src/gc/gc_alloc.h
src/gc/gc_alloc.h
+6
-1
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+14
-3
No files found.
src/gc/gc_alloc.cpp
View file @
28df5108
...
...
@@ -31,6 +31,10 @@
namespace
pyston
{
namespace
gc
{
#if STAT_TIMERS
int
gc_alloc_stattimer_id
=
Stats
::
getStatId
(
"us_timer_gc_alloc"
);
#endif
extern
"C"
void
*
gc_compat_malloc
(
size_t
sz
)
noexcept
{
return
gc_alloc
(
sz
,
GCKind
::
CONSERVATIVE
);
}
...
...
src/gc/gc_alloc.h
View file @
28df5108
...
...
@@ -40,8 +40,13 @@ static StatCounter gc_alloc_bytes_typed[] = {
};
#endif
#if STAT_TIMERS
extern
int
gc_alloc_stattimer_id
;
#endif
extern
"C"
inline
void
*
gc_alloc
(
size_t
bytes
,
GCKind
kind_id
)
{
STAT_TIMER
(
t0
,
"us_timer_gc_alloc"
);
#if STAT_TIMERS
StatTimer
gc_alloc_stattimer
(
gc_alloc_stattimer_id
);
#endif
size_t
alloc_bytes
=
bytes
+
sizeof
(
GCAllocation
);
#ifndef NVALGRIND
...
...
src/runtime/objmodel.cpp
View file @
28df5108
...
...
@@ -123,8 +123,15 @@ static Box* (*callattrInternal2)(Box*, llvm::StringRef, LookupScope, CallRewrite
static
Box
*
(
*
callattrInternal3
)(
Box
*
,
llvm
::
StringRef
,
LookupScope
,
CallRewriteArgs
*
,
ArgPassSpec
,
Box
*
,
Box
*
,
Box
*
)
=
(
Box
*
(
*
)(
Box
*
,
llvm
::
StringRef
,
LookupScope
,
CallRewriteArgs
*
,
ArgPassSpec
,
Box
*
,
Box
*
,
Box
*
))
callattrInternal
;
#if STAT_TIMERS
static
int
pyhasher_timer_id
=
Stats
::
getStatId
(
"us_timer_PyHasher"
);
static
int
pyeq_timer_id
=
Stats
::
getStatId
(
"us_timer_PyEq"
);
static
int
pylt_timer_id
=
Stats
::
getStatId
(
"us_timer_PyLt"
);
#endif
size_t
PyHasher
::
operator
()(
Box
*
b
)
const
{
STAT_TIMER
(
t0
,
"us_timer_PyHasher"
);
#if STAT_TIMERS
StatTimer
_st
(
pyhasher_timer_id
);
#endif
if
(
b
->
cls
==
str_cls
)
{
StringHash
<
char
>
H
;
auto
s
=
static_cast
<
BoxedString
*>
(
b
);
...
...
@@ -135,7 +142,9 @@ size_t PyHasher::operator()(Box* b) const {
}
bool
PyEq
::
operator
()(
Box
*
lhs
,
Box
*
rhs
)
const
{
STAT_TIMER
(
t0
,
"us_timer_PyEq"
);
#if STAT_TIMERS
StatTimer
_st
(
pyeq_timer_id
);
#endif
int
r
=
PyObject_RichCompareBool
(
lhs
,
rhs
,
Py_EQ
);
if
(
r
==
-
1
)
...
...
@@ -144,7 +153,9 @@ bool PyEq::operator()(Box* lhs, Box* rhs) const {
}
bool
PyLt
::
operator
()(
Box
*
lhs
,
Box
*
rhs
)
const
{
STAT_TIMER
(
t0
,
"us_timer_PyLt"
);
#if STAT_TIMERS
StatTimer
_st
(
pylt_timer_id
);
#endif
int
r
=
PyObject_RichCompareBool
(
lhs
,
rhs
,
Py_LT
);
if
(
r
==
-
1
)
...
...
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