| 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 5819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(); | 5840 if (copying) { |
| 5841 isolate->counters()->cow_arrays_created_runtime()->Increment(); |
| 5842 } |
| 5841 #ifdef DEBUG | 5843 #ifdef DEBUG |
| 5842 for (int i = 0; i < elements->length(); i++) { | 5844 for (int i = 0; i < elements->length(); i++) { |
| 5843 ASSERT(!elements->get(i)->IsJSObject()); | 5845 ASSERT(!elements->get(i)->IsJSObject()); |
| 5844 } | 5846 } |
| 5845 #endif | 5847 #endif |
| 5846 } else { | 5848 } else { |
| 5847 for (int i = 0; i < elements->length(); i++) { | 5849 for (int i = 0; i < elements->length(); i++) { |
| 5848 Handle<Object> value(elements->get(i), isolate); | 5850 Handle<Object> value(elements->get(i), isolate); |
| 5849 ASSERT(value->IsSmi() || | 5851 ASSERT(value->IsSmi() || |
| 5850 value->IsTheHole() || | 5852 value->IsTheHole() || |
| (...skipping 10545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16396 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16398 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 16397 static const char* error_messages_[] = { | 16399 static const char* error_messages_[] = { |
| 16398 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16400 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 16399 }; | 16401 }; |
| 16400 #undef ERROR_MESSAGES_TEXTS | 16402 #undef ERROR_MESSAGES_TEXTS |
| 16401 return error_messages_[reason]; | 16403 return error_messages_[reason]; |
| 16402 } | 16404 } |
| 16403 | 16405 |
| 16404 | 16406 |
| 16405 } } // namespace v8::internal | 16407 } } // namespace v8::internal |
| OLD | NEW |