Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 3 files changed
  • 0 comments
  • 1 contributor
2  src/avm2/compiler/inferrer.js
@@ -86,7 +86,7 @@ var Type = (function () {
86 86 };
87 87
88 88 type.prototype.isNumeric = function () {
89   - return this === Type.Int || this === Type.Number;
  89 + return this === Type.Int || this === Type.Uint || this === Type.Number;
90 90 };
91 91
92 92 type.prototype.isParameterizedType = function () {
27 src/avm2/parser.js
@@ -327,7 +327,7 @@ var ShumwayNamespace = (function () {
327 327 }
328 328 } else if (this.isUnique()) {
329 329 // Make a psuedo unique id by concatenating current milliseconds to original uri
330   - this.uri = String(this.uri+Date.now());
  330 + this.uri = String(this.uri + Date.now());
331 331 }
332 332 this.uri = mangleNamespaceString(this.uri);
333 333 release || assert(kinds[this.kind]);
@@ -341,22 +341,17 @@ var ShumwayNamespace = (function () {
341 341 return str;
342 342 }
343 343
344   - function mangleNamespaceString(strIn) {
  344 + var perfectNamespaceHash = Object.create(null);
  345 + var perfectNamespaceHashCount = 0;
  346 +
  347 + function mangleNamespaceString(str) {
345 348 if (!release) {
346   - return escapeString(strIn);
347   - }
348   - var buf = str2ab(strIn);
349   - var strOut = base64ArrayBuffer(buf).replace(/=/g, ""); // Erase padding
350   - return strOut;
351   -
352   - function str2ab(str) {
353   - var buf = new ArrayBuffer(str.length);
354   - var bufView = new Uint8Array(buf);
355   - for (var i=0, strLen=str.length; i<strLen; i++) {
356   - bufView[i] = str.charCodeAt(i);
357   - }
358   - return buf;
  349 + return escapeString(str);
  350 + }
  351 + if (str === "") {
  352 + return "";
359 353 }
  354 + return perfectNamespaceHash[str] || (perfectNamespaceHash[str] = "N" + perfectNamespaceHashCount++);
360 355 }
361 356
362 357 namespace.kindFromString = function kindFromString(str) {
@@ -1182,6 +1177,7 @@ var ClassInfo = (function () {
1182 1177 function classInfo(abc, instanceInfo, stream) {
1183 1178 this.id = nextID ++;
1184 1179 this.init = abc.methods[stream.readU30()];
  1180 + this.init.isClassInitializer = true;
1185 1181 attachHolder(this.init, this);
1186 1182 this.traits = parseTraits(abc, stream, this);
1187 1183 this.instanceInfo = instanceInfo;
@@ -1201,6 +1197,7 @@ var ScriptInfo = (function scriptInfo() {
1201 1197 this.abc = abc;
1202 1198 this.name = abc.name + "$script" + idx;
1203 1199 this.init = abc.methods[stream.readU30()];
  1200 + this.init.isScriptInitializer = true;
1204 1201 attachHolder(this.init, this);
1205 1202 this.traits = parseTraits(abc, stream, this);
1206 1203 this.traits.verified = true;
4 src/avm2/runtime.js
@@ -883,6 +883,10 @@ var Runtime = (function () {
883 883 } else if (mi.code.length > compilerMaximumMethodSize.value) {
884 884 return false;
885 885 }
  886 + // Don't compile class and script initializers since they only run once.
  887 + if (mi.isClassInitializer || mi.isScriptInitializer) {
  888 + return false;
  889 + }
886 890 return true;
887 891 }
888 892

No commit comments for this range

Something went wrong with that request. Please try again.