Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
mu-impl-fast
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
41
Issues
41
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Schedules
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mu
mu-impl-fast
Commits
22c3a1b0
Commit
22c3a1b0
authored
Nov 12, 2017
by
qinsoon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
896af8f0
Pipeline
#1306
passed with stages
in 50 minutes and 23 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
13 deletions
+32
-13
inst_sel.rs
src/compiler/backend/arch/x86_64/inst_sel.rs
+3
-3
mod.rs
src/compiler/backend/mod.rs
+9
-2
global_type_table.rs
src/gc/src/objectmodel/sidemap/global_type_table.rs
+9
-7
type_encode.rs
src/gc/src/objectmodel/sidemap/type_encode.rs
+1
-0
mm.rs
src/runtime/mm.rs
+7
-0
vm.rs
src/vm/vm.rs
+3
-1
No files found.
src/compiler/backend/arch/x86_64/inst_sel.rs
View file @
22c3a1b0
...
...
@@ -1714,7 +1714,7 @@ impl<'a> InstructionSelection {
}
Instruction_
::
New
(
ref
ty
)
=>
{
trace!
(
"instsel on NEW
"
);
trace!
(
"instsel on NEW
: {}"
,
ty
.print_details
()
);
assert
!
(
!
ty
.is_hybrid
());
let
ty_info
=
vm
.get_backend_type_info
(
ty
.id
());
...
...
@@ -1737,7 +1737,7 @@ impl<'a> InstructionSelection {
}
Instruction_
::
NewHybrid
(
ref
ty
,
var_len
)
=>
{
trace!
(
"instsel on NEWHYBRID
"
);
trace!
(
"instsel on NEWHYBRID
: {}"
,
ty
.print_details
()
);
assert
!
(
ty
.is_hybrid
());
let
ty_info
=
vm
.get_backend_type_info
(
ty
.id
());
...
...
@@ -3536,7 +3536,7 @@ impl<'a> InstructionSelection {
vm
);
// init object
if
size
<
mm
::
MAX_SMALL_OBJECT
{
if
size
<
=
mm
::
MAX_SMALL_OBJECT
{
let
tmp_encode
=
self
.make_int_const
(
encode
.small
()
.as_u64
(),
UINT16_TYPE
.clone
(),
vm
);
self
.emit_runtime_entry
(
...
...
src/compiler/backend/mod.rs
View file @
22c3a1b0
...
...
@@ -252,6 +252,8 @@ impl BackendType {
_
=>
unimplemented!
()
}
}
// void
MuType_
::
Void
=>
TypeEncode
::
short_noref
(
MINIMAL_ALIGNMENT
,
1
),
// ref
MuType_
::
Ref
(
_
)
|
MuType_
::
IRef
(
_
)
=>
TypeEncode
::
short_ref
(),
// weakref
...
...
@@ -347,6 +349,11 @@ impl BackendType {
res
.push
(
WordType
::
NonRef
);
}
}
MuType_
::
Void
=>
{
if
pointer_aligned
{
res
.push
(
WordType
::
NonRef
);
}
}
MuType_
::
Ref
(
_
)
|
MuType_
::
IRef
(
_
)
=>
{
debug_assert!
(
pointer_aligned
);
res
.push
(
WordType
::
Ref
);
...
...
@@ -575,10 +582,10 @@ impl BackendType {
ret
}
// void
// void
- one byte
MuType_
::
Void
=>
BackendType
{
ty
:
ty
.clone
(),
size
:
0
,
size
:
1
,
alignment
:
1
,
struct_layout
:
None
,
elem_size
:
None
,
...
...
src/gc/src/objectmodel/sidemap/global_type_table.rs
View file @
22c3a1b0
...
...
@@ -92,13 +92,15 @@ impl GlobalTypeTable {
pub
fn
cleanup
()
{
// unmap the table
let
mmap_start
=
GlobalTypeTable
::
table_meta
()
.mmap_start
;
let
mmap_size
=
GlobalTypeTable
::
table_meta
()
.mmap_size
;
munmap
(
mmap_start
,
mmap_size
);
// set pointers to zero
GLOBAL_TYPE_TABLE_PTR
.store
(
0
,
Ordering
::
Relaxed
);
GLOBAL_TYPE_TABLE_META
.store
(
0
,
Ordering
::
Relaxed
);
if
GLOBAL_TYPE_TABLE_META
.load
(
Ordering
::
SeqCst
)
!=
0
{
let
mmap_start
=
GlobalTypeTable
::
table_meta
()
.mmap_start
;
let
mmap_size
=
GlobalTypeTable
::
table_meta
()
.mmap_size
;
munmap
(
mmap_start
,
mmap_size
);
// set pointers to zero
GLOBAL_TYPE_TABLE_PTR
.store
(
0
,
Ordering
::
Relaxed
);
GLOBAL_TYPE_TABLE_META
.store
(
0
,
Ordering
::
Relaxed
);
}
}
#[inline(always)]
...
...
src/gc/src/objectmodel/sidemap/type_encode.rs
View file @
22c3a1b0
...
...
@@ -183,6 +183,7 @@ impl Eq for ShortTypeEncode {}
use
std
::
hash
::
*
;
impl
Hash
for
ShortTypeEncode
{
fn
hash
<
H
:
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
self
.align
.hash
(
state
);
self
.fix_len
.hash
(
state
);
self
.fix_ty
.hash
(
state
);
self
.var_len
.hash
(
state
);
...
...
src/runtime/mm.rs
View file @
22c3a1b0
...
...
@@ -54,6 +54,13 @@ pub fn gen_object_encode(backend_ty: &BackendType, size: ByteSize, vm: &VM) -> O
}
};
debug!
(
"ENCODE: gen_object_encode: {:?}, size: {}"
,
backend_ty
,
size
);
debug!
(
"ENCODE: gc_ty: {}, full_gc_ty: {}"
,
gc_tyid
,
full_tyid
);
gen_object_encode_internal
(
is_hybrid
,
gc_tyid
,
full_tyid
,
size
,
vm
)
}
...
...
src/vm/vm.rs
View file @
22c3a1b0
...
...
@@ -942,7 +942,7 @@ impl<'a> VM {
if
!
type_map
.contains_key
(
&
gc_type
)
{
let
id
=
match
gc_type
{
TypeEncode
::
Short
(
ref
enc
)
=>
{
if
resolved
.size
<
MAX_SMALL_OBJECT
{
if
resolved
.size
<
=
MAX_SMALL_OBJECT
{
GlobalTypeTable
::
insert_small_entry
(
enc
.clone
())
}
else
{
GlobalTypeTable
::
insert_large_entry
(
enc
.clone
())
...
...
@@ -950,6 +950,7 @@ impl<'a> VM {
}
TypeEncode
::
Full
(
ref
enc
)
=>
GlobalTypeTable
::
insert_full_entry
(
enc
.clone
())
};
debug!
(
"ENCODE: {} = {:?}"
,
id
,
gc_type
);
type_map
.insert
(
gc_type
.clone
(),
id
);
id_map
.insert
(
id
,
gc_type
);
}
...
...
@@ -960,6 +961,7 @@ impl<'a> VM {
Some
(
ref
enc
)
=>
{
if
!
type_map
.contains_key
(
enc
)
{
let
id
=
GlobalTypeTable
::
insert_full_entry
(
enc
.as_full
()
.clone
());
debug!
(
"ENCODE: (hybrid full) {} = {:?}"
,
id
,
enc
);
type_map
.insert
(
enc
.clone
(),
id
);
id_map
.insert
(
id
,
enc
.clone
());
}
...
...
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