| 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" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
| 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/longjump.h" | 9 #include "vm/longjump.h" |
| 10 #include "vm/runtime_entry.h" | 10 #include "vm/runtime_entry.h" |
| 11 #include "vm/simulator.h" | 11 #include "vm/simulator.h" |
| 12 #include "vm/stack_frame.h" | 12 #include "vm/stack_frame.h" |
| 13 #include "vm/stub_code.h" | 13 #include "vm/stub_code.h" |
| 14 | 14 |
| 15 namespace dart { | 15 namespace dart { |
| 16 | 16 |
| 17 #if defined(USING_SIMULATOR) | 17 #if defined(USING_SIMULATOR) |
| 18 DECLARE_FLAG(bool, trace_sim); | 18 DECLARE_FLAG(int, trace_sim_after); |
| 19 #endif | 19 #endif |
| 20 DEFINE_FLAG(bool, print_stop_message, false, "Print stop message."); | 20 DEFINE_FLAG(bool, print_stop_message, false, "Print stop message."); |
| 21 DECLARE_FLAG(bool, inline_alloc); | 21 DECLARE_FLAG(bool, inline_alloc); |
| 22 | 22 |
| 23 void Assembler::InitializeMemoryWithBreakpoints(uword data, intptr_t length) { | 23 void Assembler::InitializeMemoryWithBreakpoints(uword data, intptr_t length) { |
| 24 ASSERT(Utils::IsAligned(data, 4)); | 24 ASSERT(Utils::IsAligned(data, 4)); |
| 25 ASSERT(Utils::IsAligned(length, 4)); | 25 ASSERT(Utils::IsAligned(length, 4)); |
| 26 const uword end = data + length; | 26 const uword end = data + length; |
| 27 while (data < end) { | 27 while (data < end) { |
| 28 *reinterpret_cast<int32_t*>(data) = Instr::kBreakPointInstruction; | 28 *reinterpret_cast<int32_t*>(data) = Instr::kBreakPointInstruction; |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 } | 496 } |
| 497 | 497 |
| 498 | 498 |
| 499 void Assembler::PushObject(const Object& object) { | 499 void Assembler::PushObject(const Object& object) { |
| 500 ASSERT(!in_delay_slot_); | 500 ASSERT(!in_delay_slot_); |
| 501 LoadObject(TMP, object); | 501 LoadObject(TMP, object); |
| 502 Push(TMP); | 502 Push(TMP); |
| 503 } | 503 } |
| 504 | 504 |
| 505 | 505 |
| 506 void Assembler::CompareObject(Register rd1, Register rd2, | |
| 507 Register rn, const Object& object) { | |
| 508 ASSERT(!in_delay_slot_); | |
| 509 ASSERT(rn != TMP); | |
| 510 ASSERT(rd1 != TMP); | |
| 511 ASSERT(rd1 != rd2); | |
| 512 LoadObject(TMP, object); | |
| 513 slt(rd1, rn, TMP); | |
| 514 slt(rd2, TMP, rn); | |
| 515 } | |
| 516 | |
| 517 | |
| 518 // Preserves object and value registers. | 506 // Preserves object and value registers. |
| 519 void Assembler::StoreIntoObjectFilterNoSmi(Register object, | 507 void Assembler::StoreIntoObjectFilterNoSmi(Register object, |
| 520 Register value, | 508 Register value, |
| 521 Label* no_update) { | 509 Label* no_update) { |
| 522 ASSERT(!in_delay_slot_); | 510 ASSERT(!in_delay_slot_); |
| 523 COMPILE_ASSERT((kNewObjectAlignmentOffset == kWordSize) && | 511 COMPILE_ASSERT((kNewObjectAlignmentOffset == kWordSize) && |
| 524 (kOldObjectAlignmentOffset == 0)); | 512 (kOldObjectAlignmentOffset == 0)); |
| 525 | 513 |
| 526 // Write-barrier triggers if the value is in the new space (has bit set) and | 514 // Write-barrier triggers if the value is in the new space (has bit set) and |
| 527 // the object is in the old space (has bit cleared). | 515 // the object is in the old space (has bit cleared). |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 Emit(reinterpret_cast<int32_t>(message)); | 1246 Emit(reinterpret_cast<int32_t>(message)); |
| 1259 Bind(&stop); | 1247 Bind(&stop); |
| 1260 break_(Instr::kStopMessageCode); | 1248 break_(Instr::kStopMessageCode); |
| 1261 } | 1249 } |
| 1262 | 1250 |
| 1263 | 1251 |
| 1264 void Assembler::TraceSimMsg(const char* message) { | 1252 void Assembler::TraceSimMsg(const char* message) { |
| 1265 // Don't bother adding in the messages unless tracing is enabled, and we are | 1253 // Don't bother adding in the messages unless tracing is enabled, and we are |
| 1266 // running in the simulator. | 1254 // running in the simulator. |
| 1267 #if defined(USING_SIMULATOR) | 1255 #if defined(USING_SIMULATOR) |
| 1268 if (FLAG_trace_sim) { | 1256 if (FLAG_trace_sim_after != -1) { |
| 1269 Label msg; | 1257 Label msg; |
| 1270 b(&msg); | 1258 b(&msg); |
| 1271 Emit(reinterpret_cast<int32_t>(message)); | 1259 Emit(reinterpret_cast<int32_t>(message)); |
| 1272 Bind(&msg); | 1260 Bind(&msg); |
| 1273 break_(Instr::kSimulatorMessageCode); | 1261 break_(Instr::kSimulatorMessageCode); |
| 1274 } | 1262 } |
| 1275 #endif | 1263 #endif |
| 1276 } | 1264 } |
| 1277 | 1265 |
| 1278 } // namespace dart | 1266 } // namespace dart |
| 1279 | 1267 |
| 1280 #endif // defined TARGET_ARCH_MIPS | 1268 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |