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

Side by Side Diff: src/x64/stub-cache-x64.cc

Issue 15848002: Omit smi-check for write-barrier unless tagged. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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/ia32/stub-cache-ia32.cc ('k') | 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 // 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 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 873
874 int index = transition->instance_descriptors()->GetFieldIndex( 874 int index = transition->instance_descriptors()->GetFieldIndex(
875 transition->LastAdded()); 875 transition->LastAdded());
876 876
877 // Adjust for the number of properties stored in the object. Even in the 877 // Adjust for the number of properties stored in the object. Even in the
878 // face of a transition we can use the old map here because the size of the 878 // face of a transition we can use the old map here because the size of the
879 // object and the number of in-object properties is not going to change. 879 // object and the number of in-object properties is not going to change.
880 index -= object->map()->inobject_properties(); 880 index -= object->map()->inobject_properties();
881 881
882 // TODO(verwaest): Share this code as a code stub. 882 // TODO(verwaest): Share this code as a code stub.
883 SmiCheck smi_check = representation.IsTagged()
884 ? INLINE_SMI_CHECK : OMIT_SMI_CHECK;
883 if (index < 0) { 885 if (index < 0) {
884 // Set the property straight into the object. 886 // Set the property straight into the object.
885 int offset = object->map()->instance_size() + (index * kPointerSize); 887 int offset = object->map()->instance_size() + (index * kPointerSize);
886 if (FLAG_track_double_fields && representation.IsDouble()) { 888 if (FLAG_track_double_fields && representation.IsDouble()) {
887 __ movq(FieldOperand(receiver_reg, offset), storage_reg); 889 __ movq(FieldOperand(receiver_reg, offset), storage_reg);
888 } else { 890 } else {
889 __ movq(FieldOperand(receiver_reg, offset), value_reg); 891 __ movq(FieldOperand(receiver_reg, offset), value_reg);
890 } 892 }
891 893
892 if (!FLAG_track_fields || !representation.IsSmi()) { 894 if (!FLAG_track_fields || !representation.IsSmi()) {
893 // Update the write barrier for the array address. 895 // Update the write barrier for the array address.
894 // Pass the value being stored in the now unused name_reg. 896 // Pass the value being stored in the now unused name_reg.
895 if (!FLAG_track_double_fields || !representation.IsDouble()) { 897 if (!FLAG_track_double_fields || !representation.IsDouble()) {
896 __ movq(name_reg, value_reg); 898 __ movq(name_reg, value_reg);
897 } else { 899 } else {
898 ASSERT(storage_reg.is(name_reg)); 900 ASSERT(storage_reg.is(name_reg));
899 } 901 }
900 __ RecordWriteField( 902 __ RecordWriteField(
901 receiver_reg, offset, name_reg, scratch1, kDontSaveFPRegs); 903 receiver_reg, offset, name_reg, scratch1, kDontSaveFPRegs,
904 EMIT_REMEMBERED_SET, smi_check);
902 } 905 }
903 } else { 906 } else {
904 // Write to the properties array. 907 // Write to the properties array.
905 int offset = index * kPointerSize + FixedArray::kHeaderSize; 908 int offset = index * kPointerSize + FixedArray::kHeaderSize;
906 // Get the properties array (optimistically). 909 // Get the properties array (optimistically).
907 __ movq(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); 910 __ movq(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
908 if (FLAG_track_double_fields && representation.IsDouble()) { 911 if (FLAG_track_double_fields && representation.IsDouble()) {
909 __ movq(FieldOperand(scratch1, offset), storage_reg); 912 __ movq(FieldOperand(scratch1, offset), storage_reg);
910 } else { 913 } else {
911 __ movq(FieldOperand(scratch1, offset), value_reg); 914 __ movq(FieldOperand(scratch1, offset), value_reg);
912 } 915 }
913 916
914 if (!FLAG_track_fields || !representation.IsSmi()) { 917 if (!FLAG_track_fields || !representation.IsSmi()) {
915 // Update the write barrier for the array address. 918 // Update the write barrier for the array address.
916 // Pass the value being stored in the now unused name_reg. 919 // Pass the value being stored in the now unused name_reg.
917 if (!FLAG_track_double_fields || !representation.IsDouble()) { 920 if (!FLAG_track_double_fields || !representation.IsDouble()) {
918 __ movq(name_reg, value_reg); 921 __ movq(name_reg, value_reg);
919 } else { 922 } else {
920 ASSERT(storage_reg.is(name_reg)); 923 ASSERT(storage_reg.is(name_reg));
921 } 924 }
922 __ RecordWriteField( 925 __ RecordWriteField(
923 scratch1, offset, name_reg, receiver_reg, kDontSaveFPRegs); 926 scratch1, offset, name_reg, receiver_reg, kDontSaveFPRegs,
927 EMIT_REMEMBERED_SET, smi_check);
924 } 928 }
925 } 929 }
926 930
927 // Return the value (register rax). 931 // Return the value (register rax).
928 ASSERT(value_reg.is(rax)); 932 ASSERT(value_reg.is(rax));
929 __ ret(0); 933 __ ret(0);
930 } 934 }
931 935
932 936
933 // Both name_reg and receiver_reg are preserved on jumps to miss_label, 937 // Both name_reg and receiver_reg are preserved on jumps to miss_label,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 997
994 __ bind(&do_store); 998 __ bind(&do_store);
995 __ movsd(FieldOperand(scratch1, HeapNumber::kValueOffset), xmm0); 999 __ movsd(FieldOperand(scratch1, HeapNumber::kValueOffset), xmm0);
996 // Return the value (register rax). 1000 // Return the value (register rax).
997 ASSERT(value_reg.is(rax)); 1001 ASSERT(value_reg.is(rax));
998 __ ret(0); 1002 __ ret(0);
999 return; 1003 return;
1000 } 1004 }
1001 1005
1002 // TODO(verwaest): Share this code as a code stub. 1006 // TODO(verwaest): Share this code as a code stub.
1007 SmiCheck smi_check = representation.IsTagged()
1008 ? INLINE_SMI_CHECK : OMIT_SMI_CHECK;
1003 if (index < 0) { 1009 if (index < 0) {
1004 // Set the property straight into the object. 1010 // Set the property straight into the object.
1005 int offset = object->map()->instance_size() + (index * kPointerSize); 1011 int offset = object->map()->instance_size() + (index * kPointerSize);
1006 __ movq(FieldOperand(receiver_reg, offset), value_reg); 1012 __ movq(FieldOperand(receiver_reg, offset), value_reg);
1007 1013
1008 if (!FLAG_track_fields || !representation.IsSmi()) { 1014 if (!FLAG_track_fields || !representation.IsSmi()) {
1009 // Update the write barrier for the array address. 1015 // Update the write barrier for the array address.
1010 // Pass the value being stored in the now unused name_reg. 1016 // Pass the value being stored in the now unused name_reg.
1011 __ movq(name_reg, value_reg); 1017 __ movq(name_reg, value_reg);
1012 __ RecordWriteField( 1018 __ RecordWriteField(
1013 receiver_reg, offset, name_reg, scratch1, kDontSaveFPRegs); 1019 receiver_reg, offset, name_reg, scratch1, kDontSaveFPRegs,
1020 EMIT_REMEMBERED_SET, smi_check);
1014 } 1021 }
1015 } else { 1022 } else {
1016 // Write to the properties array. 1023 // Write to the properties array.
1017 int offset = index * kPointerSize + FixedArray::kHeaderSize; 1024 int offset = index * kPointerSize + FixedArray::kHeaderSize;
1018 // Get the properties array (optimistically). 1025 // Get the properties array (optimistically).
1019 __ movq(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); 1026 __ movq(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
1020 __ movq(FieldOperand(scratch1, offset), value_reg); 1027 __ movq(FieldOperand(scratch1, offset), value_reg);
1021 1028
1022 if (!FLAG_track_fields || !representation.IsSmi()) { 1029 if (!FLAG_track_fields || !representation.IsSmi()) {
1023 // Update the write barrier for the array address. 1030 // Update the write barrier for the array address.
1024 // Pass the value being stored in the now unused name_reg. 1031 // Pass the value being stored in the now unused name_reg.
1025 __ movq(name_reg, value_reg); 1032 __ movq(name_reg, value_reg);
1026 __ RecordWriteField( 1033 __ RecordWriteField(
1027 scratch1, offset, name_reg, receiver_reg, kDontSaveFPRegs); 1034 scratch1, offset, name_reg, receiver_reg, kDontSaveFPRegs,
1035 EMIT_REMEMBERED_SET, smi_check);
1028 } 1036 }
1029 } 1037 }
1030 1038
1031 // Return the value (register rax). 1039 // Return the value (register rax).
1032 ASSERT(value_reg.is(rax)); 1040 ASSERT(value_reg.is(rax));
1033 __ ret(0); 1041 __ ret(0);
1034 } 1042 }
1035 1043
1036 1044
1037 // Calls GenerateCheckPropertyCell for each global object in the prototype chain 1045 // Calls GenerateCheckPropertyCell for each global object in the prototype chain
(...skipping 2574 matching lines...) Expand 10 before | Expand all | Expand 10 after
3612 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); 3620 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow);
3613 } 3621 }
3614 } 3622 }
3615 3623
3616 3624
3617 #undef __ 3625 #undef __
3618 3626
3619 } } // namespace v8::internal 3627 } } // namespace v8::internal
3620 3628
3621 #endif // V8_TARGET_ARCH_X64 3629 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698