@awayfl/avm2
Version:
Virtual machine for executing AS3 code
29 lines (28 loc) • 1.16 kB
JavaScript
import { __extends } from "tslib";
import { Info } from './Info';
import { BytecodeStream, getBytecodeName } from '../ops';
var MethodBodyInfo = /** @class */ (function (_super) {
__extends(MethodBodyInfo, _super);
function MethodBodyInfo(maxStack, localCount, initScopeDepth, maxScopeDepth, code, catchBlocks, traits) {
var _this = _super.call(this, traits) || this;
_this.maxStack = maxStack;
_this.localCount = localCount;
_this.initScopeDepth = initScopeDepth;
_this.maxScopeDepth = maxScopeDepth;
_this.code = code;
_this.catchBlocks = catchBlocks;
_this.traits = traits;
_this.activationPrototype = null;
return _this;
}
MethodBodyInfo.prototype.trace = function (writer) {
writer.writeLn('Code: ' + this.code.length);
var stream = new BytecodeStream(this.code);
while (stream.currentBytecode() !== 255 /* Bytecode.END */) {
writer.writeLn(stream.currentBCI + ': ' + getBytecodeName(stream.currentBytecode()));
stream.next();
}
};
return MethodBodyInfo;
}(Info));
export { MethodBodyInfo };