Merge remote-tracking branch 'origin/master'

This commit is contained in:
Alexey Andreev 2016-02-21 22:36:54 +03:00
commit 4b006f2423
4 changed files with 34 additions and 12 deletions

View File

@ -343,10 +343,10 @@ public class TLinkedList<E> extends TAbstractSequentialList<E> implements TDeque
} }
removeEntry(currentEntry); removeEntry(currentEntry);
if (currentEntry == prevEntry) { if (currentEntry == prevEntry) {
prevEntry = nextEntry.previous; prevEntry = hasNext() ? nextEntry.previous : null;
--index; --index;
} else if (currentEntry == nextEntry) { } else if (currentEntry == nextEntry) {
nextEntry = prevEntry.next; nextEntry = hasPrevious() ? prevEntry.next : null;
} }
--size; --size;
version = modCount; version = modCount;

View File

@ -81,4 +81,33 @@ public class TTimer extends TObject {
}; };
task.nativeTimerId = Window.setTimeout(handler, (int) delay); task.nativeTimerId = Window.setTimeout(handler, (int) delay);
} }
public void scheduleAtFixedRate(final TTimerTask task, long delay, long period) {
if (cancelled || task.timer != null || task.nativeTimerId >= 0) {
throw new TIllegalStateException();
}
final long[] nextStartTime = new long[]{System.currentTimeMillis() + delay};
task.timer = this;
TimerHandler handler = new TimerHandler() {
@Override public void onTimer() {
new Thread(() -> {
if (cancelled || task.timer == null) {
return;
}
long nextDelay = nextStartTime[0] - System.currentTimeMillis();
if (nextDelay < 0 ) {
nextDelay = 0;
}
task.nativeTimerId = Window.setTimeout(this, (int) nextDelay);
nextStartTime[0] += period;
TTimerTask.performOnce(task);
if (!cancelled) {
task.timer = TTimer.this;
}
}).start();
}
};
task.nativeTimerId = Window.setTimeout(handler, (int) delay);
nextStartTime[0] += period;
}
} }

View File

@ -1,5 +1,5 @@
TeaVM, GWT, HotSport JBox2D Benchmark TeaVM, GWT, HotSpot, Bck2Brwsr JBox2D Benchmark
===================================== ===============================================
Compares the speed of execution on a complex [JBox2D](http://www.jbox2d.org/) CPU extensive Compares the speed of execution on a complex [JBox2D](http://www.jbox2d.org/) CPU extensive
computation. JavaScript produced by TeaVM and GWT can be compared by running computation. JavaScript produced by TeaVM and GWT can be compared by running

View File

@ -19,7 +19,7 @@
<description>Compares performance of the JavaScript code produced by TeaVM and GWT</description> <description>Compares performance of the JavaScript code produced by TeaVM and GWT</description>
<properties> <properties>
<bck2brwsr.version>0.14</bck2brwsr.version> <bck2brwsr.version>0.17</bck2brwsr.version>
</properties> </properties>
<dependencies> <dependencies>
@ -64,13 +64,6 @@
<artifactId>html5-canvas</artifactId> <artifactId>html5-canvas</artifactId>
<version>0.7.2</version> <version>0.7.2</version>
</dependency> </dependency>
<dependency>
<groupId>com.dukescript.canvas</groupId>
<artifactId>canvas-api</artifactId>
<version>0.7.2</version>
<classifier>bck2brwsr</classifier>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>org.apidesign.bck2brwsr</groupId> <groupId>org.apidesign.bck2brwsr</groupId>
<artifactId>ko-bck2brwsr</artifactId> <artifactId>ko-bck2brwsr</artifactId>