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

Unified Diff: runtime/vm/simulator_arm64.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_arm64.cc
diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc
index 7916d1848fdc4215c4e7df4b83dcdb7d7eef4207..8eaf8ecd05041dea6f5cb0d751e2d709a8707c4d 100644
--- a/runtime/vm/simulator_arm64.cc
+++ b/runtime/vm/simulator_arm64.cc
@@ -2164,6 +2164,36 @@ void Simulator::DecodeLoadRegLiteral(Instr* instr) {
}
+void Simulator::DecodeLoadStoreExclusive(Instr* instr) {
+ if ((instr->Bit(23) != 0) ||
+ (instr->Bit(21) != 0) ||
+ (instr->Bit(15) != 0)) {
+ UNIMPLEMENTED();
+ }
+ const int32_t size = instr->Bits(30, 2);
+ if (size != 3) {
+ UNIMPLEMENTED();
+ }
+
+ const Register rs = instr->RsField();
+ const Register rn = instr->RnField();
+ const Register rt = instr->RtField();
+ const bool is_load = instr->Bit(22) == 1;
+ if (is_load) {
+ // Format(instr, "ldxr 'rt, 'rn");
+ const int64_t addr = get_register(rn, R31IsSP);
+ intptr_t value = ReadExclusiveW(addr, instr);
zra 2016/02/25 04:02:35 int64_t calling ReadExclusiveX?
rmacnak 2016/02/25 23:31:46 Done.
+ set_register(instr, rt, value, R31IsSP);
+ } else {
+ // Format(instr, "stxr 'rs, 'rt, 'rn");
+ uword value = get_register(rt, R31IsSP);
+ uword addr = get_register(rn, R31IsSP);
+ intptr_t status = WriteExclusiveW(addr, value, instr);
+ set_register(instr, rs, status, R31IsSP);
+ }
+}
+
+
void Simulator::DecodeLoadStore(Instr* instr) {
if (instr->IsLoadStoreRegOp()) {
DecodeLoadStoreReg(instr);
@@ -2171,6 +2201,8 @@ void Simulator::DecodeLoadStore(Instr* instr) {
DecodeLoadStoreRegPair(instr);
} else if (instr->IsLoadRegLiteralOp()) {
DecodeLoadRegLiteral(instr);
+ } else if (instr->IsLoadStoreExclusiveOp()) {
+ DecodeLoadStoreExclusive(instr);
} else {
UnimplementedInstruction(instr);
}

Powered by Google App Engine
This is Rietveld 408576698