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

Side by Side Diff: src/objects.cc

Issue 10453054: Fixed JSObject::SetPropertyForResult (issue 2153) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added regression test Created 8 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 | « no previous file | test/mjsunit/regress/regress-2153.js » ('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 2960 matching lines...) Expand 10 before | Expand all | Expand 10 after
2971 name, 2971 name,
2972 value); 2972 value);
2973 } 2973 }
2974 return ConvertDescriptorToField(name, value, attributes); 2974 return ConvertDescriptorToField(name, value, attributes);
2975 case CONSTANT_FUNCTION: 2975 case CONSTANT_FUNCTION:
2976 // Only replace the function if necessary. 2976 // Only replace the function if necessary.
2977 if (value == result->GetConstantFunction()) return value; 2977 if (value == result->GetConstantFunction()) return value;
2978 // Preserve the attributes of this existing property. 2978 // Preserve the attributes of this existing property.
2979 attributes = result->GetAttributes(); 2979 attributes = result->GetAttributes();
2980 return ConvertDescriptorToField(name, value, attributes); 2980 return ConvertDescriptorToField(name, value, attributes);
2981 case CALLBACKS: 2981 case CALLBACKS: {
2982 return SetPropertyWithCallback(result->GetCallbackObject(), 2982 Object* callback_object = result->GetCallbackObject();
2983 if (callback_object->IsAccessorPair() &&
2984 !AccessorPair::cast(callback_object)->ContainsAccessor()) {
2985 return ConvertDescriptorToField(name, value, attributes);
2986 }
2987 return SetPropertyWithCallback(callback_object,
2983 name, 2988 name,
2984 value, 2989 value,
2985 result->holder(), 2990 result->holder(),
2986 strict_mode); 2991 strict_mode);
2992 }
2987 case INTERCEPTOR: 2993 case INTERCEPTOR:
2988 return SetPropertyWithInterceptor(name, value, attributes, strict_mode); 2994 return SetPropertyWithInterceptor(name, value, attributes, strict_mode);
2989 case CONSTANT_TRANSITION: { 2995 case CONSTANT_TRANSITION: {
2990 // If the same constant function is being added we can simply 2996 // If the same constant function is being added we can simply
2991 // transition to the target map. 2997 // transition to the target map.
2992 Map* target_map = result->GetTransitionMap(); 2998 Map* target_map = result->GetTransitionMap();
2993 DescriptorArray* target_descriptors = target_map->instance_descriptors(); 2999 DescriptorArray* target_descriptors = target_map->instance_descriptors();
2994 int number = target_descriptors->SearchWithCache(name); 3000 int number = target_descriptors->SearchWithCache(name);
2995 ASSERT(number != DescriptorArray::kNotFound); 3001 ASSERT(number != DescriptorArray::kNotFound);
2996 ASSERT(target_descriptors->GetType(number) == CONSTANT_FUNCTION); 3002 ASSERT(target_descriptors->GetType(number) == CONSTANT_FUNCTION);
(...skipping 10198 matching lines...) Expand 10 before | Expand all | Expand 10 after
13195 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13201 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13196 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13202 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13197 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13203 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13198 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13204 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13199 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13205 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13200 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13206 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13201 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13207 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13202 } 13208 }
13203 13209
13204 } } // namespace v8::internal 13210 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-2153.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698