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
3cc1f4d8
Commit
3cc1f4d8
authored
Dec 08, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doh these need to be incq not incl
parent
5f4d519b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
6 deletions
+73
-6
src/asm_writing/assembler.cpp
src/asm_writing/assembler.cpp
+64
-0
src/asm_writing/assembler.h
src/asm_writing/assembler.h
+4
-1
src/asm_writing/rewriter.cpp
src/asm_writing/rewriter.cpp
+4
-4
src/codegen/baseline_jit.cpp
src/codegen/baseline_jit.cpp
+1
-1
No files found.
src/asm_writing/assembler.cpp
View file @
3cc1f4d8
...
...
@@ -693,6 +693,70 @@ void Assembler::decl(Immediate imm) {
emitInt
(
imm
.
val
,
4
);
}
void
Assembler
::
incq
(
Indirect
mem
)
{
int
src_idx
=
mem
.
base
.
regnum
;
int
rex
=
REX_W
;
if
(
src_idx
>=
8
)
{
rex
|=
REX_B
;
src_idx
-=
8
;
}
assert
(
src_idx
>=
0
&&
src_idx
<
8
);
if
(
rex
)
emitRex
(
rex
);
emitByte
(
0xff
);
assert
(
-
0x80
<=
mem
.
offset
&&
mem
.
offset
<
0x80
);
if
(
mem
.
offset
==
0
)
{
emitModRM
(
0b00
,
0
,
src_idx
);
}
else
{
emitModRM
(
0b01
,
0
,
src_idx
);
emitByte
(
mem
.
offset
);
}
}
void
Assembler
::
decq
(
Indirect
mem
)
{
int
src_idx
=
mem
.
base
.
regnum
;
int
rex
=
REX_W
;
if
(
src_idx
>=
8
)
{
rex
|=
REX_B
;
src_idx
-=
8
;
}
assert
(
src_idx
>=
0
&&
src_idx
<
8
);
if
(
rex
)
emitRex
(
rex
);
emitByte
(
0xff
);
assert
(
-
0x80
<=
mem
.
offset
&&
mem
.
offset
<
0x80
);
if
(
mem
.
offset
==
0
)
{
emitModRM
(
0b00
,
1
,
src_idx
);
}
else
{
emitModRM
(
0b01
,
1
,
src_idx
);
emitByte
(
mem
.
offset
);
}
}
void
Assembler
::
incq
(
Immediate
imm
)
{
emitByte
(
0x48
);
emitByte
(
0xff
);
emitByte
(
0x04
);
emitByte
(
0x25
);
emitInt
(
imm
.
val
,
4
);
}
void
Assembler
::
decq
(
Immediate
imm
)
{
emitByte
(
0x48
);
emitByte
(
0xff
);
emitByte
(
0x0c
);
emitByte
(
0x25
);
emitInt
(
imm
.
val
,
4
);
}
void
Assembler
::
call
(
Immediate
imm
)
{
emitByte
(
0xe8
);
emitInt
(
imm
.
val
,
4
);
...
...
src/asm_writing/assembler.h
View file @
3cc1f4d8
...
...
@@ -157,9 +157,12 @@ public:
void
incl
(
Indirect
mem
);
void
decl
(
Indirect
mem
);
void
incl
(
Immediate
mem
);
void
decl
(
Immediate
mem
);
void
incq
(
Indirect
mem
);
void
decq
(
Indirect
mem
);
void
incq
(
Immediate
mem
);
void
decq
(
Immediate
mem
);
void
call
(
Immediate
imm
);
// the value is the offset
void
callq
(
Register
reg
);
...
...
src/asm_writing/rewriter.cpp
View file @
3cc1f4d8
...
...
@@ -522,10 +522,10 @@ void Rewriter::_incref(RewriterVar* var) {
//llvm::ArrayRef<RewriterVar*>());
#ifdef Py_REF_DEBUG
//assembler->trap();
assembler
->
inc
l
(
assembler
::
Immediate
(
&
_Py_RefTotal
));
assembler
->
inc
q
(
assembler
::
Immediate
(
&
_Py_RefTotal
));
#endif
auto
reg
=
var
->
getInReg
();
assembler
->
inc
l
(
assembler
::
Indirect
(
reg
,
offsetof
(
Box
,
ob_refcnt
)));
assembler
->
inc
q
(
assembler
::
Indirect
(
reg
,
offsetof
(
Box
,
ob_refcnt
)));
// Doesn't call bumpUse, since this function is designed to be callable from other emitting functions.
// (ie the caller should call bumpUse)
...
...
@@ -539,7 +539,7 @@ void Rewriter::_decref(RewriterVar* var) {
#ifdef Py_REF_DEBUG
//assembler->trap();
assembler
->
dec
l
(
assembler
::
Immediate
(
&
_Py_RefTotal
));
assembler
->
dec
q
(
assembler
::
Immediate
(
&
_Py_RefTotal
));
#endif
_setupCall
(
true
,
llvm
::
ArrayRef
<
RewriterVar
*>
(
&
var
,
1
),
llvm
::
ArrayRef
<
RewriterVar
*>
(
NULL
,
(
int
)
0
),
assembler
::
RAX
);
...
...
@@ -548,7 +548,7 @@ void Rewriter::_decref(RewriterVar* var) {
auto
reg
=
assembler
::
RDI
;
//auto reg = var->getInReg();
assembler
->
dec
l
(
assembler
::
Indirect
(
reg
,
offsetof
(
Box
,
ob_refcnt
)));
assembler
->
dec
q
(
assembler
::
Indirect
(
reg
,
offsetof
(
Box
,
ob_refcnt
)));
{
assembler
::
ForwardJump
jnz
(
*
assembler
,
assembler
::
COND_NOT_ZERO
);
//assembler->trap();
...
...
src/codegen/baseline_jit.cpp
View file @
3cc1f4d8
...
...
@@ -954,7 +954,7 @@ void JitFragmentWriter::_emitRecordType(RewriterVar* type_recorder_var, Rewriter
assembler
->
mov
(
obj_cls_reg
,
last_seen_indirect
);
assembler
->
movq
(
assembler
::
Immediate
(
0ul
),
last_seen_count
);
}
assembler
->
inc
l
(
last_seen_count
);
assembler
->
inc
q
(
last_seen_count
);
type_recorder_var
->
bumpUse
();
obj_cls_var
->
bumpUse
();
...
...
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