)]}'
{
  "commit": "86d1261dff279acf84bc699c6c116189955b0076",
  "tree": "da7a9068331297a66a2f0cf581c5859c39de92b6",
  "parents": [
    "23f414520647df3719da1a94f19237955a0f5fc2"
  ],
  "author": {
    "name": "Tess Strickland",
    "email": "sstrickl@google.com",
    "time": "Wed Jul 12 07:37:16 2023 +0000"
  },
  "committer": {
    "name": "Commit Queue",
    "email": "dart-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Wed Jul 12 07:37:16 2023 +0000"
  },
  "message": "[vm] Clean up New() methods of Dart classes.\n\nGoals of this CL, a followup to 2f63acea22:\n\n* Ensure that X::New() depends on the initialization guarantees of\n  Object::Allocate\u003cX\u003e(...):\n\n  * Ptr fields are guaranteed to be initialized to Object::null().\n  * Non-Ptr fields are guaranteed to be zero-initialized.\n\n  In cases where the only uses of the allocated object before return\n  was to perform unnecessary field assignments, X::New() just simply\n  returns the result of Object::Allocate\u003cX\u003e(...).\n\n  Otherwise, the old now-unnecessary assignments have been changed\n  into ASSERTs so that they will be checked in DEBUG mode.\n\n* Ensure that NoSafepointScopes are entered in X::New() only when\n  necessary (e.g., to ensure fields used to calculate to(...)\n  are properly set before being seen by pointer visitors as the GC\n  may run when outside a NoSafepointScope).\n\n  In particular, the often occurring pattern:\n\n  auto\u0026 result \u003d X::Handle();\n  {\n    auto raw \u003d Object::Allocate\u003cX\u003e(...);\n    NoSafepointScope no_safepoint;\n    result \u003d raw;\n  }\n  ...\n\n  has been replaced with:\n\n  const auto\u0026 result \u003d X::Handle(Object::Allocate\u003cX\u003e(...));\n\n* If a handle was allocated, the only uses of that handle before\n  returning must be performed under a NoSafepointScope, and the same\n  operations can be done directly on the object pointer, then do so\n  and remove the unnecessary handle allocation.\n\nNotable changes outside the above:\n\n* Swapped ObjectPool::EntryType::{kImmediate,kTaggedObject} so that\n  kImmediate has value 0, since Object::Allocate\u003cObjectPool\u003e(len)\n  zero-initializes the payload and without this change,\n  ObjectPool::New() must set the entry types manually.\n\n* Removed the old static ArrayPtr cached_array_ field on\n  SubtypeTestCache as well as SubtypeTestCache::{Init,Cleanup} and\n  instead added Object::empty_subtype_test_cache_array().\n\n* Removed the no-arg Closure::New() method, which is never used.\n\n* Inlined the no-arg Script::New() method into its only caller,\n  one of the other Script::New() overloads.\n\nTEST\u003dci\n\nIssue: https://github.com/dart-lang/sdk/issues/52876\nChange-Id: I079b4c9f73c7d2c0146c30cf2cd570b91a1ecf36\nCq-Include-Trybots: luci.dart.try:vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-linux-release-x64-try,vm-aot-linux-product-x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-ffi-qemu-linux-release-riscv64-try\nReviewed-on: https://dart-review.googlesource.com/c/sdk/+/313120\nReviewed-by: Ryan Macnak \u003crmacnak@google.com\u003e\nCommit-Queue: Tess Strickland \u003csstrickl@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "28abb88525f208bff937bc977ebd80fa129b4f25",
      "old_mode": 33188,
      "old_path": "runtime/vm/app_snapshot.cc",
      "new_id": "f6ad759f7fe6ad13f8ecb8a380d15b6beb4c4339",
      "new_mode": 33188,
      "new_path": "runtime/vm/app_snapshot.cc"
    },
    {
      "type": "modify",
      "old_id": "98247ab5e7bcefa46a73cda51169c235c8a7c778",
      "old_mode": 33188,
      "old_path": "runtime/vm/compiler/assembler/object_pool_builder.h",
      "new_id": "76c0c802acef07917e2309bbec3bd2d133e50263",
      "new_mode": 33188,
      "new_path": "runtime/vm/compiler/assembler/object_pool_builder.h"
    },
    {
      "type": "modify",
      "old_id": "0535b778e18590f8a1ae5c078514cc5ec4945a79",
      "old_mode": 33188,
      "old_path": "runtime/vm/dart.cc",
      "new_id": "9d2191522cf3f3674d5453059729765048b8268a",
      "new_mode": 33188,
      "new_path": "runtime/vm/dart.cc"
    },
    {
      "type": "modify",
      "old_id": "d2d5e14db08126865f02b81847357890b38e8b26",
      "old_mode": 33188,
      "old_path": "runtime/vm/object.cc",
      "new_id": "ed966bda539c50a77777bda58c26107bcdbc9ff0",
      "new_mode": 33188,
      "new_path": "runtime/vm/object.cc"
    },
    {
      "type": "modify",
      "old_id": "0dfaa94d5e455f61ee1356df0f4e09afff418f9d",
      "old_mode": 33188,
      "old_path": "runtime/vm/object.h",
      "new_id": "5837ba84613d0ed7e594fe2cf7c58d60c03f2dbc",
      "new_mode": 33188,
      "new_path": "runtime/vm/object.h"
    }
  ]
}
