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

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

Issue 9365055: Fix crashing bugs in store-and-grow IC for double values. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 | src/objects.cc » ('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 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 3887 matching lines...) Expand 10 before | Expand all | Expand 10 after
3898 // Check that the key is within bounds. 3898 // Check that the key is within bounds.
3899 __ cmp(ecx, FieldOperand(edx, JSArray::kLengthOffset)); // smis. 3899 __ cmp(ecx, FieldOperand(edx, JSArray::kLengthOffset)); // smis.
3900 if (grow_mode == ALLOW_JSARRAY_GROWTH) { 3900 if (grow_mode == ALLOW_JSARRAY_GROWTH) {
3901 __ j(above_equal, &grow); 3901 __ j(above_equal, &grow);
3902 } else { 3902 } else {
3903 __ j(above_equal, &miss_force_generic); 3903 __ j(above_equal, &miss_force_generic);
3904 } 3904 }
3905 } else { 3905 } else {
3906 // Check that the key is within bounds. 3906 // Check that the key is within bounds.
3907 __ cmp(ecx, FieldOperand(edi, FixedArray::kLengthOffset)); // smis. 3907 __ cmp(ecx, FieldOperand(edi, FixedArray::kLengthOffset)); // smis.
3908 __ j(above_equal, &miss_force_generic);
3908 } 3909 }
3909 3910
3910 __ bind(&finish_store); 3911 __ bind(&finish_store);
3911 __ StoreNumberToDoubleElements(eax, edi, ecx, edx, xmm0, 3912 __ StoreNumberToDoubleElements(eax, edi, ecx, edx, xmm0,
3912 &transition_elements_kind, true); 3913 &transition_elements_kind, true);
3913 __ ret(0); 3914 __ ret(0);
3914 3915
3915 // Handle store cache miss, replacing the ic with the generic stub. 3916 // Handle store cache miss, replacing the ic with the generic stub.
3916 __ bind(&miss_force_generic); 3917 __ bind(&miss_force_generic);
3917 Handle<Code> ic_force_generic = 3918 Handle<Code> ic_force_generic =
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
3963 Immediate(Smi::FromInt(JSArray::kPreallocatedArrayElements))); 3964 Immediate(Smi::FromInt(JSArray::kPreallocatedArrayElements)));
3964 3965
3965 // Install the new backing store in the JSArray. 3966 // Install the new backing store in the JSArray.
3966 __ mov(FieldOperand(edx, JSObject::kElementsOffset), edi); 3967 __ mov(FieldOperand(edx, JSObject::kElementsOffset), edi);
3967 __ RecordWriteField(edx, JSObject::kElementsOffset, edi, ebx, 3968 __ RecordWriteField(edx, JSObject::kElementsOffset, edi, ebx,
3968 kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); 3969 kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
3969 3970
3970 // Increment the length of the array. 3971 // Increment the length of the array.
3971 __ add(FieldOperand(edx, JSArray::kLengthOffset), 3972 __ add(FieldOperand(edx, JSArray::kLengthOffset),
3972 Immediate(Smi::FromInt(1))); 3973 Immediate(Smi::FromInt(1)));
3974 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset));
3973 __ jmp(&finish_store); 3975 __ jmp(&finish_store);
3974 3976
3975 __ bind(&check_capacity); 3977 __ bind(&check_capacity);
3976 // eax: value 3978 // eax: value
3977 // ecx: key 3979 // ecx: key
3978 // edx: receiver 3980 // edx: receiver
3979 // edi: elements 3981 // edi: elements
3980 // Make sure that the backing store can hold additional elements. 3982 // Make sure that the backing store can hold additional elements.
3981 __ cmp(ecx, FieldOperand(edi, FixedDoubleArray::kLengthOffset)); 3983 __ cmp(ecx, FieldOperand(edi, FixedDoubleArray::kLengthOffset));
3982 __ j(above_equal, &slow); 3984 __ j(above_equal, &slow);
(...skipping 12 matching lines...) Expand all
3995 __ jmp(ic_slow, RelocInfo::CODE_TARGET); 3997 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
3996 } 3998 }
3997 } 3999 }
3998 4000
3999 4001
4000 #undef __ 4002 #undef __
4001 4003
4002 } } // namespace v8::internal 4004 } } // namespace v8::internal
4003 4005
4004 #endif // V8_TARGET_ARCH_IA32 4006 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698