Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Unified Diff: sdk/lib/io/timer_impl.dart

Issue 150563005: Short-cut the call to Timer.run, to not go through standalone. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/eventhandler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/timer_impl.dart
diff --git a/sdk/lib/io/timer_impl.dart b/sdk/lib/io/timer_impl.dart
index 5396a6aa0d6afb0d656b8c4e0adf053df236a39e..495c70e6f2a243dcc0d711b12a8127169ab1ca71 100644
--- a/sdk/lib/io/timer_impl.dart
+++ b/sdk/lib/io/timer_impl.dart
@@ -128,6 +128,7 @@ class _Timer implements Timer {
static int _idCount = 0;
static RawReceivePort _receivePort;
+ static SendPort _sendPort;
static bool _handlingCallbacks = false;
Function _callback;
@@ -241,10 +242,13 @@ class _Timer implements Timer {
// events.
_createTimerHandler();
}
- _EventHandler._sendData(null,
- _receivePort,
- _firstZeroTimer != null ?
- 0 : _heap.first._wakeupTime);
+ if (_firstZeroTimer != null) {
+ _sendPort.send(null);
+ } else {
+ _EventHandler._sendData(null,
+ _receivePort,
+ _heap.first._wakeupTime);
+ }
}
}
@@ -300,6 +304,7 @@ class _Timer implements Timer {
static void _createTimerHandler() {
if(_receivePort == null) {
_receivePort = new RawReceivePort(_handleTimeout);
+ _sendPort = _receivePort.sendPort;
}
}
« no previous file with comments | « runtime/bin/eventhandler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698