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

Side by Side Diff: src/x64/codegen-x64.cc

Issue 2834027: X64: A number of small tweaks and fixes. (Closed)
Patch Set: Created 10 years, 5 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
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x64/disasm-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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 849
850 // Copy the arguments to this function possibly from the 850 // Copy the arguments to this function possibly from the
851 // adaptor frame below it. 851 // adaptor frame below it.
852 Label invoke, adapted; 852 Label invoke, adapted;
853 __ movq(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); 853 __ movq(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
854 __ SmiCompare(Operand(rdx, StandardFrameConstants::kContextOffset), 854 __ SmiCompare(Operand(rdx, StandardFrameConstants::kContextOffset),
855 Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); 855 Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
856 __ j(equal, &adapted); 856 __ j(equal, &adapted);
857 857
858 // No arguments adaptor frame. Copy fixed number of arguments. 858 // No arguments adaptor frame. Copy fixed number of arguments.
859 __ movq(rax, Immediate(scope()->num_parameters())); 859 __ Set(rax, scope()->num_parameters());
860 for (int i = 0; i < scope()->num_parameters(); i++) { 860 for (int i = 0; i < scope()->num_parameters(); i++) {
861 __ push(frame_->ParameterAt(i)); 861 __ push(frame_->ParameterAt(i));
862 } 862 }
863 __ jmp(&invoke); 863 __ jmp(&invoke);
864 864
865 // Arguments adaptor frame present. Copy arguments from there, but 865 // Arguments adaptor frame present. Copy arguments from there, but
866 // avoid copying too many arguments to avoid stack overflows. 866 // avoid copying too many arguments to avoid stack overflows.
867 __ bind(&adapted); 867 __ bind(&adapted);
868 static const uint32_t kArgumentsLimit = 1 * KB; 868 static const uint32_t kArgumentsLimit = 1 * KB;
869 __ SmiToInteger32(rax, 869 __ SmiToInteger32(rax,
(...skipping 8181 matching lines...) Expand 10 before | Expand all | Expand 10 after
9051 __ pop(rcx); 9051 __ pop(rcx);
9052 __ push(rax); 9052 __ push(rax);
9053 __ push(rdx); 9053 __ push(rdx);
9054 __ push(rcx); 9054 __ push(rcx);
9055 9055
9056 // Generate the number comparison code. 9056 // Generate the number comparison code.
9057 if (include_number_compare_) { 9057 if (include_number_compare_) {
9058 Label non_number_comparison; 9058 Label non_number_comparison;
9059 Label unordered; 9059 Label unordered;
9060 FloatingPointHelper::LoadSSE2UnknownOperands(masm, &non_number_comparison); 9060 FloatingPointHelper::LoadSSE2UnknownOperands(masm, &non_number_comparison);
9061 __ xorl(rax, rax);
9062 __ xorl(rcx, rcx);
9061 __ ucomisd(xmm0, xmm1); 9063 __ ucomisd(xmm0, xmm1);
9062 9064
9063 // Don't base result on EFLAGS when a NaN is involved. 9065 // Don't base result on EFLAGS when a NaN is involved.
9064 __ j(parity_even, &unordered); 9066 __ j(parity_even, &unordered);
9065 // Return a result of -1, 0, or 1, based on EFLAGS. 9067 // Return a result of -1, 0, or 1, based on EFLAGS.
9066 __ movq(rax, Immediate(0)); // equal 9068 __ setcc(above, rax);
9067 __ movq(rcx, Immediate(1)); 9069 __ setcc(below, rcx);
9068 __ cmovq(above, rax, rcx); 9070 __ subq(rax, rcx);
9069 __ movq(rcx, Immediate(-1));
9070 __ cmovq(below, rax, rcx);
9071 __ ret(2 * kPointerSize); // rax, rdx were pushed 9071 __ ret(2 * kPointerSize); // rax, rdx were pushed
9072 9072
9073 // If one of the numbers was NaN, then the result is always false. 9073 // If one of the numbers was NaN, then the result is always false.
9074 // The cc is never not-equal. 9074 // The cc is never not-equal.
9075 __ bind(&unordered); 9075 __ bind(&unordered);
9076 ASSERT(cc_ != not_equal); 9076 ASSERT(cc_ != not_equal);
9077 if (cc_ == less || cc_ == less_equal) { 9077 if (cc_ == less || cc_ == less_equal) {
9078 __ Set(rax, 1); 9078 __ Set(rax, 1);
9079 } else { 9079 } else {
9080 __ Set(rax, -1); 9080 __ Set(rax, -1);
(...skipping 2825 matching lines...) Expand 10 before | Expand all | Expand 10 after
11906 } 11906 }
11907 11907
11908 #endif 11908 #endif
11909 11909
11910 11910
11911 #undef __ 11911 #undef __
11912 11912
11913 } } // namespace v8::internal 11913 } } // namespace v8::internal
11914 11914
11915 #endif // V8_TARGET_ARCH_X64 11915 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x64/disasm-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698