| 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 1756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1767 movq(scratch, Operand(base, 0)); | 1767 movq(scratch, Operand(base, 0)); |
| 1768 ExternalReference reg_addr = | 1768 ExternalReference reg_addr = |
| 1769 ExternalReference(Debug_Address::Register(i)); | 1769 ExternalReference(Debug_Address::Register(i)); |
| 1770 movq(kScratchRegister, reg_addr); | 1770 movq(kScratchRegister, reg_addr); |
| 1771 movq(Operand(kScratchRegister, 0), scratch); | 1771 movq(Operand(kScratchRegister, 0), scratch); |
| 1772 lea(base, Operand(base, kPointerSize)); | 1772 lea(base, Operand(base, kPointerSize)); |
| 1773 } | 1773 } |
| 1774 } | 1774 } |
| 1775 } | 1775 } |
| 1776 | 1776 |
| 1777 void MacroAssembler::DebugBreak() { |
| 1778 ASSERT(allow_stub_calls()); |
| 1779 xor_(rax, rax); // no arguments |
| 1780 movq(rbx, ExternalReference(Runtime::kDebugBreak)); |
| 1781 CEntryStub ces(1); |
| 1782 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); |
| 1783 } |
| 1777 #endif // ENABLE_DEBUGGER_SUPPORT | 1784 #endif // ENABLE_DEBUGGER_SUPPORT |
| 1778 | 1785 |
| 1779 | 1786 |
| 1780 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag) { | 1787 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag) { |
| 1781 bool resolved; | 1788 bool resolved; |
| 1782 Handle<Code> code = ResolveBuiltin(id, &resolved); | 1789 Handle<Code> code = ResolveBuiltin(id, &resolved); |
| 1783 | 1790 |
| 1784 // Calls are not allowed in some stubs. | 1791 // Calls are not allowed in some stubs. |
| 1785 ASSERT(flag == JUMP_FUNCTION || allow_stub_calls()); | 1792 ASSERT(flag == JUMP_FUNCTION || allow_stub_calls()); |
| 1786 | 1793 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1958 // Setup the frame structure on the stack. | 1965 // Setup the frame structure on the stack. |
| 1959 // All constants are relative to the frame pointer of the exit frame. | 1966 // All constants are relative to the frame pointer of the exit frame. |
| 1960 ASSERT(ExitFrameConstants::kCallerSPDisplacement == +2 * kPointerSize); | 1967 ASSERT(ExitFrameConstants::kCallerSPDisplacement == +2 * kPointerSize); |
| 1961 ASSERT(ExitFrameConstants::kCallerPCOffset == +1 * kPointerSize); | 1968 ASSERT(ExitFrameConstants::kCallerPCOffset == +1 * kPointerSize); |
| 1962 ASSERT(ExitFrameConstants::kCallerFPOffset == 0 * kPointerSize); | 1969 ASSERT(ExitFrameConstants::kCallerFPOffset == 0 * kPointerSize); |
| 1963 push(rbp); | 1970 push(rbp); |
| 1964 movq(rbp, rsp); | 1971 movq(rbp, rsp); |
| 1965 | 1972 |
| 1966 // Reserve room for entry stack pointer and push the debug marker. | 1973 // Reserve room for entry stack pointer and push the debug marker. |
| 1967 ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize); | 1974 ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize); |
| 1968 push(Immediate(0)); // saved entry sp, patched before call | 1975 push(Immediate(0)); // Saved entry sp, patched before call. |
| 1969 if (mode == ExitFrame::MODE_DEBUG) { | 1976 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT); |
| 1970 push(Immediate(0)); | 1977 push(kScratchRegister); // Accessed from EditFrame::code_slot. |
| 1971 } else { | |
| 1972 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT); | |
| 1973 push(kScratchRegister); | |
| 1974 } | |
| 1975 | 1978 |
| 1976 // Save the frame pointer and the context in top. | 1979 // Save the frame pointer and the context in top. |
| 1977 ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address); | 1980 ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address); |
| 1978 ExternalReference context_address(Top::k_context_address); | 1981 ExternalReference context_address(Top::k_context_address); |
| 1979 movq(r14, rax); // Backup rax before we use it. | 1982 movq(r14, rax); // Backup rax before we use it. |
| 1980 | 1983 |
| 1981 movq(rax, rbp); | 1984 movq(rax, rbp); |
| 1982 store_rax(c_entry_fp_address); | 1985 store_rax(c_entry_fp_address); |
| 1983 movq(rax, rsi); | 1986 movq(rax, rsi); |
| 1984 store_rax(context_address); | 1987 store_rax(context_address); |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2579 CodePatcher::~CodePatcher() { | 2582 CodePatcher::~CodePatcher() { |
| 2580 // Indicate that code has changed. | 2583 // Indicate that code has changed. |
| 2581 CPU::FlushICache(address_, size_); | 2584 CPU::FlushICache(address_, size_); |
| 2582 | 2585 |
| 2583 // Check that the code was patched as expected. | 2586 // Check that the code was patched as expected. |
| 2584 ASSERT(masm_.pc_ == address_ + size_); | 2587 ASSERT(masm_.pc_ == address_ + size_); |
| 2585 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2588 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 2586 } | 2589 } |
| 2587 | 2590 |
| 2588 } } // namespace v8::internal | 2591 } } // namespace v8::internal |
| OLD | NEW |