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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 43333003: Move movq(Register, ExternalReference) into X64 MacroAssembler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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/builtins-x64.cc ('k') | src/x64/codegen-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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 __ xorl(rax, rdi); 624 __ xorl(rax, rdi);
625 __ xorl(rcx, rax); 625 __ xorl(rcx, rax);
626 ASSERT(IsPowerOf2(TranscendentalCache::SubCache::kCacheSize)); 626 ASSERT(IsPowerOf2(TranscendentalCache::SubCache::kCacheSize));
627 __ andl(rcx, Immediate(TranscendentalCache::SubCache::kCacheSize - 1)); 627 __ andl(rcx, Immediate(TranscendentalCache::SubCache::kCacheSize - 1));
628 628
629 // ST[0] == double value. 629 // ST[0] == double value.
630 // rbx = bits of double value. 630 // rbx = bits of double value.
631 // rcx = TranscendentalCache::hash(double value). 631 // rcx = TranscendentalCache::hash(double value).
632 ExternalReference cache_array = 632 ExternalReference cache_array =
633 ExternalReference::transcendental_cache_array_address(masm->isolate()); 633 ExternalReference::transcendental_cache_array_address(masm->isolate());
634 __ movq(rax, cache_array); 634 __ Move(rax, cache_array);
635 int cache_array_index = 635 int cache_array_index =
636 type_ * sizeof(masm->isolate()->transcendental_cache()->caches_[0]); 636 type_ * sizeof(masm->isolate()->transcendental_cache()->caches_[0]);
637 __ movq(rax, Operand(rax, cache_array_index)); 637 __ movq(rax, Operand(rax, cache_array_index));
638 // rax points to the cache for the type type_. 638 // rax points to the cache for the type type_.
639 // If NULL, the cache hasn't been initialized yet, so go through runtime. 639 // If NULL, the cache hasn't been initialized yet, so go through runtime.
640 __ testq(rax, rax); 640 __ testq(rax, rax);
641 __ j(zero, &runtime_call_clear_stack); // Only clears stack if TAGGED. 641 __ j(zero, &runtime_call_clear_stack); // Only clears stack if TAGGED.
642 #ifdef DEBUG 642 #ifdef DEBUG
643 // Check that the layout of cache elements match expectations. 643 // Check that the layout of cache elements match expectations.
644 { // NOLINT - doesn't like a single brace on a line. 644 { // NOLINT - doesn't like a single brace on a line.
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1866 __ LoadAddress(kScratchRegister, 1866 __ LoadAddress(kScratchRegister,
1867 ExternalReference::isolate_address(masm->isolate())); 1867 ExternalReference::isolate_address(masm->isolate()));
1868 __ movq(Operand(rsp, (argument_slots_on_stack - 1) * kPointerSize), 1868 __ movq(Operand(rsp, (argument_slots_on_stack - 1) * kPointerSize),
1869 kScratchRegister); 1869 kScratchRegister);
1870 1870
1871 // Argument 8: Indicate that this is a direct call from JavaScript. 1871 // Argument 8: Indicate that this is a direct call from JavaScript.
1872 __ movq(Operand(rsp, (argument_slots_on_stack - 2) * kPointerSize), 1872 __ movq(Operand(rsp, (argument_slots_on_stack - 2) * kPointerSize),
1873 Immediate(1)); 1873 Immediate(1));
1874 1874
1875 // Argument 7: Start (high end) of backtracking stack memory area. 1875 // Argument 7: Start (high end) of backtracking stack memory area.
1876 __ movq(kScratchRegister, address_of_regexp_stack_memory_address); 1876 __ Move(kScratchRegister, address_of_regexp_stack_memory_address);
1877 __ movq(r9, Operand(kScratchRegister, 0)); 1877 __ movq(r9, Operand(kScratchRegister, 0));
1878 __ movq(kScratchRegister, address_of_regexp_stack_memory_size); 1878 __ Move(kScratchRegister, address_of_regexp_stack_memory_size);
1879 __ addq(r9, Operand(kScratchRegister, 0)); 1879 __ addq(r9, Operand(kScratchRegister, 0));
1880 __ movq(Operand(rsp, (argument_slots_on_stack - 3) * kPointerSize), r9); 1880 __ movq(Operand(rsp, (argument_slots_on_stack - 3) * kPointerSize), r9);
1881 1881
1882 // Argument 6: Set the number of capture registers to zero to force global 1882 // Argument 6: Set the number of capture registers to zero to force global
1883 // regexps to behave as non-global. This does not affect non-global regexps. 1883 // regexps to behave as non-global. This does not affect non-global regexps.
1884 // Argument 6 is passed in r9 on Linux and on the stack on Windows. 1884 // Argument 6 is passed in r9 on Linux and on the stack on Windows.
1885 #ifdef _WIN64 1885 #ifdef _WIN64
1886 __ movq(Operand(rsp, (argument_slots_on_stack - 4) * kPointerSize), 1886 __ movq(Operand(rsp, (argument_slots_on_stack - 4) * kPointerSize),
1887 Immediate(0)); 1887 Immediate(0));
1888 #else 1888 #else
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
2803 // Check stack alignment. 2803 // Check stack alignment.
2804 if (FLAG_debug_code) { 2804 if (FLAG_debug_code) {
2805 __ CheckStackAlignment(); 2805 __ CheckStackAlignment();
2806 } 2806 }
2807 2807
2808 if (do_gc) { 2808 if (do_gc) {
2809 // Pass failure code returned from last attempt as first argument to 2809 // Pass failure code returned from last attempt as first argument to
2810 // PerformGC. No need to use PrepareCallCFunction/CallCFunction here as the 2810 // PerformGC. No need to use PrepareCallCFunction/CallCFunction here as the
2811 // stack is known to be aligned. This function takes one argument which is 2811 // stack is known to be aligned. This function takes one argument which is
2812 // passed in register. 2812 // passed in register.
2813 __ movq(arg_reg_2, ExternalReference::isolate_address(masm->isolate())); 2813 __ Move(arg_reg_2, ExternalReference::isolate_address(masm->isolate()));
2814 __ movq(arg_reg_1, rax); 2814 __ movq(arg_reg_1, rax);
2815 __ movq(kScratchRegister, 2815 __ Move(kScratchRegister,
2816 ExternalReference::perform_gc_function(masm->isolate())); 2816 ExternalReference::perform_gc_function(masm->isolate()));
2817 __ call(kScratchRegister); 2817 __ call(kScratchRegister);
2818 } 2818 }
2819 2819
2820 ExternalReference scope_depth = 2820 ExternalReference scope_depth =
2821 ExternalReference::heap_always_allocate_scope_depth(masm->isolate()); 2821 ExternalReference::heap_always_allocate_scope_depth(masm->isolate());
2822 if (always_allocate_scope) { 2822 if (always_allocate_scope) {
2823 Operand scope_depth_operand = masm->ExternalOperand(scope_depth); 2823 Operand scope_depth_operand = masm->ExternalOperand(scope_depth);
2824 __ incl(scope_depth_operand); 2824 __ incl(scope_depth_operand);
2825 } 2825 }
(...skipping 16 matching lines...) Expand all
2842 // Pass a pointer to the Arguments object as the second argument. 2842 // Pass a pointer to the Arguments object as the second argument.
2843 __ movq(rdx, r14); // argc. 2843 __ movq(rdx, r14); // argc.
2844 __ movq(r8, r15); // argv. 2844 __ movq(r8, r15); // argv.
2845 __ movq(r9, ExternalReference::isolate_address(masm->isolate())); 2845 __ movq(r9, ExternalReference::isolate_address(masm->isolate()));
2846 } 2846 }
2847 2847
2848 #else // _WIN64 2848 #else // _WIN64
2849 // GCC passes arguments in rdi, rsi, rdx, rcx, r8, r9. 2849 // GCC passes arguments in rdi, rsi, rdx, rcx, r8, r9.
2850 __ movq(rdi, r14); // argc. 2850 __ movq(rdi, r14); // argc.
2851 __ movq(rsi, r15); // argv. 2851 __ movq(rsi, r15); // argv.
2852 __ movq(rdx, ExternalReference::isolate_address(masm->isolate())); 2852 __ Move(rdx, ExternalReference::isolate_address(masm->isolate()));
2853 #endif 2853 #endif
2854 __ call(rbx); 2854 __ call(rbx);
2855 // Result is in rax - do not destroy this register! 2855 // Result is in rax - do not destroy this register!
2856 2856
2857 if (always_allocate_scope) { 2857 if (always_allocate_scope) {
2858 Operand scope_depth_operand = masm->ExternalOperand(scope_depth); 2858 Operand scope_depth_operand = masm->ExternalOperand(scope_depth);
2859 __ decl(scope_depth_operand); 2859 __ decl(scope_depth_operand);
2860 } 2860 }
2861 2861
2862 // Check for failure result. 2862 // Check for failure result.
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
3132 __ call(kScratchRegister); 3132 __ call(kScratchRegister);
3133 3133
3134 // Unlink this frame from the handler chain. 3134 // Unlink this frame from the handler chain.
3135 __ PopTryHandler(); 3135 __ PopTryHandler();
3136 3136
3137 __ bind(&exit); 3137 __ bind(&exit);
3138 // Check if the current stack frame is marked as the outermost JS frame. 3138 // Check if the current stack frame is marked as the outermost JS frame.
3139 __ pop(rbx); 3139 __ pop(rbx);
3140 __ Cmp(rbx, Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME)); 3140 __ Cmp(rbx, Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME));
3141 __ j(not_equal, &not_outermost_js_2); 3141 __ j(not_equal, &not_outermost_js_2);
3142 __ movq(kScratchRegister, js_entry_sp); 3142 __ Move(kScratchRegister, js_entry_sp);
3143 __ movq(Operand(kScratchRegister, 0), Immediate(0)); 3143 __ movq(Operand(kScratchRegister, 0), Immediate(0));
3144 __ bind(&not_outermost_js_2); 3144 __ bind(&not_outermost_js_2);
3145 3145
3146 // Restore the top frame descriptor from the stack. 3146 // Restore the top frame descriptor from the stack.
3147 { Operand c_entry_fp_operand = masm->ExternalOperand(c_entry_fp); 3147 { Operand c_entry_fp_operand = masm->ExternalOperand(c_entry_fp);
3148 __ pop(c_entry_fp_operand); 3148 __ pop(c_entry_fp_operand);
3149 } 3149 }
3150 3150
3151 // Restore callee-saved registers (X64 conventions). 3151 // Restore callee-saved registers (X64 conventions).
3152 #ifdef _WIN64 3152 #ifdef _WIN64
(...skipping 2662 matching lines...) Expand 10 before | Expand all | Expand 10 after
5815 __ bind(&fast_elements_case); 5815 __ bind(&fast_elements_case);
5816 GenerateCase(masm, FAST_ELEMENTS); 5816 GenerateCase(masm, FAST_ELEMENTS);
5817 } 5817 }
5818 5818
5819 5819
5820 #undef __ 5820 #undef __
5821 5821
5822 } } // namespace v8::internal 5822 } } // namespace v8::internal
5823 5823
5824 #endif // V8_TARGET_ARCH_X64 5824 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698