• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ArkScript-lang / Ark / 23209646190

17 Mar 2026 06:16PM UTC coverage: 93.659% (-0.05%) from 93.706%
23209646190

push

github

SuperFola
feat(vm): add a new super instruction CALL_SYMBOL_BY_INDEX

17 of 19 new or added lines in 3 files covered. (89.47%)

132 existing lines in 8 files now uncovered.

9601 of 10251 relevant lines covered (93.66%)

275534.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.41
/src/arkreactor/Compiler/IntermediateRepresentation/Entity.cpp
1
#include <Ark/Compiler/IntermediateRepresentation/Entity.hpp>
2

3
namespace Ark::internal::IR
4
{
5
    Entity::Entity(const Kind kind) :
37,827✔
6
        m_kind(kind),
37,827✔
7
        m_inst(NOP)
37,827✔
8
    {}
75,654✔
9

10
    Entity::Entity(const Instruction inst, const uint16_t arg) :
114,690✔
11
        m_kind(Kind::Opcode),
114,690✔
12
        m_inst(inst), m_primary_arg(arg)
114,690✔
13
    {}
229,380✔
14

15
    Entity::Entity(const Instruction inst, const uint16_t primary_arg, const uint16_t secondary_arg) :
25,377✔
16
        m_kind(Kind::Opcode2Args),
25,377✔
17
        m_inst(inst), m_primary_arg(primary_arg), m_secondary_arg(secondary_arg)
25,377✔
18
    {}
50,754✔
19

20
    Entity::Entity(const Instruction inst, const uint8_t inst2, const uint8_t inst3, const uint8_t inst4) :
366✔
21
        m_kind(Kind::Opcode3Args),
366✔
22
        m_inst(inst), m_primary_arg(inst2), m_secondary_arg(inst3), m_tertiary_arg(inst4)
366✔
23
    {}
732✔
24

25
    void Entity::replaceInstruction(const Instruction replacement)
731✔
26
    {
731✔
27
        m_inst = replacement;
731✔
28
    }
731✔
29

30
    Entity Entity::Label(const label_t value)
18,175✔
31
    {
18,175✔
32
        auto entity = Entity(Kind::Label);
18,175✔
33
        entity.m_label = value;
18,175✔
34

35
        return entity;
18,175✔
36
    }
18,175✔
37

38
    Entity Entity::Goto(const Entity& label, const Instruction inst)
18,175✔
39
    {
18,175✔
40
        auto jump = Entity(Kind::Goto);
18,175✔
41
        jump.m_label = label.m_label;
18,175✔
42
        jump.m_inst = inst;
18,175✔
43

44
        return jump;
18,175✔
45
    }
18,175✔
46

47
    Entity Entity::GotoWithArg(const Entity& label, const Instruction inst, const uint16_t primary_arg)
1,477✔
48
    {
1,477✔
49
        auto jump = Entity(Kind::GotoWithArg);
1,477✔
50
        jump.m_label = label.m_label;
1,477✔
51
        jump.m_inst = inst;
1,477✔
52
        jump.m_primary_arg = primary_arg;
1,477✔
53

54
        return jump;
1,477✔
55
    }
1,477✔
56

57
    Entity Entity::GotoIf(const Entity& label, const bool cond)
4,369✔
58
    {
4,369✔
59
        return Goto(label, cond ? POP_JUMP_IF_TRUE : POP_JUMP_IF_FALSE);
4,369✔
60
    }
61

62
    Word Entity::bytecode() const
87,255✔
63
    {
87,255✔
64
        if (m_kind == Kind::Opcode)
87,255✔
65
            return Word(m_inst, m_primary_arg);
62,266✔
66
        if (m_kind == Kind::Opcode2Args)
24,989✔
67
            return Word(m_inst, m_primary_arg, m_secondary_arg);
24,623✔
68
        if (m_kind == Kind::Opcode3Args)
366✔
69
            return Word(
366✔
70
                m_inst,
366✔
71
                static_cast<uint8_t>(m_primary_arg),
366✔
72
                static_cast<uint8_t>(m_secondary_arg),
366✔
73
                static_cast<uint8_t>(m_tertiary_arg));
366✔
UNCOV
74
        return Word(0, 0);
×
75
    }
87,255✔
76

77
    void Entity::setSourceLocation(const std::string& filename, std::size_t line)
117,322✔
78
    {
117,322✔
79
        m_source_file = filename;
117,322✔
80
        m_source_line = line;
117,322✔
81
    }
117,322✔
82
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc