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

Side by Side Diff: src/heap.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
« no previous file with comments | « no previous file | src/heap.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 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 // Allocate a byte array of the specified length 372 // Allocate a byte array of the specified length
373 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 373 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
374 // failed. 374 // failed.
375 // Please not this does not perform a garbage collection. 375 // Please not this does not perform a garbage collection.
376 static Object* AllocateByteArray(int length); 376 static Object* AllocateByteArray(int length);
377 377
378 // Allocates a fixed array initialized with undefined values 378 // Allocates a fixed array initialized with undefined values
379 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 379 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
380 // failed. 380 // failed.
381 // Please note this does not perform a garbage collection. 381 // Please note this does not perform a garbage collection.
382 static Object* AllocateFixedArray(int length, 382 static Object* AllocateFixedArray(int length, PretenureFlag pretenure);
383 PretenureFlag pretenure = NOT_TENURED); 383 // As above but specialized for pretenure == NON_TENURE.
384 static Object* AllocateFixedArray(int length);
384 385
386 // Make a copy of src and return it. Returns
387 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed.
388 static Object* CopyFixedArray(FixedArray* src);
385 389
386 // Allocates a fixed array initialized with the hole values. 390 // Allocates a fixed array initialized with the hole values.
387 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 391 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
388 // failed. 392 // failed.
389 // Please note this does not perform a garbage collection. 393 // Please note this does not perform a garbage collection.
390 static Object* AllocateFixedArrayWithHoles(int length); 394 static Object* AllocateFixedArrayWithHoles(int length);
391 395
392 // AllocateHashTable is identical to AllocateFixedArray except 396 // AllocateHashTable is identical to AllocateFixedArray except
393 // that the resulting object has hash_table_map as map. 397 // that the resulting object has hash_table_map as map.
394 static Object* AllocateHashTable(int length); 398 static Object* AllocateHashTable(int length);
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 static Object* SmiOrNumberFromDouble(double value, 811 static Object* SmiOrNumberFromDouble(double value,
808 bool new_object, 812 bool new_object,
809 PretenureFlag pretenure = NOT_TENURED); 813 PretenureFlag pretenure = NOT_TENURED);
810 814
811 // Allocate an uninitialized object in map space. The behavior is identical 815 // Allocate an uninitialized object in map space. The behavior is identical
812 // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't 816 // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't
813 // have to test the allocation space argument and (b) can reduce code size 817 // have to test the allocation space argument and (b) can reduce code size
814 // (since both AllocateRaw and AllocateRawMap are inlined). 818 // (since both AllocateRaw and AllocateRawMap are inlined).
815 static inline Object* AllocateRawMap(int size_in_bytes); 819 static inline Object* AllocateRawMap(int size_in_bytes);
816 820
821 // Allocate unitialized fixed array (pretenure == NON_TENURE).
Kasper Lund 2008/10/20 06:31:07 Why not write the comment as: Allocate uninitializ
822 static Object* AllocateRawFixedArray(int length);
817 823
818 // Initializes a JSObject based on its map. 824 // Initializes a JSObject based on its map.
819 static void InitializeJSObjectFromMap(JSObject* obj, 825 static void InitializeJSObjectFromMap(JSObject* obj,
820 FixedArray* properties, 826 FixedArray* properties,
821 Map* map); 827 Map* map);
822 828
823 static bool CreateInitialMaps(); 829 static bool CreateInitialMaps();
824 static bool CreateInitialObjects(); 830 static bool CreateInitialObjects();
825 static void CreateFixedStubs(); 831 static void CreateFixedStubs();
826 static Object* CreateOddball(Map* map, 832 static Object* CreateOddball(Map* map,
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 int marked_count_; 1175 int marked_count_;
1170 1176
1171 // The count from the end of the previous full GC. Will be zero if there 1177 // The count from the end of the previous full GC. Will be zero if there
1172 // was no previous full GC. 1178 // was no previous full GC.
1173 int previous_marked_count_; 1179 int previous_marked_count_;
1174 }; 1180 };
1175 1181
1176 } } // namespace v8::internal 1182 } } // namespace v8::internal
1177 1183
1178 #endif // V8_HEAP_H_ 1184 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698