fn emit_alloc_const_size(
        &mut self,
        tmp_allocator: &P<Value>,
        size: ByteSize,
        align: ByteSize,
        node: &TreeNode,
        backend_ty: &BackendType,
        f_context: &mut FunctionContext,
        vm: &VM
    ) -> P<Value> {
        let size = align_up(mm::check_size(size), POINTER_SIZE);
        let encode = mm::gen_object_encode(backend_ty, size, vm);

        let tmp_res = self.get_result_value(node, 0);
        let tmp_align = make_value_int_const(align as u64, vm);
        let tmp_size = make_value_int_const(size as u64, vm);

        if size <= mm::MAX_TINY_OBJECT {
            // alloc tiny
            self.emit_runtime_entry(
                &entrypoints::ALLOC_TINY,
                vec![tmp_allocator.clone(), tmp_size.clone(), tmp_align],
                Some(vec![tmp_res.clone()]),
                Some(node),
                f_context,
                vm
            );
            // init object
            let tmp_encode = cast_value(
                &make_value_int_const(encode.tiny().as_u64(), vm),
                &UINT8_TYPE
            );
            self.emit_runtime_entry(
                &entrypoints::INIT_TINY,
                vec![tmp_allocator.clone(), tmp_res.clone(), tmp_encode],
                None,
                Some(node),
                f_context,
                vm
            );
        } else if size <= mm::MAX_MEDIUM_OBJECT {
            // this could be either a small object or a medium object

            // alloc normal
            self.emit_runtime_entry(
                &entrypoints::ALLOC_NORMAL,
                vec![tmp_allocator.clone(), tmp_size.clone(), tmp_align],
                Some(vec![tmp_res.clone()]),
                Some(node),
                f_context,
                vm
            );
            // init object
            if size <= mm::MAX_SMALL_OBJECT {
                let tmp_encode = cast_value(
                    &make_value_int_const(encode.small().as_u64(), vm),
                    &UINT16_TYPE
                );
                self.emit_runtime_entry(
                    &entrypoints::INIT_SMALL,
                    vec![tmp_allocator.clone(), tmp_res.clone(), tmp_encode],
                    None,
                    Some(node),
                    f_context,
                    vm
                );
            } else {
                let tmp_encode = cast_value(
                    &make_value_int_const(encode.medium().as_u64(), vm),
                    &UINT32_TYPE
                );
                self.emit_runtime_entry(
                    &entrypoints::INIT_MEDIUM,
                    vec![tmp_allocator.clone(), tmp_res.clone(), tmp_encode],
                    None,
                    Some(node),
                    f_context,
                    vm
                );
            };
        } else {
            // large allocation
            self.emit_runtime_entry(
                &entrypoints::ALLOC_LARGE,
                vec![tmp_allocator.clone(), tmp_size.clone(), tmp_align],
                Some(vec![tmp_res.clone()]),
                Some(node),
                f_context,
                vm
            );
            // init object
            let encode = encode.large();
            let tmp_encode1 = make_value_int_const(encode.size() as u64, vm);
            let tmp_encode2 = make_value_int_const(encode.type_id() as u64, vm);
            self.emit_runtime_entry(
                &entrypoints::INIT_LARGE,
                vec![
                    tmp_allocator.clone(),
                    tmp_res.clone(),
                    tmp_encode1,
                    tmp_encode2,
                ],
                None,
                Some(node),
                f_context,
                vm
            );
        }

        tmp_res
    }
/// emits the allocation sequence
/// * if the size is known at compile time, either emits allocation for small objects or
///   large objects
/// * if the size is not known at compile time, emits a branch to check the size at runtime,
///   and call corresponding allocation
emits the allocation sequence
if the size is known at compile time, either emits allocation for small objects or
large objects
if the size is not known at compile time, emits a branch to check the size at runtime,
and call corresponding allocation
emits the allocation sequence if the size is known at compile time either emits allocation for small objects or large objects if the size is not known at compile time emits a branch to check the size at runtime and call corresponding allocation
fn emit_alloc_const_size(
        &mut self,
        tmp_allocator: &P<Value>,
        size: ByteSize,
        align: ByteSize,
        node: &TreeNode,
        backend_ty: &BackendType,
        f_context: &mut FunctionContext,
        vm: &VM
    ) -> P<Value> {
        let size = align_up(mm::check_size(size), POINTER_SIZE);
        let encode = mm::gen_object_encode(backend_ty, size, vm);
        let tmp_res = self.get_result_value(node, 0);
        let tmp_align = make_value_int_const(align as u64, vm);
        let tmp_size = make_value_int_const(size as u64, vm);
        if size <= mm::MAX_TINY_OBJECT {
            // alloc tiny
            self.emit_runtime_entry(
                &entrypoints::ALLOC_TINY,
                vec![tmp_allocator.clone(), tmp_size.clone(), tmp_align],
                Some(vec![tmp_res.clone()]),
                Some(node),
                f_context,
                vm
            );
            // init object
            let tmp_encode = cast_value(
                &make_value_int_const(encode.tiny().as_u64(), vm),
                &UINT8_TYPE
            );
            self.emit_runtime_entry(
                &entrypoints::INIT_TINY,
                vec![tmp_allocator.clone(), tmp_res.clone(), tmp_encode],
                None,
                Some(node),
                f_context,
                vm
            );
        } else if size <= mm::MAX_MEDIUM_OBJECT {
            // this could be either a small object or a medium object
            // alloc normal
            self.emit_runtime_entry(
                &entrypoints::ALLOC_NORMAL,
                vec![tmp_allocator.clone(), tmp_size.clone(), tmp_align],
                Some(vec![tmp_res.clone()]),
                Some(node),
                f_context,
                vm
            );
            // init object
            if size <= mm::MAX_SMALL_OBJECT {
                let tmp_encode = cast_value(
                    &make_value_int_const(encode.small().as_u64(), vm),
                    &UINT16_TYPE
                );
                self.emit_runtime_entry(
                    &entrypoints::INIT_SMALL,
                    vec![tmp_allocator.clone(), tmp_res.clone(), tmp_encode],
                    None,
                    Some(node),
                    f_context,
                    vm
                );
            } else {
                let tmp_encode = cast_value(
                    &make_value_int_const(encode.medium().as_u64(), vm),
                    &UINT32_TYPE
                );
                self.emit_runtime_entry(
                    &entrypoints::INIT_MEDIUM,
                    vec![tmp_allocator.clone(), tmp_res.clone(), tmp_encode],
                    None,
                    Some(node),
                    f_context,
                    vm
                );
            };
        } else {
            // large allocation
            self.emit_runtime_entry(
                &entrypoints::ALLOC_LARGE,
                vec![tmp_allocator.clone(), tmp_size.clone(), tmp_align],
                Some(vec![tmp_res.clone()]),
                Some(node),
                f_context,
                vm
            );
            // init object
            let encode = encode.large();
            let tmp_encode1 = make_value_int_const(encode.size() as u64, vm);
            let tmp_encode2 = make_value_int_const(encode.type_id() as u64, vm);
            self.emit_runtime_entry(
                &entrypoints::INIT_LARGE,
                vec![
                    tmp_allocator.clone(),
                    tmp_res.clone(),
                    tmp_encode1,
                    tmp_encode2,
                ],
                None,
                Some(node),
                f_context,
                vm
            );
        }
        tmp_res
    }
fn emit_alloc_const_size ( & mut self , tmp_allocator : & P < Value > , size : ByteSize , align : ByteSize , node : & TreeNode , backend_ty : & BackendType , f_context : & mut FunctionContext , vm : & VM ) -> P < Value > { let size = align_up ( mm :: check_size ( size ) , POINTER_SIZE ) ; let encode = mm :: gen_object_encode ( backend_ty , size , vm ) ; let tmp_res = self . get_result_value ( node , 0 ) ; let tmp_align = make_value_int_const ( align as u64 , vm ) ; let tmp_size = make_value_int_const ( size as u64 , vm ) ; if size <= mm :: MAX_TINY_OBJECT { // alloc tiny self . emit_runtime_entry ( & entrypoints :: ALLOC_TINY , vec ! [ tmp_allocator clone ( ) tmp_size clone ( ) tmp_align ] , Some ( vec ! [ tmp_res clone ( ) ] ) , Some ( node ) , f_context , vm ) ; // init object let tmp_encode = cast_value ( & make_value_int_const ( encode . tiny ( ) . as_u64 ( ) , vm ) , & UINT8_TYPE ) ; self . emit_runtime_entry ( & entrypoints :: INIT_TINY , vec ! [ tmp_allocator clone ( ) tmp_res clone ( ) tmp_encode ] , None , Some ( node ) , f_context , vm ) ; } else if size <= mm :: MAX_MEDIUM_OBJECT { // this could be either a small object or a medium object // alloc normal self . emit_runtime_entry ( & entrypoints :: ALLOC_NORMAL , vec ! [ tmp_allocator clone ( ) tmp_size clone ( ) tmp_align ] , Some ( vec ! [ tmp_res clone ( ) ] ) , Some ( node ) , f_context , vm ) ; // init object if size <= mm :: MAX_SMALL_OBJECT { let tmp_encode = cast_value ( & make_value_int_const ( encode . small ( ) . as_u64 ( ) , vm ) , & UINT16_TYPE ) ; self . emit_runtime_entry ( & entrypoints :: INIT_SMALL , vec ! [ tmp_allocator clone ( ) tmp_res clone ( ) tmp_encode ] , None , Some ( node ) , f_context , vm ) ; } else { let tmp_encode = cast_value ( & make_value_int_const ( encode . medium ( ) . as_u64 ( ) , vm ) , & UINT32_TYPE ) ; self . emit_runtime_entry ( & entrypoints :: INIT_MEDIUM , vec ! [ tmp_allocator clone ( ) tmp_res clone ( ) tmp_encode ] , None , Some ( node ) , f_context , vm ) ; } ; } else { // large allocation self . emit_runtime_entry ( & entrypoints :: ALLOC_LARGE , vec ! [ tmp_allocator clone ( ) tmp_size clone ( ) tmp_align ] , Some ( vec ! [ tmp_res clone ( ) ] ) , Some ( node ) , f_context , vm ) ; // init object let encode = encode . large ( ) ; let tmp_encode1 = make_value_int_const ( encode . size ( ) as u64 , vm ) ; let tmp_encode2 = make_value_int_const ( encode . type_id ( ) as u64 , vm ) ; self . emit_runtime_entry ( & entrypoints :: INIT_LARGE , vec ! [ tmp_allocator clone ( ) tmp_res clone ( ) tmp_encode1 tmp_encode2 ] , None , Some ( node ) , f_context , vm ) ; } tmp_res }
emits the allocation sequence
 if the size is known at compile time, either emits allocation for small objects or
large objects
 if the size is not known at compile time, emits a branch to check the size at runtime,
and call corresponding allocation
emits the allocation sequence if the size is known at compile time either emits allocation for small objects or large objects if the size is not known at compile time emits a branch to check the size at runtime and call corresponding allocation
&mut self
tmp_allocator
&P<Value>
size
ByteSize
align
ByteSize
node
&TreeNode
backend_ty
&BackendType
f_context
&mut FunctionContext
vm
&VM
&mut self
tmp_allocator
&P<Value>
size
ByteSize
align
ByteSize
node
&TreeNode
backend_ty
&BackendType
f_context
&mut FunctionContext
vm
&VM