Index: src/compiler/mips/code-generator-mips.cc |
diff --git a/src/compiler/mips/code-generator-mips.cc b/src/compiler/mips/code-generator-mips.cc |
index 03f0681ee72f5e36501ee64c051059bdb84c9ba4..a449b7eb59546f2560baf1ff54d061d3b002474b 100644 |
--- a/src/compiler/mips/code-generator-mips.cc |
+++ b/src/compiler/mips/code-generator-mips.cc |
@@ -472,6 +472,12 @@ FPUCondition FlagsConditionToConditionCmpFPU(bool& predicate, |
__ bind(&done); \ |
} |
+#define ASSEMBLE_ATOMIC_LOAD_INTEGER(asm_instr) \ |
+ do { \ |
+ __ asm_instr(i.OutputRegister(), i.MemoryOperand()); \ |
+ __ sync(); \ |
+ } while (0) |
+ |
void CodeGenerator::AssembleDeconstructFrame() { |
__ mov(sp, fp); |
__ Pop(ra, fp); |
@@ -1325,12 +1331,19 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
UNREACHABLE(); // currently unsupported checked int64 load/store. |
break; |
case kAtomicLoadInt8: |
+ ASSEMBLE_ATOMIC_LOAD_INTEGER(lb); |
+ break; |
case kAtomicLoadUint8: |
+ ASSEMBLE_ATOMIC_LOAD_INTEGER(lbu); |
+ break; |
case kAtomicLoadInt16: |
+ ASSEMBLE_ATOMIC_LOAD_INTEGER(lh); |
+ break; |
case kAtomicLoadUint16: |
+ ASSEMBLE_ATOMIC_LOAD_INTEGER(lhu); |
+ break; |
case kAtomicLoadWord32: |
- // TODO(binji): implement |
- __ nop(); |
+ ASSEMBLE_ATOMIC_LOAD_INTEGER(lw); |
break; |
} |
} // NOLINT(readability/fn_size) |