| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 // hash: key's hash field, including its array index value. | 598 // hash: key's hash field, including its array index value. |
| 599 and_(hash, Immediate(String::kArrayIndexValueMask)); | 599 and_(hash, Immediate(String::kArrayIndexValueMask)); |
| 600 shr(hash, Immediate(String::kHashShift)); | 600 shr(hash, Immediate(String::kHashShift)); |
| 601 // Here we actually clobber the key which will be used if calling into | 601 // Here we actually clobber the key which will be used if calling into |
| 602 // runtime later. However as the new key is the numeric value of a string key | 602 // runtime later. However as the new key is the numeric value of a string key |
| 603 // there is no difference in using either key. | 603 // there is no difference in using either key. |
| 604 Integer32ToSmi(index, hash); | 604 Integer32ToSmi(index, hash); |
| 605 } | 605 } |
| 606 | 606 |
| 607 | 607 |
| 608 void MacroAssembler::CallRuntime(Runtime::FunctionId id, int num_arguments) { | |
| 609 CallRuntime(Runtime::FunctionForId(id), num_arguments); | |
| 610 } | |
| 611 | |
| 612 | |
| 613 void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) { | |
| 614 const Runtime::Function* function = Runtime::FunctionForId(id); | |
| 615 Set(rax, function->nargs); | |
| 616 LoadAddress(rbx, ExternalReference(function, isolate())); | |
| 617 CEntryStub ces(1, kSaveFPRegs); | |
| 618 CallStub(&ces); | |
| 619 } | |
| 620 | |
| 621 | |
| 622 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 608 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
| 623 int num_arguments) { | 609 int num_arguments, |
| 610 SaveFPRegsMode save_doubles) { |
| 624 // If the expected number of arguments of the runtime function is | 611 // If the expected number of arguments of the runtime function is |
| 625 // constant, we check that the actual number of arguments match the | 612 // constant, we check that the actual number of arguments match the |
| 626 // expectation. | 613 // expectation. |
| 627 if (f->nargs >= 0 && f->nargs != num_arguments) { | 614 if (f->nargs >= 0 && f->nargs != num_arguments) { |
| 628 IllegalOperation(num_arguments); | 615 IllegalOperation(num_arguments); |
| 629 return; | 616 return; |
| 630 } | 617 } |
| 631 | 618 |
| 632 // TODO(1236192): Most runtime routines don't need the number of | 619 // TODO(1236192): Most runtime routines don't need the number of |
| 633 // arguments passed in because it is constant. At some point we | 620 // arguments passed in because it is constant. At some point we |
| 634 // should remove this need and make the runtime routine entry code | 621 // should remove this need and make the runtime routine entry code |
| 635 // smarter. | 622 // smarter. |
| 636 Set(rax, num_arguments); | 623 Set(rax, num_arguments); |
| 637 LoadAddress(rbx, ExternalReference(f, isolate())); | 624 LoadAddress(rbx, ExternalReference(f, isolate())); |
| 638 CEntryStub ces(f->result_size); | 625 CEntryStub ces(f->result_size, save_doubles); |
| 639 CallStub(&ces); | 626 CallStub(&ces); |
| 640 } | 627 } |
| 641 | 628 |
| 642 | 629 |
| 643 void MacroAssembler::CallExternalReference(const ExternalReference& ext, | 630 void MacroAssembler::CallExternalReference(const ExternalReference& ext, |
| 644 int num_arguments) { | 631 int num_arguments) { |
| 645 Set(rax, num_arguments); | 632 Set(rax, num_arguments); |
| 646 LoadAddress(rbx, ext); | 633 LoadAddress(rbx, ext); |
| 647 | 634 |
| 648 CEntryStub stub(1); | 635 CEntryStub stub(1); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 cvtlsi2sd(dst, src); | 940 cvtlsi2sd(dst, src); |
| 954 } | 941 } |
| 955 | 942 |
| 956 | 943 |
| 957 void MacroAssembler::Cvtlsi2sd(XMMRegister dst, const Operand& src) { | 944 void MacroAssembler::Cvtlsi2sd(XMMRegister dst, const Operand& src) { |
| 958 xorps(dst, dst); | 945 xorps(dst, dst); |
| 959 cvtlsi2sd(dst, src); | 946 cvtlsi2sd(dst, src); |
| 960 } | 947 } |
| 961 | 948 |
| 962 | 949 |
| 950 void MacroAssembler::Load(Register dst, const Operand& src, Representation r) { |
| 951 if (r.IsByte()) { |
| 952 movzxbl(dst, src); |
| 953 } else if (r.IsInteger32()) { |
| 954 movl(dst, src); |
| 955 } else { |
| 956 movq(dst, src); |
| 957 } |
| 958 } |
| 959 |
| 960 |
| 961 void MacroAssembler::Store(const Operand& dst, Register src, Representation r) { |
| 962 if (r.IsByte()) { |
| 963 movb(dst, src); |
| 964 } else if (r.IsInteger32()) { |
| 965 movl(dst, src); |
| 966 } else { |
| 967 movq(dst, src); |
| 968 } |
| 969 } |
| 970 |
| 971 |
| 963 void MacroAssembler::Set(Register dst, int64_t x) { | 972 void MacroAssembler::Set(Register dst, int64_t x) { |
| 964 if (x == 0) { | 973 if (x == 0) { |
| 965 xorl(dst, dst); | 974 xorl(dst, dst); |
| 966 } else if (is_uint32(x)) { | 975 } else if (is_uint32(x)) { |
| 967 movl(dst, Immediate(static_cast<uint32_t>(x))); | 976 movl(dst, Immediate(static_cast<uint32_t>(x))); |
| 968 } else if (is_int32(x)) { | 977 } else if (is_int32(x)) { |
| 969 movq(dst, Immediate(static_cast<int32_t>(x))); | 978 movq(dst, Immediate(static_cast<int32_t>(x))); |
| 970 } else { | 979 } else { |
| 971 movq(dst, x, RelocInfo::NONE64); | 980 movq(dst, x, RelocInfo::NONE64); |
| 972 } | 981 } |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1440 | 1449 |
| 1441 void MacroAssembler::JumpUnlessBothNonNegativeSmi(Register src1, | 1450 void MacroAssembler::JumpUnlessBothNonNegativeSmi(Register src1, |
| 1442 Register src2, | 1451 Register src2, |
| 1443 Label* on_not_both_smi, | 1452 Label* on_not_both_smi, |
| 1444 Label::Distance near_jump) { | 1453 Label::Distance near_jump) { |
| 1445 Condition both_smi = CheckBothNonNegativeSmi(src1, src2); | 1454 Condition both_smi = CheckBothNonNegativeSmi(src1, src2); |
| 1446 j(NegateCondition(both_smi), on_not_both_smi, near_jump); | 1455 j(NegateCondition(both_smi), on_not_both_smi, near_jump); |
| 1447 } | 1456 } |
| 1448 | 1457 |
| 1449 | 1458 |
| 1450 void MacroAssembler::SmiTryAddConstant(Register dst, | |
| 1451 Register src, | |
| 1452 Smi* constant, | |
| 1453 Label* on_not_smi_result, | |
| 1454 Label::Distance near_jump) { | |
| 1455 // Does not assume that src is a smi. | |
| 1456 ASSERT_EQ(static_cast<int>(1), static_cast<int>(kSmiTagMask)); | |
| 1457 STATIC_ASSERT(kSmiTag == 0); | |
| 1458 ASSERT(!dst.is(kScratchRegister)); | |
| 1459 ASSERT(!src.is(kScratchRegister)); | |
| 1460 | |
| 1461 JumpIfNotSmi(src, on_not_smi_result, near_jump); | |
| 1462 Register tmp = (dst.is(src) ? kScratchRegister : dst); | |
| 1463 LoadSmiConstant(tmp, constant); | |
| 1464 addq(tmp, src); | |
| 1465 j(overflow, on_not_smi_result, near_jump); | |
| 1466 if (dst.is(src)) { | |
| 1467 movq(dst, tmp); | |
| 1468 } | |
| 1469 } | |
| 1470 | |
| 1471 | |
| 1472 void MacroAssembler::SmiAddConstant(Register dst, Register src, Smi* constant) { | 1459 void MacroAssembler::SmiAddConstant(Register dst, Register src, Smi* constant) { |
| 1473 if (constant->value() == 0) { | 1460 if (constant->value() == 0) { |
| 1474 if (!dst.is(src)) { | 1461 if (!dst.is(src)) { |
| 1475 movq(dst, src); | 1462 movq(dst, src); |
| 1476 } | 1463 } |
| 1477 return; | 1464 return; |
| 1478 } else if (dst.is(src)) { | 1465 } else if (dst.is(src)) { |
| 1479 ASSERT(!dst.is(kScratchRegister)); | 1466 ASSERT(!dst.is(kScratchRegister)); |
| 1480 switch (constant->value()) { | 1467 switch (constant->value()) { |
| 1481 case 1: | 1468 case 1: |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1530 Smi* constant, | 1517 Smi* constant, |
| 1531 Label* on_not_smi_result, | 1518 Label* on_not_smi_result, |
| 1532 Label::Distance near_jump) { | 1519 Label::Distance near_jump) { |
| 1533 if (constant->value() == 0) { | 1520 if (constant->value() == 0) { |
| 1534 if (!dst.is(src)) { | 1521 if (!dst.is(src)) { |
| 1535 movq(dst, src); | 1522 movq(dst, src); |
| 1536 } | 1523 } |
| 1537 } else if (dst.is(src)) { | 1524 } else if (dst.is(src)) { |
| 1538 ASSERT(!dst.is(kScratchRegister)); | 1525 ASSERT(!dst.is(kScratchRegister)); |
| 1539 | 1526 |
| 1527 Label done; |
| 1540 LoadSmiConstant(kScratchRegister, constant); | 1528 LoadSmiConstant(kScratchRegister, constant); |
| 1541 addq(kScratchRegister, src); | 1529 addq(dst, kScratchRegister); |
| 1542 j(overflow, on_not_smi_result, near_jump); | 1530 j(no_overflow, &done, Label::kNear); |
| 1543 movq(dst, kScratchRegister); | 1531 // Restore src. |
| 1532 subq(dst, kScratchRegister); |
| 1533 jmp(on_not_smi_result, near_jump); |
| 1534 bind(&done); |
| 1544 } else { | 1535 } else { |
| 1545 LoadSmiConstant(dst, constant); | 1536 LoadSmiConstant(dst, constant); |
| 1546 addq(dst, src); | 1537 addq(dst, src); |
| 1547 j(overflow, on_not_smi_result, near_jump); | 1538 j(overflow, on_not_smi_result, near_jump); |
| 1548 } | 1539 } |
| 1549 } | 1540 } |
| 1550 | 1541 |
| 1551 | 1542 |
| 1552 void MacroAssembler::SmiSubConstant(Register dst, Register src, Smi* constant) { | 1543 void MacroAssembler::SmiSubConstant(Register dst, Register src, Smi* constant) { |
| 1553 if (constant->value() == 0) { | 1544 if (constant->value() == 0) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1633 } else { | 1624 } else { |
| 1634 movq(dst, src); | 1625 movq(dst, src); |
| 1635 neg(dst); | 1626 neg(dst); |
| 1636 cmpq(dst, src); | 1627 cmpq(dst, src); |
| 1637 // If the result is zero or Smi::kMinValue, negation failed to create a smi. | 1628 // If the result is zero or Smi::kMinValue, negation failed to create a smi. |
| 1638 j(not_equal, on_smi_result, near_jump); | 1629 j(not_equal, on_smi_result, near_jump); |
| 1639 } | 1630 } |
| 1640 } | 1631 } |
| 1641 | 1632 |
| 1642 | 1633 |
| 1634 template<class T> |
| 1635 static void SmiAddHelper(MacroAssembler* masm, |
| 1636 Register dst, |
| 1637 Register src1, |
| 1638 T src2, |
| 1639 Label* on_not_smi_result, |
| 1640 Label::Distance near_jump) { |
| 1641 if (dst.is(src1)) { |
| 1642 Label done; |
| 1643 masm->addq(dst, src2); |
| 1644 masm->j(no_overflow, &done, Label::kNear); |
| 1645 // Restore src1. |
| 1646 masm->subq(dst, src2); |
| 1647 masm->jmp(on_not_smi_result, near_jump); |
| 1648 masm->bind(&done); |
| 1649 } else { |
| 1650 masm->movq(dst, src1); |
| 1651 masm->addq(dst, src2); |
| 1652 masm->j(overflow, on_not_smi_result, near_jump); |
| 1653 } |
| 1654 } |
| 1655 |
| 1656 |
| 1643 void MacroAssembler::SmiAdd(Register dst, | 1657 void MacroAssembler::SmiAdd(Register dst, |
| 1644 Register src1, | 1658 Register src1, |
| 1645 Register src2, | 1659 Register src2, |
| 1646 Label* on_not_smi_result, | 1660 Label* on_not_smi_result, |
| 1647 Label::Distance near_jump) { | 1661 Label::Distance near_jump) { |
| 1648 ASSERT_NOT_NULL(on_not_smi_result); | 1662 ASSERT_NOT_NULL(on_not_smi_result); |
| 1649 ASSERT(!dst.is(src2)); | 1663 ASSERT(!dst.is(src2)); |
| 1650 if (dst.is(src1)) { | 1664 SmiAddHelper<Register>(this, dst, src1, src2, on_not_smi_result, near_jump); |
| 1651 movq(kScratchRegister, src1); | |
| 1652 addq(kScratchRegister, src2); | |
| 1653 j(overflow, on_not_smi_result, near_jump); | |
| 1654 movq(dst, kScratchRegister); | |
| 1655 } else { | |
| 1656 movq(dst, src1); | |
| 1657 addq(dst, src2); | |
| 1658 j(overflow, on_not_smi_result, near_jump); | |
| 1659 } | |
| 1660 } | 1665 } |
| 1661 | 1666 |
| 1662 | 1667 |
| 1663 void MacroAssembler::SmiAdd(Register dst, | 1668 void MacroAssembler::SmiAdd(Register dst, |
| 1664 Register src1, | 1669 Register src1, |
| 1665 const Operand& src2, | 1670 const Operand& src2, |
| 1666 Label* on_not_smi_result, | 1671 Label* on_not_smi_result, |
| 1667 Label::Distance near_jump) { | 1672 Label::Distance near_jump) { |
| 1668 ASSERT_NOT_NULL(on_not_smi_result); | 1673 ASSERT_NOT_NULL(on_not_smi_result); |
| 1669 if (dst.is(src1)) { | 1674 ASSERT(!src2.AddressUsesRegister(dst)); |
| 1670 movq(kScratchRegister, src1); | 1675 SmiAddHelper<Operand>(this, dst, src1, src2, on_not_smi_result, near_jump); |
| 1671 addq(kScratchRegister, src2); | |
| 1672 j(overflow, on_not_smi_result, near_jump); | |
| 1673 movq(dst, kScratchRegister); | |
| 1674 } else { | |
| 1675 ASSERT(!src2.AddressUsesRegister(dst)); | |
| 1676 movq(dst, src1); | |
| 1677 addq(dst, src2); | |
| 1678 j(overflow, on_not_smi_result, near_jump); | |
| 1679 } | |
| 1680 } | 1676 } |
| 1681 | 1677 |
| 1682 | 1678 |
| 1683 void MacroAssembler::SmiAdd(Register dst, | 1679 void MacroAssembler::SmiAdd(Register dst, |
| 1684 Register src1, | 1680 Register src1, |
| 1685 Register src2) { | 1681 Register src2) { |
| 1686 // No overflow checking. Use only when it's known that | 1682 // No overflow checking. Use only when it's known that |
| 1687 // overflowing is impossible. | 1683 // overflowing is impossible. |
| 1688 if (!dst.is(src1)) { | 1684 if (!dst.is(src1)) { |
| 1689 if (emit_debug_code()) { | 1685 if (emit_debug_code()) { |
| (...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2762 | 2758 |
| 2763 | 2759 |
| 2764 Operand MacroAssembler::SafepointRegisterSlot(Register reg) { | 2760 Operand MacroAssembler::SafepointRegisterSlot(Register reg) { |
| 2765 return Operand(rsp, SafepointRegisterStackIndex(reg.code()) * kPointerSize); | 2761 return Operand(rsp, SafepointRegisterStackIndex(reg.code()) * kPointerSize); |
| 2766 } | 2762 } |
| 2767 | 2763 |
| 2768 | 2764 |
| 2769 void MacroAssembler::PushTryHandler(StackHandler::Kind kind, | 2765 void MacroAssembler::PushTryHandler(StackHandler::Kind kind, |
| 2770 int handler_index) { | 2766 int handler_index) { |
| 2771 // Adjust this code if not the case. | 2767 // Adjust this code if not the case. |
| 2772 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); | 2768 STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize + |
| 2769 kFPOnStackSize); |
| 2773 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 2770 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
| 2774 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); | 2771 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); |
| 2775 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); | 2772 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); |
| 2776 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); | 2773 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); |
| 2777 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); | 2774 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); |
| 2778 | 2775 |
| 2779 // We will build up the handler from the bottom by pushing on the stack. | 2776 // We will build up the handler from the bottom by pushing on the stack. |
| 2780 // First push the frame pointer and context. | 2777 // First push the frame pointer and context. |
| 2781 if (kind == StackHandler::JS_ENTRY) { | 2778 if (kind == StackHandler::JS_ENTRY) { |
| 2782 // The frame pointer does not point to a JS frame so we save NULL for | 2779 // The frame pointer does not point to a JS frame so we save NULL for |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2821 movq(rdx, | 2818 movq(rdx, |
| 2822 FieldOperand(rbx, rdx, times_pointer_size, FixedArray::kHeaderSize)); | 2819 FieldOperand(rbx, rdx, times_pointer_size, FixedArray::kHeaderSize)); |
| 2823 SmiToInteger64(rdx, rdx); | 2820 SmiToInteger64(rdx, rdx); |
| 2824 lea(rdi, FieldOperand(rdi, rdx, times_1, Code::kHeaderSize)); | 2821 lea(rdi, FieldOperand(rdi, rdx, times_1, Code::kHeaderSize)); |
| 2825 jmp(rdi); | 2822 jmp(rdi); |
| 2826 } | 2823 } |
| 2827 | 2824 |
| 2828 | 2825 |
| 2829 void MacroAssembler::Throw(Register value) { | 2826 void MacroAssembler::Throw(Register value) { |
| 2830 // Adjust this code if not the case. | 2827 // Adjust this code if not the case. |
| 2831 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); | 2828 STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize + |
| 2829 kFPOnStackSize); |
| 2832 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 2830 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
| 2833 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); | 2831 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); |
| 2834 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); | 2832 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); |
| 2835 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); | 2833 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); |
| 2836 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); | 2834 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); |
| 2837 | 2835 |
| 2838 // The exception is expected in rax. | 2836 // The exception is expected in rax. |
| 2839 if (!value.is(rax)) { | 2837 if (!value.is(rax)) { |
| 2840 movq(rax, value); | 2838 movq(rax, value); |
| 2841 } | 2839 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2861 j(zero, &skip, Label::kNear); | 2859 j(zero, &skip, Label::kNear); |
| 2862 movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi); | 2860 movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi); |
| 2863 bind(&skip); | 2861 bind(&skip); |
| 2864 | 2862 |
| 2865 JumpToHandlerEntry(); | 2863 JumpToHandlerEntry(); |
| 2866 } | 2864 } |
| 2867 | 2865 |
| 2868 | 2866 |
| 2869 void MacroAssembler::ThrowUncatchable(Register value) { | 2867 void MacroAssembler::ThrowUncatchable(Register value) { |
| 2870 // Adjust this code if not the case. | 2868 // Adjust this code if not the case. |
| 2871 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); | 2869 STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize + |
| 2870 kFPOnStackSize); |
| 2872 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 2871 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
| 2873 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); | 2872 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); |
| 2874 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); | 2873 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); |
| 2875 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); | 2874 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); |
| 2876 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); | 2875 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); |
| 2877 | 2876 |
| 2878 // The exception is expected in rax. | 2877 // The exception is expected in rax. |
| 2879 if (!value.is(rax)) { | 2878 if (!value.is(rax)) { |
| 2880 movq(rax, value); | 2879 movq(rax, value); |
| 2881 } | 2880 } |
| (...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3701 Check(equal, kStackFrameTypesMustMatch); | 3700 Check(equal, kStackFrameTypesMustMatch); |
| 3702 } | 3701 } |
| 3703 movq(rsp, rbp); | 3702 movq(rsp, rbp); |
| 3704 pop(rbp); | 3703 pop(rbp); |
| 3705 } | 3704 } |
| 3706 | 3705 |
| 3707 | 3706 |
| 3708 void MacroAssembler::EnterExitFramePrologue(bool save_rax) { | 3707 void MacroAssembler::EnterExitFramePrologue(bool save_rax) { |
| 3709 // Set up the frame structure on the stack. | 3708 // Set up the frame structure on the stack. |
| 3710 // All constants are relative to the frame pointer of the exit frame. | 3709 // All constants are relative to the frame pointer of the exit frame. |
| 3711 ASSERT(ExitFrameConstants::kCallerSPDisplacement == +2 * kPointerSize); | 3710 ASSERT(ExitFrameConstants::kCallerSPDisplacement == |
| 3712 ASSERT(ExitFrameConstants::kCallerPCOffset == +1 * kPointerSize); | 3711 kFPOnStackSize + kPCOnStackSize); |
| 3713 ASSERT(ExitFrameConstants::kCallerFPOffset == 0 * kPointerSize); | 3712 ASSERT(ExitFrameConstants::kCallerPCOffset == kFPOnStackSize); |
| 3713 ASSERT(ExitFrameConstants::kCallerFPOffset == 0 * kPointerSize); |
| 3714 push(rbp); | 3714 push(rbp); |
| 3715 movq(rbp, rsp); | 3715 movq(rbp, rsp); |
| 3716 | 3716 |
| 3717 // Reserve room for entry stack pointer and push the code object. | 3717 // Reserve room for entry stack pointer and push the code object. |
| 3718 ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize); | 3718 ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize); |
| 3719 push(Immediate(0)); // Saved entry sp, patched before call. | 3719 push(Immediate(0)); // Saved entry sp, patched before call. |
| 3720 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT); | 3720 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT); |
| 3721 push(kScratchRegister); // Accessed from EditFrame::code_slot. | 3721 push(kScratchRegister); // Accessed from EditFrame::code_slot. |
| 3722 | 3722 |
| 3723 // Save the frame pointer and the context in top. | 3723 // Save the frame pointer and the context in top. |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4927 j(greater, &no_memento_available); | 4927 j(greater, &no_memento_available); |
| 4928 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), | 4928 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), |
| 4929 Heap::kAllocationMementoMapRootIndex); | 4929 Heap::kAllocationMementoMapRootIndex); |
| 4930 bind(&no_memento_available); | 4930 bind(&no_memento_available); |
| 4931 } | 4931 } |
| 4932 | 4932 |
| 4933 | 4933 |
| 4934 } } // namespace v8::internal | 4934 } } // namespace v8::internal |
| 4935 | 4935 |
| 4936 #endif // V8_TARGET_ARCH_X64 | 4936 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |