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

Side by Side Diff: src/objects.cc

Issue 14696016: Always generalize all representations when no transition is inserted. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 | 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 6165 matching lines...) Expand 10 before | Expand all | Expand 10 after
6176 SimpleTransitionFlag simple_flag = 6176 SimpleTransitionFlag simple_flag =
6177 (descriptor_index == descriptors->number_of_descriptors() - 1) 6177 (descriptor_index == descriptors->number_of_descriptors() - 1)
6178 ? SIMPLE_TRANSITION 6178 ? SIMPLE_TRANSITION
6179 : FULL_TRANSITION; 6179 : FULL_TRANSITION;
6180 ASSERT(name == descriptors->GetKey(descriptor_index)); 6180 ASSERT(name == descriptors->GetKey(descriptor_index));
6181 MaybeObject* maybe_transitions = AddTransition(name, result, simple_flag); 6181 MaybeObject* maybe_transitions = AddTransition(name, result, simple_flag);
6182 if (!maybe_transitions->To(&transitions)) return maybe_transitions; 6182 if (!maybe_transitions->To(&transitions)) return maybe_transitions;
6183 6183
6184 set_transitions(transitions); 6184 set_transitions(transitions);
6185 result->SetBackPointer(this); 6185 result->SetBackPointer(this);
6186 } else {
6187 descriptors->InitializeRepresentations(Representation::Tagged());
6186 } 6188 }
6187 6189
6188 return result; 6190 return result;
6189 } 6191 }
6190 6192
6191 6193
6192 MaybeObject* Map::CopyInstallDescriptors(int new_descriptor, 6194 MaybeObject* Map::CopyInstallDescriptors(int new_descriptor,
6193 DescriptorArray* descriptors) { 6195 DescriptorArray* descriptors) {
6194 ASSERT(descriptors->IsSortedNoDuplicates()); 6196 ASSERT(descriptors->IsSortedNoDuplicates());
6195 6197
(...skipping 17 matching lines...) Expand all
6213 6215
6214 if (CanHaveMoreTransitions()) { 6216 if (CanHaveMoreTransitions()) {
6215 Name* name = descriptors->GetKey(new_descriptor); 6217 Name* name = descriptors->GetKey(new_descriptor);
6216 TransitionArray* transitions; 6218 TransitionArray* transitions;
6217 MaybeObject* maybe_transitions = 6219 MaybeObject* maybe_transitions =
6218 AddTransition(name, result, SIMPLE_TRANSITION); 6220 AddTransition(name, result, SIMPLE_TRANSITION);
6219 if (!maybe_transitions->To(&transitions)) return maybe_transitions; 6221 if (!maybe_transitions->To(&transitions)) return maybe_transitions;
6220 6222
6221 set_transitions(transitions); 6223 set_transitions(transitions);
6222 result->SetBackPointer(this); 6224 result->SetBackPointer(this);
6225 } else {
6226 descriptors->InitializeRepresentations(Representation::Tagged());
6223 } 6227 }
6224 6228
6225 return result; 6229 return result;
6226 } 6230 }
6227 6231
6228 6232
6229 MaybeObject* Map::CopyAsElementsKind(ElementsKind kind, TransitionFlag flag) { 6233 MaybeObject* Map::CopyAsElementsKind(ElementsKind kind, TransitionFlag flag) {
6230 if (flag == INSERT_TRANSITION) { 6234 if (flag == INSERT_TRANSITION) {
6231 ASSERT(!HasElementsTransition() || 6235 ASSERT(!HasElementsTransition() ||
6232 ((elements_transition_map()->elements_kind() == DICTIONARY_ELEMENTS || 6236 ((elements_transition_map()->elements_kind() == DICTIONARY_ELEMENTS ||
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
6287 JSFunction* ctor = JSFunction::cast(constructor()); 6291 JSFunction* ctor = JSFunction::cast(constructor());
6288 Map* map = ctor->initial_map(); 6292 Map* map = ctor->initial_map();
6289 DescriptorArray* descriptors = map->instance_descriptors(); 6293 DescriptorArray* descriptors = map->instance_descriptors();
6290 6294
6291 int number_of_own_descriptors = map->NumberOfOwnDescriptors(); 6295 int number_of_own_descriptors = map->NumberOfOwnDescriptors();
6292 DescriptorArray* new_descriptors; 6296 DescriptorArray* new_descriptors;
6293 MaybeObject* maybe_descriptors = 6297 MaybeObject* maybe_descriptors =
6294 descriptors->CopyUpTo(number_of_own_descriptors); 6298 descriptors->CopyUpTo(number_of_own_descriptors);
6295 if (!maybe_descriptors->To(&new_descriptors)) return maybe_descriptors; 6299 if (!maybe_descriptors->To(&new_descriptors)) return maybe_descriptors;
6296 6300
6297 new_descriptors->InitializeRepresentations(Representation::Tagged());
6298
6299 return CopyReplaceDescriptors(new_descriptors, NULL, OMIT_TRANSITION, 0); 6301 return CopyReplaceDescriptors(new_descriptors, NULL, OMIT_TRANSITION, 0);
6300 } 6302 }
6301 6303
6302 6304
6303 MaybeObject* Map::Copy() { 6305 MaybeObject* Map::Copy() {
6304 DescriptorArray* descriptors = instance_descriptors(); 6306 DescriptorArray* descriptors = instance_descriptors();
6305 DescriptorArray* new_descriptors; 6307 DescriptorArray* new_descriptors;
6306 int number_of_own_descriptors = NumberOfOwnDescriptors(); 6308 int number_of_own_descriptors = NumberOfOwnDescriptors();
6307 MaybeObject* maybe_descriptors = 6309 MaybeObject* maybe_descriptors =
6308 descriptors->CopyUpTo(number_of_own_descriptors); 6310 descriptors->CopyUpTo(number_of_own_descriptors);
(...skipping 8826 matching lines...) Expand 10 before | Expand all | Expand 10 after
15135 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 15137 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
15136 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 15138 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
15137 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 15139 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
15138 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 15140 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
15139 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 15141 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
15140 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 15142 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
15141 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 15143 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
15142 } 15144 }
15143 15145
15144 } } // namespace v8::internal 15146 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698