MCPcopy Create free account
hub / github.com/Whiley/WhileyCompiler / readOperands

Method readOperands

src/main/java/wycc/io/HeapReader.java:93–114  ·  view source on GitHub ↗
(Schema schema, int opcode)

Source from the content-addressed store, hash-verified

91 }
92
93 protected int[] readOperands(Schema schema, int opcode) throws IOException {
94 // Determine operand layout
95 Item.Operands layout = schema.getDescriptor(opcode).getOperandLayout();
96 int[] operands;
97 int size;
98 // Determine number of operands according to layout
99 switch(layout) {
100 case MANY:
101 size = in.read_uv();
102 break;
103 default:
104 size = layout.ordinal();
105 }
106 //
107 operands = new int[size];
108 // Read operands
109 for (int i = 0; i != operands.length; ++i) {
110 operands[i] = in.read_uv();
111 }
112 //
113 return operands;
114 }
115
116 protected byte[] readData(Schema schema, int opcode) throws IOException {
117 // Determine operand layout

Callers 1

readItemMethod · 0.95

Calls 3

getOperandLayoutMethod · 0.80
read_uvMethod · 0.80
getDescriptorMethod · 0.65

Tested by

no test coverage detected