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

Side by Side Diff: src/objects.cc

Issue 223413002: Partial recover from performance degradation after handlification of ElementsAccessor::CopyElements… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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
« src/factory.h ('K') | « src/factory.cc ('k') | 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 11175 matching lines...) Expand 10 before | Expand all | Expand 10 after
11186 } 11186 }
11187 } else { 11187 } else {
11188 if (IsHoleyElementsKind(elements_kind)) { 11188 if (IsHoleyElementsKind(elements_kind)) {
11189 new_elements_kind = FAST_HOLEY_ELEMENTS; 11189 new_elements_kind = FAST_HOLEY_ELEMENTS;
11190 } else { 11190 } else {
11191 new_elements_kind = FAST_ELEMENTS; 11191 new_elements_kind = FAST_ELEMENTS;
11192 } 11192 }
11193 } 11193 }
11194 Handle<FixedArrayBase> old_elements(object->elements()); 11194 Handle<FixedArrayBase> old_elements(object->elements());
11195 ElementsAccessor* accessor = ElementsAccessor::ForKind(new_elements_kind); 11195 ElementsAccessor* accessor = ElementsAccessor::ForKind(new_elements_kind);
11196 accessor->CopyElements(object, new_elements, elements_kind); 11196 accessor->CopyElements(*object, new_elements, elements_kind);
11197 11197
11198 if (elements_kind != SLOPPY_ARGUMENTS_ELEMENTS) { 11198 if (elements_kind != SLOPPY_ARGUMENTS_ELEMENTS) {
11199 Handle<Map> new_map = (new_elements_kind != elements_kind) 11199 Handle<Map> new_map = (new_elements_kind != elements_kind)
11200 ? GetElementsTransitionMap(object, new_elements_kind) 11200 ? GetElementsTransitionMap(object, new_elements_kind)
11201 : handle(object->map()); 11201 : handle(object->map());
11202 object->ValidateElements(); 11202 object->ValidateElements();
11203 JSObject::SetMapAndElements(object, new_map, new_elements); 11203 JSObject::SetMapAndElements(object, new_map, new_elements);
11204 11204
11205 // Transition through the allocation site as well if present. 11205 // Transition through the allocation site as well if present.
11206 JSObject::UpdateAllocationSite(object, new_elements_kind); 11206 JSObject::UpdateAllocationSite(object, new_elements_kind);
(...skipping 29 matching lines...) Expand all
11236 if (IsHoleyElementsKind(elements_kind)) { 11236 if (IsHoleyElementsKind(elements_kind)) {
11237 new_elements_kind = FAST_HOLEY_DOUBLE_ELEMENTS; 11237 new_elements_kind = FAST_HOLEY_DOUBLE_ELEMENTS;
11238 } else { 11238 } else {
11239 new_elements_kind = FAST_DOUBLE_ELEMENTS; 11239 new_elements_kind = FAST_DOUBLE_ELEMENTS;
11240 } 11240 }
11241 11241
11242 Handle<Map> new_map = GetElementsTransitionMap(object, new_elements_kind); 11242 Handle<Map> new_map = GetElementsTransitionMap(object, new_elements_kind);
11243 11243
11244 Handle<FixedArrayBase> old_elements(object->elements()); 11244 Handle<FixedArrayBase> old_elements(object->elements());
11245 ElementsAccessor* accessor = ElementsAccessor::ForKind(FAST_DOUBLE_ELEMENTS); 11245 ElementsAccessor* accessor = ElementsAccessor::ForKind(FAST_DOUBLE_ELEMENTS);
11246 accessor->CopyElements(object, elems, elements_kind); 11246 accessor->CopyElements(*object, elems, elements_kind);
11247 11247
11248 object->ValidateElements(); 11248 object->ValidateElements();
11249 JSObject::SetMapAndElements(object, new_map, elems); 11249 JSObject::SetMapAndElements(object, new_map, elems);
11250 11250
11251 if (FLAG_trace_elements_transitions) { 11251 if (FLAG_trace_elements_transitions) {
11252 PrintElementsTransition(stdout, object, elements_kind, old_elements, 11252 PrintElementsTransition(stdout, object, elements_kind, old_elements,
11253 object->GetElementsKind(), elems); 11253 object->GetElementsKind(), elems);
11254 } 11254 }
11255 11255
11256 if (object->IsJSArray()) { 11256 if (object->IsJSArray()) {
(...skipping 5198 matching lines...) Expand 10 before | Expand all | Expand 10 after
16455 #define ERROR_MESSAGES_TEXTS(C, T) T, 16455 #define ERROR_MESSAGES_TEXTS(C, T) T,
16456 static const char* error_messages_[] = { 16456 static const char* error_messages_[] = {
16457 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16457 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16458 }; 16458 };
16459 #undef ERROR_MESSAGES_TEXTS 16459 #undef ERROR_MESSAGES_TEXTS
16460 return error_messages_[reason]; 16460 return error_messages_[reason];
16461 } 16461 }
16462 16462
16463 16463
16464 } } // namespace v8::internal 16464 } } // namespace v8::internal
OLDNEW
« src/factory.h ('K') | « src/factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698