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

Side by Side Diff: runtime/vm/stub_code_mips.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) 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" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 __ lw(T0, FieldAddress(S5, ICData::state_bits_offset())); 1398 __ lw(T0, FieldAddress(S5, ICData::state_bits_offset()));
1399 ASSERT(ICData::NumArgsTestedShift() == 0); // No shift needed. 1399 ASSERT(ICData::NumArgsTestedShift() == 0); // No shift needed.
1400 __ andi(T0, T0, Immediate(ICData::NumArgsTestedMask())); 1400 __ andi(T0, T0, Immediate(ICData::NumArgsTestedMask()));
1401 __ BranchEqual(T0, num_args, &ok); 1401 __ BranchEqual(T0, num_args, &ok);
1402 __ Stop("Incorrect stub for IC data"); 1402 __ Stop("Incorrect stub for IC data");
1403 __ Bind(&ok); 1403 __ Bind(&ok);
1404 } 1404 }
1405 #endif // DEBUG 1405 #endif // DEBUG
1406 1406
1407 1407
1408 Label stepping, done_stepping;
1408 if (FLAG_enable_debugger) { 1409 if (FLAG_enable_debugger) {
1409 // Check single stepping. 1410 // Check single stepping.
1410 Label not_stepping;
1411 __ lw(T0, FieldAddress(CTX, Context::isolate_offset())); 1411 __ lw(T0, FieldAddress(CTX, Context::isolate_offset()));
1412 __ lbu(T0, Address(T0, Isolate::single_step_offset())); 1412 __ lbu(T0, Address(T0, Isolate::single_step_offset()));
1413 __ BranchEqual(T0, 0, &not_stepping); 1413 __ BranchNotEqual(T0, 0, &stepping);
1414 // Call single step callback in debugger. 1414 __ Bind(&done_stepping);
1415 __ EnterStubFrame();
1416 __ addiu(SP, SP, Immediate(-2 * kWordSize));
1417 __ sw(S5, Address(SP, 1 * kWordSize)); // Preserve IC data.
1418 __ sw(RA, Address(SP, 0 * kWordSize)); // Return address.
1419 __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
1420 __ lw(RA, Address(SP, 0 * kWordSize));
1421 __ lw(S5, Address(SP, 1 * kWordSize));
1422 __ addiu(SP, SP, Immediate(2 * kWordSize));
1423 __ LeaveStubFrame();
1424 __ Bind(&not_stepping);
1425 } 1415 }
1426 1416
1427 // Load argument descriptor into S4. 1417 // Load argument descriptor into S4.
1428 __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset())); 1418 __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset()));
1429 // Preserve return address, since RA is needed for subroutine call. 1419 // Preserve return address, since RA is needed for subroutine call.
1430 __ mov(T2, RA); 1420 __ mov(T2, RA);
1431 // Loop that checks if there is an IC data match. 1421 // Loop that checks if there is an IC data match.
1432 Label loop, update, test, found; 1422 Label loop, update, test, found;
1433 // S5: IC data object (preserved). 1423 // S5: IC data object (preserved).
1434 __ lw(T0, FieldAddress(S5, ICData::ic_data_offset())); 1424 __ lw(T0, FieldAddress(S5, ICData::ic_data_offset()));
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 __ movz(T4, T7, CMPRES1); 1539 __ movz(T4, T7, CMPRES1);
1550 __ sw(T4, Address(T0, count_offset)); 1540 __ sw(T4, Address(T0, count_offset));
1551 1541
1552 __ Bind(&call_target_function); 1542 __ Bind(&call_target_function);
1553 // T0 <- T3: Target function. 1543 // T0 <- T3: Target function.
1554 __ mov(T0, T3); 1544 __ mov(T0, T3);
1555 Label is_compiled; 1545 Label is_compiled;
1556 __ lw(T4, FieldAddress(T0, Function::instructions_offset())); 1546 __ lw(T4, FieldAddress(T0, Function::instructions_offset()));
1557 __ AddImmediate(T4, Instructions::HeaderSize() - kHeapObjectTag); 1547 __ AddImmediate(T4, Instructions::HeaderSize() - kHeapObjectTag);
1558 __ jr(T4); 1548 __ jr(T4);
1549
1550 if (FLAG_enable_debugger) {
1551 // Call single step callback in debugger.
1552 __ Bind(&stepping);
1553 __ EnterStubFrame();
1554 __ addiu(SP, SP, Immediate(-2 * kWordSize));
1555 __ sw(S5, Address(SP, 1 * kWordSize)); // Preserve IC data.
1556 __ sw(RA, Address(SP, 0 * kWordSize)); // Return address.
1557 __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
1558 __ lw(RA, Address(SP, 0 * kWordSize));
1559 __ lw(S5, Address(SP, 1 * kWordSize));
1560 __ addiu(SP, SP, Immediate(2 * kWordSize));
1561 __ LeaveStubFrame();
1562 __ b(&done_stepping);
1563 }
1559 } 1564 }
1560 1565
1561 1566
1562 // Use inline cache data array to invoke the target or continue in inline 1567 // Use inline cache data array to invoke the target or continue in inline
1563 // cache miss handler. Stub for 1-argument check (receiver class). 1568 // cache miss handler. Stub for 1-argument check (receiver class).
1564 // RA: Return address. 1569 // RA: Return address.
1565 // S5: Inline cache data object. 1570 // S5: Inline cache data object.
1566 // Inline cache data object structure: 1571 // Inline cache data object structure:
1567 // 0: function-name 1572 // 0: function-name
1568 // 1: N, number of arguments checked. 1573 // 1: N, number of arguments checked.
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 const Register right = T0; 2067 const Register right = T0;
2063 __ lw(left, Address(SP, 1 * kWordSize)); 2068 __ lw(left, Address(SP, 1 * kWordSize));
2064 __ lw(right, Address(SP, 0 * kWordSize)); 2069 __ lw(right, Address(SP, 0 * kWordSize));
2065 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); 2070 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2);
2066 __ Ret(); 2071 __ Ret();
2067 } 2072 }
2068 2073
2069 } // namespace dart 2074 } // namespace dart
2070 2075
2071 #endif // defined TARGET_ARCH_MIPS 2076 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698