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
ec6f626b
Commit
ec6f626b
authored
Jul 13, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #692 from toshok/fewer-mallocs2
Fewer mallocs
parents
78493220
3501184a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
8 deletions
+9
-8
src/asm_writing/assembler.h
src/asm_writing/assembler.h
+2
-2
src/asm_writing/disassemble.cpp
src/asm_writing/disassemble.cpp
+2
-2
src/asm_writing/disassemble.h
src/asm_writing/disassemble.h
+2
-1
src/asm_writing/rewriter.h
src/asm_writing/rewriter.h
+2
-2
src/codegen/ast_interpreter.cpp
src/codegen/ast_interpreter.cpp
+1
-1
No files found.
src/asm_writing/assembler.h
View file @
ec6f626b
...
...
@@ -94,7 +94,7 @@ public:
Assembler
(
uint8_t
*
start
,
int
size
)
:
start_addr
(
start
),
end_addr
(
start
+
size
),
addr
(
start_addr
),
failed
(
false
)
{}
#ifndef NDEBUG
inline
void
comment
(
std
::
string
msg
)
{
inline
void
comment
(
const
llvm
::
Twine
&
msg
)
{
if
(
ASSEMBLY_LOGGING
)
{
logger
.
log_comment
(
msg
,
addr
-
start_addr
);
}
...
...
@@ -107,7 +107,7 @@ public:
}
}
#else
inline
void
comment
(
std
::
string
msg
)
{}
inline
void
comment
(
const
llvm
::
Twine
&
msg
)
{}
inline
std
::
string
dump
()
{
return
""
;
}
#endif
...
...
src/asm_writing/disassemble.cpp
View file @
ec6f626b
...
...
@@ -59,8 +59,8 @@ void disassemblyInitialize() {
llvm
::
InitializeNativeTargetAsmParser
();
}
void
AssemblyLogger
::
log_comment
(
const
std
::
string
&
comment
,
size_t
offset
)
{
comments
[
offset
].
push_back
(
comment
);
void
AssemblyLogger
::
log_comment
(
const
llvm
::
Twine
&
comment
,
size_t
offset
)
{
comments
[
offset
].
push_back
(
comment
.
str
()
);
}
void
AssemblyLogger
::
append_comments
(
llvm
::
raw_string_ostream
&
stream
,
size_t
pos
)
const
{
...
...
src/asm_writing/disassemble.h
View file @
ec6f626b
...
...
@@ -17,6 +17,7 @@
#include <unordered_map>
#include "llvm/ADT/Twine.h"
#include "llvm/Support/raw_ostream.h"
namespace
pyston
{
...
...
@@ -31,7 +32,7 @@ private:
void
append_comments
(
llvm
::
raw_string_ostream
&
,
size_t
pos
)
const
;
public:
void
log_comment
(
const
std
::
string
&
,
size_t
offset
);
void
log_comment
(
const
llvm
::
Twine
&
,
size_t
offset
);
std
::
string
finalize_log
(
uint8_t
const
*
start_addr
,
uint8_t
const
*
end_addr
)
const
;
};
}
...
...
src/asm_writing/rewriter.h
View file @
ec6f626b
...
...
@@ -232,7 +232,7 @@ private:
// Here "done" means that it would be okay to release all of the var's locations and
// thus allocate new variables in that same location. To be safe, you can always just
// only call bumpUse at the end, but in some cases it may be possible earlier.
std
::
vector
<
int
>
uses
;
llvm
::
SmallVector
<
int
,
32
>
uses
;
int
next_use
;
void
bumpUse
();
void
releaseIfNoUses
();
...
...
@@ -348,7 +348,7 @@ protected:
Rewriter
(
std
::
unique_ptr
<
ICSlotRewrite
>
rewrite
,
int
num_args
,
const
std
::
vector
<
int
>&
live_outs
);
std
::
vector
<
RewriterAction
>
actions
;
llvm
::
SmallVector
<
RewriterAction
,
32
>
actions
;
void
addAction
(
std
::
function
<
void
()
>
action
,
std
::
vector
<
RewriterVar
*>
const
&
vars
,
ActionType
type
)
{
assertPhaseCollecting
();
for
(
RewriterVar
*
var
:
vars
)
{
...
...
src/codegen/ast_interpreter.cpp
View file @
ec6f626b
...
...
@@ -78,7 +78,7 @@ public:
class
ASTInterpreter
{
public:
typedef
ContiguousMap
<
InternedString
,
Box
*>
SymMap
;
typedef
ContiguousMap
<
InternedString
,
Box
*
,
llvm
::
SmallDenseMap
<
InternedString
,
int
,
16
>
>
SymMap
;
ASTInterpreter
(
CLFunction
*
clfunc
);
~
ASTInterpreter
();
...
...
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