Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mu-impl-fast
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
40
Issues
40
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
mu
mu-impl-fast
Commits
89a703d2
Commit
89a703d2
authored
Aug 22, 2017
by
Isaac Oscar Gariano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hopefully fixed vm dumping bug
parent
790a2b8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
13 deletions
+48
-13
src/vm/vm.rs
src/vm/vm.rs
+14
-13
tests/test_muc/test_simple.py
tests/test_muc/test_simple.py
+34
-0
No files found.
src/vm/vm.rs
View file @
89a703d2
...
...
@@ -149,29 +149,30 @@ unsafe impl rodal::Dump for VM {
// Dump empty maps so that we can safely read and modify them once loaded
dumper
.dump_padding
(
&
self
.global_locations
);
dumper
.dump_object_here
(
&
RwLock
::
new
(
rodal
::
EmptyHashMap
::
<
MuID
,
ValueLocation
>
::
new
()
));
let
global_locations
=
RwLock
::
new
(
rodal
::
EmptyHashMap
::
<
MuID
,
ValueLocation
>
::
new
());
dumper
.dump_object_here
(
&
global_locations
);
dumper
.dump_padding
(
&
self
.func_vers
);
dumper
.dump_object_here
(
&
RwLock
::
new
(
let
func_vers
=
RwLock
::
new
(
rodal
::
EmptyHashMap
::
<
MuID
,
RwLock
<
MuFunctionVersion
>>
::
new
()
));
);
dumper
.dump_object_here
(
&
func_vers
);
dumper
.dump_padding
(
&
self
.aot_pending_funcref_store
);
dumper
.dump_object_here
(
&
RwLock
::
new
(
rodal
::
EmptyHashMap
::
<
Address
,
ValueLocation
>
::
new
()
)
);
let
aot_pending_funcref_store
=
RwLock
::
new
(
rodal
::
EmptyHashMap
::
<
Address
,
ValueLocation
>
::
new
());
dumper
.dump_object_here
(
&
aot_pending_funcref_store
);
// Dump an emepty hashmap for the other hashmaps
dumper
.dump_padding
(
&
self
.compiled_callsite_table
);
dumper
.dump_object_here
(
&
RwLock
::
new
(
rodal
::
EmptyHashMap
::
<
Address
,
CompiledCallsite
>
::
new
()
));
let
compiled_callsite_table
=
RwLock
::
new
(
rodal
::
EmptyHashMap
::
<
Address
,
CompiledCallsite
>
::
new
());
dumper
.dump_object_here
(
&
compiled_callsite_table
);
dumper
.dump_object
(
&
self
.callsite_count
);
dumper
.dump_padding
(
&
self
.pending_joins
);
dumper
.dump_object_here
(
&
Mutex
::
new
(
rodal
::
EmptyLinkedList
::
<
JoinHandle
<
()
>>
::
new
()));
let
pending_joins
=
Mutex
::
new
(
rodal
::
EmptyLinkedList
::
<
JoinHandle
<
()
>>
::
new
());
dumper
.dump_object_here
(
&
pending_joins
);
}
}
...
...
tests/test_muc/test_simple.py
View file @
89a703d2
...
...
@@ -123,6 +123,40 @@ def test_stack_pass_and_return():
}
"""
,
"test_stack_pass_and_return"
);
assert
(
execute
(
"test_stack_pass_and_return"
)
==
44
);
def
test_stack_args
():
lib
=
load_bundle
(
"""
.funcsig stack_sig = (double double double double double double double double double double)->(int<32>)
.funcdef test_stack_args <stack_sig>
{
entry(<double>d0 <double>d1 <double>d2 <double>d3 <double>d4 <double>d5 <double>d6 <double>d7 <double> d8 <double> d9):
ds0 = FMUL <double> d0 <double>0.0 d
ds1 = FMUL <double> d1 <double>1.0 d
ds2 = FMUL <double> d2 <double>2.0 d
ds3 = FMUL <double> d3 <double>3.0 d
ds4 = FMUL <double> d4 <double>4.0 d
ds5 = FMUL <double> d5 <double>5.0 d
ds6 = FMUL <double> d6 <double>6.0 d
ds7 = FMUL <double> d7 <double>7.0 d
ds8 = FMUL <double> d8 <double>8.0 d
ds9 = FMUL <double> d9 <double>9.0 d
s1 = FADD <double> ds0 ds1
s2 = FADD <double> s1 ds2
s3 = FADD <double> s2 ds3
s4 = FADD <double> s3 ds4
s5 = FADD <double> s4 ds5
s6 = FADD <double> s5 ds6
s7 = FADD <double> s6 ds7
s8 = FADD <double> s7 ds8
s9 = FADD <double> s8 ds9
r = FPTOSI <double int<32>> s9
RET r
}
"""
,
"test_stack_args"
);
test_stack_args
=
get_function
(
lib
.
test_stack_args
,
[
ctypes
.
c_double
,
ctypes
.
c_double
,
ctypes
.
c_double
,
ctypes
.
c_double
,
ctypes
.
c_double
,
ctypes
.
c_double
,
ctypes
.
c_double
,
ctypes
.
c_double
,
ctypes
.
c_double
,
ctypes
.
c_double
],
ctypes
.
c_int32
);
args
=
[
0.0
,
1.0
,
2.0
,
3.0
,
4.0
,
5.0
,
6.0
,
7.0
,
8.0
,
9.0
]
assert
(
test_stack_args
(
*
tuple
(
args
))
==
sum
(
map
((
lambda
x
:
x
**
2
),
args
)));
def
test_double_inline
():
lib
=
load_bundle
(
...
...
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