401 {
402 SimpleHashMap::Entry* entry = tokens_map_.
Lookup(
403 GetHashmapKeyFromPort(port), GetHashmapHashFromPort(port), true);
404 PortEntry* pentry;
405 if (entry->value == nullptr) {
406 pentry = new PortEntry();
407 pentry->dart_port =
port;
408 pentry->token_count = kTokenCount;
409 pentry->is_reading = IsReadingMask(mask);
410 entry->value = reinterpret_cast<void*>(pentry);
411
412 if (pentry->IsReady()) {
413 active_readers_.
Add(pentry);
414 }
415 } else {
416 pentry = reinterpret_cast<PortEntry*>(entry->value);
417 bool was_ready = pentry->IsReady();
418 pentry->is_reading = IsReadingMask(mask);
419 bool is_ready = pentry->IsReady();
420
421 if (was_ready && !is_ready) {
422 active_readers_.
Remove(pentry);
423 } else if (!was_ready && is_ready) {
424 active_readers_.
Add(pentry);
425 }
426 }
427
428#ifdef DEBUG
429
430 int ready_count = 0;
431
432 if (active_readers_.
HasHead()) {
433 PortEntry*
root =
reinterpret_cast<PortEntry*
>(active_readers_.
head());
434 PortEntry* current =
root;
435 do {
436 ASSERT(current->IsReady());
437 ready_count++;
439 current = active_readers_.
head();
440 } while (current != root);
441 }
442
443 for (SimpleHashMap::Entry* entry = tokens_map_.
Start(); entry !=
nullptr;
444 entry = tokens_map_.
Next(entry)) {
445 PortEntry* pentry = reinterpret_cast<PortEntry*>(entry->value);
446 if (pentry->IsReady()) {
447 ready_count--;
448 }
449 }
450
452#endif
453 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service port