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/ast/scopes.h" | 5 #include "src/ast/scopes.h" |
6 #include "src/compiler/code-generator.h" | 6 #include "src/compiler/code-generator.h" |
7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/osr.h" | 10 #include "src/compiler/osr.h" |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 __ sync(); \ | 478 __ sync(); \ |
479 } while (0) | 479 } while (0) |
480 | 480 |
481 #define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr) \ | 481 #define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr) \ |
482 do { \ | 482 do { \ |
483 __ sync(); \ | 483 __ sync(); \ |
484 __ asm_instr(i.InputRegister(2), i.MemoryOperand()); \ | 484 __ asm_instr(i.InputRegister(2), i.MemoryOperand()); \ |
485 __ sync(); \ | 485 __ sync(); \ |
486 } while (0) | 486 } while (0) |
487 | 487 |
| 488 #define ASSEMBLE_IEEE754_BINOP(name) \ |
| 489 do { \ |
| 490 FrameScope scope(masm(), StackFrame::MANUAL); \ |
| 491 __ PrepareCallCFunction(0, 2, kScratchReg); \ |
| 492 __ MovToFloatParameters(i.InputDoubleRegister(0), \ |
| 493 i.InputDoubleRegister(1)); \ |
| 494 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ |
| 495 0, 2); \ |
| 496 /* Move the result in the double result register. */ \ |
| 497 __ MovFromFloatResult(i.OutputDoubleRegister()); \ |
| 498 } while (0) |
| 499 |
488 #define ASSEMBLE_IEEE754_UNOP(name) \ | 500 #define ASSEMBLE_IEEE754_UNOP(name) \ |
489 do { \ | 501 do { \ |
490 FrameScope scope(masm(), StackFrame::MANUAL); \ | 502 FrameScope scope(masm(), StackFrame::MANUAL); \ |
491 __ PrepareCallCFunction(0, 1, kScratchReg); \ | 503 __ PrepareCallCFunction(0, 1, kScratchReg); \ |
492 __ MovToFloatParameter(i.InputDoubleRegister(0)); \ | 504 __ MovToFloatParameter(i.InputDoubleRegister(0)); \ |
493 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ | 505 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ |
494 0, 1); \ | 506 0, 1); \ |
495 /* Move the result in the double result register. */ \ | 507 /* Move the result in the double result register. */ \ |
496 __ MovFromFloatResult(i.OutputDoubleRegister()); \ | 508 __ MovFromFloatResult(i.OutputDoubleRegister()); \ |
497 } while (0) | 509 } while (0) |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 __ bind(ool->exit()); | 734 __ bind(ool->exit()); |
723 break; | 735 break; |
724 } | 736 } |
725 case kArchStackSlot: { | 737 case kArchStackSlot: { |
726 FrameOffset offset = | 738 FrameOffset offset = |
727 frame_access_state()->GetFrameOffset(i.InputInt32(0)); | 739 frame_access_state()->GetFrameOffset(i.InputInt32(0)); |
728 __ Addu(i.OutputRegister(), offset.from_stack_pointer() ? sp : fp, | 740 __ Addu(i.OutputRegister(), offset.from_stack_pointer() ? sp : fp, |
729 Operand(offset.offset())); | 741 Operand(offset.offset())); |
730 break; | 742 break; |
731 } | 743 } |
| 744 case kIeee754Float64Atan: |
| 745 ASSEMBLE_IEEE754_UNOP(atan); |
| 746 break; |
| 747 case kIeee754Float64Atan2: |
| 748 ASSEMBLE_IEEE754_BINOP(atan2); |
| 749 break; |
732 case kIeee754Float64Log: | 750 case kIeee754Float64Log: |
733 ASSEMBLE_IEEE754_UNOP(log); | 751 ASSEMBLE_IEEE754_UNOP(log); |
734 break; | 752 break; |
735 case kIeee754Float64Log1p: | 753 case kIeee754Float64Log1p: |
736 ASSEMBLE_IEEE754_UNOP(log1p); | 754 ASSEMBLE_IEEE754_UNOP(log1p); |
737 break; | 755 break; |
738 case kMipsAdd: | 756 case kMipsAdd: |
739 __ Addu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); | 757 __ Addu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); |
740 break; | 758 break; |
741 case kMipsAddOvf: | 759 case kMipsAddOvf: |
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2014 padding_size -= v8::internal::Assembler::kInstrSize; | 2032 padding_size -= v8::internal::Assembler::kInstrSize; |
2015 } | 2033 } |
2016 } | 2034 } |
2017 } | 2035 } |
2018 | 2036 |
2019 #undef __ | 2037 #undef __ |
2020 | 2038 |
2021 } // namespace compiler | 2039 } // namespace compiler |
2022 } // namespace internal | 2040 } // namespace internal |
2023 } // namespace v8 | 2041 } // namespace v8 |
OLD | NEW |