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

Unified Diff: src/vm/natives.cc

Issue 1375373004: Use the event-handler for timers. (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: Created 5 years, 3 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
Index: src/vm/natives.cc
diff --git a/src/vm/natives.cc b/src/vm/natives.cc
index aaa7416c6523d109636ab521f191053bbb04d804..2cc65cf7f50dd9a43c1580dbf671f3259664909c 100644
--- a/src/vm/natives.cc
+++ b/src/vm/natives.cc
@@ -1314,4 +1314,15 @@ NATIVE(Uint32DigitsSet) {
return process->program()->null_object();
}
+NATIVE(TimerScheduleTimeout) {
+ int64 timeout = AsForeignInt64(arguments[0]);
+ Instance* instance = Instance::cast(arguments[1]);
+ ASSERT(instance->IsPort());
+ Object* field = instance->GetInstanceField(0);
+ uword address = AsForeignWord(field);
+ Port* port = reinterpret_cast<Port*>(address);
+ process->program()->event_handler()->ScheduleTimeout(timeout, port);
+ return process->program()->null_object();
+}
+
} // namespace fletch

Powered by Google App Engine
This is Rietveld 408576698