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
3b9634c9
Commit
3b9634c9
authored
Feb 24, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dont merge] reference checking helper function
parent
0f8b5369
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
0 deletions
+13
-0
src/codegen/irgen/refcounts.cpp
src/codegen/irgen/refcounts.cpp
+4
-0
src/codegen/runtime_hooks.cpp
src/codegen/runtime_hooks.cpp
+1
-0
src/codegen/runtime_hooks.h
src/codegen/runtime_hooks.h
+1
-0
src/runtime/inline/link_forcer.cpp
src/runtime/inline/link_forcer.cpp
+1
-0
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+4
-0
src/runtime/objmodel.h
src/runtime/objmodel.h
+2
-0
No files found.
src/codegen/irgen/refcounts.cpp
View file @
3b9634c9
...
@@ -174,6 +174,10 @@ void addDecrefs(llvm::Value* v, bool nullable, int num_refs, llvm::Instruction*
...
@@ -174,6 +174,10 @@ void addDecrefs(llvm::Value* v, bool nullable, int num_refs, llvm::Instruction*
getConstantInt
(
num_refs
,
g
.
i64
),
""
,
decref_pt
);
getConstantInt
(
num_refs
,
g
.
i64
),
""
,
decref_pt
);
new
llvm
::
StoreInst
(
new_refcount
,
refcount_ptr
,
decref_pt
);
new
llvm
::
StoreInst
(
new_refcount
,
refcount_ptr
,
decref_pt
);
#ifdef Py_REF_DEBUG
llvm
::
CallInst
::
Create
(
g
.
funcs
.
checkRefs
,
{
v
},
""
,
decref_pt
);
#endif
llvm
::
BasicBlock
*
cur_block
=
decref_pt
->
getParent
();
llvm
::
BasicBlock
*
cur_block
=
decref_pt
->
getParent
();
llvm
::
BasicBlock
*
continue_block
=
cur_block
->
splitBasicBlock
(
decref_pt
);
llvm
::
BasicBlock
*
continue_block
=
cur_block
->
splitBasicBlock
(
decref_pt
);
llvm
::
BasicBlock
*
dealloc_block
llvm
::
BasicBlock
*
dealloc_block
...
...
src/codegen/runtime_hooks.cpp
View file @
3b9634c9
...
@@ -322,6 +322,7 @@ void initGlobalFuncs(GlobalState& g) {
...
@@ -322,6 +322,7 @@ void initGlobalFuncs(GlobalState& g) {
GET
(
caughtCapiException
);
GET
(
caughtCapiException
);
GET
(
reraiseCapiExcAsCxx
);
GET
(
reraiseCapiExcAsCxx
);
GET
(
deopt
);
GET
(
deopt
);
GET
(
checkRefs
);
GET
(
div_float_float
);
GET
(
div_float_float
);
GET
(
floordiv_float_float
);
GET
(
floordiv_float_float
);
...
...
src/codegen/runtime_hooks.h
View file @
3b9634c9
...
@@ -53,6 +53,7 @@ struct GlobalFuncs {
...
@@ -53,6 +53,7 @@ struct GlobalFuncs {
llvm
::
Value
*
raise0
,
*
raise0_capi
,
*
raise3
,
*
raise3_capi
,
*
rawThrow
;
llvm
::
Value
*
raise0
,
*
raise0_capi
,
*
raise3
,
*
raise3_capi
,
*
rawThrow
;
llvm
::
Value
*
PyErr_Fetch
,
*
PyErr_NormalizeException
,
*
PyErr_Restore
,
*
caughtCapiException
,
*
reraiseCapiExcAsCxx
;
llvm
::
Value
*
PyErr_Fetch
,
*
PyErr_NormalizeException
,
*
PyErr_Restore
,
*
caughtCapiException
,
*
reraiseCapiExcAsCxx
;
llvm
::
Value
*
deopt
;
llvm
::
Value
*
deopt
;
llvm
::
Value
*
checkRefs
;
llvm
::
Value
*
div_float_float
,
*
floordiv_float_float
,
*
mod_float_float
,
*
pow_float_float
;
llvm
::
Value
*
div_float_float
,
*
floordiv_float_float
,
*
mod_float_float
,
*
pow_float_float
;
...
...
src/runtime/inline/link_forcer.cpp
View file @
3b9634c9
...
@@ -136,6 +136,7 @@ void force() {
...
@@ -136,6 +136,7 @@ void force() {
FORCE
(
caughtCapiException
);
FORCE
(
caughtCapiException
);
FORCE
(
reraiseCapiExcAsCxx
);
FORCE
(
reraiseCapiExcAsCxx
);
FORCE
(
deopt
);
FORCE
(
deopt
);
FORCE
(
checkRefs
);
FORCE
(
div_i64_i64
);
FORCE
(
div_i64_i64
);
FORCE
(
mod_i64_i64
);
FORCE
(
mod_i64_i64
);
...
...
src/runtime/objmodel.cpp
View file @
3b9634c9
...
@@ -6894,4 +6894,8 @@ extern "C" void boxedLocalsDel(Box* boxedLocals, BoxedString* attr) {
...
@@ -6894,4 +6894,8 @@ extern "C" void boxedLocalsDel(Box* boxedLocals, BoxedString* attr) {
}
}
d
.
erase
(
it
);
d
.
erase
(
it
);
}
}
extern
"C"
void
checkRefs
(
Box
*
b
)
{
RELEASE_ASSERT
(
b
->
ob_refcnt
>=
0
,
"%ld"
,
b
->
ob_refcnt
);
}
}
}
src/runtime/objmodel.h
View file @
3b9634c9
...
@@ -229,5 +229,7 @@ extern "C" void delGlobal(Box* globals, BoxedString* name);
...
@@ -229,5 +229,7 @@ extern "C" void delGlobal(Box* globals, BoxedString* name);
extern
"C"
void
boxedLocalsSet
(
Box
*
boxedLocals
,
BoxedString
*
attr
,
Box
*
val
);
extern
"C"
void
boxedLocalsSet
(
Box
*
boxedLocals
,
BoxedString
*
attr
,
Box
*
val
);
extern
"C"
Box
*
boxedLocalsGet
(
Box
*
boxedLocals
,
BoxedString
*
attr
,
Box
*
globals
);
extern
"C"
Box
*
boxedLocalsGet
(
Box
*
boxedLocals
,
BoxedString
*
attr
,
Box
*
globals
);
extern
"C"
void
boxedLocalsDel
(
Box
*
boxedLocals
,
BoxedString
*
attr
);
extern
"C"
void
boxedLocalsDel
(
Box
*
boxedLocals
,
BoxedString
*
attr
);
extern
"C"
void
checkRefs
(
Box
*
b
);
}
}
#endif
#endif
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