| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
| 9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
| 10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 do { \ | 587 do { \ |
| 588 if (instr->InputAt(4)->IsRegister()) { \ | 588 if (instr->InputAt(4)->IsRegister()) { \ |
| 589 Register value = i.InputRegister(4); \ | 589 Register value = i.InputRegister(4); \ |
| 590 ASSEMBLE_CHECKED_STORE_INTEGER_IMPL(asm_instr, Register); \ | 590 ASSEMBLE_CHECKED_STORE_INTEGER_IMPL(asm_instr, Register); \ |
| 591 } else { \ | 591 } else { \ |
| 592 Immediate value = i.InputImmediate(4); \ | 592 Immediate value = i.InputImmediate(4); \ |
| 593 ASSEMBLE_CHECKED_STORE_INTEGER_IMPL(asm_instr, Immediate); \ | 593 ASSEMBLE_CHECKED_STORE_INTEGER_IMPL(asm_instr, Immediate); \ |
| 594 } \ | 594 } \ |
| 595 } while (false) | 595 } while (false) |
| 596 | 596 |
| 597 #define ASSEMBLE_IEEE754_BINOP(name) \ |
| 598 do { \ |
| 599 __ PrepareCallCFunction(2); \ |
| 600 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ |
| 601 2); \ |
| 602 } while (false) |
| 603 |
| 597 #define ASSEMBLE_IEEE754_UNOP(name) \ | 604 #define ASSEMBLE_IEEE754_UNOP(name) \ |
| 598 do { \ | 605 do { \ |
| 599 __ PrepareCallCFunction(1); \ | 606 __ PrepareCallCFunction(1); \ |
| 600 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ | 607 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ |
| 601 1); \ | 608 1); \ |
| 602 } while (false) | 609 } while (false) |
| 603 | 610 |
| 604 void CodeGenerator::AssembleDeconstructFrame() { | 611 void CodeGenerator::AssembleDeconstructFrame() { |
| 605 __ movq(rsp, rbp); | 612 __ movq(rsp, rbp); |
| 606 __ popq(rbp); | 613 __ popq(rbp); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 frame_access_state()->GetFrameOffset(i.InputInt32(0)); | 847 frame_access_state()->GetFrameOffset(i.InputInt32(0)); |
| 841 Register base; | 848 Register base; |
| 842 if (offset.from_stack_pointer()) { | 849 if (offset.from_stack_pointer()) { |
| 843 base = rsp; | 850 base = rsp; |
| 844 } else { | 851 } else { |
| 845 base = rbp; | 852 base = rbp; |
| 846 } | 853 } |
| 847 __ leaq(i.OutputRegister(), Operand(base, offset.offset())); | 854 __ leaq(i.OutputRegister(), Operand(base, offset.offset())); |
| 848 break; | 855 break; |
| 849 } | 856 } |
| 857 case kIeee754Float64Atan: |
| 858 ASSEMBLE_IEEE754_UNOP(atan); |
| 859 break; |
| 860 case kIeee754Float64Atan2: |
| 861 ASSEMBLE_IEEE754_BINOP(atan2); |
| 862 break; |
| 850 case kIeee754Float64Log: | 863 case kIeee754Float64Log: |
| 851 ASSEMBLE_IEEE754_UNOP(log); | 864 ASSEMBLE_IEEE754_UNOP(log); |
| 852 break; | 865 break; |
| 853 case kIeee754Float64Log1p: | 866 case kIeee754Float64Log1p: |
| 854 ASSEMBLE_IEEE754_UNOP(log1p); | 867 ASSEMBLE_IEEE754_UNOP(log1p); |
| 855 break; | 868 break; |
| 856 case kX64Add32: | 869 case kX64Add32: |
| 857 ASSEMBLE_BINOP(addl); | 870 ASSEMBLE_BINOP(addl); |
| 858 break; | 871 break; |
| 859 case kX64Add: | 872 case kX64Add: |
| (...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2327 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2340 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 2328 __ Nop(padding_size); | 2341 __ Nop(padding_size); |
| 2329 } | 2342 } |
| 2330 } | 2343 } |
| 2331 | 2344 |
| 2332 #undef __ | 2345 #undef __ |
| 2333 | 2346 |
| 2334 } // namespace compiler | 2347 } // namespace compiler |
| 2335 } // namespace internal | 2348 } // namespace internal |
| 2336 } // namespace v8 | 2349 } // namespace v8 |
| OLD | NEW |