DartVM

Cards (14)

  • The Dart language is type safe; it uses static type checking to ensure that a variable’s value always matches the variable’s static type. Sometimes, this is referred to as sound typing.
  • Dart has built-in sound null safety. This means values can’t be null unless you say they can be.
  • Dart includes both a Dart VM with JIT compilation and an AOT compiler for producing machine code.
  • During development, a fast developer cycle is critical for iteration. The Dart VM offers a JIT compiler with incremental recompilation (enabling hot reload).
  • When apps are ready to be deployed to production — the Dart AOT compiler can compile to native ARM or x64 machine code. Your AOT-compiled app launches with consistent, short startup time.
  • Any Dart code within the VM is running within some isolate with its own heap and usually with its own mutator thread.
  • An OS thread can enter only one isolate at a time. It has to leave current isolate if it wants to enter another isolate;
  • DartVM expects to be given Kernel binaries (also called dill files) which contain serialized Kernel abstract syntax tree.
  • The task of translating Dart source into Kernel AST is handled by the common front-end (CFE).
  • In Dart, a snapshot is a precompiled representation of a Dart program that is generated and stored ahead of time. It is essentially a list of objects to create and instructions on how to connect them together.
  • Dart’s garbage collector is composed of two generations (young and old).
  • The young generation is where new objects are initially allocated. Objects that survive a garbage collection cycle in the young generation are promoted to the old generation.
  • The old generation, contains objects that have survived multiple garbage collection cycles in the young generation. They are less likely to become garbage, so garbage collection is less frequent. When garbage collection occurs it involves a larger set of objects.
  • The young generation is collected by a parallel, scavenger. The old generation is collected by concurrent-mark concurrent-sweep.