OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |