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

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

Issue 6927013: Fix bug in x64 >>> operator. (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 | « 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 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 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 // in that case. 969 // in that case.
970 if (op_ == Token::SHR) { 970 if (op_ == Token::SHR) {
971 __ bind(&non_smi_shr_result); 971 __ bind(&non_smi_shr_result);
972 Label allocation_failed; 972 Label allocation_failed;
973 __ movl(rbx, rax); // rbx holds result value (uint32 value as int64). 973 __ movl(rbx, rax); // rbx holds result value (uint32 value as int64).
974 // Allocate heap number in new space. 974 // Allocate heap number in new space.
975 // Not using AllocateHeapNumber macro in order to reuse 975 // Not using AllocateHeapNumber macro in order to reuse
976 // already loaded heap_number_map. 976 // already loaded heap_number_map.
977 __ AllocateInNewSpace(HeapNumber::kSize, 977 __ AllocateInNewSpace(HeapNumber::kSize,
978 rax, 978 rax,
979 rcx, 979 rdx,
980 no_reg, 980 no_reg,
981 &allocation_failed, 981 &allocation_failed,
982 TAG_OBJECT); 982 TAG_OBJECT);
983 // Set the map. 983 // Set the map.
984 if (FLAG_debug_code) { 984 if (FLAG_debug_code) {
985 __ AbortIfNotRootValue(heap_number_map, 985 __ AbortIfNotRootValue(heap_number_map,
986 Heap::kHeapNumberMapRootIndex, 986 Heap::kHeapNumberMapRootIndex,
987 "HeapNumberMap register clobbered."); 987 "HeapNumberMap register clobbered.");
988 } 988 }
989 __ movq(FieldOperand(rax, HeapObject::kMapOffset), 989 __ movq(FieldOperand(rax, HeapObject::kMapOffset),
990 heap_number_map); 990 heap_number_map);
991 __ cvtqsi2sd(xmm0, rbx); 991 __ cvtqsi2sd(xmm0, rbx);
992 __ movsd(FieldOperand(rax, HeapNumber::kValueOffset), xmm0); 992 __ movsd(FieldOperand(rax, HeapNumber::kValueOffset), xmm0);
993 __ Ret(); 993 __ Ret();
994 994
995 __ bind(&allocation_failed); 995 __ bind(&allocation_failed);
996 // We need tagged values in rdx and rax for the following code, 996 // We need tagged values in rdx and rax for the following code,
997 // not int32 in rax and rcx. 997 // not int32 in rax and rcx.
998 __ Integer32ToSmi(rax, rcx); 998 __ Integer32ToSmi(rax, rcx);
999 __ Integer32ToSmi(rdx, rax); 999 __ Integer32ToSmi(rdx, rbx);
1000 __ jmp(allocation_failure); 1000 __ jmp(allocation_failure);
1001 } 1001 }
1002 break; 1002 break;
1003 } 1003 }
1004 default: UNREACHABLE(); break; 1004 default: UNREACHABLE(); break;
1005 } 1005 }
1006 // No fall-through from this generated code. 1006 // No fall-through from this generated code.
1007 if (FLAG_debug_code) { 1007 if (FLAG_debug_code) {
1008 __ Abort("Unexpected fall-through in " 1008 __ Abort("Unexpected fall-through in "
1009 "TypeRecordingBinaryStub::GenerateFloatingPointCode."); 1009 "TypeRecordingBinaryStub::GenerateFloatingPointCode.");
(...skipping 3724 matching lines...) Expand 10 before | Expand all | Expand 10 after
4734 // Do a tail call to the rewritten stub. 4734 // Do a tail call to the rewritten stub.
4735 __ jmp(rdi); 4735 __ jmp(rdi);
4736 } 4736 }
4737 4737
4738 4738
4739 #undef __ 4739 #undef __
4740 4740
4741 } } // namespace v8::internal 4741 } } // namespace v8::internal
4742 4742
4743 #endif // V8_TARGET_ARCH_X64 4743 #endif // V8_TARGET_ARCH_X64
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