@glimmer/program
Advanced tools
Comparing version 0.30.1 to 0.30.2
@@ -1,2 +0,2 @@ | ||
define('@glimmer/program', ['exports', '@glimmer/encoder'], function (exports, _glimmer_encoder) { 'use strict'; | ||
define('@glimmer/program', ['exports', '@glimmer/encoder', '@glimmer/util'], function (exports, _glimmer_encoder, _glimmer_util) { 'use strict'; | ||
@@ -326,2 +326,3 @@ function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } | ||
var INFO_OFFSET = 1; | ||
var MAX_SIZE = 65535; | ||
var SIZE_MASK = 65535; | ||
@@ -360,2 +361,3 @@ var SCOPE_MASK = 1073676288; | ||
this.placeholders = []; | ||
this.offset = 0; | ||
@@ -477,3 +479,24 @@ this.handle = 0; | ||
Heap.prototype.pushPlaceholder = function pushPlaceholder(valueFunc) { | ||
var address = this.offset++; | ||
this.heap[address] = MAX_SIZE; | ||
this.placeholders.push([address, valueFunc]); | ||
}; | ||
Heap.prototype.patchPlaceholders = function patchPlaceholders() { | ||
var placeholders = this.placeholders; | ||
for (var i = 0; i < placeholders.length; i++) { | ||
var _placeholders$i = placeholders[i], | ||
address = _placeholders$i[0], | ||
getValue = _placeholders$i[1]; | ||
false && _glimmer_util.assert(this.getbyaddr(address) === MAX_SIZE, 'expected to find a placeholder value at ' + address); | ||
this.setbyaddr(address, getValue()); | ||
} | ||
}; | ||
Heap.prototype.capture = function capture() { | ||
this.patchPlaceholders(); | ||
// Only called in eager mode | ||
@@ -570,2 +593,2 @@ var buffer = slice(this.heap, 0, this.offset); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2xpbW1lci1wcm9ncmFtLmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9AZ2xpb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7OztzREFTaEMsUUFDTDthQUFLLFFBQVEsU0FBUztlQUNmLEtBQUs7Ozs7O0FBSWhCLElBQW1DOzs7Ozs7Ozs7O0VBQVE7QUFJM0MsZUFBZSxLQUE2QixPQUFlLEtBQ3pEO1FBQUksZUFBZSxhQUFhO1lBQzFCLElBQUksVUFBVSxXQUFXO21CQUNwQixJQUFJLE1BQU0sT0FBTyxLQUFLOztZQUczQixNQUFNLElBQUksWUFBWTtlQUVuQixRQUFRLEtBQUssU0FBUztnQkFDdkIsU0FBVSxJQUFJOztlQUdiLElBQUk7O1dBR047Ozs7Ozs7Ozs7Ozs7OzsifQ== |
@@ -12,2 +12,4 @@ 'use strict'; | ||
var _util = require('@glimmer/util'); | ||
var TableSlotState; | ||
@@ -22,2 +24,3 @@ (function (TableSlotState) { | ||
const INFO_OFFSET = 1; | ||
const MAX_SIZE = 0b1111111111111111; | ||
const SIZE_MASK = 0b00000000000000001111111111111111; | ||
@@ -54,2 +57,3 @@ const SCOPE_MASK = 0b00111111111111110000000000000000; | ||
constructor(serializedHeap) { | ||
this.placeholders = []; | ||
this.offset = 0; | ||
@@ -154,3 +158,18 @@ this.handle = 0; | ||
} | ||
pushPlaceholder(valueFunc) { | ||
let address = this.offset++; | ||
this.heap[address] = MAX_SIZE; | ||
this.placeholders.push([address, valueFunc]); | ||
} | ||
patchPlaceholders() { | ||
let { placeholders } = this; | ||
for (let i = 0; i < placeholders.length; i++) { | ||
let [address, getValue] = placeholders[i]; | ||
false && (0, _util.assert)(this.getbyaddr(address) === MAX_SIZE, `expected to find a placeholder value at ${address}`); | ||
this.setbyaddr(address, getValue()); | ||
} | ||
} | ||
capture() { | ||
this.patchPlaceholders(); | ||
// Only called in eager mode | ||
@@ -210,2 +229,2 @@ let buffer = slice(this.heap, 0, this.offset); | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZ3JhbS5qcyIsInNvdXJjZVJvb3QiOiIiLC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ci5zbGljZSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICByZXR1cm4gYXJyLnNsaWNlKHN0YXJ0LCBlbmQpLmJ1ZmZlcjtcbiAgICB9XG5cbiAgICBsZXQgcmV0ID0gbmV3IFVpbnQxNkFycmF5KGVuZCk7XG5cbiAgICBmb3IgKDsgc3RhcnQgPCBlbmQ7IHN0YXJ0KyspIHtcbiAgICAgIHJldFtzdGFydF0gID0gYXJyW3N0YXJ0XTtcbiAgICB9XG5cbiAgICByZXR1cm4gcmV0LmJ1ZmZlcjtcbiAgfVxuXG4gIHJldHVybiBudWxsO1xufVxuIl19 |
@@ -12,2 +12,4 @@ "use strict"; | ||
var _util = require("@glimmer/util"); | ||
function _defaults(obj, defaults) { | ||
@@ -48,2 +50,3 @@ var keys = Object.getOwnPropertyNames(defaults);for (var i = 0; i < keys.length; i++) { | ||
var INFO_OFFSET = 1; | ||
var MAX_SIZE = 65535; | ||
var SIZE_MASK = 65535; | ||
@@ -82,2 +85,3 @@ var SCOPE_MASK = 1073676288; | ||
this.placeholders = []; | ||
this.offset = 0; | ||
@@ -202,3 +206,24 @@ this.handle = 0; | ||
Heap.prototype.pushPlaceholder = function pushPlaceholder(valueFunc) { | ||
var address = this.offset++; | ||
this.heap[address] = MAX_SIZE; | ||
this.placeholders.push([address, valueFunc]); | ||
}; | ||
Heap.prototype.patchPlaceholders = function patchPlaceholders() { | ||
var placeholders = this.placeholders; | ||
for (var i = 0; i < placeholders.length; i++) { | ||
var _placeholders$i = placeholders[i], | ||
address = _placeholders$i[0], | ||
getValue = _placeholders$i[1]; | ||
false && (0, _util.assert)(this.getbyaddr(address) === MAX_SIZE, 'expected to find a placeholder value at ' + address); | ||
this.setbyaddr(address, getValue()); | ||
} | ||
}; | ||
Heap.prototype.capture = function capture() { | ||
this.patchPlaceholders(); | ||
// Only called in eager mode | ||
@@ -280,2 +305,2 @@ var buffer = slice(this.heap, 0, this.offset); | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;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tcbiAgICByZXR1cm4gdGhpcy5fb3Bjb2RlO1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBQcm9ncmFtPFRlbXBsYXRlTWV0YT4gZXh0ZW5kcyBXcml0ZU9ubHlQcm9ncmFtIHtcbiAgcHVibGljIGNvbnN0YW50czogQ29uc3RhbnRzPFRlbXBsYXRlTWV0YT47XG59XG5cbmZ1bmN0aW9uIHNsaWNlKGFycjogVWludDE2QXJyYXkgfCBudW1iZXJbXSwgc3RhcnQ6IG51bWJlciwgZW5kOiBudW1iZXIpIHtcbiAgaWYgKGFyciBpbnN0YW5jZW9mIFVpbnQxNkFycmF5KSB7XG4gICAgaWYgKGFyci5zbGljZSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICByZXR1cm4gYXJyLnNsaWNlKHN0YXJ0LCBlbmQpLmJ1ZmZlcjtcbiAgICB9XG5cbiAgICBsZXQgcmV0ID0gbmV3IFVpbnQxNkFycmF5KGVuZCk7XG5cbiAgICBmb3IgKDsgc3RhcnQgPCBlbmQ7IHN0YXJ0KyspIHtcbiAgICAgIHJldFtzdGFydF0gID0gYXJyW3N0YXJ0XTtcbiAgICB9XG5cbiAgICByZXR1cm4gcmV0LmJ1ZmZlcjtcbiAgfVxuXG4gIHJldHVybiBudWxsO1xufVxuIl19 |
import { WriteOnlyConstants, RuntimeConstants } from './constants'; | ||
import { Opcode } from './opcode'; | ||
import { assert } from "@glimmer/util"; | ||
var TableSlotState; | ||
@@ -13,2 +14,3 @@ (function (TableSlotState) { | ||
const INFO_OFFSET = 1; | ||
const MAX_SIZE = 0b1111111111111111; | ||
const SIZE_MASK = 0b00000000000000001111111111111111; | ||
@@ -45,2 +47,3 @@ const SCOPE_MASK = 0b00111111111111110000000000000000; | ||
constructor(serializedHeap) { | ||
this.placeholders = []; | ||
this.offset = 0; | ||
@@ -145,3 +148,18 @@ this.handle = 0; | ||
} | ||
pushPlaceholder(valueFunc) { | ||
let address = this.offset++; | ||
this.heap[address] = MAX_SIZE; | ||
this.placeholders.push([address, valueFunc]); | ||
} | ||
patchPlaceholders() { | ||
let { placeholders } = this; | ||
for (let i = 0; i < placeholders.length; i++) { | ||
let [address, getValue] = placeholders[i]; | ||
(false && assert(this.getbyaddr(address) === MAX_SIZE, `expected to find a placeholder value at ${address}`)); | ||
this.setbyaddr(address, getValue()); | ||
} | ||
} | ||
capture() { | ||
this.patchPlaceholders(); | ||
// Only called in eager mode | ||
@@ -197,2 +215,2 @@ let buffer = slice(this.heap, 0, this.offset); | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZ3JhbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL3Byb2dyYW0vbGliL3Byb2dyYW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUdBLEFBQU8sU0FBYSxBQUFrQixvQkFBRSxBQUFnQixBQUFnQix3QkFBTSxBQUFhLEFBQUM7QUFDNUYsQUFBTyxTQUFFLEFBQU0sQUFBRSxjQUFNLEFBQVUsQUFBQztBQUVsQyxJQUFLLEFBS0o7QUFMRCxXQUFLLEFBQWM7QUFDakIsc0RBQVM7QUFDVCxrREFBSztBQUNMLG1EQUFNO0FBQ04sb0RBQU8sQUFDVDtBQUFDLEdBTEksQUFBYyxtQkFBZCxBQUFjLGlCQUtsQjtBQUVELE1BQU0sQUFBVSxhQUFHLEFBQUMsQUFBQztBQUNyQixNQUFNLEFBQVcsY0FBRyxBQUFDLEFBQUM7QUFDdEIsTUFBTSxBQUFTLFlBQUksQUFBa0MsQUFBQztBQUN0RCxNQUFNLEFBQVUsYUFBRyxBQUFrQyxBQUFDO0FBQ3RELE1BQU0sQUFBVSxhQUFHLEFBQWtDLEFBQUM7QUFFdEQseUJBQXlCLEFBQVksTUFBRSxBQUFpQixXQUFFLEFBQWE7QUFDckUsQUFBTSxXQUFDLEF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1xuICBwdWJsaWMgY29uc3RhbnRzOiBDb25zdGFudHM8VGVtcGxhdGVNZXRhPjtcbn1cblxuZnVuY3Rpb24gc2xpY2UoYXJyOiBVaW50MTZBcnJheSB8IG51bWJlcltdLCBzdGFydDogbnVtYmVyLCBlbmQ6IG51bWJlcikge1xuICBpZiAoYXJyIGluc3RhbmNlb2YgVWludDE2QXJyYXkpIHtcbiAgICBpZiAoYXJyLnNsaWNlICE9PSB1bmRlZmluZWQpIHtcbiAgICAgIHJldHVybiBhcnIuc2xpY2Uoc3RhcnQsIGVuZCkuYnVmZmVyO1xuICAgIH1cblxuICAgIGxldCByZXQgPSBuZXcgVWludDE2QXJyYXkoZW5kKTtcblxuICAgIGZvciAoOyBzdGFydCA8IGVuZDsgc3RhcnQrKykge1xuICAgICAgcmV0W3N0YXJ0XSAgPSBhcnJbc3RhcnRdO1xuICAgIH1cblxuICAgIHJldHVybiByZXQuYnVmZmVyO1xuICB9XG5cbiAgcmV0dXJuIG51bGw7XG59XG4iXX0= |
@@ -11,2 +11,3 @@ function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } | ||
import { Opcode } from './opcode'; | ||
import { assert } from "@glimmer/util"; | ||
var TableSlotState; | ||
@@ -21,2 +22,3 @@ (function (TableSlotState) { | ||
var INFO_OFFSET = 1; | ||
var MAX_SIZE = 65535; | ||
var SIZE_MASK = 65535; | ||
@@ -55,2 +57,3 @@ var SCOPE_MASK = 1073676288; | ||
this.placeholders = []; | ||
this.offset = 0; | ||
@@ -176,3 +179,24 @@ this.handle = 0; | ||
Heap.prototype.pushPlaceholder = function pushPlaceholder(valueFunc) { | ||
var address = this.offset++; | ||
this.heap[address] = MAX_SIZE; | ||
this.placeholders.push([address, valueFunc]); | ||
}; | ||
Heap.prototype.patchPlaceholders = function patchPlaceholders() { | ||
var placeholders = this.placeholders; | ||
for (var i = 0; i < placeholders.length; i++) { | ||
var _placeholders$i = placeholders[i], | ||
address = _placeholders$i[0], | ||
getValue = _placeholders$i[1]; | ||
false && assert(this.getbyaddr(address) === MAX_SIZE, 'expected to find a placeholder value at ' + address); | ||
this.setbyaddr(address, getValue()); | ||
} | ||
}; | ||
Heap.prototype.capture = function capture() { | ||
this.patchPlaceholders(); | ||
// Only called in eager mode | ||
@@ -254,2 +278,2 @@ var buffer = slice(this.heap, 0, this.offset); | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZ3JhbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL3Byb2dyYW0vbGliL3Byb2dyYW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFHQSxBQUFPLFNBQWEsQUFBa0Isb0JBQUUsQUFBZ0IsQUFBZ0Isd0JBQU0sQUFBYSxBQUFDO0FBQzVGLEFBQU8sU0FBRSxBQUFNLEFBQUUsY0FBTSxBQUFVLEFBQUM7QUFFbEMsSUFBSyxBQUtKO0FBTEQsV0FBSyxBQUFjLGdCQUNqQjtzREFBUyxBQUNUO2tEQUFLLEFBQ0w7bURBQU0sQUFDTjtvREFBTyxBQUNULEFBQUM7R0FMSSxBQUFjLG1CQUFkLEFBQWMsaUJBS2xCO0FBRUQsSUFBTSxBQUFVLGFBQUcsQUFBQyxBQUFDO0FBQ3JCLElBQU0sQUFBVyxjQUFHLEFBQUMsQUFBQztBQUN0QixJQUFNLEFBQVMsWUFBSSxBQUFrQyxBQUFDO0FBQ3RELElBQU0sQUFBVSxhQUFHLEFBQWtDLEFBQUM7QUFDdEQsSUFBTSxBQUFVLGFBQUcsQUFBa0MsQUFBQztBQUV0RCx5QkFBeUIsQUFBWSxNQUFFLEFBQ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Ckge1xuICAgIHRoaXMuX29wY29kZSA9IG5ldyBPcGNvZGUodGhpcy5oZWFwKTtcbiAgfVxuXG4gIG9wY29kZShvZmZzZXQ6IG51bWJlcik6IE9wY29kZSB7XG4gICAgdGhpcy5fb3Bjb2RlLm9mZnNldCA9IG9mZnNldDtcbiAgICByZXR1cm4gdGhpcy5fb3Bjb2RlO1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBQcm9ncmFtPFRlbXBsYXRlTWV0YT4gZXh0ZW5kcyBXcml0ZU9ubHlQcm9ncmFtIHtcbiAgcHVibGljIGNvbnN0YW50czogQ29uc3RhbnRzPFRlbXBsYXRlTWV0YT47XG59XG5cbmZ1bmN0aW9uIHNsaWNlKGFycjogVWludDE2QXJyYXkgfCBudW1iZXJbXSwgc3RhcnQ6IG51bWJlciwgZW5kOiBudW1iZXIpIHtcbiAgaWYgKGFyciBpbnN0YW5jZW9mIFVpbnQxNkFycmF5KSB7XG4gICAgaWYgKGFyci5zbGljZSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICByZXR1cm4gYXJyLnNsaWNlKHN0YXJ0LCBlbmQpLmJ1ZmZlcjtcbiAgICB9XG5cbiAgICBsZXQgcmV0ID0gbmV3IFVpbnQxNkFycmF5KGVuZCk7XG5cbiAgICBmb3IgKDsgc3RhcnQgPCBlbmQ7IHN0YXJ0KyspIHtcbiAgICAgIHJldFtzdGFydF0gID0gYXJyW3N0YXJ0XTtcbiAgICB9XG5cbiAgICByZXR1cm4gcmV0LmJ1ZmZlcjtcbiAgfVxuXG4gIHJldHVybiBudWxsO1xufVxuIl19 |
@@ -9,2 +9,3 @@ import { CompileTimeProgram, VMHandle, RuntimeResolver } from "@glimmer/interfaces"; | ||
} | ||
export declare type Placeholder = [number, () => number]; | ||
/** | ||
@@ -32,2 +33,3 @@ * The Heap is responsible for dynamically allocating | ||
private heap; | ||
private placeholders; | ||
private table; | ||
@@ -56,2 +58,4 @@ private offset; | ||
compact(): void; | ||
pushPlaceholder(valueFunc: () => number): void; | ||
private patchPlaceholders(); | ||
capture(): SerializedHeap; | ||
@@ -58,0 +62,0 @@ } |
{ | ||
"name": "@glimmer/program", | ||
"version": "0.30.1", | ||
"version": "0.30.2", | ||
"repository": "https://github.com/glimmerjs/glimmer-vm/tree/master/packages/@glimmer/program", | ||
"dependencies": { | ||
"@glimmer/util": "^0.30.1", | ||
"@glimmer/interfaces": "^0.30.1", | ||
"@glimmer/encoder": "^0.30.1" | ||
"@glimmer/util": "^0.30.2", | ||
"@glimmer/interfaces": "^0.30.2", | ||
"@glimmer/encoder": "^0.30.2" | ||
}, | ||
@@ -10,0 +10,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
292082
2771
Updated@glimmer/encoder@^0.30.2
Updated@glimmer/interfaces@^0.30.2
Updated@glimmer/util@^0.30.2