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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 } while (0) | 505 } while (0) |
506 | 506 |
507 #define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr) \ | 507 #define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr) \ |
508 do { \ | 508 do { \ |
509 __ Dmb(InnerShareable, BarrierAll); \ | 509 __ Dmb(InnerShareable, BarrierAll); \ |
510 __ asm_instr(i.InputRegister(2), \ | 510 __ asm_instr(i.InputRegister(2), \ |
511 MemOperand(i.InputRegister(0), i.InputRegister(1))); \ | 511 MemOperand(i.InputRegister(0), i.InputRegister(1))); \ |
512 __ Dmb(InnerShareable, BarrierAll); \ | 512 __ Dmb(InnerShareable, BarrierAll); \ |
513 } while (0) | 513 } while (0) |
514 | 514 |
| 515 #define ASSEMBLE_IEEE754_BINOP(name) \ |
| 516 do { \ |
| 517 FrameScope scope(masm(), StackFrame::MANUAL); \ |
| 518 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ |
| 519 0, 2); \ |
| 520 } while (0) |
| 521 |
515 #define ASSEMBLE_IEEE754_UNOP(name) \ | 522 #define ASSEMBLE_IEEE754_UNOP(name) \ |
516 do { \ | 523 do { \ |
517 FrameScope scope(masm(), StackFrame::MANUAL); \ | 524 FrameScope scope(masm(), StackFrame::MANUAL); \ |
518 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ | 525 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ |
519 0, 1); \ | 526 0, 1); \ |
520 } while (0) | 527 } while (0) |
521 | 528 |
522 void CodeGenerator::AssembleDeconstructFrame() { | 529 void CodeGenerator::AssembleDeconstructFrame() { |
523 const CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 530 const CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
524 if (descriptor->IsCFunctionCall() || descriptor->UseNativeStack()) { | 531 if (descriptor->IsCFunctionCall() || descriptor->UseNativeStack()) { |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 frame_access_state()->GetFrameOffset(i.InputInt32(0)); | 799 frame_access_state()->GetFrameOffset(i.InputInt32(0)); |
793 Register base; | 800 Register base; |
794 if (offset.from_stack_pointer()) { | 801 if (offset.from_stack_pointer()) { |
795 base = __ StackPointer(); | 802 base = __ StackPointer(); |
796 } else { | 803 } else { |
797 base = fp; | 804 base = fp; |
798 } | 805 } |
799 __ Add(i.OutputRegister(0), base, Operand(offset.offset())); | 806 __ Add(i.OutputRegister(0), base, Operand(offset.offset())); |
800 break; | 807 break; |
801 } | 808 } |
| 809 case kIeee754Float64Atan: |
| 810 ASSEMBLE_IEEE754_UNOP(atan); |
| 811 break; |
| 812 case kIeee754Float64Atan2: |
| 813 ASSEMBLE_IEEE754_BINOP(atan2); |
| 814 break; |
802 case kIeee754Float64Log: | 815 case kIeee754Float64Log: |
803 ASSEMBLE_IEEE754_UNOP(log); | 816 ASSEMBLE_IEEE754_UNOP(log); |
804 break; | 817 break; |
805 case kIeee754Float64Log1p: | 818 case kIeee754Float64Log1p: |
806 ASSEMBLE_IEEE754_UNOP(log1p); | 819 ASSEMBLE_IEEE754_UNOP(log1p); |
807 break; | 820 break; |
808 case kArm64Float32RoundDown: | 821 case kArm64Float32RoundDown: |
809 __ Frintm(i.OutputFloat32Register(), i.InputFloat32Register(0)); | 822 __ Frintm(i.OutputFloat32Register(), i.InputFloat32Register(0)); |
810 break; | 823 break; |
811 case kArm64Float64RoundDown: | 824 case kArm64Float64RoundDown: |
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1938 padding_size -= kInstructionSize; | 1951 padding_size -= kInstructionSize; |
1939 } | 1952 } |
1940 } | 1953 } |
1941 } | 1954 } |
1942 | 1955 |
1943 #undef __ | 1956 #undef __ |
1944 | 1957 |
1945 } // namespace compiler | 1958 } // namespace compiler |
1946 } // namespace internal | 1959 } // namespace internal |
1947 } // namespace v8 | 1960 } // namespace v8 |
OLD | NEW |