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.
1229 1230 1231 1232 1233 1234 1235 |
# File 'lib/wardite.rb', line 1229 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
1217 1218 1219 |
# File 'lib/wardite.rb', line 1217 def callsig @callsig end |
#code_body ⇒ Object
: CodeSection::CodeBody
1221 1222 1223 |
# File 'lib/wardite.rb', line 1221 def code_body @code_body end |
#findex ⇒ Object
: Integer
1223 1224 1225 |
# File 'lib/wardite.rb', line 1223 def findex @findex end |
Instance Method Details
#body ⇒ Object
1238 1239 1240 |
# File 'lib/wardite.rb', line 1238 def body code_body.body end |
#clone(override_type: nil) ⇒ Object
1254 1255 1256 1257 1258 1259 1260 1261 |
# File 'lib/wardite.rb', line 1254 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
1248 1249 1250 |
# File 'lib/wardite.rb', line 1248 def locals_count code_body.locals_count end |
#locals_type ⇒ Object
1243 1244 1245 |
# File 'lib/wardite.rb', line 1243 def locals_type code_body.locals_type end |