Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: src/elements.cc

Issue 8561011: Avoid explicitly using built-in new operator where possible to appease VS compiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/extensions/gc-extension.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/extensions/gc-extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698