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.
-
#findex ⇒ Object
: Integer.
-
#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.
1286 1287 1288 1289 1290 1291 1292 |
# File 'lib/wardite.rb', line 1286 def initialize(callsig, retsig, code_body) @callsig = callsig @retsig = retsig @code_body = code_body @findex = 0 # for debug end |
Instance Attribute Details
#callsig ⇒ Object
: Array
1274 1275 1276 |
# File 'lib/wardite.rb', line 1274 def callsig @callsig end |
#code_body ⇒ Object
: CodeSection::CodeBody
1278 1279 1280 |
# File 'lib/wardite.rb', line 1278 def code_body @code_body end |
#findex ⇒ Object
: Integer
1280 1281 1282 |
# File 'lib/wardite.rb', line 1280 def findex @findex end |
Instance Method Details
#body ⇒ Object
1295 1296 1297 |
# File 'lib/wardite.rb', line 1295 def body code_body.body end |
#clone(override_type: nil) ⇒ Object
1311 1312 1313 1314 1315 1316 1317 1318 |
# File 'lib/wardite.rb', line 1311 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
1305 1306 1307 |
# File 'lib/wardite.rb', line 1305 def locals_count code_body.locals_count end |
#locals_type ⇒ Object
1300 1301 1302 |
# File 'lib/wardite.rb', line 1300 def locals_type code_body.locals_type end |