| 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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 __ sync(); \ | 489 __ sync(); \ |
| 490 } while (0) | 490 } while (0) |
| 491 | 491 |
| 492 #define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr) \ | 492 #define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr) \ |
| 493 do { \ | 493 do { \ |
| 494 __ sync(); \ | 494 __ sync(); \ |
| 495 __ asm_instr(i.InputRegister(2), i.MemoryOperand()); \ | 495 __ asm_instr(i.InputRegister(2), i.MemoryOperand()); \ |
| 496 __ sync(); \ | 496 __ sync(); \ |
| 497 } while (0) | 497 } while (0) |
| 498 | 498 |
| 499 #define ASSEMBLE_IEEE754_BINOP(name) \ |
| 500 do { \ |
| 501 FrameScope scope(masm(), StackFrame::MANUAL); \ |
| 502 __ PrepareCallCFunction(0, 2, kScratchReg); \ |
| 503 __ MovToFloatParameters(i.InputDoubleRegister(0), \ |
| 504 i.InputDoubleRegister(1)); \ |
| 505 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ |
| 506 0, 2); \ |
| 507 /* Move the result in the double result register. */ \ |
| 508 __ MovFromFloatResult(i.OutputDoubleRegister()); \ |
| 509 } while (0) |
| 510 |
| 499 #define ASSEMBLE_IEEE754_UNOP(name) \ | 511 #define ASSEMBLE_IEEE754_UNOP(name) \ |
| 500 do { \ | 512 do { \ |
| 501 FrameScope scope(masm(), StackFrame::MANUAL); \ | 513 FrameScope scope(masm(), StackFrame::MANUAL); \ |
| 502 __ PrepareCallCFunction(0, 1, kScratchReg); \ | 514 __ PrepareCallCFunction(0, 1, kScratchReg); \ |
| 503 __ MovToFloatParameter(i.InputDoubleRegister(0)); \ | 515 __ MovToFloatParameter(i.InputDoubleRegister(0)); \ |
| 504 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ | 516 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ |
| 505 0, 1); \ | 517 0, 1); \ |
| 506 /* Move the result in the double result register. */ \ | 518 /* Move the result in the double result register. */ \ |
| 507 __ MovFromFloatResult(i.OutputDoubleRegister()); \ | 519 __ MovFromFloatResult(i.OutputDoubleRegister()); \ |
| 508 } while (0) | 520 } while (0) |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 __ bind(ool->exit()); | 743 __ bind(ool->exit()); |
| 732 break; | 744 break; |
| 733 } | 745 } |
| 734 case kArchStackSlot: { | 746 case kArchStackSlot: { |
| 735 FrameOffset offset = | 747 FrameOffset offset = |
| 736 frame_access_state()->GetFrameOffset(i.InputInt32(0)); | 748 frame_access_state()->GetFrameOffset(i.InputInt32(0)); |
| 737 __ Daddu(i.OutputRegister(), offset.from_stack_pointer() ? sp : fp, | 749 __ Daddu(i.OutputRegister(), offset.from_stack_pointer() ? sp : fp, |
| 738 Operand(offset.offset())); | 750 Operand(offset.offset())); |
| 739 break; | 751 break; |
| 740 } | 752 } |
| 753 case kIeee754Float64Atan: |
| 754 ASSEMBLE_IEEE754_UNOP(atan); |
| 755 break; |
| 756 case kIeee754Float64Atan2: |
| 757 ASSEMBLE_IEEE754_BINOP(atan2); |
| 758 break; |
| 741 case kIeee754Float64Log: | 759 case kIeee754Float64Log: |
| 742 ASSEMBLE_IEEE754_UNOP(log); | 760 ASSEMBLE_IEEE754_UNOP(log); |
| 743 break; | 761 break; |
| 744 case kIeee754Float64Log1p: | 762 case kIeee754Float64Log1p: |
| 745 ASSEMBLE_IEEE754_UNOP(log1p); | 763 ASSEMBLE_IEEE754_UNOP(log1p); |
| 746 break; | 764 break; |
| 747 case kMips64Add: | 765 case kMips64Add: |
| 748 __ Addu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); | 766 __ Addu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); |
| 749 break; | 767 break; |
| 750 case kMips64Dadd: | 768 case kMips64Dadd: |
| (...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2272 padding_size -= v8::internal::Assembler::kInstrSize; | 2290 padding_size -= v8::internal::Assembler::kInstrSize; |
| 2273 } | 2291 } |
| 2274 } | 2292 } |
| 2275 } | 2293 } |
| 2276 | 2294 |
| 2277 #undef __ | 2295 #undef __ |
| 2278 | 2296 |
| 2279 } // namespace compiler | 2297 } // namespace compiler |
| 2280 } // namespace internal | 2298 } // namespace internal |
| 2281 } // namespace v8 | 2299 } // namespace v8 |
| OLD | NEW |