| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2972 void* data, | 2972 void* data, |
| 2973 ExternalArrayType array_type, | 2973 ExternalArrayType array_type, |
| 2974 int length) { | 2974 int length) { |
| 2975 i::Handle<i::ExternalArray> array = | 2975 i::Handle<i::ExternalArray> array = |
| 2976 FACTORY->NewExternalArray(length, array_type, data); | 2976 FACTORY->NewExternalArray(length, array_type, data); |
| 2977 | 2977 |
| 2978 // If the object already has external elements, create a new, unique | 2978 // If the object already has external elements, create a new, unique |
| 2979 // map if the element type is now changing, because assumptions about | 2979 // map if the element type is now changing, because assumptions about |
| 2980 // generated code based on the receiver's map will be invalid. | 2980 // generated code based on the receiver's map will be invalid. |
| 2981 i::Handle<i::HeapObject> elements(object->elements()); | 2981 i::Handle<i::HeapObject> elements(object->elements()); |
| 2982 bool force_unique_map = | 2982 bool cant_reuse_map = |
| 2983 elements->map()->IsUndefined() || | 2983 elements->map()->IsUndefined() || |
| 2984 !elements->map()->has_external_array_elements() || | 2984 !elements->map()->has_external_array_elements() || |
| 2985 elements->map() != HEAP->MapForExternalArrayType(array_type); | 2985 elements->map() != HEAP->MapForExternalArrayType(array_type); |
| 2986 if (force_unique_map) { | 2986 if (cant_reuse_map) { |
| 2987 i::Handle<i::Map> external_array_map = | 2987 i::Handle<i::Map> external_array_map = |
| 2988 FACTORY->NewExternalArrayElementsMap( | 2988 FACTORY->GetExternalArrayElementsMap( |
| 2989 i::Handle<i::Map>(object->map())); | 2989 i::Handle<i::Map>(object->map()), |
| 2990 array_type, |
| 2991 object->HasFastProperties()); |
| 2990 object->set_map(*external_array_map); | 2992 object->set_map(*external_array_map); |
| 2991 } | 2993 } |
| 2992 object->set_elements(*array); | 2994 object->set_elements(*array); |
| 2993 } | 2995 } |
| 2994 | 2996 |
| 2995 } // namespace | 2997 } // namespace |
| 2996 | 2998 |
| 2997 | 2999 |
| 2998 void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) { | 3000 void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) { |
| 2999 i::Isolate* isolate = i::Isolate::Current(); | 3001 i::Isolate* isolate = i::Isolate::Current(); |
| (...skipping 2609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5609 | 5611 |
| 5610 | 5612 |
| 5611 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 5613 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
| 5612 HandleScopeImplementer* thread_local = | 5614 HandleScopeImplementer* thread_local = |
| 5613 reinterpret_cast<HandleScopeImplementer*>(storage); | 5615 reinterpret_cast<HandleScopeImplementer*>(storage); |
| 5614 thread_local->IterateThis(v); | 5616 thread_local->IterateThis(v); |
| 5615 return storage + ArchiveSpacePerThread(); | 5617 return storage + ArchiveSpacePerThread(); |
| 5616 } | 5618 } |
| 5617 | 5619 |
| 5618 } } // namespace v8::internal | 5620 } } // namespace v8::internal |
| OLD | NEW |