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 5818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5829 | 5829 |
5830 // Deep copy local elements. | 5830 // Deep copy local elements. |
5831 // Pixel elements cannot be created using an object literal. | 5831 // Pixel elements cannot be created using an object literal. |
5832 ASSERT(!copy->HasExternalArrayElements()); | 5832 ASSERT(!copy->HasExternalArrayElements()); |
5833 switch (copy->GetElementsKind()) { | 5833 switch (copy->GetElementsKind()) { |
5834 case FAST_SMI_ELEMENTS: | 5834 case FAST_SMI_ELEMENTS: |
5835 case FAST_ELEMENTS: | 5835 case FAST_ELEMENTS: |
5836 case FAST_HOLEY_SMI_ELEMENTS: | 5836 case FAST_HOLEY_SMI_ELEMENTS: |
5837 case FAST_HOLEY_ELEMENTS: { | 5837 case FAST_HOLEY_ELEMENTS: { |
5838 Handle<FixedArray> elements(FixedArray::cast(copy->elements())); | 5838 Handle<FixedArray> elements(FixedArray::cast(copy->elements())); |
5839 if (elements->map() == isolate->heap()->fixed_cow_array_map()) { | 5839 if (elements->map() != isolate->heap()->fixed_cow_array_map()) { |
5840 isolate->counters()->cow_arrays_created_runtime()->Increment(); | |
Michael Starzinger
2013/11/04 14:12:03
This removes the accounting of cloned CoW arrays i
mvstanton
2013/11/04 14:47:15
Thanks, I was trying to avoid double counting but
| |
5841 #ifdef DEBUG | |
5842 for (int i = 0; i < elements->length(); i++) { | |
5843 ASSERT(!elements->get(i)->IsJSObject()); | |
5844 } | |
5845 #endif | |
5846 } else { | |
5847 for (int i = 0; i < elements->length(); i++) { | 5840 for (int i = 0; i < elements->length(); i++) { |
5848 Handle<Object> value(elements->get(i), isolate); | 5841 Handle<Object> value(elements->get(i), isolate); |
5849 ASSERT(value->IsSmi() || | 5842 ASSERT(value->IsSmi() || |
5850 value->IsTheHole() || | 5843 value->IsTheHole() || |
5851 (IsFastObjectElementsKind(copy->GetElementsKind()))); | 5844 (IsFastObjectElementsKind(copy->GetElementsKind()))); |
5852 if (value->IsJSObject()) { | 5845 if (value->IsJSObject()) { |
5853 Handle<JSObject> result = VisitElementOrProperty( | 5846 Handle<JSObject> result = VisitElementOrProperty( |
5854 copy, Handle<JSObject>::cast(value)); | 5847 copy, Handle<JSObject>::cast(value)); |
5855 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, result, Handle<JSObject>()); | 5848 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, result, Handle<JSObject>()); |
5856 if (copying) { | 5849 if (copying) { |
(...skipping 10539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
16396 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16389 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16397 static const char* error_messages_[] = { | 16390 static const char* error_messages_[] = { |
16398 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16391 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16399 }; | 16392 }; |
16400 #undef ERROR_MESSAGES_TEXTS | 16393 #undef ERROR_MESSAGES_TEXTS |
16401 return error_messages_[reason]; | 16394 return error_messages_[reason]; |
16402 } | 16395 } |
16403 | 16396 |
16404 | 16397 |
16405 } } // namespace v8::internal | 16398 } } // namespace v8::internal |
OLD | NEW |