| OLD | NEW |
| 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/runtime_entry.h" | 9 #include "vm/runtime_entry.h" |
| 10 #include "vm/simulator.h" | 10 #include "vm/simulator.h" |
| 11 #include "vm/stub_code.h" | 11 #include "vm/stub_code.h" |
| 12 | 12 |
| 13 namespace dart { | 13 namespace dart { |
| 14 | 14 |
| 15 #if defined(USING_SIMULATOR) |
| 15 DECLARE_FLAG(bool, trace_sim); | 16 DECLARE_FLAG(bool, trace_sim); |
| 17 #endif |
| 16 DEFINE_FLAG(bool, print_stop_message, false, "Print stop message."); | 18 DEFINE_FLAG(bool, print_stop_message, false, "Print stop message."); |
| 17 | 19 |
| 18 | 20 |
| 19 void Assembler::InitializeMemoryWithBreakpoints(uword data, int length) { | 21 void Assembler::InitializeMemoryWithBreakpoints(uword data, int length) { |
| 20 ASSERT(Utils::IsAligned(data, 4)); | 22 ASSERT(Utils::IsAligned(data, 4)); |
| 21 ASSERT(Utils::IsAligned(length, 4)); | 23 ASSERT(Utils::IsAligned(length, 4)); |
| 22 const uword end = data + length; | 24 const uword end = data + length; |
| 23 while (data < end) { | 25 while (data < end) { |
| 24 *reinterpret_cast<int32_t*>(data) = Instr::kBreakPointInstruction; | 26 *reinterpret_cast<int32_t*>(data) = Instr::kBreakPointInstruction; |
| 25 data += 4; | 27 data += 4; |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 } | 570 } |
| 569 Label stop; | 571 Label stop; |
| 570 b(&stop); | 572 b(&stop); |
| 571 Emit(reinterpret_cast<int32_t>(message)); | 573 Emit(reinterpret_cast<int32_t>(message)); |
| 572 Bind(&stop); | 574 Bind(&stop); |
| 573 break_(Instr::kStopMessageCode); | 575 break_(Instr::kStopMessageCode); |
| 574 } | 576 } |
| 575 | 577 |
| 576 | 578 |
| 577 void Assembler::TraceSimMsg(const char* message) { | 579 void Assembler::TraceSimMsg(const char* message) { |
| 578 // Don't bother adding in the messages unless tracing is enabled. | 580 // Don't bother adding in the messages unless tracing is enabled, and we are |
| 581 // running in the simulator. |
| 582 #if defined(USING_SIMULATOR) |
| 579 if (FLAG_trace_sim) { | 583 if (FLAG_trace_sim) { |
| 580 Label msg; | 584 Label msg; |
| 581 b(&msg); | 585 b(&msg); |
| 582 Emit(reinterpret_cast<int32_t>(message)); | 586 Emit(reinterpret_cast<int32_t>(message)); |
| 583 Bind(&msg); | 587 Bind(&msg); |
| 584 break_(Instr::kMsgMessageCode); | 588 break_(Instr::kMsgMessageCode); |
| 585 } | 589 } |
| 590 #endif |
| 586 } | 591 } |
| 587 | 592 |
| 588 } // namespace dart | 593 } // namespace dart |
| 589 | 594 |
| 590 #endif // defined TARGET_ARCH_MIPS | 595 #endif // defined TARGET_ARCH_MIPS |
| 591 | 596 |
| OLD | NEW |