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/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/arm64/macro-assembler-arm64.h" | 8 #include "src/arm64/macro-assembler-arm64.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 __ asm_instr(i.OutputRegister##width(), i.InputRegister##width(0), \ | 465 __ asm_instr(i.OutputRegister##width(), i.InputRegister##width(0), \ |
466 i.InputRegister##width(1)); \ | 466 i.InputRegister##width(1)); \ |
467 } else { \ | 467 } else { \ |
468 uint32_t imm = \ | 468 uint32_t imm = \ |
469 static_cast<uint32_t>(i.InputOperand##width(1).ImmediateValue()); \ | 469 static_cast<uint32_t>(i.InputOperand##width(1).ImmediateValue()); \ |
470 __ asm_instr(i.OutputRegister##width(), i.InputRegister##width(0), \ | 470 __ asm_instr(i.OutputRegister##width(), i.InputRegister##width(0), \ |
471 imm % (width)); \ | 471 imm % (width)); \ |
472 } \ | 472 } \ |
473 } while (0) | 473 } while (0) |
474 | 474 |
| 475 #define ASSEMBLE_ATOMIC_LOAD_INTEGER(asm_instr) \ |
| 476 do { \ |
| 477 __ asm_instr(i.OutputRegister(), \ |
| 478 MemOperand(i.InputRegister(0), i.InputRegister(1))); \ |
| 479 __ Dmb(InnerShareable, BarrierAll); \ |
| 480 } while (0) |
| 481 |
475 void CodeGenerator::AssembleDeconstructFrame() { | 482 void CodeGenerator::AssembleDeconstructFrame() { |
476 const CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 483 const CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
477 if (descriptor->IsCFunctionCall() || descriptor->UseNativeStack()) { | 484 if (descriptor->IsCFunctionCall() || descriptor->UseNativeStack()) { |
478 __ Mov(csp, fp); | 485 __ Mov(csp, fp); |
479 } else { | 486 } else { |
480 __ Mov(jssp, fp); | 487 __ Mov(jssp, fp); |
481 } | 488 } |
482 __ Pop(fp, lr); | 489 __ Pop(fp, lr); |
483 } | 490 } |
484 | 491 |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 break; | 1404 break; |
1398 case kCheckedStoreWord64: | 1405 case kCheckedStoreWord64: |
1399 ASSEMBLE_CHECKED_STORE_INTEGER_64(Str); | 1406 ASSEMBLE_CHECKED_STORE_INTEGER_64(Str); |
1400 break; | 1407 break; |
1401 case kCheckedStoreFloat32: | 1408 case kCheckedStoreFloat32: |
1402 ASSEMBLE_CHECKED_STORE_FLOAT(32); | 1409 ASSEMBLE_CHECKED_STORE_FLOAT(32); |
1403 break; | 1410 break; |
1404 case kCheckedStoreFloat64: | 1411 case kCheckedStoreFloat64: |
1405 ASSEMBLE_CHECKED_STORE_FLOAT(64); | 1412 ASSEMBLE_CHECKED_STORE_FLOAT(64); |
1406 break; | 1413 break; |
| 1414 case kAtomicLoadInt8: |
| 1415 ASSEMBLE_ATOMIC_LOAD_INTEGER(Ldrsb); |
| 1416 break; |
| 1417 case kAtomicLoadUint8: |
| 1418 ASSEMBLE_ATOMIC_LOAD_INTEGER(Ldrb); |
| 1419 break; |
| 1420 case kAtomicLoadInt16: |
| 1421 ASSEMBLE_ATOMIC_LOAD_INTEGER(Ldrsh); |
| 1422 break; |
| 1423 case kAtomicLoadUint16: |
| 1424 ASSEMBLE_ATOMIC_LOAD_INTEGER(Ldrh); |
| 1425 break; |
| 1426 case kAtomicLoadWord32: |
| 1427 __ Ldr(i.OutputRegister32(), |
| 1428 MemOperand(i.InputRegister(0), i.InputRegister(1))); |
| 1429 __ Dmb(InnerShareable, BarrierAll); |
| 1430 break; |
1407 } | 1431 } |
1408 } // NOLINT(readability/fn_size) | 1432 } // NOLINT(readability/fn_size) |
1409 | 1433 |
1410 | 1434 |
1411 // Assemble branches after this instruction. | 1435 // Assemble branches after this instruction. |
1412 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { | 1436 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { |
1413 Arm64OperandConverter i(this, instr); | 1437 Arm64OperandConverter i(this, instr); |
1414 Label* tlabel = branch->true_label; | 1438 Label* tlabel = branch->true_label; |
1415 Label* flabel = branch->false_label; | 1439 Label* flabel = branch->false_label; |
1416 FlagsCondition condition = branch->condition; | 1440 FlagsCondition condition = branch->condition; |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1814 padding_size -= kInstructionSize; | 1838 padding_size -= kInstructionSize; |
1815 } | 1839 } |
1816 } | 1840 } |
1817 } | 1841 } |
1818 | 1842 |
1819 #undef __ | 1843 #undef __ |
1820 | 1844 |
1821 } // namespace compiler | 1845 } // namespace compiler |
1822 } // namespace internal | 1846 } // namespace internal |
1823 } // namespace v8 | 1847 } // namespace v8 |
OLD | NEW |