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

GoLangDream / rgo / 22354699729

24 Feb 2026 02:16PM UTC coverage: 26.811% (-61.2%) from 88.041%
22354699729

push

github

jimxl
开始实现ruby 虚拟机

0 of 3590 new or added lines in 9 files covered. (0.0%)

1384 of 5162 relevant lines covered (26.81%)

5.39 hits per line

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

0.0
/rvm/compiler/bytecode.go
1
package compiler
2

3
import (
4
        "encoding/binary"
5
)
6

NEW
7
func Make(op Opcode, operands ...int) Instructions {
×
NEW
8
        def, ok := definitions[op]
×
NEW
9
        if !ok {
×
NEW
10
                return []byte{}
×
NEW
11
        }
×
12

NEW
13
        instructionLen := 1
×
NEW
14
        for _, w := range def.OperandWidths {
×
NEW
15
                instructionLen += w
×
NEW
16
        }
×
17

NEW
18
        instruction := make([]byte, instructionLen)
×
NEW
19
        instruction[0] = byte(op)
×
NEW
20

×
NEW
21
        offset := 1
×
NEW
22

×
NEW
23
        for i, o := range operands {
×
NEW
24
                width := def.OperandWidths[i]
×
NEW
25
                switch width {
×
NEW
26
                case 2:
×
NEW
27
                        binary.BigEndian.PutUint16(instruction[offset:], uint16(o))
×
NEW
28
                case 1:
×
NEW
29
                        instruction[offset] = byte(o)
×
30
                }
NEW
31
                offset += width
×
32
        }
33

NEW
34
        return instruction
×
35
}
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