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 | |
398 void CodeGenerator::AssembleDeconstructFrame() { | 391 void CodeGenerator::AssembleDeconstructFrame() { |
399 __ LeaveFrame(StackFrame::MANUAL); | 392 __ LeaveFrame(StackFrame::MANUAL); |
400 } | 393 } |
401 | 394 |
402 void CodeGenerator::AssembleSetupStackPointer() {} | 395 void CodeGenerator::AssembleSetupStackPointer() {} |
403 | 396 |
404 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { | 397 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
405 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 398 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
406 if (sp_slot_delta > 0) { | 399 if (sp_slot_delta > 0) { |
407 __ add(sp, sp, Operand(sp_slot_delta * kPointerSize)); | 400 __ add(sp, sp, Operand(sp_slot_delta * kPointerSize)); |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 case kCheckedStoreFloat32: | 1243 case kCheckedStoreFloat32: |
1251 ASSEMBLE_CHECKED_STORE_FLOAT(32); | 1244 ASSEMBLE_CHECKED_STORE_FLOAT(32); |
1252 break; | 1245 break; |
1253 case kCheckedStoreFloat64: | 1246 case kCheckedStoreFloat64: |
1254 ASSEMBLE_CHECKED_STORE_FLOAT(64); | 1247 ASSEMBLE_CHECKED_STORE_FLOAT(64); |
1255 break; | 1248 break; |
1256 case kCheckedLoadWord64: | 1249 case kCheckedLoadWord64: |
1257 case kCheckedStoreWord64: | 1250 case kCheckedStoreWord64: |
1258 UNREACHABLE(); // currently unsupported checked int64 load/store. | 1251 UNREACHABLE(); // currently unsupported checked int64 load/store. |
1259 break; | 1252 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; | |
1276 } | 1253 } |
1277 } // NOLINT(readability/fn_size) | 1254 } // NOLINT(readability/fn_size) |
1278 | 1255 |
1279 | 1256 |
1280 // Assembles branches after an instruction. | 1257 // Assembles branches after an instruction. |
1281 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { | 1258 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { |
1282 ArmOperandConverter i(this, instr); | 1259 ArmOperandConverter i(this, instr); |
1283 Label* tlabel = branch->true_label; | 1260 Label* tlabel = branch->true_label; |
1284 Label* flabel = branch->false_label; | 1261 Label* flabel = branch->false_label; |
1285 Condition cc = FlagsConditionToCondition(branch->condition); | 1262 Condition cc = FlagsConditionToCondition(branch->condition); |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 padding_size -= v8::internal::Assembler::kInstrSize; | 1635 padding_size -= v8::internal::Assembler::kInstrSize; |
1659 } | 1636 } |
1660 } | 1637 } |
1661 } | 1638 } |
1662 | 1639 |
1663 #undef __ | 1640 #undef __ |
1664 | 1641 |
1665 } // namespace compiler | 1642 } // namespace compiler |
1666 } // namespace internal | 1643 } // namespace internal |
1667 } // namespace v8 | 1644 } // namespace v8 |
OLD | NEW |