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

Side by Side Diff: src/objects-inl.h

Issue 7516: - Optimized copying of FixedArray. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 months 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
« src/heap.h ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 2277 matching lines...) Expand 10 before | Expand all | Expand 10 after
2288 WRITE_FIELD(this, kCodeCacheOffset, Heap::empty_fixed_array()); 2288 WRITE_FIELD(this, kCodeCacheOffset, Heap::empty_fixed_array());
2289 } 2289 }
2290 2290
2291 2291
2292 void JSArray::SetContent(FixedArray* storage) { 2292 void JSArray::SetContent(FixedArray* storage) {
2293 set_length(Smi::FromInt(storage->length())); 2293 set_length(Smi::FromInt(storage->length()));
2294 set_elements(storage); 2294 set_elements(storage);
2295 } 2295 }
2296 2296
2297 2297
2298 Object* FixedArray::Copy() {
2299 if (length() == 0) return this;
2300 return Heap::CopyFixedArray(this);
2301 }
2302
2303
2298 #undef CAST_ACCESSOR 2304 #undef CAST_ACCESSOR
2299 #undef INT_ACCESSORS 2305 #undef INT_ACCESSORS
2300 #undef SMI_ACCESSORS 2306 #undef SMI_ACCESSORS
2301 #undef ACCESSORS 2307 #undef ACCESSORS
2302 #undef FIELD_ADDR 2308 #undef FIELD_ADDR
2303 #undef READ_FIELD 2309 #undef READ_FIELD
2304 #undef WRITE_FIELD 2310 #undef WRITE_FIELD
2305 #undef WRITE_BARRIER 2311 #undef WRITE_BARRIER
2306 #undef READ_MEMADDR_FIELD 2312 #undef READ_MEMADDR_FIELD
2307 #undef WRITE_MEMADDR_FIELD 2313 #undef WRITE_MEMADDR_FIELD
2308 #undef READ_DOUBLE_FIELD 2314 #undef READ_DOUBLE_FIELD
2309 #undef WRITE_DOUBLE_FIELD 2315 #undef WRITE_DOUBLE_FIELD
2310 #undef READ_INT_FIELD 2316 #undef READ_INT_FIELD
2311 #undef WRITE_INT_FIELD 2317 #undef WRITE_INT_FIELD
2312 #undef READ_SHORT_FIELD 2318 #undef READ_SHORT_FIELD
2313 #undef WRITE_SHORT_FIELD 2319 #undef WRITE_SHORT_FIELD
2314 #undef READ_BYTE_FIELD 2320 #undef READ_BYTE_FIELD
2315 #undef WRITE_BYTE_FIELD 2321 #undef WRITE_BYTE_FIELD
2316 2322
2317 2323
2318 } } // namespace v8::internal 2324 } } // namespace v8::internal
2319 2325
2320 #endif // V8_OBJECTS_INL_H_ 2326 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/heap.h ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698