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

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

Issue 1097413004: Use a breakpoint instruction for a stop message on arm instead of (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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
« no previous file with comments | « runtime/vm/assembler_arm.h ('k') | runtime/vm/assembler_arm64.h » ('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" // NOLINT 5 #include "vm/globals.h" // NOLINT
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 QRegister qd, QRegister qn, QRegister qm) { 1463 QRegister qd, QRegister qn, QRegister qm) {
1464 EmitSIMDqqq(B24 | B9 | B8, sz, qd, qn, qm); 1464 EmitSIMDqqq(B24 | B9 | B8, sz, qd, qn, qm);
1465 } 1465 }
1466 1466
1467 1467
1468 void Assembler::vcgtqs(QRegister qd, QRegister qn, QRegister qm) { 1468 void Assembler::vcgtqs(QRegister qd, QRegister qn, QRegister qm) {
1469 EmitSIMDqqq(B24 | B21 | B11 | B10 | B9, kSWord, qd, qn, qm); 1469 EmitSIMDqqq(B24 | B21 | B11 | B10 | B9, kSWord, qd, qn, qm);
1470 } 1470 }
1471 1471
1472 1472
1473 void Assembler::svc(uint32_t imm24, Condition cond) {
1474 ASSERT(cond != kNoCondition);
1475 ASSERT(imm24 < (1 << 24));
1476 int32_t encoding = (cond << kConditionShift) | B27 | B26 | B25 | B24 | imm24;
1477 Emit(encoding);
1478 }
1479
1480
1481 void Assembler::bkpt(uint16_t imm16) { 1473 void Assembler::bkpt(uint16_t imm16) {
1482 // bkpt requires that the cond field is AL. 1474 // bkpt requires that the cond field is AL.
1483 int32_t encoding = (AL << kConditionShift) | B24 | B21 | 1475 int32_t encoding = (AL << kConditionShift) | B24 | B21 |
1484 ((imm16 >> 4) << 8) | B6 | B5 | B4 | (imm16 & 0xf); 1476 ((imm16 >> 4) << 8) | B6 | B5 | B4 | (imm16 & 0xf);
1485 Emit(encoding); 1477 Emit(encoding);
1486 } 1478 }
1487 1479
1488 1480
1489 void Assembler::b(Label* label, Condition cond) { 1481 void Assembler::b(Label* label, Condition cond) {
1490 EmitBranch(cond, label, false); 1482 EmitBranch(cond, label, false);
(...skipping 1987 matching lines...) Expand 10 before | Expand all | Expand 10 after
3478 BranchLink(&stub_code->PrintStopMessageLabel()); // Passing message in R0. 3470 BranchLink(&stub_code->PrintStopMessageLabel()); // Passing message in R0.
3479 PopList((1 << R0) | (1 << IP) | (1 << LR)); // Restore R0, IP, LR. 3471 PopList((1 << R0) | (1 << IP) | (1 << LR)); // Restore R0, IP, LR.
3480 } 3472 }
3481 // Emit the message address before the svc instruction, so that we can 3473 // Emit the message address before the svc instruction, so that we can
3482 // 'unstop' and continue execution in the simulator or jump to the next 3474 // 'unstop' and continue execution in the simulator or jump to the next
3483 // instruction in gdb. 3475 // instruction in gdb.
3484 Label stop; 3476 Label stop;
3485 b(&stop); 3477 b(&stop);
3486 Emit(reinterpret_cast<int32_t>(message)); 3478 Emit(reinterpret_cast<int32_t>(message));
3487 Bind(&stop); 3479 Bind(&stop);
3488 svc(kStopMessageSvcCode); 3480 bkpt(Instr::kStopMessageCode);
3489 } 3481 }
3490 3482
3491 3483
3492 Address Assembler::ElementAddressForIntIndex(bool is_load, 3484 Address Assembler::ElementAddressForIntIndex(bool is_load,
3493 bool is_external, 3485 bool is_external,
3494 intptr_t cid, 3486 intptr_t cid,
3495 intptr_t index_scale, 3487 intptr_t index_scale,
3496 Register array, 3488 Register array,
3497 intptr_t index, 3489 intptr_t index,
3498 Register temp) { 3490 Register temp) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
3577 3569
3578 3570
3579 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3571 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3580 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); 3572 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters));
3581 return fpu_reg_names[reg]; 3573 return fpu_reg_names[reg];
3582 } 3574 }
3583 3575
3584 } // namespace dart 3576 } // namespace dart
3585 3577
3586 #endif // defined TARGET_ARCH_ARM 3578 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm.h ('k') | runtime/vm/assembler_arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698