OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/compiler/code-generator-impl.h" | 9 #include "src/compiler/code-generator-impl.h" |
10 #include "src/compiler/gap-resolver.h" | 10 #include "src/compiler/gap-resolver.h" |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 if (instr->InputAt(1)->IsRegister()) { \ | 381 if (instr->InputAt(1)->IsRegister()) { \ |
382 __ cmp(offset, i.InputRegister(1)); \ | 382 __ cmp(offset, i.InputRegister(1)); \ |
383 } else { \ | 383 } else { \ |
384 __ cmp(offset, i.InputImmediate(1)); \ | 384 __ cmp(offset, i.InputImmediate(1)); \ |
385 } \ | 385 } \ |
386 auto value = i.InputRegister(2); \ | 386 auto value = i.InputRegister(2); \ |
387 __ asm_instr(value, i.InputOffset(3), lo); \ | 387 __ asm_instr(value, i.InputOffset(3), lo); \ |
388 DCHECK_EQ(LeaveCC, i.OutputSBit()); \ | 388 DCHECK_EQ(LeaveCC, i.OutputSBit()); \ |
389 } while (0) | 389 } while (0) |
390 | 390 |
| 391 #define ASSEMBLE_ATOMIC_LOAD_INTEGER(asm_instr) \ |
| 392 do { \ |
| 393 __ asm_instr(i.OutputRegister(), \ |
| 394 MemOperand(i.InputRegister(0), i.InputRegister(1))); \ |
| 395 __ dmb(ISH); \ |
| 396 } while (0) |
| 397 |
391 void CodeGenerator::AssembleDeconstructFrame() { | 398 void CodeGenerator::AssembleDeconstructFrame() { |
392 __ LeaveFrame(StackFrame::MANUAL); | 399 __ LeaveFrame(StackFrame::MANUAL); |
393 } | 400 } |
394 | 401 |
395 void CodeGenerator::AssembleSetupStackPointer() {} | 402 void CodeGenerator::AssembleSetupStackPointer() {} |
396 | 403 |
397 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { | 404 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
398 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 405 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
399 if (sp_slot_delta > 0) { | 406 if (sp_slot_delta > 0) { |
400 __ add(sp, sp, Operand(sp_slot_delta * kPointerSize)); | 407 __ add(sp, sp, Operand(sp_slot_delta * kPointerSize)); |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 case kCheckedStoreFloat32: | 1250 case kCheckedStoreFloat32: |
1244 ASSEMBLE_CHECKED_STORE_FLOAT(32); | 1251 ASSEMBLE_CHECKED_STORE_FLOAT(32); |
1245 break; | 1252 break; |
1246 case kCheckedStoreFloat64: | 1253 case kCheckedStoreFloat64: |
1247 ASSEMBLE_CHECKED_STORE_FLOAT(64); | 1254 ASSEMBLE_CHECKED_STORE_FLOAT(64); |
1248 break; | 1255 break; |
1249 case kCheckedLoadWord64: | 1256 case kCheckedLoadWord64: |
1250 case kCheckedStoreWord64: | 1257 case kCheckedStoreWord64: |
1251 UNREACHABLE(); // currently unsupported checked int64 load/store. | 1258 UNREACHABLE(); // currently unsupported checked int64 load/store. |
1252 break; | 1259 break; |
| 1260 |
| 1261 case kAtomicLoadInt8: |
| 1262 ASSEMBLE_ATOMIC_LOAD_INTEGER(ldrsb); |
| 1263 break; |
| 1264 case kAtomicLoadUint8: |
| 1265 ASSEMBLE_ATOMIC_LOAD_INTEGER(ldrb); |
| 1266 break; |
| 1267 case kAtomicLoadInt16: |
| 1268 ASSEMBLE_ATOMIC_LOAD_INTEGER(ldrsh); |
| 1269 break; |
| 1270 case kAtomicLoadUint16: |
| 1271 ASSEMBLE_ATOMIC_LOAD_INTEGER(ldrh); |
| 1272 break; |
| 1273 case kAtomicLoadWord32: |
| 1274 ASSEMBLE_ATOMIC_LOAD_INTEGER(ldr); |
| 1275 break; |
1253 } | 1276 } |
1254 } // NOLINT(readability/fn_size) | 1277 } // NOLINT(readability/fn_size) |
1255 | 1278 |
1256 | 1279 |
1257 // Assembles branches after an instruction. | 1280 // Assembles branches after an instruction. |
1258 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { | 1281 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { |
1259 ArmOperandConverter i(this, instr); | 1282 ArmOperandConverter i(this, instr); |
1260 Label* tlabel = branch->true_label; | 1283 Label* tlabel = branch->true_label; |
1261 Label* flabel = branch->false_label; | 1284 Label* flabel = branch->false_label; |
1262 Condition cc = FlagsConditionToCondition(branch->condition); | 1285 Condition cc = FlagsConditionToCondition(branch->condition); |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1635 padding_size -= v8::internal::Assembler::kInstrSize; | 1658 padding_size -= v8::internal::Assembler::kInstrSize; |
1636 } | 1659 } |
1637 } | 1660 } |
1638 } | 1661 } |
1639 | 1662 |
1640 #undef __ | 1663 #undef __ |
1641 | 1664 |
1642 } // namespace compiler | 1665 } // namespace compiler |
1643 } // namespace internal | 1666 } // namespace internal |
1644 } // namespace v8 | 1667 } // namespace v8 |
OLD | NEW |