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

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

Issue 7037025: Fix handling of -0 in the unary-op IC and avoid repeated patching/transitions. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 7 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 | « src/arm/code-stubs-arm.cc ('k') | src/ic.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 615
616 616
617 void TypeRecordingUnaryOpStub::GenerateSmiStubBitNot(MacroAssembler* masm) { 617 void TypeRecordingUnaryOpStub::GenerateSmiStubBitNot(MacroAssembler* masm) {
618 Label non_smi; 618 Label non_smi;
619 GenerateSmiCodeBitNot(masm, &non_smi); 619 GenerateSmiCodeBitNot(masm, &non_smi);
620 __ bind(&non_smi); 620 __ bind(&non_smi);
621 GenerateTypeTransition(masm); 621 GenerateTypeTransition(masm);
622 } 622 }
623 623
624 624
625 void TypeRecordingUnaryOpStub::GenerateSmiCodeSub( 625 void TypeRecordingUnaryOpStub::GenerateSmiCodeSub(MacroAssembler* masm,
626 MacroAssembler* masm, Label* non_smi, Label* undo, Label* slow, 626 Label* non_smi,
627 Label::Distance non_smi_near, Label::Distance undo_near, 627 Label* undo,
628 Label::Distance slow_near) { 628 Label* slow,
629 Label::Distance non_smi_near,
630 Label::Distance undo_near,
631 Label::Distance slow_near) {
629 // Check whether the value is a smi. 632 // Check whether the value is a smi.
630 __ test(eax, Immediate(kSmiTagMask)); 633 __ test(eax, Immediate(kSmiTagMask));
631 __ j(not_zero, non_smi, non_smi_near); 634 __ j(not_zero, non_smi, non_smi_near);
632 635
633 // We can't handle -0 with smis, so use a type transition for that case. 636 // We can't handle -0 with smis, so use a type transition for that case.
634 __ test(eax, Operand(eax)); 637 __ test(eax, Operand(eax));
635 __ j(zero, slow, slow_near); 638 __ j(zero, slow, slow_near);
636 639
637 // Try optimistic subtraction '0 - value', saving operand in eax for undo. 640 // Try optimistic subtraction '0 - value', saving operand in eax for undo.
638 __ mov(edx, Operand(eax)); 641 __ mov(edx, Operand(eax));
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 case Token::BIT_NOT: 675 case Token::BIT_NOT:
673 GenerateHeapNumberStubBitNot(masm); 676 GenerateHeapNumberStubBitNot(masm);
674 break; 677 break;
675 default: 678 default:
676 UNREACHABLE(); 679 UNREACHABLE();
677 } 680 }
678 } 681 }
679 682
680 683
681 void TypeRecordingUnaryOpStub::GenerateHeapNumberStubSub(MacroAssembler* masm) { 684 void TypeRecordingUnaryOpStub::GenerateHeapNumberStubSub(MacroAssembler* masm) {
682 Label non_smi, undo, slow; 685 Label non_smi, undo, slow, call_builtin;
683 GenerateSmiCodeSub(masm, &non_smi, &undo, &slow, Label::kNear); 686 GenerateSmiCodeSub(masm, &non_smi, &undo, &call_builtin, Label::kNear);
684 __ bind(&non_smi); 687 __ bind(&non_smi);
685 GenerateHeapNumberCodeSub(masm, &slow); 688 GenerateHeapNumberCodeSub(masm, &slow);
686 __ bind(&undo); 689 __ bind(&undo);
687 GenerateSmiCodeUndo(masm); 690 GenerateSmiCodeUndo(masm);
688 __ bind(&slow); 691 __ bind(&slow);
689 GenerateTypeTransition(masm); 692 GenerateTypeTransition(masm);
693 __ bind(&call_builtin);
694 GenerateGenericCodeFallback(masm);
690 } 695 }
691 696
692 697
693 void TypeRecordingUnaryOpStub::GenerateHeapNumberStubBitNot( 698 void TypeRecordingUnaryOpStub::GenerateHeapNumberStubBitNot(
694 MacroAssembler* masm) { 699 MacroAssembler* masm) {
695 Label non_smi, slow; 700 Label non_smi, slow;
696 GenerateSmiCodeBitNot(masm, &non_smi, Label::kNear); 701 GenerateSmiCodeBitNot(masm, &non_smi, Label::kNear);
697 __ bind(&non_smi); 702 __ bind(&non_smi);
698 GenerateHeapNumberCodeBitNot(masm, &slow); 703 GenerateHeapNumberCodeBitNot(masm, &slow);
699 __ bind(&slow); 704 __ bind(&slow);
(...skipping 5477 matching lines...) Expand 10 before | Expand all | Expand 10 after
6177 __ Drop(1); 6182 __ Drop(1);
6178 __ ret(2 * kPointerSize); 6183 __ ret(2 * kPointerSize);
6179 } 6184 }
6180 6185
6181 6186
6182 #undef __ 6187 #undef __
6183 6188
6184 } } // namespace v8::internal 6189 } } // namespace v8::internal
6185 6190
6186 #endif // V8_TARGET_ARCH_IA32 6191 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698