2870 {
2871 const intptr_t bytes_written =
s->bytes_written();
2873
2874 intptr_t pointer_offsets_length =
2876 if (pointer_offsets_length != 0) {
2877 FATAL(
"Cannot serialize code with embedded pointers");
2878 }
2880
2881 s->UnexpectedObject(
code,
"Disabled code");
2882 }
2883
2884 s->WriteInstructions(
code->untag()->instructions_,
2885 code->untag()->unchecked_offset_,
code, deferred);
2887
2888
2889
2890 const uint32_t active_unchecked_offset =
2891 code->untag()->unchecked_entry_point_ -
code->untag()->entry_point_;
2892 s->WriteInstructions(
code->untag()->active_instructions_,
2893 active_unchecked_offset,
code, deferred);
2894 }
2895
2896#if defined(DART_PRECOMPILER)
2897 if (FLAG_write_v8_snapshot_profile_to != nullptr) {
2898
2899
2902 ObjectPoolPtr
pool =
code->untag()->object_pool_;
2903
2904 ASSERT(!
s->HasRef(
pool) ||
pool == Object::empty_object_pool().ptr());
2905 s->CreateArtificialNodeIfNeeded(
pool);
2906 s->AttributePropertyRef(
pool,
"object_pool_");
2907 }
2910 auto const table =
code->untag()->static_calls_target_table_;
2911
2912
2914 s->CreateArtificialNodeIfNeeded(
table);
2915 s->AttributePropertyRef(
table,
"static_calls_target_table_");
2916 }
2917 }
2918#endif
2919
2921
2922 ASSERT(
s->bytes_written() == bytes_written);
2923
2924
2926 !FLAG_retain_code_objects);
2927#if defined(DART_PRECOMPILER)
2928 if (FLAG_write_v8_snapshot_profile_to != nullptr) {
2929
2930 const auto& owner =
code->untag()->owner_;
2931 s->CreateArtificialNodeIfNeeded(owner);
2932 s->AttributePropertyRef(owner,
"owner_");
2933 }
2934#endif
2935 return;
2936 }
2937
2938
2939
2941 if (
s->InCurrentLoadingUnitOrRoot(
code->untag()->object_pool_)) {
2943 } else {
2945 }
2946 }
2953 }
2954 if (FLAG_precompiled_mode && FLAG_dwarf_stack_traces_mode) {
2957 } else {
2959 if (
s->InCurrentLoadingUnitOrRoot(
code->untag()->code_source_map_)) {
2961 } else {
2963 }
2964 }
2968 }
2969
2970#if !defined(PRODUCT)
2972 if (FLAG_code_comments) {
2974 }
2975#endif
2976 }
#define WriteFieldValue(field, value)
#define WriteField(obj, field)
static DecodeResult decode(std::string path)