File tree Expand file tree Collapse file tree 5 files changed +9
-9
lines changed 
Tests/WasmKitTests/Execution/Instructions Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ extension Store {
321321
322322    /// > Note:
323323    /// <https://webassembly.github.io/spec/core/exec/modules.html#alloc-func>
324-     func  allocate( function:  Function ,  module:  ModuleInstance )  ->  FunctionAddress  { 
324+     func  allocate( function:  GuestFunction ,  module:  ModuleInstance )  ->  FunctionAddress  { 
325325        let  address  =  functions. count
326326        let  instance  =  FunctionInstance ( function,  module:  module) 
327327        functions. append ( instance) 
Original file line number Diff line number Diff line change @@ -37,9 +37,9 @@ public final class ModuleInstance {
3737public  struct  FunctionInstance  { 
3838    public  let  type :  FunctionType 
3939    public  let  module :  ModuleInstance 
40-     public   var  code :  Function 
40+     var  code :  GuestFunction 
4141
42-     init ( _ function:  Function ,  module:  ModuleInstance )  { 
42+     init ( _ function:  GuestFunction ,  module:  ModuleInstance )  { 
4343        type =  module. types [ Int ( function. type) ] 
4444        self . module =  module
4545        code =  function
Original file line number Diff line number Diff line change @@ -1265,7 +1265,7 @@ extension WasmParser {
12651265        } 
12661266
12671267        let  functions  =  codes. enumerated ( ) . map  {  [ hasDataCount,  features]  index,  code in 
1268-             Function ( 
1268+             GuestFunction ( 
12691269                type:  typeIndices [ index] ,  locals:  code. locals, 
12701270                body:  { 
12711271                    let  stream  =  StaticByteStream ( bytes:  Array ( code. expression) ) 
Original file line number Diff line number Diff line change 44/// <https://webassembly.github.io/spec/core/syntax/modules.html#modules>
55public  struct  Module  { 
66    public  internal( set)   var  types :  [ FunctionType ] 
7-     public   internal ( set )   var  functions :  [ Function ] 
7+     var  functions :  [ GuestFunction ] 
88    public  internal( set)   var  tables :  [ Table ] 
99    public  internal( set)   var  memories :  [ Memory ] 
1010    public  internal( set)   var  globals :  [ Global ] 
@@ -16,9 +16,9 @@ public struct Module {
1616    public  internal( set)   var  exports :  [ Export ] 
1717    public  internal( set)   var  customSections =  [ CustomSection] ( ) 
1818
19-     public   init ( 
19+     init ( 
2020        types:  [ FunctionType ]  =  [ ] , 
21-         functions:  [ Function ]  =  [ ] , 
21+         functions:  [ GuestFunction ]  =  [ ] , 
2222        tables:  [ Table ]  =  [ ] , 
2323        memories:  [ Memory ]  =  [ ] , 
2424        globals:  [ Global ]  =  [ ] , 
@@ -67,7 +67,7 @@ public typealias LabelIndex = UInt32
6767
6868/// > Note:
6969/// <https://webassembly.github.io/spec/core/syntax/modules.html#functions>
70- public   struct  Function  { 
70+ struct  GuestFunction  { 
7171    init ( type:  TypeIndex ,  locals:  [ ValueType ] ,  body:  @escaping  ( )  throws  ->  Expression )  { 
7272        self . type =  type
7373        self . locals =  locals
Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ final class ControlInstructionTests: XCTestCase {
398398    } 
399399} 
400400
401- extension  Function  { 
401+ extension  GuestFunction  { 
402402    init ( type:  TypeIndex ,  locals:  [ ValueType ] ,  body:  Expression )  { 
403403        self . init ( type:  type,  locals:  locals,  body:  {  body } ) 
404404    } 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments