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
2b380e81
Commit
2b380e81
authored
Nov 10, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated codespeed instructions
parent
fbfe2bfa
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
23 deletions
+38
-23
docs/PERF_TRACKING.md
docs/PERF_TRACKING.md
+2
-1
src/asm_writing/icinfo.cpp
src/asm_writing/icinfo.cpp
+15
-8
src/asm_writing/icinfo.h
src/asm_writing/icinfo.h
+9
-8
src/codegen/patchpoints.cpp
src/codegen/patchpoints.cpp
+5
-4
src/core/types.h
src/core/types.h
+4
-1
src/runtime/ics.cpp
src/runtime/ics.cpp
+2
-0
src/runtime/ics.h
src/runtime/ics.h
+1
-1
No files found.
docs/PERF_TRACKING.md
View file @
2b380e81
...
@@ -11,8 +11,9 @@ virtualenv codespeed_env
...
@@ -11,8 +11,9 @@ virtualenv codespeed_env
cd codespeed
cd codespeed
pip install -r requirements
pip install -r requirements
python manage.py syncdb
python manage.py syncdb
# create admin user
# create admin user
when prompted
python manage.py migrate
python manage.py migrate
python manage.py collectstatic
cp sample_project/deploy/apache-reverseproxy.conf /etc/apache2/sites-available/010-speed.pyston.conf
cp sample_project/deploy/apache-reverseproxy.conf /etc/apache2/sites-available/010-speed.pyston.conf
ln -s /etc/apache2/sites-available/010-speed.pyston.conf /etc/apache2/sites-enabled
ln -s /etc/apache2/sites-available/010-speed.pyston.conf /etc/apache2/sites-enabled
...
...
src/asm_writing/icinfo.cpp
View file @
2b380e81
...
@@ -184,21 +184,23 @@ ICSlotInfo* ICInfo::pickEntryForRewrite(uint64_t decision_path, const char* debu
...
@@ -184,21 +184,23 @@ ICSlotInfo* ICInfo::pickEntryForRewrite(uint64_t decision_path, const char* debu
ICInfo
::
ICInfo
(
void
*
start_addr
,
void
*
continue_addr
,
StackInfo
stack_info
,
int
num_slots
,
int
slot_size
,
ICInfo
::
ICInfo
(
void
*
start_addr
,
void
*
slowpath_rtn_addr
,
void
*
continue_addr
,
StackInfo
stack_info
,
int
num_slots
,
llvm
::
CallingConv
::
ID
calling_conv
,
const
std
::
unordered_set
<
int
>&
live_outs
,
int
slot_size
,
llvm
::
CallingConv
::
ID
calling_conv
,
const
std
::
unordered_set
<
int
>&
live_outs
,
assembler
::
GenericRegister
return_register
,
TypeRecorder
*
type_recorder
)
assembler
::
GenericRegister
return_register
,
TypeRecorder
*
type_recorder
)
:
next_slot_to_try
(
0
),
stack_info
(
stack_info
),
num_slots
(
num_slots
),
slot_size
(
slot_size
),
:
next_slot_to_try
(
0
),
stack_info
(
stack_info
),
num_slots
(
num_slots
),
slot_size
(
slot_size
),
calling_conv
(
calling_conv
),
live_outs
(
live_outs
.
begin
(),
live_outs
.
end
()),
return_register
(
return_register
),
calling_conv
(
calling_conv
),
live_outs
(
live_outs
.
begin
(),
live_outs
.
end
()),
return_register
(
return_register
),
type_recorder
(
type_recorder
),
failed
(
false
),
start_addr
(
start_addr
),
continue_addr
(
continue_addr
)
{
type_recorder
(
type_recorder
),
failed
(
false
),
start_addr
(
start_addr
),
slowpath_rtn_addr
(
slowpath_rtn_addr
),
continue_addr
(
continue_addr
)
{
for
(
int
i
=
0
;
i
<
num_slots
;
i
++
)
{
for
(
int
i
=
0
;
i
<
num_slots
;
i
++
)
{
slots
.
push_back
(
SlotInfo
(
this
,
i
));
slots
.
push_back
(
SlotInfo
(
this
,
i
));
}
}
}
}
static
std
::
unordered_map
<
void
*
,
ICInfo
*>
ics_by_return_addr
;
static
std
::
unordered_map
<
void
*
,
ICInfo
*>
ics_by_return_addr
;
ICInfo
*
registerCompiledPatchpoint
(
uint8_t
*
start_addr
,
uint8_t
*
slowpath_start_addr
,
uint8_t
*
continue_addr
,
std
::
unique_ptr
<
ICInfo
>
registerCompiledPatchpoint
(
uint8_t
*
start_addr
,
uint8_t
*
slowpath_start_addr
,
uint8_t
*
slowpath_rtn_addr
,
const
ICSetupInfo
*
ic
,
StackInfo
stack_info
,
uint8_t
*
continue_addr
,
uint8_t
*
slowpath_rtn_addr
,
std
::
unordered_set
<
int
>
live_outs
)
{
const
ICSetupInfo
*
ic
,
StackInfo
stack_info
,
std
::
unordered_set
<
int
>
live_outs
)
{
assert
(
slowpath_start_addr
-
start_addr
>=
ic
->
num_slots
*
ic
->
slot_size
);
assert
(
slowpath_start_addr
-
start_addr
>=
ic
->
num_slots
*
ic
->
slot_size
);
assert
(
slowpath_rtn_addr
>
slowpath_start_addr
);
assert
(
slowpath_rtn_addr
>
slowpath_start_addr
);
assert
(
slowpath_rtn_addr
<=
start_addr
+
ic
->
totalSize
());
assert
(
slowpath_rtn_addr
<=
start_addr
+
ic
->
totalSize
());
...
@@ -236,12 +238,17 @@ ICInfo* registerCompiledPatchpoint(uint8_t* start_addr, uint8_t* slowpath_start_
...
@@ -236,12 +238,17 @@ ICInfo* registerCompiledPatchpoint(uint8_t* start_addr, uint8_t* slowpath_start_
writer
->
jmp
(
JumpDestination
::
fromStart
(
slowpath_start_addr
-
start
));
writer
->
jmp
(
JumpDestination
::
fromStart
(
slowpath_start_addr
-
start
));
}
}
ICInfo
*
icinfo
=
new
ICInfo
(
start_addr
,
continue_addr
,
stack_info
,
ic
->
num_slots
,
ic
->
slot_size
,
ICInfo
*
icinfo
=
new
ICInfo
(
start_addr
,
slowpath_rtn_addr
,
continue_addr
,
stack_info
,
ic
->
num_slots
,
ic
->
slot_size
,
ic
->
getCallingConvention
(),
live_outs
,
return_register
,
ic
->
type_recorder
);
ic
->
getCallingConvention
(),
live_outs
,
return_register
,
ic
->
type_recorder
);
ics_by_return_addr
[
slowpath_rtn_addr
]
=
icinfo
;
ics_by_return_addr
[
slowpath_rtn_addr
]
=
icinfo
;
return
icinfo
;
return
std
::
unique_ptr
<
ICInfo
>
(
icinfo
);
}
void
deregisterCompiledPatchpoint
(
ICInfo
*
ic
)
{
assert
(
ics_by_return_addr
.
count
(
ic
->
slowpath_rtn_addr
));
ics_by_return_addr
.
erase
(
ic
->
slowpath_rtn_addr
);
}
}
ICInfo
*
getICInfo
(
void
*
rtn_addr
)
{
ICInfo
*
getICInfo
(
void
*
rtn_addr
)
{
...
...
src/asm_writing/icinfo.h
View file @
2b380e81
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#ifndef PYSTON_ASMWRITING_ICINFO_H
#ifndef PYSTON_ASMWRITING_ICINFO_H
#define PYSTON_ASMWRITING_ICINFO_H
#define PYSTON_ASMWRITING_ICINFO_H
#include <memory>
#include <unordered_set>
#include <unordered_set>
#include <vector>
#include <vector>
...
@@ -106,13 +107,11 @@ private:
...
@@ -106,13 +107,11 @@ private:
// for ICSlotRewrite:
// for ICSlotRewrite:
ICSlotInfo
*
pickEntryForRewrite
(
uint64_t
decision_path
,
const
char
*
debug_name
);
ICSlotInfo
*
pickEntryForRewrite
(
uint64_t
decision_path
,
const
char
*
debug_name
);
void
*
getSlowpathStart
();
public:
public:
ICInfo
(
void
*
start_addr
,
void
*
continue_addr
,
StackInfo
stack_info
,
int
num_slots
,
int
slot_size
,
ICInfo
(
void
*
start_addr
,
void
*
slowpath_rtn_addr
,
void
*
continue_addr
,
StackInfo
stack_info
,
int
num_slots
,
llvm
::
CallingConv
::
ID
calling_conv
,
const
std
::
unordered_set
<
int
>&
live_outs
,
int
slot_size
,
llvm
::
CallingConv
::
ID
calling_conv
,
const
std
::
unordered_set
<
int
>&
live_outs
,
assembler
::
GenericRegister
return_register
,
TypeRecorder
*
type_recorder
);
assembler
::
GenericRegister
return_register
,
TypeRecorder
*
type_recorder
);
void
*
const
start_addr
,
*
const
continue_addr
;
void
*
const
start_addr
,
*
const
slowpath_rtn_addr
,
*
const
continue_addr
;
int
getSlotSize
()
{
return
slot_size
;
}
int
getSlotSize
()
{
return
slot_size
;
}
int
getNumSlots
()
{
return
num_slots
;
}
int
getNumSlots
()
{
return
num_slots
;
}
...
@@ -129,9 +128,11 @@ public:
...
@@ -129,9 +128,11 @@ public:
class
ICSetupInfo
;
class
ICSetupInfo
;
struct
CompiledFunction
;
struct
CompiledFunction
;
ICInfo
*
registerCompiledPatchpoint
(
uint8_t
*
start_addr
,
uint8_t
*
slowpath_start_addr
,
uint8_t
*
continue_addr
,
std
::
unique_ptr
<
ICInfo
>
registerCompiledPatchpoint
(
uint8_t
*
start_addr
,
uint8_t
*
slowpath_start_addr
,
uint8_t
*
slowpath_rtn_addr
,
const
ICSetupInfo
*
,
StackInfo
stack_info
,
uint8_t
*
continue_addr
,
uint8_t
*
slowpath_rtn_addr
,
std
::
unordered_set
<
int
>
live_outs
);
const
ICSetupInfo
*
,
StackInfo
stack_info
,
std
::
unordered_set
<
int
>
live_outs
);
void
deregisterCompiledPatchpoint
(
ICInfo
*
ic
);
ICInfo
*
getICInfo
(
void
*
rtn_addr
);
ICInfo
*
getICInfo
(
void
*
rtn_addr
);
}
}
...
...
src/codegen/patchpoints.cpp
View file @
2b380e81
...
@@ -230,12 +230,13 @@ void processStackmap(CompiledFunction* cf, StackMap* stackmap) {
...
@@ -230,12 +230,13 @@ void processStackmap(CompiledFunction* cf, StackMap* stackmap) {
assert
(
pp
->
numICStackmapArgs
()
==
0
);
// don't do anything with these for now
assert
(
pp
->
numICStackmapArgs
()
==
0
);
// don't do anything with these for now
ICInfo
*
icinfo
=
registerCompiledPatchpoint
(
start_addr
,
slowpath_start
,
end_addr
,
slowpath_rtn_addr
,
ic
,
std
::
unique_ptr
<
ICInfo
>
icinfo
=
registerCompiledPatchpoint
(
StackInfo
({
stack_size
,
scratch_size
,
scratch_rbp_offset
})
,
start_addr
,
slowpath_start
,
end_addr
,
slowpath_rtn_addr
,
ic
,
std
::
move
(
live_outs
));
StackInfo
({
stack_size
,
scratch_size
,
scratch_rbp_offset
}),
std
::
move
(
live_outs
));
assert
(
cf
);
assert
(
cf
);
cf
->
ics
.
push_back
(
icinfo
);
// TODO: unsafe. hard to use a unique_ptr here though.
cf
->
ics
.
push_back
(
icinfo
.
release
());
}
}
for
(
PatchpointInfo
*
pp
:
new_patchpoints
)
{
for
(
PatchpointInfo
*
pp
:
new_patchpoints
)
{
...
...
src/core/types.h
View file @
2b380e81
...
@@ -210,7 +210,10 @@ public:
...
@@ -210,7 +210,10 @@ public:
code
(
code
),
llvm_code
(
llvm_code
),
effort
(
effort
),
times_called
(
0
),
line_table
(
nullptr
),
code
(
code
),
llvm_code
(
llvm_code
),
effort
(
effort
),
times_called
(
0
),
line_table
(
nullptr
),
location_map
(
nullptr
)
{}
location_map
(
nullptr
)
{}
// TODO this will need to be implemented eventually, and delete line_table if it exists
// TODO this will need to be implemented eventually; things to delete:
// - line_table if it exists
// - location_map if it exists
// - all entries in ics (after deregistering them)
~
CompiledFunction
();
~
CompiledFunction
();
};
};
...
...
src/runtime/ics.cpp
View file @
2b380e81
...
@@ -177,6 +177,7 @@ RuntimeIC::RuntimeIC(void* func_addr, int num_slots, int slot_size) {
...
@@ -177,6 +177,7 @@ RuntimeIC::RuntimeIC(void* func_addr, int num_slots, int slot_size) {
#endif
#endif
static
const
int
CALL_SIZE
=
13
;
static
const
int
CALL_SIZE
=
13
;
static
const
int
EPILOGUE_SIZE
=
2
;
static
const
int
EPILOGUE_SIZE
=
2
;
int
patchable_size
=
num_slots
*
slot_size
;
int
patchable_size
=
num_slots
*
slot_size
;
int
total_size
=
PROLOGUE_SIZE
+
patchable_size
+
CALL_SIZE
+
EPILOGUE_SIZE
;
int
total_size
=
PROLOGUE_SIZE
+
patchable_size
+
CALL_SIZE
+
EPILOGUE_SIZE
;
addr
=
malloc
(
total_size
);
addr
=
malloc
(
total_size
);
...
@@ -233,6 +234,7 @@ RuntimeIC::RuntimeIC(void* func_addr, int num_slots, int slot_size) {
...
@@ -233,6 +234,7 @@ RuntimeIC::RuntimeIC(void* func_addr, int num_slots, int slot_size) {
RuntimeIC
::~
RuntimeIC
()
{
RuntimeIC
::~
RuntimeIC
()
{
if
(
ENABLE_RUNTIME_ICS
)
{
if
(
ENABLE_RUNTIME_ICS
)
{
deregisterCompiledPatchpoint
(
icinfo
.
get
());
deregisterEHFrames
((
uint8_t
*
)
eh_frame_addr
,
(
uint64_t
)
eh_frame_addr
,
EH_FRAME_SIZE
);
deregisterEHFrames
((
uint8_t
*
)
eh_frame_addr
,
(
uint64_t
)
eh_frame_addr
,
EH_FRAME_SIZE
);
free
(
addr
);
free
(
addr
);
free
(
eh_frame_addr
);
free
(
eh_frame_addr
);
...
...
src/runtime/ics.h
View file @
2b380e81
...
@@ -27,7 +27,7 @@ private:
...
@@ -27,7 +27,7 @@ private:
void
*
addr
;
void
*
addr
;
void
*
eh_frame_addr
;
void
*
eh_frame_addr
;
ICInfo
*
icinfo
;
std
::
unique_ptr
<
ICInfo
>
icinfo
;
RuntimeIC
(
const
RuntimeIC
&
)
=
delete
;
RuntimeIC
(
const
RuntimeIC
&
)
=
delete
;
void
operator
=
(
const
RuntimeIC
&
)
=
delete
;
void
operator
=
(
const
RuntimeIC
&
)
=
delete
;
...
...
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