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

Side by Side Diff: src/objects.cc

Issue 149249: Fix issue number 398: replacing a constant function on a clone. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 5 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 | test/cctest/test-api.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 return AddFastPropertyUsingMap(result->GetTransitionMap(), 1858 return AddFastPropertyUsingMap(result->GetTransitionMap(),
1859 name, 1859 name,
1860 value); 1860 value);
1861 } 1861 }
1862 return ConvertDescriptorToField(name, value, attributes); 1862 return ConvertDescriptorToField(name, value, attributes);
1863 case CONSTANT_FUNCTION: 1863 case CONSTANT_FUNCTION:
1864 // Only replace the function if necessary. 1864 // Only replace the function if necessary.
1865 if (value == result->GetConstantFunction()) return value; 1865 if (value == result->GetConstantFunction()) return value;
1866 // Preserve the attributes of this existing property. 1866 // Preserve the attributes of this existing property.
1867 attributes = result->GetAttributes(); 1867 attributes = result->GetAttributes();
1868 return ConvertDescriptorToFieldAndMapTransition(name, value, attributes); 1868 return ConvertDescriptorToField(name, value, attributes);
1869 case CALLBACKS: 1869 case CALLBACKS:
1870 return SetPropertyWithCallback(result->GetCallbackObject(), 1870 return SetPropertyWithCallback(result->GetCallbackObject(),
1871 name, 1871 name,
1872 value, 1872 value,
1873 result->holder()); 1873 result->holder());
1874 case INTERCEPTOR: 1874 case INTERCEPTOR:
1875 return SetPropertyWithInterceptor(name, value, attributes); 1875 return SetPropertyWithInterceptor(name, value, attributes);
1876 case CONSTANT_TRANSITION: 1876 case CONSTANT_TRANSITION:
1877 // Replace with a MAP_TRANSITION to a new map with a FIELD, even 1877 // Replace with a MAP_TRANSITION to a new map with a FIELD, even
1878 // if the value is a function. 1878 // if the value is a function.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1940 return AddFastPropertyUsingMap(result->GetTransitionMap(), 1940 return AddFastPropertyUsingMap(result->GetTransitionMap(),
1941 name, 1941 name,
1942 value); 1942 value);
1943 } 1943 }
1944 return ConvertDescriptorToField(name, value, attributes); 1944 return ConvertDescriptorToField(name, value, attributes);
1945 case CONSTANT_FUNCTION: 1945 case CONSTANT_FUNCTION:
1946 // Only replace the function if necessary. 1946 // Only replace the function if necessary.
1947 if (value == result->GetConstantFunction()) return value; 1947 if (value == result->GetConstantFunction()) return value;
1948 // Preserve the attributes of this existing property. 1948 // Preserve the attributes of this existing property.
1949 attributes = result->GetAttributes(); 1949 attributes = result->GetAttributes();
1950 return ConvertDescriptorToFieldAndMapTransition(name, value, attributes); 1950 return ConvertDescriptorToField(name, value, attributes);
1951 case CALLBACKS: 1951 case CALLBACKS:
1952 case INTERCEPTOR: 1952 case INTERCEPTOR:
1953 // Override callback in clone 1953 // Override callback in clone
1954 return ConvertDescriptorToField(name, value, attributes); 1954 return ConvertDescriptorToField(name, value, attributes);
1955 case CONSTANT_TRANSITION: 1955 case CONSTANT_TRANSITION:
1956 // Replace with a MAP_TRANSITION to a new map with a FIELD, even 1956 // Replace with a MAP_TRANSITION to a new map with a FIELD, even
1957 // if the value is a function. 1957 // if the value is a function.
1958 return ConvertDescriptorToFieldAndMapTransition(name, value, attributes); 1958 return ConvertDescriptorToFieldAndMapTransition(name, value, attributes);
1959 case NULL_DESCRIPTOR: 1959 case NULL_DESCRIPTOR:
1960 return ConvertDescriptorToFieldAndMapTransition(name, value, attributes); 1960 return ConvertDescriptorToFieldAndMapTransition(name, value, attributes);
(...skipping 5745 matching lines...) Expand 10 before | Expand all | Expand 10 after
7706 if (break_point_objects()->IsUndefined()) return 0; 7706 if (break_point_objects()->IsUndefined()) return 0;
7707 // Single beak point. 7707 // Single beak point.
7708 if (!break_point_objects()->IsFixedArray()) return 1; 7708 if (!break_point_objects()->IsFixedArray()) return 1;
7709 // Multiple break points. 7709 // Multiple break points.
7710 return FixedArray::cast(break_point_objects())->length(); 7710 return FixedArray::cast(break_point_objects())->length();
7711 } 7711 }
7712 #endif 7712 #endif
7713 7713
7714 7714
7715 } } // namespace v8::internal 7715 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698