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

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

Issue 1743123002: X87: [runtime] Unify comparison operator runtime entries. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | no next file » | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_X87 5 #if V8_TARGET_ARCH_X87
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 1143
1144 __ bind(&undetectable); 1144 __ bind(&undetectable);
1145 __ test_b(FieldOperand(ecx, Map::kBitFieldOffset), 1145 __ test_b(FieldOperand(ecx, Map::kBitFieldOffset),
1146 1 << Map::kIsUndetectable); 1146 1 << Map::kIsUndetectable);
1147 __ j(zero, &return_unequal, Label::kNear); 1147 __ j(zero, &return_unequal, Label::kNear);
1148 __ Move(eax, Immediate(EQUAL)); 1148 __ Move(eax, Immediate(EQUAL));
1149 __ ret(0); // eax, edx were pushed 1149 __ ret(0); // eax, edx were pushed
1150 } 1150 }
1151 __ bind(&runtime_call); 1151 __ bind(&runtime_call);
1152 1152
1153 // Push arguments below the return address.
1154 __ pop(ecx);
1155 __ push(edx);
1156 __ push(eax);
1157
1158 // Figure out which native to call and setup the arguments.
1159 if (cc == equal) { 1153 if (cc == equal) {
1160 __ push(ecx); 1154 {
1161 __ TailCallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals); 1155 FrameScope scope(masm, StackFrame::INTERNAL);
1156 __ Push(edx);
1157 __ Push(eax);
1158 __ CallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals);
1159 }
1160 // Turn true into 0 and false into some non-zero value.
1161 STATIC_ASSERT(EQUAL == 0);
1162 __ sub(eax, Immediate(isolate()->factory()->true_value()));
1163 __ Ret();
1162 } else { 1164 } else {
1165 // Push arguments below the return address.
1166 __ pop(ecx);
1167 __ push(edx);
1168 __ push(eax);
1163 __ push(Immediate(Smi::FromInt(NegativeComparisonResult(cc)))); 1169 __ push(Immediate(Smi::FromInt(NegativeComparisonResult(cc))));
1164 1170
1165 // Restore return address on the stack. 1171 // Restore return address on the stack.
1166 __ push(ecx); 1172 __ push(ecx);
1167
1168 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) 1173 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater)
1169 // tagged as a small integer. 1174 // tagged as a small integer.
1170 __ TailCallRuntime(Runtime::kCompare); 1175 __ TailCallRuntime(Runtime::kCompare);
1171 } 1176 }
1172 1177
1173 __ bind(&miss); 1178 __ bind(&miss);
1174 GenerateMiss(masm); 1179 GenerateMiss(masm);
1175 } 1180 }
1176 1181
1177 1182
(...skipping 4408 matching lines...) Expand 10 before | Expand all | Expand 10 after
5586 return_value_operand, NULL); 5591 return_value_operand, NULL);
5587 } 5592 }
5588 5593
5589 5594
5590 #undef __ 5595 #undef __
5591 5596
5592 } // namespace internal 5597 } // namespace internal
5593 } // namespace v8 5598 } // namespace v8
5594 5599
5595 #endif // V8_TARGET_ARCH_X87 5600 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698