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

Unified Diff: runtime/vm/simulator_mips.cc

Issue 1722013002: Enable concurrent sweep on MIPS and ARM64. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/simulator_mips.cc
diff --git a/runtime/vm/simulator_mips.cc b/runtime/vm/simulator_mips.cc
index 2b03da8d0d0d0d626cab4e06f37b98280806b314..93fae367943e89531cfc96537d5cc3050c639903 100644
--- a/runtime/vm/simulator_mips.cc
+++ b/runtime/vm/simulator_mips.cc
@@ -1173,9 +1173,9 @@ intptr_t Simulator::WriteExclusiveW(uword addr, intptr_t value, Instr* instr) {
bool write_allowed = HasExclusiveAccessAndOpen(addr);
if (write_allowed) {
WriteW(addr, value, instr);
- return 0; // Success.
+ return 1; // Success.
}
- return 1; // Failure.
+ return 0; // Failure.
}
@@ -2169,6 +2169,19 @@ void Simulator::InstructionDecode(Instr* instr) {
set_register(instr->RtField(), instr->UImmField() << 16);
break;
}
+ case LL: {
+ // Format(instr, "ll 'rt, 'imms('rs)");
+ int32_t base_val = get_register(instr->RsField());
+ int32_t imm_val = instr->SImmField();
+ uword addr = base_val + imm_val;
+ if (Simulator::IsIllegalAddress(addr)) {
+ HandleIllegalAccess(addr, instr);
+ } else {
+ int32_t res = ReadExclusiveW(addr, instr);
+ set_register(instr->RtField(), res);
+ }
+ break;
+ }
case LW: {
// Format(instr, "lw 'rt, 'imms('rs)");
int32_t base_val = get_register(instr->RsField());
@@ -2214,6 +2227,20 @@ void Simulator::InstructionDecode(Instr* instr) {
}
break;
}
+ case SC: {
+ // Format(instr, "sc 'rt, 'imms('rs)");
+ int32_t rt_val = get_register(instr->RtField());
+ int32_t base_val = get_register(instr->RsField());
+ int32_t imm_val = instr->SImmField();
+ uword addr = base_val + imm_val;
+ if (Simulator::IsIllegalAddress(addr)) {
+ HandleIllegalAccess(addr, instr);
+ } else {
+ intptr_t status = WriteExclusiveW(addr, rt_val, instr);
+ set_register(instr->RtField(), status);
+ }
+ break;
+ }
case SLTI: {
// Format(instr, "slti 'rt, 'rs, 'imms");
int32_t rs_val = get_register(instr->RsField());

Powered by Google App Engine
This is Rietveld 408576698