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

Side by Side Diff: src/objects.cc

Issue 10700137: After transitioning to constant function, return the constant function as result of the assignment. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: u Created 8 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/mjsunit/regress/regress-2226.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 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after
2952 } 2952 }
2953 return self->ConvertDescriptorToField(*name, *value, attributes); 2953 return self->ConvertDescriptorToField(*name, *value, attributes);
2954 } 2954 }
2955 2955
2956 // Is transition to CONSTANT_FUNCTION. 2956 // Is transition to CONSTANT_FUNCTION.
2957 Object* constant_function = descriptors->GetValue(descriptor); 2957 Object* constant_function = descriptors->GetValue(descriptor);
2958 // If the same constant function is being added we can simply 2958 // If the same constant function is being added we can simply
2959 // transition to the target map. 2959 // transition to the target map.
2960 if (constant_function == *value) { 2960 if (constant_function == *value) {
2961 self->set_map(transition_map); 2961 self->set_map(transition_map);
2962 return this; 2962 return constant_function;
2963 } 2963 }
2964 // Otherwise, replace with a map transition to a new map with a FIELD, 2964 // Otherwise, replace with a map transition to a new map with a FIELD,
2965 // even if the value is a constant function. 2965 // even if the value is a constant function.
2966 return self->ConvertDescriptorToFieldAndMapTransition(*name, 2966 return self->ConvertDescriptorToFieldAndMapTransition(*name,
2967 *value, 2967 *value,
2968 attributes); 2968 attributes);
2969 } 2969 }
2970 case HANDLER: 2970 case HANDLER:
2971 case NONEXISTENT: 2971 case NONEXISTENT:
2972 UNREACHABLE(); 2972 UNREACHABLE();
(...skipping 10299 matching lines...) Expand 10 before | Expand all | Expand 10 after
13272 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13272 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13273 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13273 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13274 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13274 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13275 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13275 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13276 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13276 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13277 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13277 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13278 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13278 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13279 } 13279 }
13280 13280
13281 } } // namespace v8::internal 13281 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-2226.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698