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

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

Issue 387063002: Moves infrequently used debugger code in CheckInlineCachestub. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 kNoPP, kUnsignedWord); 1340 kNoPP, kUnsignedWord);
1341 ASSERT(ICData::NumArgsTestedShift() == 0); // No shift needed. 1341 ASSERT(ICData::NumArgsTestedShift() == 0); // No shift needed.
1342 __ andi(R6, R6, ICData::NumArgsTestedMask()); 1342 __ andi(R6, R6, ICData::NumArgsTestedMask());
1343 __ CompareImmediate(R6, num_args, kNoPP); 1343 __ CompareImmediate(R6, num_args, kNoPP);
1344 __ b(&ok, EQ); 1344 __ b(&ok, EQ);
1345 __ Stop("Incorrect stub for IC data"); 1345 __ Stop("Incorrect stub for IC data");
1346 __ Bind(&ok); 1346 __ Bind(&ok);
1347 } 1347 }
1348 #endif // DEBUG 1348 #endif // DEBUG
1349 1349
1350 Label stepping, done_stepping;
1350 if (FLAG_enable_debugger) { 1351 if (FLAG_enable_debugger) {
1351 // Check single stepping. 1352 // Check single stepping.
1352 Label not_stepping;
1353 __ LoadFieldFromOffset(R6, CTX, Context::isolate_offset(), kNoPP); 1353 __ LoadFieldFromOffset(R6, CTX, Context::isolate_offset(), kNoPP);
1354 __ LoadFromOffset( 1354 __ LoadFromOffset(
1355 R6, R6, Isolate::single_step_offset(), kNoPP, kUnsignedByte); 1355 R6, R6, Isolate::single_step_offset(), kNoPP, kUnsignedByte);
1356 __ CompareRegisters(R6, ZR); 1356 __ CompareRegisters(R6, ZR);
1357 __ b(&not_stepping, EQ); 1357 __ b(&stepping, NE);
1358 __ EnterStubFrame(); 1358 __ Bind(&done_stepping);
1359 __ Push(R5); // Preserve IC data.
1360 __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
1361 __ Pop(R5);
1362 __ LeaveStubFrame();
1363 __ Bind(&not_stepping);
1364 } 1359 }
1365 1360
1366 // Load arguments descriptor into R4. 1361 // Load arguments descriptor into R4.
1367 __ LoadFieldFromOffset(R4, R5, ICData::arguments_descriptor_offset(), kNoPP); 1362 __ LoadFieldFromOffset(R4, R5, ICData::arguments_descriptor_offset(), kNoPP);
1368 // Loop that checks if there is an IC data match. 1363 // Loop that checks if there is an IC data match.
1369 Label loop, update, test, found; 1364 Label loop, update, test, found;
1370 // R5: IC data object (preserved). 1365 // R5: IC data object (preserved).
1371 __ LoadFieldFromOffset(R6, R5, ICData::ic_data_offset(), kNoPP); 1366 __ LoadFieldFromOffset(R6, R5, ICData::ic_data_offset(), kNoPP);
1372 // R6: ic_data_array with check entries: classes and target functions. 1367 // R6: ic_data_array with check entries: classes and target functions.
1373 __ AddImmediate(R6, R6, Array::data_offset() - kHeapObjectTag, kNoPP); 1368 __ AddImmediate(R6, R6, Array::data_offset() - kHeapObjectTag, kNoPP);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 __ LoadImmediate(R2, Smi::RawValue(Smi::kMaxValue), kNoPP); 1464 __ LoadImmediate(R2, Smi::RawValue(Smi::kMaxValue), kNoPP);
1470 __ csel(R1, R2, R1, VS); // Overflow. 1465 __ csel(R1, R2, R1, VS); // Overflow.
1471 __ StoreToOffset(R1, R6, count_offset, kNoPP); 1466 __ StoreToOffset(R1, R6, count_offset, kNoPP);
1472 1467
1473 __ Bind(&call_target_function); 1468 __ Bind(&call_target_function);
1474 // R0: target function. 1469 // R0: target function.
1475 __ LoadFieldFromOffset(R2, R0, Function::instructions_offset(), kNoPP); 1470 __ LoadFieldFromOffset(R2, R0, Function::instructions_offset(), kNoPP);
1476 __ AddImmediate( 1471 __ AddImmediate(
1477 R2, R2, Instructions::HeaderSize() - kHeapObjectTag, kNoPP); 1472 R2, R2, Instructions::HeaderSize() - kHeapObjectTag, kNoPP);
1478 __ br(R2); 1473 __ br(R2);
1474
1475 if (FLAG_enable_debugger) {
1476 __ Bind(&stepping);
1477 __ EnterStubFrame();
1478 __ Push(R5); // Preserve IC data.
1479 __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
1480 __ Pop(R5);
1481 __ LeaveStubFrame();
1482 __ b(&done_stepping);
1483 }
1479 } 1484 }
1480 1485
1481 1486
1482 // Use inline cache data array to invoke the target or continue in inline 1487 // Use inline cache data array to invoke the target or continue in inline
1483 // cache miss handler. Stub for 1-argument check (receiver class). 1488 // cache miss handler. Stub for 1-argument check (receiver class).
1484 // LR: return address. 1489 // LR: return address.
1485 // R5: inline cache data object. 1490 // R5: inline cache data object.
1486 // Inline cache data object structure: 1491 // Inline cache data object structure:
1487 // 0: function-name 1492 // 0: function-name
1488 // 1: N, number of arguments checked. 1493 // 1: N, number of arguments checked.
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1932 const Register right = R0; 1937 const Register right = R0;
1933 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); 1938 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP);
1934 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); 1939 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP);
1935 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 1940 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
1936 __ ret(); 1941 __ ret();
1937 } 1942 }
1938 1943
1939 } // namespace dart 1944 } // namespace dart
1940 1945
1941 #endif // defined TARGET_ARCH_ARM64 1946 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698