public int?GetFieldOffset(FieldDefinition fd) { var key = fd.FullName; FieldTableEntry result; if (!FieldTable.TryGetValue(key, out result)) { var size = WasmUtil.SizeOfType(fd.FieldType); // HACK HACK HACK int offset = fd.IsStatic ? (int)ReserveHeapSpace(size) : WasmUtil.OffsetOfField(fd); result = new FieldTableEntry(offset, fd); FieldTable.Add(key, result); } return(result.Offset); }
public int? GetFieldOffset(FieldDefinition fd) { var key = fd.FullName; FieldTableEntry result; if (!FieldTable.TryGetValue(key, out result)) { var size = WasmUtil.SizeOfType(fd.FieldType); // HACK HACK HACK int offset = fd.IsStatic ? (int)ReserveHeapSpace(size) : WasmUtil.OffsetOfField(fd); result = new FieldTableEntry(offset, fd); FieldTable.Add(key, result); } return result.Offset; }