@@ -971,6 +971,7 @@ void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id,
971971 RawPcDescriptors::Kind kind,
972972 LocationSummary* locs,
973973 Code::EntryKind entry_kind) {
974+ ASSERT (CanCallDart ());
974975 __ BranchLinkPatchable (stub, entry_kind);
975976 EmitCallsiteMetadata (token_pos, deopt_id, kind, locs);
976977}
@@ -981,6 +982,7 @@ void FlowGraphCompiler::GenerateStaticDartCall(intptr_t deopt_id,
981982 LocationSummary* locs,
982983 const Function& target,
983984 Code::EntryKind entry_kind) {
985+ ASSERT (CanCallDart ());
984986 if (FLAG_precompiled_mode && FLAG_use_bare_instructions) {
985987 __ GenerateUnRelocatedPcRelativeCall ();
986988 AddPcRelativeCallTarget (target, entry_kind);
@@ -1028,6 +1030,7 @@ void FlowGraphCompiler::EmitOptimizedInstanceCall(const Code& stub,
10281030 TokenPosition token_pos,
10291031 LocationSummary* locs,
10301032 Code::EntryKind entry_kind) {
1033+ ASSERT (CanCallDart ());
10311034 ASSERT (Array::Handle (zone (), ic_data.arguments_descriptor ()).Length () > 0 );
10321035 // Each ICData propagated from unoptimized to optimized code contains the
10331036 // function that corresponds to the Dart function of that IC call. Due
@@ -1050,6 +1053,7 @@ void FlowGraphCompiler::EmitInstanceCallJIT(const Code& stub,
10501053 TokenPosition token_pos,
10511054 LocationSummary* locs,
10521055 Code::EntryKind entry_kind) {
1056+ ASSERT (CanCallDart ());
10531057 ASSERT (entry_kind == Code::EntryKind::kNormal ||
10541058 entry_kind == Code::EntryKind::kUnchecked );
10551059 ASSERT (Array::Handle (zone (), ic_data.arguments_descriptor ()).Length () > 0 );
@@ -1081,6 +1085,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall(
10811085 LocationSummary* locs,
10821086 intptr_t try_index,
10831087 intptr_t slow_path_argument_count) {
1088+ ASSERT (CanCallDart ());
10841089 ASSERT (!arguments_descriptor.IsNull () && (arguments_descriptor.Length () > 0 ));
10851090 const ArgumentsDescriptor args_desc (arguments_descriptor);
10861091 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle (
@@ -1125,6 +1130,7 @@ void FlowGraphCompiler::EmitInstanceCallAOT(const ICData& ic_data,
11251130 LocationSummary* locs,
11261131 Code::EntryKind entry_kind,
11271132 bool receiver_can_be_smi) {
1133+ ASSERT (CanCallDart ());
11281134 ASSERT (ic_data.NumArgsTested () == 1 );
11291135 const Code& initial_stub = StubCode::UnlinkedCall ();
11301136 const char * switchable_call_mode = " smiable" ;
@@ -1175,6 +1181,7 @@ void FlowGraphCompiler::EmitUnoptimizedStaticCall(intptr_t count_with_type_args,
11751181 LocationSummary* locs,
11761182 const ICData& ic_data,
11771183 Code::EntryKind entry_kind) {
1184+ ASSERT (CanCallDart ());
11781185 const Code& stub =
11791186 StubCode::UnoptimizedStaticCallEntry (ic_data.NumArgsTested ());
11801187 __ LoadObject (R5, ic_data);
@@ -1191,6 +1198,7 @@ void FlowGraphCompiler::EmitOptimizedStaticCall(
11911198 TokenPosition token_pos,
11921199 LocationSummary* locs,
11931200 Code::EntryKind entry_kind) {
1201+ ASSERT (CanCallDart ());
11941202 ASSERT (!function.IsClosureFunction ());
11951203 if (function.HasOptionalParameters () || function.IsGeneric ()) {
11961204 __ LoadObject (R4, arguments_descriptor);
@@ -1210,6 +1218,7 @@ void FlowGraphCompiler::EmitDispatchTableCall(
12101218 Register cid_reg,
12111219 int32_t selector_offset,
12121220 const Array& arguments_descriptor) {
1221+ ASSERT (CanCallDart ());
12131222 ASSERT (cid_reg != ARGS_DESC_REG);
12141223 if (!arguments_descriptor.IsNull ()) {
12151224 __ LoadObject (ARGS_DESC_REG, arguments_descriptor);
0 commit comments