Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: runtime/vm/flow_graph_compiler_arm64.cc

Issue 2357343003: Fix lazy deoptimization in the presence of exceptions (Closed)
Patch Set: Ensure space for patching on ARM/MIPS archs Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_dbc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 const StubEntry& stub_entry, 1150 const StubEntry& stub_entry,
1151 RawPcDescriptors::Kind kind, 1151 RawPcDescriptors::Kind kind,
1152 LocationSummary* locs) { 1152 LocationSummary* locs) {
1153 __ BranchLinkPatchable(stub_entry); 1153 __ BranchLinkPatchable(stub_entry);
1154 AddCurrentDescriptor(kind, deopt_id, token_pos); 1154 AddCurrentDescriptor(kind, deopt_id, token_pos);
1155 RecordSafepoint(locs); 1155 RecordSafepoint(locs);
1156 // Marks either the continuation point in unoptimized code or the 1156 // Marks either the continuation point in unoptimized code or the
1157 // deoptimization point in optimized code, after call. 1157 // deoptimization point in optimized code, after call.
1158 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); 1158 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
1159 if (is_optimizing()) { 1159 if (is_optimizing()) {
1160 AddDeoptIndexAtCall(deopt_id_after, token_pos); 1160 AddDeoptIndexAtCall(deopt_id_after);
1161 } else { 1161 } else {
1162 // Add deoptimization continuation point after the call and before the 1162 // Add deoptimization continuation point after the call and before the
1163 // arguments are removed. 1163 // arguments are removed.
1164 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); 1164 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
1165 } 1165 }
1166 } 1166 }
1167 1167
1168 1168
1169 void FlowGraphCompiler::GenerateStaticDartCall(intptr_t deopt_id, 1169 void FlowGraphCompiler::GenerateStaticDartCall(intptr_t deopt_id,
1170 TokenPosition token_pos, 1170 TokenPosition token_pos,
1171 const StubEntry& stub_entry, 1171 const StubEntry& stub_entry,
1172 RawPcDescriptors::Kind kind, 1172 RawPcDescriptors::Kind kind,
1173 LocationSummary* locs, 1173 LocationSummary* locs,
1174 const Function& target) { 1174 const Function& target) {
1175 // Call sites to the same target can share object pool entries. These 1175 // Call sites to the same target can share object pool entries. These
1176 // call sites are never patched for breakpoints: the function is deoptimized 1176 // call sites are never patched for breakpoints: the function is deoptimized
1177 // and the unoptimized code with IC calls for static calls is patched instead. 1177 // and the unoptimized code with IC calls for static calls is patched instead.
1178 ASSERT(is_optimizing()); 1178 ASSERT(is_optimizing());
1179 __ BranchLinkWithEquivalence(stub_entry, target); 1179 __ BranchLinkWithEquivalence(stub_entry, target);
1180 1180
1181 AddCurrentDescriptor(kind, deopt_id, token_pos); 1181 AddCurrentDescriptor(kind, deopt_id, token_pos);
1182 RecordSafepoint(locs); 1182 RecordSafepoint(locs);
1183 // Marks either the continuation point in unoptimized code or the 1183 // Marks either the continuation point in unoptimized code or the
1184 // deoptimization point in optimized code, after call. 1184 // deoptimization point in optimized code, after call.
1185 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); 1185 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
1186 if (is_optimizing()) { 1186 if (is_optimizing()) {
1187 AddDeoptIndexAtCall(deopt_id_after, token_pos); 1187 AddDeoptIndexAtCall(deopt_id_after);
1188 } else { 1188 } else {
1189 // Add deoptimization continuation point after the call and before the 1189 // Add deoptimization continuation point after the call and before the
1190 // arguments are removed. 1190 // arguments are removed.
1191 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); 1191 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
1192 } 1192 }
1193 AddStaticCallTarget(target); 1193 AddStaticCallTarget(target);
1194 } 1194 }
1195 1195
1196 1196
1197 void FlowGraphCompiler::GenerateRuntimeCall(TokenPosition token_pos, 1197 void FlowGraphCompiler::GenerateRuntimeCall(TokenPosition token_pos,
1198 intptr_t deopt_id, 1198 intptr_t deopt_id,
1199 const RuntimeEntry& entry, 1199 const RuntimeEntry& entry,
1200 intptr_t argument_count, 1200 intptr_t argument_count,
1201 LocationSummary* locs) { 1201 LocationSummary* locs) {
1202 __ CallRuntime(entry, argument_count); 1202 __ CallRuntime(entry, argument_count);
1203 AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos); 1203 AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos);
1204 RecordSafepoint(locs); 1204 RecordSafepoint(locs);
1205 if (deopt_id != Thread::kNoDeoptId) { 1205 if (deopt_id != Thread::kNoDeoptId) {
1206 // Marks either the continuation point in unoptimized code or the 1206 // Marks either the continuation point in unoptimized code or the
1207 // deoptimization point in optimized code, after call. 1207 // deoptimization point in optimized code, after call.
1208 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); 1208 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
1209 if (is_optimizing()) { 1209 if (is_optimizing()) {
1210 AddDeoptIndexAtCall(deopt_id_after, token_pos); 1210 AddDeoptIndexAtCall(deopt_id_after);
1211 } else { 1211 } else {
1212 // Add deoptimization continuation point after the call and before the 1212 // Add deoptimization continuation point after the call and before the
1213 // arguments are removed. 1213 // arguments are removed.
1214 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); 1214 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
1215 } 1215 }
1216 } 1216 }
1217 } 1217 }
1218 1218
1219 1219
1220 void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) { 1220 void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 try_index = CurrentTryIndex(); 1329 try_index = CurrentTryIndex();
1330 } 1330 }
1331 pc_descriptors_list()->AddDescriptor(RawPcDescriptors::kOther, 1331 pc_descriptors_list()->AddDescriptor(RawPcDescriptors::kOther,
1332 assembler()->CodeSize(), 1332 assembler()->CodeSize(),
1333 Thread::kNoDeoptId, 1333 Thread::kNoDeoptId,
1334 token_pos, 1334 token_pos,
1335 try_index); 1335 try_index);
1336 } else if (is_optimizing()) { 1336 } else if (is_optimizing()) {
1337 AddCurrentDescriptor(RawPcDescriptors::kOther, 1337 AddCurrentDescriptor(RawPcDescriptors::kOther,
1338 Thread::kNoDeoptId, token_pos); 1338 Thread::kNoDeoptId, token_pos);
1339 AddDeoptIndexAtCall(deopt_id_after, token_pos); 1339 AddDeoptIndexAtCall(deopt_id_after);
1340 } else { 1340 } else {
1341 AddCurrentDescriptor(RawPcDescriptors::kOther, 1341 AddCurrentDescriptor(RawPcDescriptors::kOther,
1342 Thread::kNoDeoptId, token_pos); 1342 Thread::kNoDeoptId, token_pos);
1343 // Add deoptimization continuation point after the call and before the 1343 // Add deoptimization continuation point after the call and before the
1344 // arguments are removed. 1344 // arguments are removed.
1345 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); 1345 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
1346 } 1346 }
1347 __ Drop(argument_count); 1347 __ Drop(argument_count);
1348 } 1348 }
1349 1349
(...skipping 13 matching lines...) Expand all
1363 __ LoadUniqueObject(R5, ic_data); 1363 __ LoadUniqueObject(R5, ic_data);
1364 __ LoadUniqueObject(CODE_REG, initial_stub); 1364 __ LoadUniqueObject(CODE_REG, initial_stub);
1365 __ ldr(TMP, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); 1365 __ ldr(TMP, FieldAddress(CODE_REG, Code::checked_entry_point_offset()));
1366 __ blr(TMP); 1366 __ blr(TMP);
1367 1367
1368 AddCurrentDescriptor(RawPcDescriptors::kOther, 1368 AddCurrentDescriptor(RawPcDescriptors::kOther,
1369 Thread::kNoDeoptId, token_pos); 1369 Thread::kNoDeoptId, token_pos);
1370 RecordSafepoint(locs); 1370 RecordSafepoint(locs);
1371 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); 1371 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
1372 if (is_optimizing()) { 1372 if (is_optimizing()) {
1373 AddDeoptIndexAtCall(deopt_id_after, token_pos); 1373 AddDeoptIndexAtCall(deopt_id_after);
1374 } else { 1374 } else {
1375 // Add deoptimization continuation point after the call and before the 1375 // Add deoptimization continuation point after the call and before the
1376 // arguments are removed. 1376 // arguments are removed.
1377 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); 1377 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
1378 } 1378 }
1379 __ Drop(argument_count); 1379 __ Drop(argument_count);
1380 } 1380 }
1381 1381
1382 1382
1383 void FlowGraphCompiler::EmitUnoptimizedStaticCall( 1383 void FlowGraphCompiler::EmitUnoptimizedStaticCall(
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
1933 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { 1933 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
1934 __ PopDouble(reg); 1934 __ PopDouble(reg);
1935 } 1935 }
1936 1936
1937 1937
1938 #undef __ 1938 #undef __
1939 1939
1940 } // namespace dart 1940 } // namespace dart
1941 1941
1942 #endif // defined TARGET_ARCH_ARM64 1942 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698