| 301 | //// FuncDesc //// |
| 302 | |
| 303 | ValueType FuncDesc::GetLocalType(Index index) const { |
| 304 | if (index < type.params.size()) { |
| 305 | return type.params[index]; |
| 306 | } |
| 307 | index -= type.params.size(); |
| 308 | |
| 309 | auto iter = std::lower_bound( |
| 310 | locals.begin(), locals.end(), index + 1, |
| 311 | [](const LocalDesc& lhs, Index rhs) { return lhs.end < rhs; }); |
| 312 | assert(iter != locals.end()); |
| 313 | return iter->type; |
| 314 | } |
| 315 | |
| 316 | //// Store //// |
| 317 | Store::Store(const Features& features) : features_(features) { |