| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 V(ExternalUnsignedIntElementsAccessor, EXTERNAL_UNSIGNED_INT_ELEMENTS) \ | 820 V(ExternalUnsignedIntElementsAccessor, EXTERNAL_UNSIGNED_INT_ELEMENTS) \ |
| 821 V(ExternalFloatElementsAccessor, EXTERNAL_FLOAT_ELEMENTS) \ | 821 V(ExternalFloatElementsAccessor, EXTERNAL_FLOAT_ELEMENTS) \ |
| 822 V(ExternalDoubleElementsAccessor, EXTERNAL_DOUBLE_ELEMENTS) \ | 822 V(ExternalDoubleElementsAccessor, EXTERNAL_DOUBLE_ELEMENTS) \ |
| 823 V(PixelElementsAccessor, EXTERNAL_PIXEL_ELEMENTS) | 823 V(PixelElementsAccessor, EXTERNAL_PIXEL_ELEMENTS) |
| 824 | 824 |
| 825 static struct ConcreteElementsAccessors { | 825 static struct ConcreteElementsAccessors { |
| 826 #define ACCESSOR_STRUCT(Class, Name) Class* Name##_handler; | 826 #define ACCESSOR_STRUCT(Class, Name) Class* Name##_handler; |
| 827 ELEMENTS_LIST(ACCESSOR_STRUCT) | 827 ELEMENTS_LIST(ACCESSOR_STRUCT) |
| 828 #undef ACCESSOR_STRUCT | 828 #undef ACCESSOR_STRUCT |
| 829 } element_accessors = { | 829 } element_accessors = { |
| 830 #define ACCESSOR_INIT(Class, Name) ::new Class(), | 830 #define ACCESSOR_INIT(Class, Name) new Class(), |
| 831 ELEMENTS_LIST(ACCESSOR_INIT) | 831 ELEMENTS_LIST(ACCESSOR_INIT) |
| 832 #undef ACCESSOR_INIT | 832 #undef ACCESSOR_INIT |
| 833 }; | 833 }; |
| 834 | 834 |
| 835 static ElementsAccessor* accessor_array[] = { | 835 static ElementsAccessor* accessor_array[] = { |
| 836 #define ACCESSOR_ARRAY(Class, Name) element_accessors.Name##_handler, | 836 #define ACCESSOR_ARRAY(Class, Name) element_accessors.Name##_handler, |
| 837 ELEMENTS_LIST(ACCESSOR_ARRAY) | 837 ELEMENTS_LIST(ACCESSOR_ARRAY) |
| 838 #undef ACCESSOR_ARRAY | 838 #undef ACCESSOR_ARRAY |
| 839 }; | 839 }; |
| 840 | 840 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 FixedArray* new_backing_store; | 899 FixedArray* new_backing_store; |
| 900 MaybeObject* maybe_obj = array->GetHeap()->AllocateFixedArray(1); | 900 MaybeObject* maybe_obj = array->GetHeap()->AllocateFixedArray(1); |
| 901 if (!maybe_obj->To(&new_backing_store)) return maybe_obj; | 901 if (!maybe_obj->To(&new_backing_store)) return maybe_obj; |
| 902 new_backing_store->set(0, length); | 902 new_backing_store->set(0, length); |
| 903 array->SetContent(new_backing_store); | 903 array->SetContent(new_backing_store); |
| 904 return array; | 904 return array; |
| 905 } | 905 } |
| 906 | 906 |
| 907 | 907 |
| 908 } } // namespace v8::internal | 908 } } // namespace v8::internal |
| OLD | NEW |