| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1615 push(rbp); | 1615 push(rbp); |
| 1616 } else { | 1616 } else { |
| 1617 ASSERT(try_location == IN_JS_ENTRY); | 1617 ASSERT(try_location == IN_JS_ENTRY); |
| 1618 // The frame pointer does not point to a JS frame so we save NULL | 1618 // The frame pointer does not point to a JS frame so we save NULL |
| 1619 // for rbp. We expect the code throwing an exception to check rbp | 1619 // for rbp. We expect the code throwing an exception to check rbp |
| 1620 // before dereferencing it to restore the context. | 1620 // before dereferencing it to restore the context. |
| 1621 push(Immediate(StackHandler::ENTRY)); | 1621 push(Immediate(StackHandler::ENTRY)); |
| 1622 push(Immediate(0)); // NULL frame pointer. | 1622 push(Immediate(0)); // NULL frame pointer. |
| 1623 } | 1623 } |
| 1624 // Save the current handler. | 1624 // Save the current handler. |
| 1625 movq(kScratchRegister, ExternalReference(Top::k_handler_address)); | 1625 movq(kScratchRegister, ExternalReference(Isolate::k_handler_address)); |
| 1626 push(Operand(kScratchRegister, 0)); | 1626 push(Operand(kScratchRegister, 0)); |
| 1627 // Link this handler. | 1627 // Link this handler. |
| 1628 movq(Operand(kScratchRegister, 0), rsp); | 1628 movq(Operand(kScratchRegister, 0), rsp); |
| 1629 } | 1629 } |
| 1630 | 1630 |
| 1631 | 1631 |
| 1632 void MacroAssembler::PopTryHandler() { | 1632 void MacroAssembler::PopTryHandler() { |
| 1633 ASSERT_EQ(0, StackHandlerConstants::kNextOffset); | 1633 ASSERT_EQ(0, StackHandlerConstants::kNextOffset); |
| 1634 // Unlink this handler. | 1634 // Unlink this handler. |
| 1635 movq(kScratchRegister, ExternalReference(Top::k_handler_address)); | 1635 movq(kScratchRegister, ExternalReference(Isolate::k_handler_address)); |
| 1636 pop(Operand(kScratchRegister, 0)); | 1636 pop(Operand(kScratchRegister, 0)); |
| 1637 // Remove the remaining fields. | 1637 // Remove the remaining fields. |
| 1638 addq(rsp, Immediate(StackHandlerConstants::kSize - kPointerSize)); | 1638 addq(rsp, Immediate(StackHandlerConstants::kSize - kPointerSize)); |
| 1639 } | 1639 } |
| 1640 | 1640 |
| 1641 | 1641 |
| 1642 void MacroAssembler::Ret() { | 1642 void MacroAssembler::Ret() { |
| 1643 ret(0); | 1643 ret(0); |
| 1644 } | 1644 } |
| 1645 | 1645 |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2051 push(rbp); | 2051 push(rbp); |
| 2052 movq(rbp, rsp); | 2052 movq(rbp, rsp); |
| 2053 | 2053 |
| 2054 // Reserve room for entry stack pointer and push the debug marker. | 2054 // Reserve room for entry stack pointer and push the debug marker. |
| 2055 ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize); | 2055 ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize); |
| 2056 push(Immediate(0)); // Saved entry sp, patched before call. | 2056 push(Immediate(0)); // Saved entry sp, patched before call. |
| 2057 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT); | 2057 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT); |
| 2058 push(kScratchRegister); // Accessed from EditFrame::code_slot. | 2058 push(kScratchRegister); // Accessed from EditFrame::code_slot. |
| 2059 | 2059 |
| 2060 // Save the frame pointer and the context in top. | 2060 // Save the frame pointer and the context in top. |
| 2061 ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address); | 2061 ExternalReference c_entry_fp_address(Isolate::k_c_entry_fp_address); |
| 2062 ExternalReference context_address(Top::k_context_address); | 2062 ExternalReference context_address(Isolate::k_context_address); |
| 2063 movq(r14, rax); // Backup rax before we use it. | 2063 movq(r14, rax); // Backup rax before we use it. |
| 2064 | 2064 |
| 2065 movq(rax, rbp); | 2065 movq(rax, rbp); |
| 2066 store_rax(c_entry_fp_address); | 2066 store_rax(c_entry_fp_address); |
| 2067 movq(rax, rsi); | 2067 movq(rax, rsi); |
| 2068 store_rax(context_address); | 2068 store_rax(context_address); |
| 2069 | 2069 |
| 2070 // Setup argv in callee-saved register r15. It is reused in LeaveExitFrame, | 2070 // Setup argv in callee-saved register r15. It is reused in LeaveExitFrame, |
| 2071 // so it must be retained across the C-call. | 2071 // so it must be retained across the C-call. |
| 2072 int offset = StandardFrameConstants::kCallerSPOffset - kPointerSize; | 2072 int offset = StandardFrameConstants::kCallerSPOffset - kPointerSize; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2132 | 2132 |
| 2133 // Get the return address from the stack and restore the frame pointer. | 2133 // Get the return address from the stack and restore the frame pointer. |
| 2134 movq(rcx, Operand(rbp, 1 * kPointerSize)); | 2134 movq(rcx, Operand(rbp, 1 * kPointerSize)); |
| 2135 movq(rbp, Operand(rbp, 0 * kPointerSize)); | 2135 movq(rbp, Operand(rbp, 0 * kPointerSize)); |
| 2136 | 2136 |
| 2137 // Pop everything up to and including the arguments and the receiver | 2137 // Pop everything up to and including the arguments and the receiver |
| 2138 // from the caller stack. | 2138 // from the caller stack. |
| 2139 lea(rsp, Operand(r15, 1 * kPointerSize)); | 2139 lea(rsp, Operand(r15, 1 * kPointerSize)); |
| 2140 | 2140 |
| 2141 // Restore current context from top and clear it in debug mode. | 2141 // Restore current context from top and clear it in debug mode. |
| 2142 ExternalReference context_address(Top::k_context_address); | 2142 ExternalReference context_address(Isolate::k_context_address); |
| 2143 movq(kScratchRegister, context_address); | 2143 movq(kScratchRegister, context_address); |
| 2144 movq(rsi, Operand(kScratchRegister, 0)); | 2144 movq(rsi, Operand(kScratchRegister, 0)); |
| 2145 #ifdef DEBUG | 2145 #ifdef DEBUG |
| 2146 movq(Operand(kScratchRegister, 0), Immediate(0)); | 2146 movq(Operand(kScratchRegister, 0), Immediate(0)); |
| 2147 #endif | 2147 #endif |
| 2148 | 2148 |
| 2149 // Push the return address to get ready to return. | 2149 // Push the return address to get ready to return. |
| 2150 push(rcx); | 2150 push(rcx); |
| 2151 | 2151 |
| 2152 // Clear the top frame. | 2152 // Clear the top frame. |
| 2153 ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address); | 2153 ExternalReference c_entry_fp_address(Isolate::k_c_entry_fp_address); |
| 2154 movq(kScratchRegister, c_entry_fp_address); | 2154 movq(kScratchRegister, c_entry_fp_address); |
| 2155 movq(Operand(kScratchRegister, 0), Immediate(0)); | 2155 movq(Operand(kScratchRegister, 0), Immediate(0)); |
| 2156 } | 2156 } |
| 2157 | 2157 |
| 2158 | 2158 |
| 2159 Register MacroAssembler::CheckMaps(JSObject* object, | 2159 Register MacroAssembler::CheckMaps(JSObject* object, |
| 2160 Register object_reg, | 2160 Register object_reg, |
| 2161 JSObject* holder, | 2161 JSObject* holder, |
| 2162 Register holder_reg, | 2162 Register holder_reg, |
| 2163 Register scratch, | 2163 Register scratch, |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2713 CPU::FlushICache(address_, size_); | 2713 CPU::FlushICache(address_, size_); |
| 2714 | 2714 |
| 2715 // Check that the code was patched as expected. | 2715 // Check that the code was patched as expected. |
| 2716 ASSERT(masm_.pc_ == address_ + size_); | 2716 ASSERT(masm_.pc_ == address_ + size_); |
| 2717 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2717 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 2718 } | 2718 } |
| 2719 | 2719 |
| 2720 } } // namespace v8::internal | 2720 } } // namespace v8::internal |
| 2721 | 2721 |
| 2722 #endif // V8_TARGET_ARCH_X64 | 2722 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |