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

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

Issue 598059: Fix problem with GenericBinaryOperationStub::GenerateCall for a Smi... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 10 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 | « no previous file | 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 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 7018 matching lines...) Expand 10 before | Expand all | Expand 10 after
7029 Register right_arg = eax; 7029 Register right_arg = eax;
7030 if (!(left.is(left_arg) && right.is(right_arg))) { 7030 if (!(left.is(left_arg) && right.is(right_arg))) {
7031 if (left.is(right_arg) && right.is(left_arg)) { 7031 if (left.is(right_arg) && right.is(left_arg)) {
7032 if (IsOperationCommutative()) { 7032 if (IsOperationCommutative()) {
7033 SetArgsReversed(); 7033 SetArgsReversed();
7034 } else { 7034 } else {
7035 __ xchg(left, right); 7035 __ xchg(left, right);
7036 } 7036 }
7037 } else if (left.is(left_arg)) { 7037 } else if (left.is(left_arg)) {
7038 __ mov(right_arg, right); 7038 __ mov(right_arg, right);
7039 } else if (right.is(right_arg)) {
7040 __ mov(left_arg, left);
7039 } else if (left.is(right_arg)) { 7041 } else if (left.is(right_arg)) {
7040 if (IsOperationCommutative()) { 7042 if (IsOperationCommutative()) {
7041 __ mov(left_arg, right); 7043 __ mov(left_arg, right);
7042 SetArgsReversed(); 7044 SetArgsReversed();
7043 } else { 7045 } else {
7044 // Order of moves important to avoid destroying left argument. 7046 // Order of moves important to avoid destroying left argument.
7045 __ mov(left_arg, left); 7047 __ mov(left_arg, left);
7046 __ mov(right_arg, right); 7048 __ mov(right_arg, right);
7047 } 7049 }
7048 } else if (right.is(left_arg)) { 7050 } else if (right.is(left_arg)) {
7049 if (IsOperationCommutative()) { 7051 if (IsOperationCommutative()) {
7050 __ mov(right_arg, left); 7052 __ mov(right_arg, left);
7051 SetArgsReversed(); 7053 SetArgsReversed();
7052 } else { 7054 } else {
7053 // Order of moves important to avoid destroying right argument. 7055 // Order of moves important to avoid destroying right argument.
7054 __ mov(right_arg, right); 7056 __ mov(right_arg, right);
7055 __ mov(left_arg, left); 7057 __ mov(left_arg, left);
7056 } 7058 }
7057 } else if (right.is(right_arg)) {
7058 __ mov(left_arg, left);
7059 } else { 7059 } else {
7060 // Order of moves is not important. 7060 // Order of moves is not important.
7061 __ mov(left_arg, left); 7061 __ mov(left_arg, left);
7062 __ mov(right_arg, right); 7062 __ mov(right_arg, right);
7063 } 7063 }
7064 } 7064 }
7065 7065
7066 // Update flags to indicate that arguments are in registers. 7066 // Update flags to indicate that arguments are in registers.
7067 SetArgsInRegisters(); 7067 SetArgsInRegisters();
7068 __ IncrementCounter(&Counters::generic_binary_stub_calls_regs, 1); 7068 __ IncrementCounter(&Counters::generic_binary_stub_calls_regs, 1);
(...skipping 15 matching lines...) Expand all
7084 } else { 7084 } else {
7085 // The calling convention with registers is left in edx and right in eax. 7085 // The calling convention with registers is left in edx and right in eax.
7086 Register left_arg = edx; 7086 Register left_arg = edx;
7087 Register right_arg = eax; 7087 Register right_arg = eax;
7088 if (left.is(left_arg)) { 7088 if (left.is(left_arg)) {
7089 __ mov(right_arg, Immediate(right)); 7089 __ mov(right_arg, Immediate(right));
7090 } else if (left.is(right_arg) && IsOperationCommutative()) { 7090 } else if (left.is(right_arg) && IsOperationCommutative()) {
7091 __ mov(left_arg, Immediate(right)); 7091 __ mov(left_arg, Immediate(right));
7092 SetArgsReversed(); 7092 SetArgsReversed();
7093 } else { 7093 } else {
7094 // For non-commutative operations, left and right_arg might be
7095 // the same register. Therefore, the order of the moves is
7096 // important here in order to not overwrite left before moving
7097 // it to left_arg.
7094 __ mov(left_arg, left); 7098 __ mov(left_arg, left);
7095 __ mov(right_arg, Immediate(right)); 7099 __ mov(right_arg, Immediate(right));
7096 } 7100 }
7097 7101
7098 // Update flags to indicate that arguments are in registers. 7102 // Update flags to indicate that arguments are in registers.
7099 SetArgsInRegisters(); 7103 SetArgsInRegisters();
7100 __ IncrementCounter(&Counters::generic_binary_stub_calls_regs, 1); 7104 __ IncrementCounter(&Counters::generic_binary_stub_calls_regs, 1);
7101 } 7105 }
7102 7106
7103 // Call the stub. 7107 // Call the stub.
(...skipping 12 matching lines...) Expand all
7116 } else { 7120 } else {
7117 // The calling convention with registers is left in edx and right in eax. 7121 // The calling convention with registers is left in edx and right in eax.
7118 Register left_arg = edx; 7122 Register left_arg = edx;
7119 Register right_arg = eax; 7123 Register right_arg = eax;
7120 if (right.is(right_arg)) { 7124 if (right.is(right_arg)) {
7121 __ mov(left_arg, Immediate(left)); 7125 __ mov(left_arg, Immediate(left));
7122 } else if (right.is(left_arg) && IsOperationCommutative()) { 7126 } else if (right.is(left_arg) && IsOperationCommutative()) {
7123 __ mov(right_arg, Immediate(left)); 7127 __ mov(right_arg, Immediate(left));
7124 SetArgsReversed(); 7128 SetArgsReversed();
7125 } else { 7129 } else {
7130 // For non-commutative operations, right and left_arg might be
7131 // the same register. Therefore, the order of the moves is
7132 // important here in order to not overwrite right before moving
7133 // it to right_arg.
7134 __ mov(right_arg, right);
7126 __ mov(left_arg, Immediate(left)); 7135 __ mov(left_arg, Immediate(left));
7127 __ mov(right_arg, right);
7128 } 7136 }
7129 // Update flags to indicate that arguments are in registers. 7137 // Update flags to indicate that arguments are in registers.
7130 SetArgsInRegisters(); 7138 SetArgsInRegisters();
7131 __ IncrementCounter(&Counters::generic_binary_stub_calls_regs, 1); 7139 __ IncrementCounter(&Counters::generic_binary_stub_calls_regs, 1);
7132 } 7140 }
7133 7141
7134 // Call the stub. 7142 // Call the stub.
7135 __ CallStub(this); 7143 __ CallStub(this);
7136 } 7144 }
7137 7145
(...skipping 2956 matching lines...) Expand 10 before | Expand all | Expand 10 after
10094 10102
10095 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) 10103 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
10096 // tagged as a small integer. 10104 // tagged as a small integer.
10097 __ bind(&runtime); 10105 __ bind(&runtime);
10098 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); 10106 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1);
10099 } 10107 }
10100 10108
10101 #undef __ 10109 #undef __
10102 10110
10103 } } // namespace v8::internal 10111 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698