Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Open Source Software
Zipr Backend
Commits
71c3b1b2
Commit
71c3b1b2
authored
9 years ago
by
whh8b
Browse files
Options
Downloads
Patches
Plain Diff
Track fallback dollops.
parent
acccedee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/zipr_dollop_man.h
+38
-3
38 additions, 3 deletions
include/zipr_dollop_man.h
src/dollop.cpp
+16
-1
16 additions, 1 deletion
src/dollop.cpp
src/zipr_dollop_man.cpp
+3
-0
3 additions, 0 deletions
src/zipr_dollop_man.cpp
test/ZiprDollop.cpp
+5
-2
5 additions, 2 deletions
test/ZiprDollop.cpp
with
62 additions
and
6 deletions
include/zipr_dollop_man.h
+
38
−
3
View file @
71c3b1b2
...
...
@@ -36,12 +36,25 @@
class
ZiprDollopManager_t
:
public
DollopManager_t
{
public:
ZiprDollopManager_t
()
:
m_refresh_stats
(
true
)
{}
/*
* Adders.
*/
void
AddDollops
(
Dollop_t
*
dollop_head
);
Zipr_SDK
::
Dollop_t
*
AddNewDollops
(
libIRDB
::
Instruction_t
*
start
);
/*
* Getters.
*/
Zipr_SDK
::
Dollop_t
*
GetContainingDollop
(
libIRDB
::
Instruction_t
*
insn
);
size_t
Size
()
{
return
m_dollops
.
size
();
}
/*
* Patch functions.
*/
void
AddDollopPatch
(
Zipr_SDK
::
DollopPatch_t
*
new_patch
)
{
m_patches_to_dollops
[
new_patch
->
Target
()].
push_back
(
new_patch
);
}
...
...
@@ -53,29 +66,51 @@ class ZiprDollopManager_t : public DollopManager_t {
*/
return
m_patches_to_dollops
.
at
(
target
);
}
void
PrintDollopPatches
(
const
std
::
ostream
&
);
/*
* Dollop target update functions.
*/
bool
UpdateTargets
(
Dollop_t
*
);
void
UpdateAllTargets
();
/*
* Iteration functions.
*/
std
::
list
<
Dollop_t
*>::
const_iterator
dollops_begin
()
{
return
m_dollops
.
begin
();
}
std
::
list
<
Dollop_t
*>::
const_iterator
dollops_end
()
{
return
m_dollops
.
end
();
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
ZiprDollopManager_t
&
dollop_man
);
/*
* Printing/output functions.
*/
void
PrintDollopPatches
(
const
std
::
ostream
&
);
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
ZiprDollopManager_t
&
dollop_man
);
void
PrintStats
(
std
::
ostream
&
out
);
void
PrintPlacementMap
(
const
MemorySpace_t
&
memory_space
,
const
std
::
string
&
map_filename
);
private
:
/*
* Helper functions.
*/
void
AddDollop
(
Dollop_t
*
dollop
);
void
CalculateStats
();
/*
* Support variables.
*/
std
::
list
<
Dollop_t
*>
m_dollops
;
std
::
map
<
libIRDB
::
Instruction_t
*
,
Dollop_t
*>
m_insn_to_dollop
;
std
::
list
<
DollopPatch_t
*>
m_patches
;
std
::
map
<
Dollop_t
*
,
std
::
list
<
DollopPatch_t
*>>
m_patches_to_dollops
;
bool
m_refresh_stats
;
/*
* Statistics.
*/
bool
m_refresh_stats
;
size_t
m_total_dollop_space
,
m_total_dollop_entries
;
unsigned
int
m_total_dollops
,
m_truncated_dollops
;
};
...
...
This diff is collapsed.
Click to expand it.
src/dollop.cpp
+
16
−
1
View file @
71c3b1b2
...
...
@@ -7,6 +7,7 @@ namespace Zipr_SDK {
Dollop_t
::
Dollop_t
(
Instruction_t
*
start
)
:
m_size
(
0
),
m_fallthrough_dollop
(
NULL
),
m_fallback_dollop
(
NULL
),
m_fallthrough_patched
(
false
),
m_coalesced
(
false
),
m_was_truncated
(
false
)
...
...
@@ -96,6 +97,18 @@ namespace Zipr_SDK {
new_dollop
=
new
Dollop_t
();
/*
* Set fallthrough and fallback dollop pointers.
* ----- ----
* | | | |
* this - new - fallthrough
* |
* |-----
*/
if
(
m_fallthrough_dollop
)
m_fallthrough_dollop
->
FallbackDollop
(
new_dollop
);
new_dollop
->
FallbackDollop
(
this
);
new_dollop
->
FallthroughDollop
(
m_fallthrough_dollop
);
m_fallthrough_dollop
=
new_dollop
;
...
...
@@ -162,13 +175,15 @@ namespace Zipr_SDK {
}
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
Dollop_t
&
d
)
{
std
::
list
<
DollopEntry_t
*>::
const_iterator
it
,
it_end
;
Dollop_t
*
fallthrough
=
NULL
;
Dollop_t
*
fallthrough
=
NULL
,
*
fallback
=
NULL
;
for
(
it
=
d
.
begin
(),
it_end
=
d
.
end
();
it
!=
it_end
;
it
++
)
{
out
<<
std
::
hex
<<
*
(
*
it
)
<<
std
::
endl
;
}
if
((
fallback
=
d
.
FallbackDollop
())
!=
NULL
)
out
<<
"Fallback: "
<<
std
::
hex
<<
fallback
<<
std
::
endl
;
if
((
fallthrough
=
d
.
FallthroughDollop
())
!=
NULL
)
out
<<
"Fallthrough: "
<<
std
::
hex
<<
fallthrough
<<
std
::
endl
;
return
out
;
...
...
This diff is collapsed.
Click to expand it.
src/zipr_dollop_man.cpp
+
3
−
0
View file @
71c3b1b2
...
...
@@ -73,6 +73,7 @@ namespace zipr {
* the updated fallthrough dollop!
*/
new_dollop
->
FallthroughDollop
(
fallthrough_dollop
);
fallthrough_dollop
->
FallbackDollop
(
new_dollop
);
/*
* Delete the overlapping instructions.
...
...
@@ -116,6 +117,7 @@ namespace zipr {
{
assert
(
existing_dollop
->
front
()
->
Instruction
()
==
fallthrough
);
new_dollop
->
FallthroughDollop
(
existing_dollop
);
existing_dollop
->
FallbackDollop
(
new_dollop
);
break
;
}
/*
...
...
@@ -125,6 +127,7 @@ namespace zipr {
previous_dollop
=
new_dollop
;
new_dollop
=
Dollop_t
::
CreateNewDollop
(
fallthrough
);
previous_dollop
->
FallthroughDollop
(
new_dollop
);
new_dollop
->
FallbackDollop
(
previous_dollop
);
}
AddDollops
(
original_new_dollop
);
return
original_new_dollop
;
...
...
This diff is collapsed.
Click to expand it.
test/ZiprDollop.cpp
+
5
−
2
View file @
71c3b1b2
...
...
@@ -180,7 +180,9 @@ bool TestAddNewDollopSplitsExistingDollop(void) {
return
success
&&
a
->
GetDollopEntryCount
()
==
2
&&
b
->
GetDollopEntryCount
()
==
2
&&
dollop_man
.
Size
()
==
2
;
dollop_man
.
Size
()
==
2
&&
a
->
FallthroughDollop
()
==
b
&&
b
->
FallbackDollop
()
==
a
;
}
bool
TestUpdateTargetsDollopManager
(
void
)
{
...
...
@@ -349,7 +351,8 @@ bool TestDollopSplit(void) {
cout
<<
"Dollop B: "
<<
endl
;
cout
<<
*
b
<<
endl
;
return
a
->
GetDollopEntryCount
()
==
1
&&
b
->
GetDollopEntryCount
()
==
4
;
return
a
->
GetDollopEntryCount
()
==
1
&&
b
->
GetDollopEntryCount
()
==
4
&&
a
->
FallthroughDollop
()
==
b
&&
b
->
FallbackDollop
()
==
a
;
}
bool
TestDollopEntryEquals
(
void
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment