MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / execute

Function execute

src/common/sdl.cpp:490–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488
489
490static bool execute(sdl_arg* arg)
491{
492/**************************************
493 *
494 * e x e c u t e
495 *
496 **************************************
497 *
498 * Functional description
499 * Execute compiled slice description language.
500 *
501 **************************************/
502 SLONG* variable;
503 SLONG stack[64];
504 SLONG value, count;
505 dsc element_desc;
506
507 Ods::InternalArrayDesc* array_desc = arg->sdl_arg_desc;
508 const Ods::InternalArrayDesc::iad_repeat* const range_end =
509 array_desc->iad_rpt + array_desc->iad_dimensions;
510 SLONG* variables = arg->sdl_arg_variables;
511 const IPTR* next = arg->sdl_arg_compiled;
512 SLONG* stack_ptr = stack + FB_NELEM(stack);
513
514 for (;;)
515 {
516 const SLONG x = *next++;
517 switch (x)
518 {
519 case op_literal:
520 *--stack_ptr = *next++;
521 break;
522
523 case op_variable:
524 *--stack_ptr = variables[*next++];
525 break;
526
527 case op_add:
528 value = *stack_ptr++;
529 *stack_ptr += value;
530 break;
531
532 case op_subtract:
533 value = *stack_ptr++;
534 *stack_ptr -= value;
535 break;
536
537 case op_multiply:
538 value = *stack_ptr++;
539 *stack_ptr *= value;
540 break;
541
542 case op_divide:
543 value = *stack_ptr++;
544 *stack_ptr /= value;
545 break;
546
547 case op_goto:

Callers 15

run_if_is_deferredMethod · 0.85
wait_internalMethod · 0.85
operator()Method · 0.85
operator()Method · 0.85
executeMethod · 0.85
for_eachFunction · 0.85
execWithCheckMethod · 0.85
openCursorMethod · 0.85
executeDdlMethod · 0.85
executeUpdateMethod · 0.85
executeMethod · 0.85

Calls 3

GdsClass · 0.85
NumClass · 0.85
errorFunction · 0.70

Tested by

no test coverage detected