Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 22267005: Use StackArgumenstAccessor and kPCOnStackSize/kFPOnStackSize to compute stack address/operand (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased with bleeding_edge Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2747 matching lines...) Expand 10 before | Expand all | Expand 10 after
2758 2758
2759 2759
2760 Operand MacroAssembler::SafepointRegisterSlot(Register reg) { 2760 Operand MacroAssembler::SafepointRegisterSlot(Register reg) {
2761 return Operand(rsp, SafepointRegisterStackIndex(reg.code()) * kPointerSize); 2761 return Operand(rsp, SafepointRegisterStackIndex(reg.code()) * kPointerSize);
2762 } 2762 }
2763 2763
2764 2764
2765 void MacroAssembler::PushTryHandler(StackHandler::Kind kind, 2765 void MacroAssembler::PushTryHandler(StackHandler::Kind kind,
2766 int handler_index) { 2766 int handler_index) {
2767 // Adjust this code if not the case. 2767 // Adjust this code if not the case.
2768 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); 2768 STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize +
2769 kFPOnStackSize);
2769 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); 2770 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
2770 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); 2771 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize);
2771 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); 2772 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize);
2772 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); 2773 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize);
2773 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); 2774 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize);
2774 2775
2775 // 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.
2776 // First push the frame pointer and context. 2777 // First push the frame pointer and context.
2777 if (kind == StackHandler::JS_ENTRY) { 2778 if (kind == StackHandler::JS_ENTRY) {
2778 // 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
2817 movq(rdx, 2818 movq(rdx,
2818 FieldOperand(rbx, rdx, times_pointer_size, FixedArray::kHeaderSize)); 2819 FieldOperand(rbx, rdx, times_pointer_size, FixedArray::kHeaderSize));
2819 SmiToInteger64(rdx, rdx); 2820 SmiToInteger64(rdx, rdx);
2820 lea(rdi, FieldOperand(rdi, rdx, times_1, Code::kHeaderSize)); 2821 lea(rdi, FieldOperand(rdi, rdx, times_1, Code::kHeaderSize));
2821 jmp(rdi); 2822 jmp(rdi);
2822 } 2823 }
2823 2824
2824 2825
2825 void MacroAssembler::Throw(Register value) { 2826 void MacroAssembler::Throw(Register value) {
2826 // Adjust this code if not the case. 2827 // Adjust this code if not the case.
2827 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); 2828 STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize +
2829 kFPOnStackSize);
2828 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); 2830 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
2829 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); 2831 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize);
2830 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); 2832 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize);
2831 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); 2833 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize);
2832 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); 2834 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize);
2833 2835
2834 // The exception is expected in rax. 2836 // The exception is expected in rax.
2835 if (!value.is(rax)) { 2837 if (!value.is(rax)) {
2836 movq(rax, value); 2838 movq(rax, value);
2837 } 2839 }
(...skipping 19 matching lines...) Expand all
2857 j(zero, &skip, Label::kNear); 2859 j(zero, &skip, Label::kNear);
2858 movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi); 2860 movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi);
2859 bind(&skip); 2861 bind(&skip);
2860 2862
2861 JumpToHandlerEntry(); 2863 JumpToHandlerEntry();
2862 } 2864 }
2863 2865
2864 2866
2865 void MacroAssembler::ThrowUncatchable(Register value) { 2867 void MacroAssembler::ThrowUncatchable(Register value) {
2866 // Adjust this code if not the case. 2868 // Adjust this code if not the case.
2867 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); 2869 STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize +
2870 kFPOnStackSize);
2868 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); 2871 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
2869 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); 2872 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize);
2870 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); 2873 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize);
2871 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); 2874 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize);
2872 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); 2875 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize);
2873 2876
2874 // The exception is expected in rax. 2877 // The exception is expected in rax.
2875 if (!value.is(rax)) { 2878 if (!value.is(rax)) {
2876 movq(rax, value); 2879 movq(rax, value);
2877 } 2880 }
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
3697 Check(equal, kStackFrameTypesMustMatch); 3700 Check(equal, kStackFrameTypesMustMatch);
3698 } 3701 }
3699 movq(rsp, rbp); 3702 movq(rsp, rbp);
3700 pop(rbp); 3703 pop(rbp);
3701 } 3704 }
3702 3705
3703 3706
3704 void MacroAssembler::EnterExitFramePrologue(bool save_rax) { 3707 void MacroAssembler::EnterExitFramePrologue(bool save_rax) {
3705 // Set up the frame structure on the stack. 3708 // Set up the frame structure on the stack.
3706 // 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.
3707 ASSERT(ExitFrameConstants::kCallerSPDisplacement == +2 * kPointerSize); 3710 ASSERT(ExitFrameConstants::kCallerSPDisplacement ==
3708 ASSERT(ExitFrameConstants::kCallerPCOffset == +1 * kPointerSize); 3711 kFPOnStackSize + kPCOnStackSize);
3709 ASSERT(ExitFrameConstants::kCallerFPOffset == 0 * kPointerSize); 3712 ASSERT(ExitFrameConstants::kCallerPCOffset == kFPOnStackSize);
3713 ASSERT(ExitFrameConstants::kCallerFPOffset == 0 * kPointerSize);
3710 push(rbp); 3714 push(rbp);
3711 movq(rbp, rsp); 3715 movq(rbp, rsp);
3712 3716
3713 // Reserve room for entry stack pointer and push the code object. 3717 // Reserve room for entry stack pointer and push the code object.
3714 ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize); 3718 ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize);
3715 push(Immediate(0)); // Saved entry sp, patched before call. 3719 push(Immediate(0)); // Saved entry sp, patched before call.
3716 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT); 3720 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT);
3717 push(kScratchRegister); // Accessed from EditFrame::code_slot. 3721 push(kScratchRegister); // Accessed from EditFrame::code_slot.
3718 3722
3719 // 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
4923 j(greater, &no_memento_available); 4927 j(greater, &no_memento_available);
4924 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), 4928 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize),
4925 Heap::kAllocationMementoMapRootIndex); 4929 Heap::kAllocationMementoMapRootIndex);
4926 bind(&no_memento_available); 4930 bind(&no_memento_available);
4927 } 4931 }
4928 4932
4929 4933
4930 } } // namespace v8::internal 4934 } } // namespace v8::internal
4931 4935
4932 #endif // V8_TARGET_ARCH_X64 4936 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698