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

Side by Side Diff: runtime/vm/flow_graph_compiler_arm.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.cc ('k') | runtime/vm/flow_graph_compiler_arm64.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
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 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 const StubEntry& stub_entry, 1156 const StubEntry& stub_entry,
1157 RawPcDescriptors::Kind kind, 1157 RawPcDescriptors::Kind kind,
1158 LocationSummary* locs) { 1158 LocationSummary* locs) {
1159 __ BranchLinkPatchable(stub_entry); 1159 __ BranchLinkPatchable(stub_entry);
1160 AddCurrentDescriptor(kind, deopt_id, token_pos); 1160 AddCurrentDescriptor(kind, deopt_id, token_pos);
1161 RecordSafepoint(locs); 1161 RecordSafepoint(locs);
1162 // Marks either the continuation point in unoptimized code or the 1162 // Marks either the continuation point in unoptimized code or the
1163 // deoptimization point in optimized code, after call. 1163 // deoptimization point in optimized code, after call.
1164 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); 1164 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
1165 if (is_optimizing()) { 1165 if (is_optimizing()) {
1166 AddDeoptIndexAtCall(deopt_id_after, token_pos); 1166 AddDeoptIndexAtCall(deopt_id_after);
1167 } else { 1167 } else {
1168 // Add deoptimization continuation point after the call and before the 1168 // Add deoptimization continuation point after the call and before the
1169 // arguments are removed. 1169 // arguments are removed.
1170 AddCurrentDescriptor(RawPcDescriptors::kDeopt, 1170 AddCurrentDescriptor(RawPcDescriptors::kDeopt,
1171 deopt_id_after, token_pos); 1171 deopt_id_after, token_pos);
1172 } 1172 }
1173 } 1173 }
1174 1174
1175 1175
1176 void FlowGraphCompiler::GenerateStaticDartCall(intptr_t deopt_id, 1176 void FlowGraphCompiler::GenerateStaticDartCall(intptr_t deopt_id,
1177 TokenPosition token_pos, 1177 TokenPosition token_pos,
1178 const StubEntry& stub_entry, 1178 const StubEntry& stub_entry,
1179 RawPcDescriptors::Kind kind, 1179 RawPcDescriptors::Kind kind,
1180 LocationSummary* locs, 1180 LocationSummary* locs,
1181 const Function& target) { 1181 const Function& target) {
1182 // Call sites to the same target can share object pool entries. These 1182 // Call sites to the same target can share object pool entries. These
1183 // call sites are never patched for breakpoints: the function is deoptimized 1183 // call sites are never patched for breakpoints: the function is deoptimized
1184 // and the unoptimized code with IC calls for static calls is patched instead. 1184 // and the unoptimized code with IC calls for static calls is patched instead.
1185 ASSERT(is_optimizing()); 1185 ASSERT(is_optimizing());
1186 __ BranchLinkWithEquivalence(stub_entry, target); 1186 __ BranchLinkWithEquivalence(stub_entry, target);
1187 1187
1188 AddCurrentDescriptor(kind, deopt_id, token_pos); 1188 AddCurrentDescriptor(kind, deopt_id, token_pos);
1189 RecordSafepoint(locs); 1189 RecordSafepoint(locs);
1190 // Marks either the continuation point in unoptimized code or the 1190 // Marks either the continuation point in unoptimized code or the
1191 // deoptimization point in optimized code, after call. 1191 // deoptimization point in optimized code, after call.
1192 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); 1192 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
1193 if (is_optimizing()) { 1193 if (is_optimizing()) {
1194 AddDeoptIndexAtCall(deopt_id_after, token_pos); 1194 AddDeoptIndexAtCall(deopt_id_after);
1195 } else { 1195 } else {
1196 // Add deoptimization continuation point after the call and before the 1196 // Add deoptimization continuation point after the call and before the
1197 // arguments are removed. 1197 // arguments are removed.
1198 AddCurrentDescriptor(RawPcDescriptors::kDeopt, 1198 AddCurrentDescriptor(RawPcDescriptors::kDeopt,
1199 deopt_id_after, token_pos); 1199 deopt_id_after, token_pos);
1200 } 1200 }
1201 AddStaticCallTarget(target); 1201 AddStaticCallTarget(target);
1202 } 1202 }
1203 1203
1204 1204
1205 void FlowGraphCompiler::GenerateRuntimeCall(TokenPosition token_pos, 1205 void FlowGraphCompiler::GenerateRuntimeCall(TokenPosition token_pos,
1206 intptr_t deopt_id, 1206 intptr_t deopt_id,
1207 const RuntimeEntry& entry, 1207 const RuntimeEntry& entry,
1208 intptr_t argument_count, 1208 intptr_t argument_count,
1209 LocationSummary* locs) { 1209 LocationSummary* locs) {
1210 __ CallRuntime(entry, argument_count); 1210 __ CallRuntime(entry, argument_count);
1211 AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos); 1211 AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos);
1212 RecordSafepoint(locs); 1212 RecordSafepoint(locs);
1213 if (deopt_id != Thread::kNoDeoptId) { 1213 if (deopt_id != Thread::kNoDeoptId) {
1214 // Marks either the continuation point in unoptimized code or the 1214 // Marks either the continuation point in unoptimized code or the
1215 // deoptimization point in optimized code, after call. 1215 // deoptimization point in optimized code, after call.
1216 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); 1216 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
1217 if (is_optimizing()) { 1217 if (is_optimizing()) {
1218 AddDeoptIndexAtCall(deopt_id_after, token_pos); 1218 AddDeoptIndexAtCall(deopt_id_after);
1219 } else { 1219 } else {
1220 // Add deoptimization continuation point after the call and before the 1220 // Add deoptimization continuation point after the call and before the
1221 // arguments are removed. 1221 // arguments are removed.
1222 AddCurrentDescriptor(RawPcDescriptors::kDeopt, 1222 AddCurrentDescriptor(RawPcDescriptors::kDeopt,
1223 deopt_id_after, 1223 deopt_id_after,
1224 token_pos); 1224 token_pos);
1225 } 1225 }
1226 } 1226 }
1227 } 1227 }
1228 1228
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 try_index = CurrentTryIndex(); 1347 try_index = CurrentTryIndex();
1348 } 1348 }
1349 pc_descriptors_list()->AddDescriptor(RawPcDescriptors::kOther, 1349 pc_descriptors_list()->AddDescriptor(RawPcDescriptors::kOther,
1350 assembler()->CodeSize(), 1350 assembler()->CodeSize(),
1351 Thread::kNoDeoptId, 1351 Thread::kNoDeoptId,
1352 token_pos, 1352 token_pos,
1353 try_index); 1353 try_index);
1354 } else if (is_optimizing()) { 1354 } else if (is_optimizing()) {
1355 AddCurrentDescriptor(RawPcDescriptors::kOther, 1355 AddCurrentDescriptor(RawPcDescriptors::kOther,
1356 Thread::kNoDeoptId, token_pos); 1356 Thread::kNoDeoptId, token_pos);
1357 AddDeoptIndexAtCall(deopt_id_after, token_pos); 1357 AddDeoptIndexAtCall(deopt_id_after);
1358 } else { 1358 } else {
1359 AddCurrentDescriptor(RawPcDescriptors::kOther, 1359 AddCurrentDescriptor(RawPcDescriptors::kOther,
1360 Thread::kNoDeoptId, token_pos); 1360 Thread::kNoDeoptId, token_pos);
1361 // Add deoptimization continuation point after the call and before the 1361 // Add deoptimization continuation point after the call and before the
1362 // arguments are removed. 1362 // arguments are removed.
1363 AddCurrentDescriptor(RawPcDescriptors::kDeopt, 1363 AddCurrentDescriptor(RawPcDescriptors::kDeopt,
1364 deopt_id_after, token_pos); 1364 deopt_id_after, token_pos);
1365 } 1365 }
1366 __ Drop(argument_count); 1366 __ Drop(argument_count);
1367 } 1367 }
(...skipping 14 matching lines...) Expand all
1382 __ LoadFromOffset(kWord, R0, SP, (argument_count - 1) * kWordSize); 1382 __ LoadFromOffset(kWord, R0, SP, (argument_count - 1) * kWordSize);
1383 __ LoadUniqueObject(R9, ic_data); 1383 __ LoadUniqueObject(R9, ic_data);
1384 __ LoadUniqueObject(CODE_REG, initial_stub); 1384 __ LoadUniqueObject(CODE_REG, initial_stub);
1385 __ ldr(LR, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); 1385 __ ldr(LR, FieldAddress(CODE_REG, Code::checked_entry_point_offset()));
1386 __ blx(LR); 1386 __ blx(LR);
1387 1387
1388 AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos); 1388 AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos);
1389 RecordSafepoint(locs); 1389 RecordSafepoint(locs);
1390 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); 1390 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
1391 if (is_optimizing()) { 1391 if (is_optimizing()) {
1392 AddDeoptIndexAtCall(deopt_id_after, token_pos); 1392 AddDeoptIndexAtCall(deopt_id_after);
1393 } else { 1393 } else {
1394 // Add deoptimization continuation point after the call and before the 1394 // Add deoptimization continuation point after the call and before the
1395 // arguments are removed. 1395 // arguments are removed.
1396 AddCurrentDescriptor(RawPcDescriptors::kDeopt, 1396 AddCurrentDescriptor(RawPcDescriptors::kDeopt,
1397 deopt_id_after, token_pos); 1397 deopt_id_after, token_pos);
1398 } 1398 }
1399 __ Drop(argument_count); 1399 __ Drop(argument_count);
1400 } 1400 }
1401 1401
1402 1402
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
1996 DRegister dreg = EvenDRegisterOf(reg); 1996 DRegister dreg = EvenDRegisterOf(reg);
1997 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); 1997 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex));
1998 } 1998 }
1999 1999
2000 2000
2001 #undef __ 2001 #undef __
2002 2002
2003 } // namespace dart 2003 } // namespace dart
2004 2004
2005 #endif // defined TARGET_ARCH_ARM 2005 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/flow_graph_compiler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698