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.
1257 1258 1259 1260 1261 1262 1263 |
# File 'lib/wardite.rb', line 1257 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
1245 1246 1247 |
# File 'lib/wardite.rb', line 1245 def callsig @callsig end |
#code_body ⇒ Object
: CodeSection::CodeBody
1249 1250 1251 |
# File 'lib/wardite.rb', line 1249 def code_body @code_body end |
#findex ⇒ Object
: Integer
1251 1252 1253 |
# File 'lib/wardite.rb', line 1251 def findex @findex end |
Instance Method Details
#body ⇒ Object
1266 1267 1268 |
# File 'lib/wardite.rb', line 1266 def body code_body.body end |
#clone(override_type: nil) ⇒ Object
1282 1283 1284 1285 1286 1287 1288 1289 |
# File 'lib/wardite.rb', line 1282 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
1276 1277 1278 |
# File 'lib/wardite.rb', line 1276 def locals_count code_body.locals_count end |
#locals_type ⇒ Object
1271 1272 1273 |
# File 'lib/wardite.rb', line 1271 def locals_type code_body.locals_type end |