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

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

Issue 335443002: Setup R10/EDX to be valid Oops before stub calls (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 } 1208 }
1209 1209
1210 1210
1211 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, 1211 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label,
1212 const ICData& ic_data, 1212 const ICData& ic_data,
1213 intptr_t argument_count, 1213 intptr_t argument_count,
1214 intptr_t deopt_id, 1214 intptr_t deopt_id,
1215 intptr_t token_pos, 1215 intptr_t token_pos,
1216 LocationSummary* locs) { 1216 LocationSummary* locs) {
1217 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0); 1217 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0);
1218 __ LoadImmediate(R4, 0, kNoPP);
1218 __ LoadObject(R5, ic_data, PP); 1219 __ LoadObject(R5, ic_data, PP);
1219 GenerateDartCall(deopt_id, 1220 GenerateDartCall(deopt_id,
1220 token_pos, 1221 token_pos,
1221 target_label, 1222 target_label,
1222 PcDescriptors::kIcCall, 1223 PcDescriptors::kIcCall,
1223 locs); 1224 locs);
1224 __ Drop(argument_count); 1225 __ Drop(argument_count);
1226 #if defined(DEBUG)
1227 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP);
1228 #endif
1225 } 1229 }
1226 1230
1227 1231
1228 void FlowGraphCompiler::EmitMegamorphicInstanceCall( 1232 void FlowGraphCompiler::EmitMegamorphicInstanceCall(
1229 const ICData& ic_data, 1233 const ICData& ic_data,
1230 intptr_t argument_count, 1234 intptr_t argument_count,
1231 intptr_t deopt_id, 1235 intptr_t deopt_id,
1232 intptr_t token_pos, 1236 intptr_t token_pos,
1233 LocationSummary* locs) { 1237 LocationSummary* locs) {
1234 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); 1238 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 const ICData& ic_data) { 1298 const ICData& ic_data) {
1295 uword label_address = 0; 1299 uword label_address = 0;
1296 if (ic_data.NumArgsTested() == 0) { 1300 if (ic_data.NumArgsTested() == 0) {
1297 label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint(); 1301 label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint();
1298 } else if (ic_data.NumArgsTested() == 2) { 1302 } else if (ic_data.NumArgsTested() == 2) {
1299 label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint(); 1303 label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint();
1300 } else { 1304 } else {
1301 UNIMPLEMENTED(); 1305 UNIMPLEMENTED();
1302 } 1306 }
1303 ExternalLabel target_label(label_address); 1307 ExternalLabel target_label(label_address);
1308 __ LoadImmediate(R4, 0, kNoPP);
1304 __ LoadObject(R5, ic_data, PP); 1309 __ LoadObject(R5, ic_data, PP);
1305 GenerateDartCall(deopt_id, 1310 GenerateDartCall(deopt_id,
1306 token_pos, 1311 token_pos,
1307 &target_label, 1312 &target_label,
1308 PcDescriptors::kUnoptStaticCall, 1313 PcDescriptors::kUnoptStaticCall,
1309 locs); 1314 locs);
1315 #if defined(DEBUG)
1316 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP);
1317 #endif
1310 __ Drop(argument_count); 1318 __ Drop(argument_count);
1311 } 1319 }
1312 1320
1313 1321
1314 void FlowGraphCompiler::EmitOptimizedStaticCall( 1322 void FlowGraphCompiler::EmitOptimizedStaticCall(
1315 const Function& function, 1323 const Function& function,
1316 const Array& arguments_descriptor, 1324 const Array& arguments_descriptor,
1317 intptr_t argument_count, 1325 intptr_t argument_count,
1318 intptr_t deopt_id, 1326 intptr_t deopt_id,
1319 intptr_t token_pos, 1327 intptr_t token_pos,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 Register right, 1372 Register right,
1365 bool needs_number_check, 1373 bool needs_number_check,
1366 intptr_t token_pos) { 1374 intptr_t token_pos) {
1367 if (needs_number_check) { 1375 if (needs_number_check) {
1368 __ Push(left); 1376 __ Push(left);
1369 __ Push(right); 1377 __ Push(right);
1370 if (is_optimizing()) { 1378 if (is_optimizing()) {
1371 __ BranchLinkPatchable( 1379 __ BranchLinkPatchable(
1372 &StubCode::OptimizedIdenticalWithNumberCheckLabel()); 1380 &StubCode::OptimizedIdenticalWithNumberCheckLabel());
1373 } else { 1381 } else {
1382 __ LoadImmediate(R4, 0, kNoPP);
1383 __ LoadImmediate(R5, 0, kNoPP);
1374 __ BranchLinkPatchable( 1384 __ BranchLinkPatchable(
1375 &StubCode::UnoptimizedIdenticalWithNumberCheckLabel()); 1385 &StubCode::UnoptimizedIdenticalWithNumberCheckLabel());
1376 } 1386 }
1377 if (token_pos != Scanner::kNoSourcePos) { 1387 if (token_pos != Scanner::kNoSourcePos) {
1378 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, 1388 AddCurrentDescriptor(PcDescriptors::kRuntimeCall,
1379 Isolate::kNoDeoptId, 1389 Isolate::kNoDeoptId,
1380 token_pos); 1390 token_pos);
1381 } 1391 }
1392 #if defined(DEBUG)
1393 if (!is_optimizing()) {
1394 // Do this *after* adding the pc descriptor!
1395 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP);
1396 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP);
1397 }
1398 #endif
1382 // Stub returns result in flags (result of a cmpl, we need ZF computed). 1399 // Stub returns result in flags (result of a cmpl, we need ZF computed).
1383 __ Pop(right); 1400 __ Pop(right);
1384 __ Pop(left); 1401 __ Pop(left);
1385 } else { 1402 } else {
1386 __ CompareRegisters(left, right); 1403 __ CompareRegisters(left, right);
1387 } 1404 }
1388 } 1405 }
1389 1406
1390 1407
1391 // This function must be in sync with FlowGraphCompiler::RecordSafepoint and 1408 // This function must be in sync with FlowGraphCompiler::RecordSafepoint and
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1709 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { 1726 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
1710 UNIMPLEMENTED(); 1727 UNIMPLEMENTED();
1711 } 1728 }
1712 1729
1713 1730
1714 #undef __ 1731 #undef __
1715 1732
1716 } // namespace dart 1733 } // namespace dart
1717 1734
1718 #endif // defined TARGET_ARCH_ARM64 1735 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698