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_UNOP(name) \ |
| 598 do { \ |
| 599 __ PrepareCallCFunction(1); \ |
| 600 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ |
| 601 1); \ |
| 602 } while (false) |
| 603 |
597 void CodeGenerator::AssembleDeconstructFrame() { | 604 void CodeGenerator::AssembleDeconstructFrame() { |
598 __ movq(rsp, rbp); | 605 __ movq(rsp, rbp); |
599 __ popq(rbp); | 606 __ popq(rbp); |
600 } | 607 } |
601 | 608 |
602 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { | 609 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
603 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 610 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
604 if (sp_slot_delta > 0) { | 611 if (sp_slot_delta > 0) { |
605 __ addq(rsp, Immediate(sp_slot_delta * kPointerSize)); | 612 __ addq(rsp, Immediate(sp_slot_delta * kPointerSize)); |
606 } | 613 } |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 Register base; | 841 Register base; |
835 if (offset.from_stack_pointer()) { | 842 if (offset.from_stack_pointer()) { |
836 base = rsp; | 843 base = rsp; |
837 } else { | 844 } else { |
838 base = rbp; | 845 base = rbp; |
839 } | 846 } |
840 __ leaq(i.OutputRegister(), Operand(base, offset.offset())); | 847 __ leaq(i.OutputRegister(), Operand(base, offset.offset())); |
841 break; | 848 break; |
842 } | 849 } |
843 case kIeee754Float64Log: | 850 case kIeee754Float64Log: |
844 __ PrepareCallCFunction(1); | 851 ASSEMBLE_IEEE754_UNOP(log); |
845 __ CallCFunction(ExternalReference::ieee754_log_function(isolate()), 1); | 852 break; |
| 853 case kIeee754Float64Log1p: |
| 854 ASSEMBLE_IEEE754_UNOP(log1p); |
846 break; | 855 break; |
847 case kX64Add32: | 856 case kX64Add32: |
848 ASSEMBLE_BINOP(addl); | 857 ASSEMBLE_BINOP(addl); |
849 break; | 858 break; |
850 case kX64Add: | 859 case kX64Add: |
851 ASSEMBLE_BINOP(addq); | 860 ASSEMBLE_BINOP(addq); |
852 break; | 861 break; |
853 case kX64Sub32: | 862 case kX64Sub32: |
854 ASSEMBLE_BINOP(subl); | 863 ASSEMBLE_BINOP(subl); |
855 break; | 864 break; |
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2318 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2327 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
2319 __ Nop(padding_size); | 2328 __ Nop(padding_size); |
2320 } | 2329 } |
2321 } | 2330 } |
2322 | 2331 |
2323 #undef __ | 2332 #undef __ |
2324 | 2333 |
2325 } // namespace compiler | 2334 } // namespace compiler |
2326 } // namespace internal | 2335 } // namespace internal |
2327 } // namespace v8 | 2336 } // namespace v8 |
OLD | NEW |