Class: Wardite::WasmFunction
- Inherits:
-
Object
- Object
- Wardite::WasmFunction
- Defined in:
- lib/wardite.rb
Overview
TODO: common interface btw. WasmFunction and ExternalFunction?
Instance Attribute Summary collapse
-
#callsig ⇒ Object
: Array.
-
#code_body ⇒ Object
: CodeSection::CodeBody.
-
#retsig ⇒ Object
: Array.
Instance Method Summary collapse
- #body ⇒ Object
- #clone(override_type: nil) ⇒ Object
-
#initialize(callsig, retsig, code_body) ⇒ WasmFunction
constructor
A new instance of WasmFunction.
- #locals_count ⇒ Object
- #locals_type ⇒ Object
Constructor Details
#initialize(callsig, retsig, code_body) ⇒ WasmFunction
Returns a new instance of WasmFunction.
1158 1159 1160 1161 1162 1163 |
# File 'lib/wardite.rb', line 1158 def initialize(callsig, retsig, code_body) @callsig = callsig @retsig = retsig @code_body = code_body end |
Instance Attribute Details
#callsig ⇒ Object
: Array
1148 1149 1150 |
# File 'lib/wardite.rb', line 1148 def callsig @callsig end |
#code_body ⇒ Object
: CodeSection::CodeBody
1152 1153 1154 |
# File 'lib/wardite.rb', line 1152 def code_body @code_body end |
Instance Method Details
#body ⇒ Object
1166 1167 1168 |
# File 'lib/wardite.rb', line 1166 def body code_body.body end |
#clone(override_type: nil) ⇒ Object
1182 1183 1184 1185 1186 1187 1188 1189 |
# File 'lib/wardite.rb', line 1182 def clone(override_type: nil) if override_type # code_body is assumed to be frozen, so we can copy its ref WasmFunction.new(override_type.callsig, override_type.retsig, code_body) else WasmFunction.new(callsig, retsig, code_body) end end |
#locals_count ⇒ Object
1176 1177 1178 |
# File 'lib/wardite.rb', line 1176 def locals_count code_body.locals_count end |
#locals_type ⇒ Object
1171 1172 1173 |
# File 'lib/wardite.rb', line 1171 def locals_type code_body.locals_type end |