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
2023c928
Commit
2023c928
authored
Jun 11, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewriter: remove duplicate getAttr calls
parent
97426460
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
src/asm_writing/rewriter.cpp
src/asm_writing/rewriter.cpp
+14
-0
src/asm_writing/rewriter.h
src/asm_writing/rewriter.h
+2
-1
src/codegen/baseline_jit.cpp
src/codegen/baseline_jit.cpp
+2
-0
No files found.
src/asm_writing/rewriter.cpp
View file @
2023c928
...
...
@@ -416,6 +416,20 @@ void Rewriter::_addAttrGuard(RewriterVar* var, int offset, RewriterVar* val_cons
RewriterVar
*
RewriterVar
::
getAttr
(
int
offset
,
Location
dest
,
assembler
::
MovType
type
)
{
STAT_TIMER
(
t0
,
"us_timer_rewriter"
,
10
);
// if no changing action happened we can reuse get attributes
if
(
!
rewriter
->
added_changing_action
)
{
RewriterVar
*&
result
=
getattrs
[
std
::
make_pair
(
offset
,
(
int
)
type
)];
if
(
result
)
{
if
(
dest
!=
Location
::
any
())
result
->
getInReg
(
dest
,
true
/* allow_constant_in_reg */
);
}
else
{
result
=
rewriter
->
createNewVar
();
rewriter
->
addAction
([
=
]()
{
rewriter
->
_getAttr
(
result
,
this
,
offset
,
dest
,
type
);
},
{
this
},
ActionType
::
NORMAL
);
}
return
result
;
}
RewriterVar
*
result
=
rewriter
->
createNewVar
();
rewriter
->
addAction
([
=
]()
{
rewriter
->
_getAttr
(
result
,
this
,
offset
,
dest
,
type
);
},
{
this
},
ActionType
::
NORMAL
);
return
result
;
...
...
src/asm_writing/rewriter.h
View file @
2023c928
...
...
@@ -263,7 +263,8 @@ private:
Location
arg_loc
;
std
::
pair
<
int
/*offset*/
,
int
/*size*/
>
scratch_allocation
;
llvm
::
SmallSet
<
std
::
tuple
<
int
,
uint64_t
,
bool
>
,
4
>
attr_guards
;
// used to detect duplicate guards
llvm
::
SmallSet
<
std
::
tuple
<
int
,
uint64_t
,
bool
>
,
4
>
attr_guards
;
// used to detect duplicate guards
llvm
::
SmallDenseMap
<
std
::
pair
<
int
,
int
>
,
RewriterVar
*>
getattrs
;
// used to detect duplicate getAttrs
// Gets a copy of this variable in a register, spilling/reloading if necessary.
// TODO have to be careful with the result since the interface doesn't guarantee
...
...
src/codegen/baseline_jit.cpp
View file @
2023c928
...
...
@@ -177,6 +177,8 @@ JitFragmentWriter::JitFragmentWriter(CFGBlock* block, std::unique_ptr<ICInfo> ic
ic_info
(
std
::
move
(
ic_info
))
{
allocatable_regs
=
bjit_allocatable_regs
;
added_changing_action
=
true
;
if
(
LOG_BJIT_ASSEMBLY
)
comment
(
"BJIT: JitFragmentWriter() start"
);
interp
=
createNewVar
();
...
...
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