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

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

Issue 1056663005: X87: Fix the bug in CompareIC_GenerateNumber (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X87 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 3240 matching lines...) Expand 10 before | Expand all | Expand 10 after
3251 __ ret(0); 3251 __ ret(0);
3252 3252
3253 __ bind(&miss); 3253 __ bind(&miss);
3254 GenerateMiss(masm); 3254 GenerateMiss(masm);
3255 } 3255 }
3256 3256
3257 3257
3258 void CompareICStub::GenerateNumbers(MacroAssembler* masm) { 3258 void CompareICStub::GenerateNumbers(MacroAssembler* masm) {
3259 DCHECK(state() == CompareICState::NUMBER); 3259 DCHECK(state() == CompareICState::NUMBER);
3260 3260
3261 Label generic_stub; 3261 Label generic_stub, check_left;
3262 Label unordered, maybe_undefined1, maybe_undefined2; 3262 Label unordered, maybe_undefined1, maybe_undefined2;
3263 Label miss; 3263 Label miss;
3264 3264
3265 if (left() == CompareICState::SMI) { 3265 if (left() == CompareICState::SMI) {
3266 __ JumpIfNotSmi(edx, &miss); 3266 __ JumpIfNotSmi(edx, &miss);
3267 } 3267 }
3268 if (right() == CompareICState::SMI) { 3268 if (right() == CompareICState::SMI) {
3269 __ JumpIfNotSmi(eax, &miss); 3269 __ JumpIfNotSmi(eax, &miss);
3270 } 3270 }
3271 3271
3272 // Inlining the double comparison and falling back to the general compare 3272 // Inlining the double comparison and falling back to the general compare
3273 // stub if NaN is involved or SSE2 or CMOV is unsupported. 3273 // stub if NaN is involved or SSE2 or CMOV is unsupported.
3274 __ mov(ecx, edx); 3274 __ JumpIfSmi(eax, &check_left, Label::kNear);
3275 __ and_(ecx, eax);
3276 __ JumpIfSmi(ecx, &generic_stub, Label::kNear);
3277
3278 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), 3275 __ cmp(FieldOperand(eax, HeapObject::kMapOffset),
3279 isolate()->factory()->heap_number_map()); 3276 isolate()->factory()->heap_number_map());
3280 __ j(not_equal, &maybe_undefined1, Label::kNear); 3277 __ j(not_equal, &maybe_undefined1, Label::kNear);
3278
3279 __ bind(&check_left);
3280 __ JumpIfSmi(edx, &generic_stub, Label::kNear);
3281 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), 3281 __ cmp(FieldOperand(edx, HeapObject::kMapOffset),
3282 isolate()->factory()->heap_number_map()); 3282 isolate()->factory()->heap_number_map());
3283 __ j(not_equal, &maybe_undefined2, Label::kNear); 3283 __ j(not_equal, &maybe_undefined2, Label::kNear);
3284 3284
3285 __ bind(&unordered); 3285 __ bind(&unordered);
3286 __ bind(&generic_stub); 3286 __ bind(&generic_stub);
3287 CompareICStub stub(isolate(), op(), CompareICState::GENERIC, 3287 CompareICStub stub(isolate(), op(), CompareICState::GENERIC,
3288 CompareICState::GENERIC, CompareICState::GENERIC); 3288 CompareICState::GENERIC, CompareICState::GENERIC);
3289 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); 3289 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
3290 3290
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after
5063 ApiParameterOperand(2), kStackSpace, nullptr, 5063 ApiParameterOperand(2), kStackSpace, nullptr,
5064 Operand(ebp, 7 * kPointerSize), NULL); 5064 Operand(ebp, 7 * kPointerSize), NULL);
5065 } 5065 }
5066 5066
5067 5067
5068 #undef __ 5068 #undef __
5069 5069
5070 } } // namespace v8::internal 5070 } } // namespace v8::internal
5071 5071
5072 #endif // V8_TARGET_ARCH_X87 5072 #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