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.
1240 1241 1242 1243 1244 1245 |
# File 'lib/wardite.rb', line 1240 def initialize(callsig, retsig, code_body) @callsig = callsig @retsig = retsig @code_body = code_body end |
Instance Attribute Details
#callsig ⇒ Object
: Array
1230 1231 1232 |
# File 'lib/wardite.rb', line 1230 def callsig @callsig end |
#code_body ⇒ Object
: CodeSection::CodeBody
1234 1235 1236 |
# File 'lib/wardite.rb', line 1234 def code_body @code_body end |
Instance Method Details
#body ⇒ Object
1248 1249 1250 |
# File 'lib/wardite.rb', line 1248 def body code_body.body end |
#clone(override_type: nil) ⇒ Object
1264 1265 1266 1267 1268 1269 1270 1271 |
# File 'lib/wardite.rb', line 1264 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
1258 1259 1260 |
# File 'lib/wardite.rb', line 1258 def locals_count code_body.locals_count end |
#locals_type ⇒ Object
1253 1254 1255 |
# File 'lib/wardite.rb', line 1253 def locals_type code_body.locals_type end |