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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 } \ | 472 } \ |
473 } while (0) | 473 } while (0) |
474 | 474 |
475 #define ASSEMBLE_ATOMIC_LOAD_INTEGER(asm_instr) \ | 475 #define ASSEMBLE_ATOMIC_LOAD_INTEGER(asm_instr) \ |
476 do { \ | 476 do { \ |
477 __ asm_instr(i.OutputRegister(), \ | 477 __ asm_instr(i.OutputRegister(), \ |
478 MemOperand(i.InputRegister(0), i.InputRegister(1))); \ | 478 MemOperand(i.InputRegister(0), i.InputRegister(1))); \ |
479 __ Dmb(InnerShareable, BarrierAll); \ | 479 __ Dmb(InnerShareable, BarrierAll); \ |
480 } while (0) | 480 } while (0) |
481 | 481 |
| 482 #define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr) \ |
| 483 do { \ |
| 484 __ Dmb(InnerShareable, BarrierAll); \ |
| 485 __ asm_instr(i.InputRegister(2), \ |
| 486 MemOperand(i.InputRegister(0), i.InputRegister(1))); \ |
| 487 __ Dmb(InnerShareable, BarrierAll); \ |
| 488 } while (0) |
| 489 |
482 void CodeGenerator::AssembleDeconstructFrame() { | 490 void CodeGenerator::AssembleDeconstructFrame() { |
483 const CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 491 const CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
484 if (descriptor->IsCFunctionCall() || descriptor->UseNativeStack()) { | 492 if (descriptor->IsCFunctionCall() || descriptor->UseNativeStack()) { |
485 __ Mov(csp, fp); | 493 __ Mov(csp, fp); |
486 } else { | 494 } else { |
487 __ Mov(jssp, fp); | 495 __ Mov(jssp, fp); |
488 } | 496 } |
489 __ Pop(fp, lr); | 497 __ Pop(fp, lr); |
490 } | 498 } |
491 | 499 |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1424 ASSEMBLE_ATOMIC_LOAD_INTEGER(Ldrsh); | 1432 ASSEMBLE_ATOMIC_LOAD_INTEGER(Ldrsh); |
1425 break; | 1433 break; |
1426 case kAtomicLoadUint16: | 1434 case kAtomicLoadUint16: |
1427 ASSEMBLE_ATOMIC_LOAD_INTEGER(Ldrh); | 1435 ASSEMBLE_ATOMIC_LOAD_INTEGER(Ldrh); |
1428 break; | 1436 break; |
1429 case kAtomicLoadWord32: | 1437 case kAtomicLoadWord32: |
1430 __ Ldr(i.OutputRegister32(), | 1438 __ Ldr(i.OutputRegister32(), |
1431 MemOperand(i.InputRegister(0), i.InputRegister(1))); | 1439 MemOperand(i.InputRegister(0), i.InputRegister(1))); |
1432 __ Dmb(InnerShareable, BarrierAll); | 1440 __ Dmb(InnerShareable, BarrierAll); |
1433 break; | 1441 break; |
| 1442 case kAtomicStoreWord8: |
| 1443 ASSEMBLE_ATOMIC_STORE_INTEGER(Strb); |
| 1444 break; |
| 1445 case kAtomicStoreWord16: |
| 1446 ASSEMBLE_ATOMIC_STORE_INTEGER(Strh); |
| 1447 break; |
| 1448 case kAtomicStoreWord32: |
| 1449 __ Dmb(InnerShareable, BarrierAll); |
| 1450 __ Str(i.InputRegister32(2), |
| 1451 MemOperand(i.InputRegister(0), i.InputRegister(1))); |
| 1452 __ Dmb(InnerShareable, BarrierAll); |
| 1453 break; |
1434 } | 1454 } |
1435 return kSuccess; | 1455 return kSuccess; |
1436 } // NOLINT(readability/fn_size) | 1456 } // NOLINT(readability/fn_size) |
1437 | 1457 |
1438 | 1458 |
1439 // Assemble branches after this instruction. | 1459 // Assemble branches after this instruction. |
1440 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { | 1460 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { |
1441 Arm64OperandConverter i(this, instr); | 1461 Arm64OperandConverter i(this, instr); |
1442 Label* tlabel = branch->true_label; | 1462 Label* tlabel = branch->true_label; |
1443 Label* flabel = branch->false_label; | 1463 Label* flabel = branch->false_label; |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1860 padding_size -= kInstructionSize; | 1880 padding_size -= kInstructionSize; |
1861 } | 1881 } |
1862 } | 1882 } |
1863 } | 1883 } |
1864 | 1884 |
1865 #undef __ | 1885 #undef __ |
1866 | 1886 |
1867 } // namespace compiler | 1887 } // namespace compiler |
1868 } // namespace internal | 1888 } // namespace internal |
1869 } // namespace v8 | 1889 } // namespace v8 |
OLD | NEW |