Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::chain::wasm_ops Namespace Reference

Classes

struct  blocktype
 
struct  branchtabletype
 
class  cached_ops
 
struct  field_specific_params
 
struct  field_specific_params< voidtype >
 
struct  instr
 
struct  instr_base
 
class  instruction_stream
 
struct  memarg
 
struct  memoryoptype
 
struct  nop_mutator
 
struct  op_types
 
struct  propagate_post_injection
 
struct  propagate_post_injection< Mutator >
 
struct  propagate_should_kill
 
struct  propagate_should_kill< Mutator >
 
struct  SYSIO_OperatorDecoderStream
 
struct  visitor_arg
 
struct  voidtype
 

Typedefs

using wasm_op_ptr = std::unique_ptr<instr>
 
using wasm_instr_ptr = std::shared_ptr<instr>
 
using wasm_return_t = std::vector<uint8_t>
 
using wasm_instr_callback = std::function<std::vector<wasm_instr_ptr>(uint8_t)>
 
using code_vector = std::vector<uint8_t>
 
using code_iterator = std::vector<uint8_t>::iterator
 
using wasm_op_generator = std::function<wasm_instr_ptr(std::vector<uint8_t>, size_t)>
 

Enumerations

enum  code {
  unreachable_code = 0x00 , nop_code = 0x01 , block_code = 0x02 , loop_code = 0x03 ,
  if__code = 0x04 , else__code = 0x05 , end_code = 0x0B , br_code = 0x0C ,
  br_if_code = 0x0D , br_table_code = 0x0E , return__code = 0x0F , call_code = 0x10 ,
  call_indirect_code = 0x11 , drop_code = 0x1A , select_code = 0x1B , get_local_code = 0x20 ,
  set_local_code = 0x21 , tee_local_code = 0x22 , get_global_code = 0x23 , set_global_code = 0x24 ,
  i32_load_code = 0x28 , i64_load_code = 0x29 , f32_load_code = 0x2A , f64_load_code = 0x2B ,
  i32_load8_s_code = 0x2C , i32_load8_u_code = 0x2D , i32_load16_s_code = 0x2E , i32_load16_u_code = 0x2F ,
  i64_load8_s_code = 0x30 , i64_load8_u_code = 0x31 , i64_load16_s_code = 0x32 , i64_load16_u_code = 0x33 ,
  i64_load32_s_code = 0x34 , i64_load32_u_code = 0x35 , i32_store_code = 0x36 , i64_store_code = 0x37 ,
  f32_store_code = 0x38 , f64_store_code = 0x39 , i32_store8_code = 0x3A , i32_store16_code = 0x3B ,
  i64_store8_code = 0x3C , i64_store16_code = 0x3D , i64_store32_code = 0x3E , current_memory_code = 0x3F ,
  grow_memory_code = 0x40 , i32_const_code = 0x41 , i64_const_code = 0x42 , f32_const_code = 0x43 ,
  f64_const_code = 0x44 , i32_eqz_code = 0x45 , i32_eq_code = 0x46 , i32_ne_code = 0x47 ,
  i32_lt_s_code = 0x48 , i32_lt_u_code = 0x49 , i32_gt_s_code = 0x4A , i32_gt_u_code = 0x4B ,
  i32_le_s_code = 0x4C , i32_le_u_code = 0x4D , i32_ge_s_code = 0x4E , i32_ge_u_code = 0x4F ,
  i64_eqz_code = 0x50 , i64_eq_code = 0x51 , i64_ne_code = 0x52 , i64_lt_s_code = 0x53 ,
  i64_lt_u_code = 0x54 , i64_gt_s_code = 0x55 , i64_gt_u_code = 0x56 , i64_le_s_code = 0x57 ,
  i64_le_u_code = 0x58 , i64_ge_s_code = 0x59 , i64_ge_u_code = 0x5A , f32_eq_code = 0x5B ,
  f32_ne_code = 0x5C , f32_lt_code = 0x5D , f32_gt_code = 0x5E , f32_le_code = 0x5F ,
  f32_ge_code = 0x60 , f64_eq_code = 0x61 , f64_ne_code = 0x62 , f64_lt_code = 0x63 ,
  f64_gt_code = 0x64 , f64_le_code = 0x65 , f64_ge_code = 0x66 , i32_clz_code = 0x67 ,
  i32_ctz_code = 0x68 , i32_popcnt_code = 0x69 , i32_add_code = 0x6A , i32_sub_code = 0x6B ,
  i32_mul_code = 0x6C , i32_div_s_code = 0x6D , i32_div_u_code = 0x6E , i32_rem_s_code = 0x6F ,
  i32_rem_u_code = 0x70 , i32_and_code = 0x71 , i32_or_code = 0x72 , i32_xor_code = 0x73 ,
  i32_shl_code = 0x74 , i32_shr_s_code = 0x75 , i32_shr_u_code = 0x76 , i32_rotl_code = 0x77 ,
  i32_rotr_code = 0x78 , i64_clz_code = 0x79 , i64_ctz_code = 0x7A , i64_popcnt_code = 0x7B ,
  i64_add_code = 0x7C , i64_sub_code = 0x7D , i64_mul_code = 0x7E , i64_div_s_code = 0x7F ,
  i64_div_u_code = 0x80 , i64_rem_s_code = 0x81 , i64_rem_u_code = 0x82 , i64_and_code = 0x83 ,
  i64_or_code = 0x84 , i64_xor_code = 0x85 , i64_shl_code = 0x86 , i64_shr_s_code = 0x87 ,
  i64_shr_u_code = 0x88 , i64_rotl_code = 0x89 , i64_rotr_code = 0x8A , f32_abs_code = 0x8B ,
  f32_neg_code = 0x8C , f32_ceil_code = 0x8D , f32_floor_code = 0x8E , f32_trunc_code = 0x8F ,
  f32_nearest_code = 0x90 , f32_sqrt_code = 0x91 , f32_add_code = 0x92 , f32_sub_code = 0x93 ,
  f32_mul_code = 0x94 , f32_div_code = 0x95 , f32_min_code = 0x96 , f32_max_code = 0x97 ,
  f32_copysign_code = 0x98 , f64_abs_code = 0x99 , f64_neg_code = 0x9A , f64_ceil_code = 0x9B ,
  f64_floor_code = 0x9C , f64_trunc_code = 0x9D , f64_nearest_code = 0x9E , f64_sqrt_code = 0x9F ,
  f64_add_code = 0xA0 , f64_sub_code = 0xA1 , f64_mul_code = 0xA2 , f64_div_code = 0xA3 ,
  f64_min_code = 0xA4 , f64_max_code = 0xA5 , f64_copysign_code = 0xA6 , i32_wrap_i64_code = 0xA7 ,
  i32_trunc_s_f32_code = 0xA8 , i32_trunc_u_f32_code = 0xA9 , i32_trunc_s_f64_code = 0xAA , i32_trunc_u_f64_code = 0xAB ,
  i64_extend_s_i32_code = 0xAC , i64_extend_u_i32_code = 0xAD , i64_trunc_s_f32_code = 0xAE , i64_trunc_u_f32_code = 0xAF ,
  i64_trunc_s_f64_code = 0xB0 , i64_trunc_u_f64_code = 0xB1 , f32_convert_s_i32_code = 0xB2 , f32_convert_u_i32_code = 0xB3 ,
  f32_convert_s_i64_code = 0xB4 , f32_convert_u_i64_code = 0xB5 , f32_demote_f64_code = 0xB6 , f64_convert_s_i32_code = 0xB7 ,
  f64_convert_u_i32_code = 0xB8 , f64_convert_s_i64_code = 0xB9 , f64_convert_u_i64_code = 0xBA , f64_promote_f32_code = 0xBB ,
  i32_reinterpret_f32_code = 0xBC , i64_reinterpret_f64_code = 0xBD , f32_reinterpret_i32_code = 0xBE , f64_reinterpret_i64_code = 0xBF ,
  error_code = 0xFF
}
 

Functions

std::string to_string (uint32_t field)
 
std::string to_string (uint64_t field)
 
std::string to_string (blocktype field)
 
std::string to_string (memoryoptype field)
 
std::string to_string (memarg field)
 
std::string to_string (branchtabletype field)
 
void pack (instruction_stream *stream, uint32_t field)
 
void pack (instruction_stream *stream, uint64_t field)
 
void pack (instruction_stream *stream, blocktype field)
 
void pack (instruction_stream *stream, memoryoptype field)
 
void pack (instruction_stream *stream, memarg field)
 
void pack (instruction_stream *stream, branchtabletype field)
 
template<class Op_Types >
std::vector< instr * > * get_cached_ops_vec ()
 
std::string to_string (NoImm imm)
 
std::string to_string (MemoryImm imm)
 
std::string to_string (CallImm imm)
 
std::string to_string (CallIndirectImm imm)
 
std::vector< U8pack (uint32_t field)
 
std::vector< U8pack (uint64_t field)
 
std::vector< U8pack (blocktype field)
 
std::vector< U8pack (memoryoptype field)
 
std::vector< U8pack (memarg field)
 
std::vector< U8pack (branchtabletype field)
 

Typedef Documentation

◆ code_iterator

using sysio::chain::wasm_ops::code_iterator = std::vector<uint8_t>::iterator

Definition at line 60 of file wasm_sysio_binary_ops.hpp.

◆ code_vector

Definition at line 59 of file wasm_sysio_binary_ops.hpp.

◆ wasm_instr_callback

Definition at line 58 of file wasm_sysio_binary_ops.hpp.

◆ wasm_instr_ptr

Definition at line 56 of file wasm_sysio_binary_ops.hpp.

◆ wasm_op_generator

using sysio::chain::wasm_ops::wasm_op_generator = std::function<wasm_instr_ptr(std::vector<uint8_t>, size_t)>

Definition at line 61 of file wasm_sysio_binary_ops.hpp.

◆ wasm_op_ptr

using sysio::chain::wasm_ops::wasm_op_ptr = std::unique_ptr<instr>

Definition at line 55 of file wasm_sysio_binary_ops.hpp.

◆ wasm_return_t

Definition at line 57 of file wasm_sysio_binary_ops.hpp.

Enumeration Type Documentation

◆ code

Enumerator
unreachable_code 
nop_code 
block_code 
loop_code 
if__code 
else__code 
end_code 
br_code 
br_if_code 
br_table_code 
return__code 
call_code 
call_indirect_code 
drop_code 
select_code 
get_local_code 
set_local_code 
tee_local_code 
get_global_code 
set_global_code 
i32_load_code 
i64_load_code 
f32_load_code 
f64_load_code 
i32_load8_s_code 
i32_load8_u_code 
i32_load16_s_code 
i32_load16_u_code 
i64_load8_s_code 
i64_load8_u_code 
i64_load16_s_code 
i64_load16_u_code 
i64_load32_s_code 
i64_load32_u_code 
i32_store_code 
i64_store_code 
f32_store_code 
f64_store_code 
i32_store8_code 
i32_store16_code 
i64_store8_code 
i64_store16_code 
i64_store32_code 
current_memory_code 
grow_memory_code 
i32_const_code 
i64_const_code 
f32_const_code 
f64_const_code 
i32_eqz_code 
i32_eq_code 
i32_ne_code 
i32_lt_s_code 
i32_lt_u_code 
i32_gt_s_code 
i32_gt_u_code 
i32_le_s_code 
i32_le_u_code 
i32_ge_s_code 
i32_ge_u_code 
i64_eqz_code 
i64_eq_code 
i64_ne_code 
i64_lt_s_code 
i64_lt_u_code 
i64_gt_s_code 
i64_gt_u_code 
i64_le_s_code 
i64_le_u_code 
i64_ge_s_code 
i64_ge_u_code 
f32_eq_code 
f32_ne_code 
f32_lt_code 
f32_gt_code 
f32_le_code 
f32_ge_code 
f64_eq_code 
f64_ne_code 
f64_lt_code 
f64_gt_code 
f64_le_code 
f64_ge_code 
i32_clz_code 
i32_ctz_code 
i32_popcnt_code 
i32_add_code 
i32_sub_code 
i32_mul_code 
i32_div_s_code 
i32_div_u_code 
i32_rem_s_code 
i32_rem_u_code 
i32_and_code 
i32_or_code 
i32_xor_code 
i32_shl_code 
i32_shr_s_code 
i32_shr_u_code 
i32_rotl_code 
i32_rotr_code 
i64_clz_code 
i64_ctz_code 
i64_popcnt_code 
i64_add_code 
i64_sub_code 
i64_mul_code 
i64_div_s_code 
i64_div_u_code 
i64_rem_s_code 
i64_rem_u_code 
i64_and_code 
i64_or_code 
i64_xor_code 
i64_shl_code 
i64_shr_s_code 
i64_shr_u_code 
i64_rotl_code 
i64_rotr_code 
f32_abs_code 
f32_neg_code 
f32_ceil_code 
f32_floor_code 
f32_trunc_code 
f32_nearest_code 
f32_sqrt_code 
f32_add_code 
f32_sub_code 
f32_mul_code 
f32_div_code 
f32_min_code 
f32_max_code 
f32_copysign_code 
f64_abs_code 
f64_neg_code 
f64_ceil_code 
f64_floor_code 
f64_trunc_code 
f64_nearest_code 
f64_sqrt_code 
f64_add_code 
f64_sub_code 
f64_mul_code 
f64_div_code 
f64_min_code 
f64_max_code 
f64_copysign_code 
i32_wrap_i64_code 
i32_trunc_s_f32_code 
i32_trunc_u_f32_code 
i32_trunc_s_f64_code 
i32_trunc_u_f64_code 
i64_extend_s_i32_code 
i64_extend_u_i32_code 
i64_trunc_s_f32_code 
i64_trunc_u_f32_code 
i64_trunc_s_f64_code 
i64_trunc_u_f64_code 
f32_convert_s_i32_code 
f32_convert_u_i32_code 
f32_convert_s_i64_code 
f32_convert_u_i64_code 
f32_demote_f64_code 
f64_convert_s_i32_code 
f64_convert_u_i32_code 
f64_convert_s_i64_code 
f64_convert_u_i64_code 
f64_promote_f32_code 
i32_reinterpret_f32_code 
i64_reinterpret_f64_code 
f32_reinterpret_i32_code 
f64_reinterpret_i64_code 
error_code 

Definition at line 349 of file wasm_sysio_binary_ops.hpp.

349 {
350 unreachable_code = 0x00,
351 nop_code = 0x01,
352 block_code = 0x02,
353 loop_code = 0x03,
354 if__code = 0x04,
355 else__code = 0x05,
356 end_code = 0x0B,
357 br_code = 0x0C,
358 br_if_code = 0x0D,
359 br_table_code = 0x0E,
360 return__code = 0x0F,
361 call_code = 0x10,
362 call_indirect_code = 0x11,
363 drop_code = 0x1A,
364 select_code = 0x1B,
365 get_local_code = 0x20,
366 set_local_code = 0x21,
367 tee_local_code = 0x22,
368 get_global_code = 0x23,
369 set_global_code = 0x24,
370 i32_load_code = 0x28,
371 i64_load_code = 0x29,
372 f32_load_code = 0x2A,
373 f64_load_code = 0x2B,
374 i32_load8_s_code = 0x2C,
375 i32_load8_u_code = 0x2D,
376 i32_load16_s_code = 0x2E,
377 i32_load16_u_code = 0x2F,
378 i64_load8_s_code = 0x30,
379 i64_load8_u_code = 0x31,
380 i64_load16_s_code = 0x32,
381 i64_load16_u_code = 0x33,
382 i64_load32_s_code = 0x34,
383 i64_load32_u_code = 0x35,
384 i32_store_code = 0x36,
385 i64_store_code = 0x37,
386 f32_store_code = 0x38,
387 f64_store_code = 0x39,
388 i32_store8_code = 0x3A,
389 i32_store16_code = 0x3B,
390 i64_store8_code = 0x3C,
391 i64_store16_code = 0x3D,
392 i64_store32_code = 0x3E,
393 current_memory_code = 0x3F,
394 grow_memory_code = 0x40,
395 i32_const_code = 0x41,
396 i64_const_code = 0x42,
397 f32_const_code = 0x43,
398 f64_const_code = 0x44,
399 i32_eqz_code = 0x45,
400 i32_eq_code = 0x46,
401 i32_ne_code = 0x47,
402 i32_lt_s_code = 0x48,
403 i32_lt_u_code = 0x49,
404 i32_gt_s_code = 0x4A,
405 i32_gt_u_code = 0x4B,
406 i32_le_s_code = 0x4C,
407 i32_le_u_code = 0x4D,
408 i32_ge_s_code = 0x4E,
409 i32_ge_u_code = 0x4F,
410 i64_eqz_code = 0x50,
411 i64_eq_code = 0x51,
412 i64_ne_code = 0x52,
413 i64_lt_s_code = 0x53,
414 i64_lt_u_code = 0x54,
415 i64_gt_s_code = 0x55,
416 i64_gt_u_code = 0x56,
417 i64_le_s_code = 0x57,
418 i64_le_u_code = 0x58,
419 i64_ge_s_code = 0x59,
420 i64_ge_u_code = 0x5A,
421 f32_eq_code = 0x5B,
422 f32_ne_code = 0x5C,
423 f32_lt_code = 0x5D,
424 f32_gt_code = 0x5E,
425 f32_le_code = 0x5F,
426 f32_ge_code = 0x60,
427 f64_eq_code = 0x61,
428 f64_ne_code = 0x62,
429 f64_lt_code = 0x63,
430 f64_gt_code = 0x64,
431 f64_le_code = 0x65,
432 f64_ge_code = 0x66,
433 i32_clz_code = 0x67,
434 i32_ctz_code = 0x68,
435 i32_popcnt_code = 0x69,
436 i32_add_code = 0x6A,
437 i32_sub_code = 0x6B,
438 i32_mul_code = 0x6C,
439 i32_div_s_code = 0x6D,
440 i32_div_u_code = 0x6E,
441 i32_rem_s_code = 0x6F,
442 i32_rem_u_code = 0x70,
443 i32_and_code = 0x71,
444 i32_or_code = 0x72,
445 i32_xor_code = 0x73,
446 i32_shl_code = 0x74,
447 i32_shr_s_code = 0x75,
448 i32_shr_u_code = 0x76,
449 i32_rotl_code = 0x77,
450 i32_rotr_code = 0x78,
451 i64_clz_code = 0x79,
452 i64_ctz_code = 0x7A,
453 i64_popcnt_code = 0x7B,
454 i64_add_code = 0x7C,
455 i64_sub_code = 0x7D,
456 i64_mul_code = 0x7E,
457 i64_div_s_code = 0x7F,
458 i64_div_u_code = 0x80,
459 i64_rem_s_code = 0x81,
460 i64_rem_u_code = 0x82,
461 i64_and_code = 0x83,
462 i64_or_code = 0x84,
463 i64_xor_code = 0x85,
464 i64_shl_code = 0x86,
465 i64_shr_s_code = 0x87,
466 i64_shr_u_code = 0x88,
467 i64_rotl_code = 0x89,
468 i64_rotr_code = 0x8A,
469 f32_abs_code = 0x8B,
470 f32_neg_code = 0x8C,
471 f32_ceil_code = 0x8D,
472 f32_floor_code = 0x8E,
473 f32_trunc_code = 0x8F,
474 f32_nearest_code = 0x90,
475 f32_sqrt_code = 0x91,
476 f32_add_code = 0x92,
477 f32_sub_code = 0x93,
478 f32_mul_code = 0x94,
479 f32_div_code = 0x95,
480 f32_min_code = 0x96,
481 f32_max_code = 0x97,
482 f32_copysign_code = 0x98,
483 f64_abs_code = 0x99,
484 f64_neg_code = 0x9A,
485 f64_ceil_code = 0x9B,
486 f64_floor_code = 0x9C,
487 f64_trunc_code = 0x9D,
488 f64_nearest_code = 0x9E,
489 f64_sqrt_code = 0x9F,
490 f64_add_code = 0xA0,
491 f64_sub_code = 0xA1,
492 f64_mul_code = 0xA2,
493 f64_div_code = 0xA3,
494 f64_min_code = 0xA4,
495 f64_max_code = 0xA5,
496 f64_copysign_code = 0xA6,
497 i32_wrap_i64_code = 0xA7,
512 f32_demote_f64_code = 0xB6,
522 error_code = 0xFF,
523}; // code

Function Documentation

◆ get_cached_ops_vec()

template<class Op_Types >
std::vector< instr * > * sysio::chain::wasm_ops::get_cached_ops_vec ( )

Definition at line 632 of file wasm_sysio_binary_ops.hpp.

632 {
633 #define GEN_FIELD( r, P, OP ) \
634 static std::unique_ptr<typename Op_Types::BOOST_PP_CAT(OP,_t)> BOOST_PP_CAT(P, OP) = std::make_unique<typename Op_Types::BOOST_PP_CAT(OP,_t)>();
635 BOOST_PP_SEQ_FOR_EACH( GEN_FIELD, cached_, WASM_OP_SEQ )
636 #undef GEN_FIELD
637 static std::vector<instr*> _cached_ops;
638
639#define PUSH_BACK_OP( r, T, OP ) \
640 _cached_ops[BOOST_PP_CAT(OP,_code)] = BOOST_PP_CAT(T, OP).get();
641
642 if ( _cached_ops.empty() ) {
643 // prefill with error
644 _cached_ops.resize( 256, cached_error.get() );
645 BOOST_PP_SEQ_FOR_EACH( PUSH_BACK_OP, cached_ , WASM_OP_SEQ )
646 }
647#undef PUSH_BACK_OP
648 return &_cached_ops;
649}
#define GEN_FIELD(r, P, OP)
#define PUSH_BACK_OP(r, T, OP)
#define WASM_OP_SEQ

◆ pack() [1/12]

std::vector< U8 > sysio::chain::wasm_ops::pack ( blocktype field)
inline

Definition at line 51 of file wasm_sysio_binary_ops.cpp.

51 {
52 return { U8(field.result) };
53}
uint8_t U8
Definition BasicTypes.h:5
ehm field

◆ pack() [2/12]

std::vector< U8 > sysio::chain::wasm_ops::pack ( branchtabletype field)
inline

Definition at line 63 of file wasm_sysio_binary_ops.cpp.

63 {
64 return { U8(field.target_depth), U8(field.target_depth >> 8), U8(field.target_depth >> 16), U8(field.target_depth >> 24),
65 U8(field.target_depth >> 32), U8(field.target_depth >> 40), U8(field.target_depth >> 48), U8(field.target_depth >> 56),
66 U8(field.table_index), U8(field.table_index >> 8), U8(field.table_index >> 16), U8(field.table_index >> 24),
67 U8(field.table_index >> 32), U8(field.table_index >> 40), U8(field.table_index >> 48), U8(field.table_index >> 56)
68
69 };
70}

◆ pack() [3/12]

void sysio::chain::wasm_ops::pack ( instruction_stream * stream,
blocktype field )
inline

Definition at line 113 of file wasm_sysio_binary_ops.hpp.

113 {
114 const char packed[] = { char(field.result) };
115 stream->set(sizeof(packed), packed);
116}

◆ pack() [4/12]

void sysio::chain::wasm_ops::pack ( instruction_stream * stream,
branchtabletype field )
inline

Definition at line 127 of file wasm_sysio_binary_ops.hpp.

127 {
128 const char packed[] = { char(field.target_depth), char(field.target_depth >> 8), char(field.target_depth >> 16), char(field.target_depth >> 24),
129 char(field.target_depth >> 32), char(field.target_depth >> 40), char(field.target_depth >> 48), char(field.target_depth >> 56),
130 char(field.table_index), char(field.table_index >> 8), char(field.table_index >> 16), char(field.table_index >> 24),
131 char(field.table_index >> 32), char(field.table_index >> 40), char(field.table_index >> 48), char(field.table_index >> 56) };
132 stream->set(sizeof(packed), packed);
133}

◆ pack() [5/12]

void sysio::chain::wasm_ops::pack ( instruction_stream * stream,
memarg field )
inline

Definition at line 121 of file wasm_sysio_binary_ops.hpp.

121 {
122 const char packed[] = { char(field.a), char(field.a >> 8), char(field.a >> 16), char(field.a >> 24),
123 char(field.o), char(field.o >> 8), char(field.o >> 16), char(field.o >> 24)};
124 stream->set(sizeof(packed), packed);
125
126}

◆ pack() [6/12]

void sysio::chain::wasm_ops::pack ( instruction_stream * stream,
memoryoptype field )
inline

Definition at line 117 of file wasm_sysio_binary_ops.hpp.

117 {
118 const char packed[] = { char(field.end) };
119 stream->set(sizeof(packed), packed);
120}

◆ pack() [7/12]

void sysio::chain::wasm_ops::pack ( instruction_stream * stream,
uint32_t field )
inline

Definition at line 104 of file wasm_sysio_binary_ops.hpp.

104 {
105 const char packed[] = { char(field), char(field >> 8), char(field >> 16), char(field >> 24) };
106 stream->set(sizeof(packed), packed);
107}
Here is the caller graph for this function:

◆ pack() [8/12]

void sysio::chain::wasm_ops::pack ( instruction_stream * stream,
uint64_t field )
inline

Definition at line 108 of file wasm_sysio_binary_ops.hpp.

108 {
109 const char packed[] = { char(field), char(field >> 8), char(field >> 16), char(field >> 24),
110 char(field >> 32), char(field >> 40), char(field >> 48), char(field >> 56) };
111 stream->set(sizeof(packed), packed);
112}

◆ pack() [9/12]

std::vector< U8 > sysio::chain::wasm_ops::pack ( memarg field)
inline

Definition at line 57 of file wasm_sysio_binary_ops.cpp.

57 {
58 return { U8(field.a), U8(field.a >> 8), U8(field.a >> 16), U8(field.a >> 24),
59 U8(field.o), U8(field.o >> 8), U8(field.o >> 16), U8(field.o >> 24),
60 };
61
62}

◆ pack() [10/12]

std::vector< U8 > sysio::chain::wasm_ops::pack ( memoryoptype field)
inline

Definition at line 54 of file wasm_sysio_binary_ops.cpp.

54 {
55 return { U8(field.end) };
56}

◆ pack() [11/12]

std::vector< U8 > sysio::chain::wasm_ops::pack ( uint32_t field)
inline

Definition at line 43 of file wasm_sysio_binary_ops.cpp.

43 {
44 return { U8(field), U8(field >> 8), U8(field >> 16), U8(field >> 24) };
45}

◆ pack() [12/12]

std::vector< U8 > sysio::chain::wasm_ops::pack ( uint64_t field)
inline

Definition at line 46 of file wasm_sysio_binary_ops.cpp.

46 {
47 return { U8(field), U8(field >> 8), U8(field >> 16), U8(field >> 24),
48 U8(field >> 32), U8(field >> 40), U8(field >> 48), U8(field >> 56)
49 };
50}

◆ to_string() [1/10]

std::string sysio::chain::wasm_ops::to_string ( blocktype field)
inline

Definition at line 91 of file wasm_sysio_binary_ops.hpp.

91 {
92 return std::string("blocktype : ")+std::to_string((uint32_t)field.result);
93}
unsigned int uint32_t
Definition stdint.h:126

◆ to_string() [2/10]

std::string sysio::chain::wasm_ops::to_string ( branchtabletype field)
inline

Definition at line 100 of file wasm_sysio_binary_ops.hpp.

100 {
101 return std::string("branchtabletype : ")+std::to_string(field.target_depth)+std::string(", ")+std::to_string(field.table_index);
102}

◆ to_string() [3/10]

std::string sysio::chain::wasm_ops::to_string ( CallImm imm)
inline

Definition at line 18 of file wasm_sysio_binary_ops.cpp.

18 {
19 return "call index : "+std::to_string(uint32_t(imm.functionIndex));
20}
U32 functionIndex
Definition Operators.h:45

◆ to_string() [4/10]

std::string sysio::chain::wasm_ops::to_string ( CallIndirectImm imm)
inline

Definition at line 21 of file wasm_sysio_binary_ops.cpp.

21 {
22 return "call indirect type : "+std::to_string(uint32_t(imm.type.index));
23}
IndexedFunctionType type
Definition Operators.h:50

◆ to_string() [5/10]

std::string sysio::chain::wasm_ops::to_string ( memarg field)
inline

Definition at line 97 of file wasm_sysio_binary_ops.hpp.

97 {
98 return std::string("memarg : ")+std::to_string(field.a)+std::string(", ")+std::to_string(field.o);
99}

◆ to_string() [6/10]

std::string sysio::chain::wasm_ops::to_string ( MemoryImm imm)
inline

Definition at line 15 of file wasm_sysio_binary_ops.cpp.

15 {
16 return "memory imm";
17}

◆ to_string() [7/10]

std::string sysio::chain::wasm_ops::to_string ( memoryoptype field)
inline

Definition at line 94 of file wasm_sysio_binary_ops.hpp.

94 {
95 return std::string("memoryoptype : ")+std::to_string((uint32_t)field.end);
96}

◆ to_string() [8/10]

std::string sysio::chain::wasm_ops::to_string ( NoImm imm)
inline

Definition at line 12 of file wasm_sysio_binary_ops.cpp.

12 {
13 return "no imm";
14}

◆ to_string() [9/10]

std::string sysio::chain::wasm_ops::to_string ( uint32_t field)
inline

Definition at line 85 of file wasm_sysio_binary_ops.hpp.

85 {
86 return std::string("i32 : ")+std::to_string(field);
87}
Here is the caller graph for this function:

◆ to_string() [10/10]

std::string sysio::chain::wasm_ops::to_string ( uint64_t field)
inline

Definition at line 88 of file wasm_sysio_binary_ops.hpp.

88 {
89 return std::string("i64 : ")+std::to_string(field);
90}