Skip to content

Start function indirection #2199

@lexaknyazev

Description

@lexaknyazev

It seems that when the start function has 200 or more instructions it gets moved to another function and the native start function contains only a single call. Why is that so?

For example:

// repeat 67 times
store<u8>(0, 0);

produces

(module
 (type $none_=>_none (func))
 (memory $0 0)
 (export "memory" (memory $0))
 (start $~start)
 (func $start:assembly/foo
  i32.const 0
  i32.const 0
  i32.store8
  i32.const 0
  i32.const 0
  i32.store8
;; 65 more times
 )
 (func $~start
  call $start:assembly/foo
 )
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions