Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

singleton pause object to reduce allocation

  • Loading branch information...
commit 0ad456d380937ee9567ad67e208c69006f5564af 1 parent b788e1b
Danny Yoo authored
Showing with 6 additions and 5 deletions.
  1. +5 −4 js-assembler/runtime-src/runtime.js
  2. +1 −1  version.rkt
View
9 js-assembler/runtime-src/runtime.js
@@ -488,11 +488,12 @@
var Pause = function(onPause) {
// onPause: MACHINE -> void
- this.onPause = onPause || function(MACHINE) {};
+ this.onPause = onPause;
};
-
+ var THE_SINGLETON_PAUSE = new Pause();
var PAUSE = function(onPause) {
- throw(new Pause(onPause));
+ THE_SINGLETON_PAUSE.onPause = onPause;
+ throw(THE_SINGLETON_PAUSE);
};
@@ -564,7 +565,7 @@
scheduleTrampoline(that, thunk, release);
return;
}
- } else if (e instanceof Pause) {
+ } else if (e === THE_SINGLETON_PAUSE) {
var pauseLock = new ExclusiveLock();
var oldArgcount = that.a;
var restarted = false;
View
2  version.rkt
@@ -7,4 +7,4 @@
(provide version)
(: version String)
-(define version "1.213")
+(define version "1.215")
Please sign in to comment.
Something went wrong with that request. Please try again.