dart-sdk/pkg/dart2js_runtime_metrics
Mayank Patke c556766395 [dart2js] Expose JS_TRUE and JS_FALSE via dart2js_runtime_metrics.
dart2js already had an external function in foreign_helper called
JS_FALSE. This function is completely opaque until it is lowered to the
constant value `false` in SSA, so one can write `if (JS_FALSE())` in
order to ensure that the guarded code is treated as live and compiled,
but eventually tree-shaken and omitted from SSA and codegen.

This CL adds a JS_TRUE counterpart for completeness, and exposes both
JS_TRUE and JS_FALSE through package:dart2js_runtime_metrics.

Change-Id: I9b375fa37ada1b65fb9183902bb295e05fa6b8c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349704
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-02-09 18:38:55 +00:00
..
lib [dart2js] Expose JS_TRUE and JS_FALSE via dart2js_runtime_metrics. 2024-02-09 18:38:55 +00:00
test [dart2js] Expose JS_TRUE and JS_FALSE via dart2js_runtime_metrics. 2024-02-09 18:38:55 +00:00
analysis_options.yaml [pkg/async_helper] use package:lints/recommended.yaml 2023-02-15 02:45:33 +00:00
CHANGELOG.md [dart2js] Moving runtime allocations to pkg:dart2js_runtime_metrics 2022-04-29 21:48:41 +00:00
LICENSE
OWNERS [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
pubspec.yaml [pkg] prefer 'any' deps for package dev dependencies 2022-05-27 01:34:59 +00:00
README.md

☠☠ Warning: This package is experimental and may be removed in a future version of Dart. ☠☠

dart2js can generate extra code to measure certain activities. This library provides access to the measurements at runtime.

An application might make timings and other measurements and report them back to a server in order to collect information on how the application is working in production. The APIs in this library provide access to measurements that require help from dart2js. For example, startupMetrics accesses measurements of activities that happen as the program is loaded, before main().

The APIs are stubbed so that dummy values are returned on the VM and dartdevc.