How to use the bitfield.js function in bitfield

To help you get started, we’ve selected a few bitfield examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github js-js / ssa.js / lib / ssa.js View on Github external
function SSA(pipeline) {
  this.pipeline = pipeline;

  this.visited = new BitField(this.pipeline.blocks.length);

  // List of phis for each block
  this.phi = new Array(this.pipeline.blocks.length);
  for (var i = 0; i < this.phi.length; i++)
    this.phi[i] = [];

  this.maxStore = 0;

  this.env = null;
}
module.exports = SSA;
github indutny / json-pipeline / lib / pipeline / dominance / index.js View on Github external
Dominance.prototype.enumerate = function enumerate() {
  // Simple DFS with range tracking
  var queue = [ this.blocks[0] ];
  var visited = new BitField(this.blocks.length);

  this.blocks[0].dominanceDepth = 0;

  var index = 0;
  while (queue.length !== 0) {
    var block = queue[queue.length - 1];
    if (!visited.set(block.blockIndex))
      continue;

    for (var i = block.children.length - 1; i >= 0; i--)
      queue.push(block.children[i]);

    block.dominanceStart = index++;
    if (block.parent !== null)
      block.dominanceDepth = block.parent.dominanceDepth + 1;
github indutny / json-pipeline / lib / pipeline / cfg / index.js View on Github external
CFGBuilder.prototype._reindexBlocks = function _reindexBlocks() {
  var out = [];

  var visited = new BitField(this.blocks.length);
  var queue = [ this.blocks[0] ];
  while (queue.length !== 0) {
    var block = queue.pop();

    var ready = true;
    for (var i = 0; i < block.predecessors.length; i++)
      if (!visited.check(block.predecessors[i].blockIndex))
        ready = false;

    // Back edge
    if (queue.length === 0)
      ready = true;
    if (!ready)
      continue;

    if (visited.set(block.blockIndex))

bitfield

a simple bitfield, compliant with the BitTorrent spec

MIT
Latest version published 10 months ago

Package Health Score

74 / 100
Full package analysis

Popular bitfield functions