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

Side by Side Diff: runtime/lib/isolate_patch.dart

Issue 892963002: Reduce timer stack overhead by getting immediate callback and run it, instead of calling through fu… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/lib/timer_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "dart:collection" show HashMap; 5 import "dart:collection" show HashMap;
6 import "dart:_internal"; 6 import "dart:_internal";
7 7
8 patch class ReceivePort { 8 patch class ReceivePort {
9 /* patch */ factory ReceivePort() = _ReceivePortImpl; 9 /* patch */ factory ReceivePort() = _ReceivePortImpl;
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 void _runPendingImmediateCallback() { 92 void _runPendingImmediateCallback() {
93 if (_pendingImmediateCallback != null) { 93 if (_pendingImmediateCallback != null) {
94 var callback = _pendingImmediateCallback; 94 var callback = _pendingImmediateCallback;
95 _pendingImmediateCallback = null; 95 _pendingImmediateCallback = null;
96 callback(); 96 callback();
97 } 97 }
98 } 98 }
99 99
100 ImmediateCallback _removePendingImmediateCallback() {
101 var callback = _pendingImmediateCallback;
102 _pendingImmediateCallback = null;
103 return callback;
104 }
105
100 /// The embedder can execute this function to get hold of 106 /// The embedder can execute this function to get hold of
101 /// [_isolateScheduleImmediate] above. 107 /// [_isolateScheduleImmediate] above.
102 Function _getIsolateScheduleImmediateClosure() { 108 Function _getIsolateScheduleImmediateClosure() {
103 return _isolateScheduleImmediate; 109 return _isolateScheduleImmediate;
104 } 110 }
105 111
106 class _RawReceivePortImpl implements RawReceivePort { 112 class _RawReceivePortImpl implements RawReceivePort {
107 factory _RawReceivePortImpl() native "RawReceivePortImpl_factory"; 113 factory _RawReceivePortImpl() native "RawReceivePortImpl_factory";
108 114
109 close() { 115 close() {
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 static Isolate _getCurrentIsolate() { 415 static Isolate _getCurrentIsolate() {
410 List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate(); 416 List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate();
411 return new Isolate(portAndCapabilities[0], 417 return new Isolate(portAndCapabilities[0],
412 pauseCapability: portAndCapabilities[1], 418 pauseCapability: portAndCapabilities[1],
413 terminateCapability: portAndCapabilities[2]); 419 terminateCapability: portAndCapabilities[2]);
414 } 420 }
415 421
416 static List _getPortAndCapabilitiesOfCurrentIsolate() 422 static List _getPortAndCapabilitiesOfCurrentIsolate()
417 native "Isolate_getPortAndCapabilitiesOfCurrentIsolate"; 423 native "Isolate_getPortAndCapabilitiesOfCurrentIsolate";
418 } 424 }
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/timer_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698