Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mu-impl-ref2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mu
mu-impl-ref2
Commits
1d03dfae
Commit
1d03dfae
authored
Sep 02, 2015
by
Kunshan Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed association between functions and expFuncs.
parent
7ba974c9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
1 deletion
+44
-1
src/main/scala/uvm/Bundle.scala
src/main/scala/uvm/Bundle.scala
+15
-1
src/main/scala/uvm/refimpl/itpr/boxes.scala
src/main/scala/uvm/refimpl/itpr/boxes.scala
+8
-0
src/test/scala/uvm/ir/textinput/TestingBundlesValidators.scala
...est/scala/uvm/ir/textinput/TestingBundlesValidators.scala
+17
-0
tests/uvm-parsing-test/redef-base.uir
tests/uvm-parsing-test/redef-base.uir
+2
-0
tests/uvm-parsing-test/redef-overlay.uir
tests/uvm-parsing-test/redef-overlay.uir
+2
-0
No files found.
src/main/scala/uvm/Bundle.scala
View file @
1d03dfae
...
...
@@ -73,7 +73,19 @@ class Bundle {
val
id
=
cand
.
id
oldNs
.
get
(
id
)
match
{
case
None
=>
oldNs
.
add
(
cand
)
case
Some
(
oldObj
)
=>
oldObj
.
versions
=
cand
.
versions
.
head
::
oldObj
.
versions
case
Some
(
oldObj
)
=>
oldObj
.
versions
=
cand
.
versions
.
head
::
oldObj
.
versions
cand
.
versions
.
head
.
func
=
oldObj
}
}
}
private
def
fixExpFuncs
(
oldNs
:
Namespace
[
Function
],
newNs
:
Namespace
[
ExposedFunc
])
{
for
(
expFunc
<-
newNs
.
all
)
{
val
funcID
=
expFunc
.
func
.
id
oldNs
.
get
(
funcID
)
match
{
case
None
=>
case
Some
(
oldFunc
)
=>
expFunc
.
func
=
oldFunc
}
}
}
...
...
@@ -88,5 +100,7 @@ class Bundle {
simpleMerge
(
constantNs
,
newBundle
.
constantNs
)
simpleMerge
(
globalCellNs
,
newBundle
.
globalCellNs
)
mergeFunc
(
funcNs
,
newBundle
.
funcNs
)
simpleMerge
(
expFuncNs
,
newBundle
.
expFuncNs
)
fixExpFuncs
(
funcNs
,
newBundle
.
expFuncNs
)
}
}
src/main/scala/uvm/refimpl/itpr/boxes.scala
View file @
1d03dfae
...
...
@@ -80,6 +80,12 @@ case class BoxTagRef64(var raw: Long) extends HasObjRef {
raw
=
OpHelper
.
refToTr64
(
newObjRef
,
oldTag
)
}
}
case
class
BoxPointer
(
var
addr
:
Word
)
extends
ValueBox
{
def
copyFrom
(
other
:
ValueBox
)
:
Unit
=
{
val
that
=
other
.
asInstanceOf
[
BoxPointer
]
this
.
addr
=
that
.
addr
}
}
object
ValueBox
{
...
...
@@ -99,6 +105,8 @@ object ValueBox {
case
_:
TypeStack
=>
BoxStack
(
None
)
case
_:
TypeThread
=>
BoxThread
(
None
)
case
_:
TypeTagRef64
=>
BoxTagRef64
(
0L
)
case
_:
TypePtr
=>
BoxPointer
(
0L
)
case
_:
TypeFuncPtr
=>
BoxPointer
(
0L
)
}
}
\ No newline at end of file
src/test/scala/uvm/ir/textinput/TestingBundlesValidators.scala
View file @
1d03dfae
...
...
@@ -1183,9 +1183,26 @@ trait TestingBundlesValidators extends Matchers with ExtraMatchers {
(
ourGlobal
func
"@foxsay"
).
versions
.
head
shouldBe
(
ourNew
funcVer
"@foxsay_v1"
)
(
ourGlobal
func
"@meaning_of_life"
).
versions
.
head
shouldBe
(
ourNew
funcVer
"@meaning_of_life_v2"
)
(
ourGlobal
funcVer
"@meaning_of_life_v1"
).
func
shouldBe
(
ourGlobal
func
"@meaning_of_life"
)
(
ourGlobal
funcVer
"@meaning_of_life_v2"
).
func
shouldBe
(
ourGlobal
func
"@meaning_of_life"
)
val
foxSay
=
ourGlobal
func
"@foxsay"
ourGlobal
value
"@foxsay"
shouldBe
foxSay
ourGlobal
globalValue
"@foxsay"
shouldBe
foxSay
{
val
its
=
ourGlobal
expFunc
"@meaning_external1"
its
.
func
shouldBe
(
ourGlobal
func
"@meaning_of_life"
)
its
.
callConv
shouldBe
Flag
(
"#DEFAULT"
)
its
.
cookie
shouldBe
(
ourGlobal
const
"@I64_42"
)
}
{
val
its
=
ourGlobal
expFunc
"@meaning_external2"
its
.
func
shouldBe
(
ourGlobal
func
"@meaning_of_life"
)
its
.
callConv
shouldBe
Flag
(
"#DEFAULT"
)
its
.
cookie
shouldBe
(
ourGlobal
const
"@I64_43"
)
}
}
}
\ No newline at end of file
tests/uvm-parsing-test/redef-base.uir
View file @
1d03dfae
...
...
@@ -9,3 +9,5 @@
}
.funcdecl @foxsay <@IntReturner>
.expose @meaning_external1 = @meaning_of_life #DEFAULT @I64_42
tests/uvm-parsing-test/redef-overlay.uir
View file @
1d03dfae
...
...
@@ -9,3 +9,5 @@
%entry:
%ret = RET <@i64> @I64_43
}
.expose @meaning_external2 = @meaning_of_life #DEFAULT @I64_43
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