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

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

Issue 16826016: Implement IC support for Constant Function transitions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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/property.h ('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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 miss_restore_name); 810 miss_restore_name);
811 } else if (!holder->HasFastProperties() && !holder->IsJSGlobalProxy()) { 811 } else if (!holder->HasFastProperties() && !holder->IsJSGlobalProxy()) {
812 GenerateDictionaryNegativeLookup( 812 GenerateDictionaryNegativeLookup(
813 masm, miss_restore_name, holder_reg, name, scratch1, scratch2); 813 masm, miss_restore_name, holder_reg, name, scratch1, scratch2);
814 } 814 }
815 } 815 }
816 } 816 }
817 817
818 Register storage_reg = name_reg; 818 Register storage_reg = name_reg;
819 819
820 if (FLAG_track_fields && representation.IsSmi()) { 820 if (details.type() == CONSTANT_FUNCTION) {
821 Handle<HeapObject> constant(
822 HeapObject::cast(descriptors->GetValue(descriptor)));
823 __ LoadHeapObject(scratch1, constant);
824 __ cmpq(value_reg, scratch1);
825 __ j(not_equal, miss_restore_name);
826 } else if (FLAG_track_fields && representation.IsSmi()) {
821 __ JumpIfNotSmi(value_reg, miss_restore_name); 827 __ JumpIfNotSmi(value_reg, miss_restore_name);
822 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { 828 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
823 __ JumpIfSmi(value_reg, miss_restore_name); 829 __ JumpIfSmi(value_reg, miss_restore_name);
824 } else if (FLAG_track_double_fields && representation.IsDouble()) { 830 } else if (FLAG_track_double_fields && representation.IsDouble()) {
825 Label do_store, heap_number; 831 Label do_store, heap_number;
826 __ AllocateHeapNumber(storage_reg, scratch1, slow); 832 __ AllocateHeapNumber(storage_reg, scratch1, slow);
827 833
828 __ JumpIfNotSmi(value_reg, &heap_number); 834 __ JumpIfNotSmi(value_reg, &heap_number);
829 __ SmiToInteger32(scratch1, value_reg); 835 __ SmiToInteger32(scratch1, value_reg);
830 __ cvtlsi2sd(xmm0, scratch1); 836 __ cvtlsi2sd(xmm0, scratch1);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 872
867 // Update the write barrier for the map field. 873 // Update the write barrier for the map field.
868 __ RecordWriteField(receiver_reg, 874 __ RecordWriteField(receiver_reg,
869 HeapObject::kMapOffset, 875 HeapObject::kMapOffset,
870 scratch1, 876 scratch1,
871 scratch2, 877 scratch2,
872 kDontSaveFPRegs, 878 kDontSaveFPRegs,
873 OMIT_REMEMBERED_SET, 879 OMIT_REMEMBERED_SET,
874 OMIT_SMI_CHECK); 880 OMIT_SMI_CHECK);
875 881
882 if (details.type() == CONSTANT_FUNCTION) return;
883
876 int index = transition->instance_descriptors()->GetFieldIndex( 884 int index = transition->instance_descriptors()->GetFieldIndex(
877 transition->LastAdded()); 885 transition->LastAdded());
878 886
879 // Adjust for the number of properties stored in the object. Even in the 887 // Adjust for the number of properties stored in the object. Even in the
880 // face of a transition we can use the old map here because the size of the 888 // face of a transition we can use the old map here because the size of the
881 // object and the number of in-object properties is not going to change. 889 // object and the number of in-object properties is not going to change.
882 index -= object->map()->inobject_properties(); 890 index -= object->map()->inobject_properties();
883 891
884 // TODO(verwaest): Share this code as a code stub. 892 // TODO(verwaest): Share this code as a code stub.
885 SmiCheck smi_check = representation.IsTagged() 893 SmiCheck smi_check = representation.IsTagged()
(...skipping 2600 matching lines...) Expand 10 before | Expand all | Expand 10 after
3486 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); 3494 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow);
3487 } 3495 }
3488 } 3496 }
3489 3497
3490 3498
3491 #undef __ 3499 #undef __
3492 3500
3493 } } // namespace v8::internal 3501 } } // namespace v8::internal
3494 3502
3495 #endif // V8_TARGET_ARCH_X64 3503 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/property.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698