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

Side by Side Diff: src/heap.h

Issue 24261012: Remove duplicated heap allocation functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 // A cache is used for ASCII codes. 857 // A cache is used for ASCII codes.
858 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 858 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
859 // failed. Please note this does not perform a garbage collection. 859 // failed. Please note this does not perform a garbage collection.
860 MUST_USE_RESULT MaybeObject* LookupSingleCharacterStringFromCode( 860 MUST_USE_RESULT MaybeObject* LookupSingleCharacterStringFromCode(
861 uint16_t code); 861 uint16_t code);
862 862
863 // Allocate a byte array of the specified length 863 // Allocate a byte array of the specified length
864 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 864 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
865 // failed. 865 // failed.
866 // Please note this does not perform a garbage collection. 866 // Please note this does not perform a garbage collection.
867 MUST_USE_RESULT MaybeObject* AllocateByteArray(int length, 867 MUST_USE_RESULT MaybeObject* AllocateByteArray(
868 PretenureFlag pretenure); 868 int length,
869 869 PretenureFlag pretenure = NOT_TENURED);
870 // Allocate a non-tenured byte array of the specified length
871 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
872 // failed.
873 // Please note this does not perform a garbage collection.
874 MUST_USE_RESULT MaybeObject* AllocateByteArray(int length);
875 870
876 // Allocates an external array of the specified length and type. 871 // Allocates an external array of the specified length and type.
877 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 872 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
878 // failed. 873 // failed.
879 // Please note this does not perform a garbage collection. 874 // Please note this does not perform a garbage collection.
880 MUST_USE_RESULT MaybeObject* AllocateExternalArray( 875 MUST_USE_RESULT MaybeObject* AllocateExternalArray(
881 int length, 876 int length,
882 ExternalArrayType array_type, 877 ExternalArrayType array_type,
883 void* external_pointer, 878 void* external_pointer,
884 PretenureFlag pretenure); 879 PretenureFlag pretenure);
(...skipping 20 matching lines...) Expand all
905 MUST_USE_RESULT MaybeObject* AllocateBox(Object* value, 900 MUST_USE_RESULT MaybeObject* AllocateBox(Object* value,
906 PretenureFlag pretenure); 901 PretenureFlag pretenure);
907 902
908 // Allocate a tenured AllocationSite. It's payload is null 903 // Allocate a tenured AllocationSite. It's payload is null
909 MUST_USE_RESULT MaybeObject* AllocateAllocationSite(); 904 MUST_USE_RESULT MaybeObject* AllocateAllocationSite();
910 905
911 // Allocates a fixed array initialized with undefined values 906 // Allocates a fixed array initialized with undefined values
912 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 907 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
913 // failed. 908 // failed.
914 // Please note this does not perform a garbage collection. 909 // Please note this does not perform a garbage collection.
915 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length, 910 MUST_USE_RESULT MaybeObject* AllocateFixedArray(
916 PretenureFlag pretenure); 911 int length,
917 // Allocates a fixed array initialized with undefined values 912 PretenureFlag pretenure = NOT_TENURED);
918 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length);
919 913
920 // Allocates an uninitialized fixed array. It must be filled by the caller. 914 // Allocates an uninitialized fixed array. It must be filled by the caller.
921 // 915 //
922 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 916 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
923 // failed. 917 // failed.
924 // Please note this does not perform a garbage collection. 918 // Please note this does not perform a garbage collection.
925 MUST_USE_RESULT MaybeObject* AllocateUninitializedFixedArray(int length); 919 MUST_USE_RESULT MaybeObject* AllocateUninitializedFixedArray(int length);
926 920
927 // Move len elements within a given array from src_index index to dst_index 921 // Move len elements within a given array from src_index index to dst_index
928 // index. 922 // index.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 MUST_USE_RESULT MaybeObject* AllocateArgumentsObject( 1031 MUST_USE_RESULT MaybeObject* AllocateArgumentsObject(
1038 Object* callee, int length); 1032 Object* callee, int length);
1039 1033
1040 // Same as NewNumberFromDouble, but may return a preallocated/immutable 1034 // Same as NewNumberFromDouble, but may return a preallocated/immutable
1041 // number object (e.g., minus_zero_value_, nan_value_) 1035 // number object (e.g., minus_zero_value_, nan_value_)
1042 MUST_USE_RESULT MaybeObject* NumberFromDouble( 1036 MUST_USE_RESULT MaybeObject* NumberFromDouble(
1043 double value, PretenureFlag pretenure = NOT_TENURED); 1037 double value, PretenureFlag pretenure = NOT_TENURED);
1044 1038
1045 // Allocated a HeapNumber from value. 1039 // Allocated a HeapNumber from value.
1046 MUST_USE_RESULT MaybeObject* AllocateHeapNumber( 1040 MUST_USE_RESULT MaybeObject* AllocateHeapNumber(
1047 double value, 1041 double value, PretenureFlag pretenure = NOT_TENURED);
1048 PretenureFlag pretenure);
1049 // pretenure = NOT_TENURED
1050 MUST_USE_RESULT MaybeObject* AllocateHeapNumber(double value);
1051 1042
1052 // Converts an int into either a Smi or a HeapNumber object. 1043 // Converts an int into either a Smi or a HeapNumber object.
1053 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 1044 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
1054 // failed. 1045 // failed.
1055 // Please note this does not perform a garbage collection. 1046 // Please note this does not perform a garbage collection.
1056 MUST_USE_RESULT inline MaybeObject* NumberFromInt32( 1047 MUST_USE_RESULT inline MaybeObject* NumberFromInt32(
1057 int32_t value, PretenureFlag pretenure = NOT_TENURED); 1048 int32_t value, PretenureFlag pretenure = NOT_TENURED);
1058 1049
1059 // Converts an int into either a Smi or a HeapNumber object. 1050 // Converts an int into either a Smi or a HeapNumber object.
1060 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 1051 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
(...skipping 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after
3022 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 3013 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
3023 3014
3024 private: 3015 private:
3025 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3016 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3026 }; 3017 };
3027 #endif // DEBUG 3018 #endif // DEBUG
3028 3019
3029 } } // namespace v8::internal 3020 } } // namespace v8::internal
3030 3021
3031 #endif // V8_HEAP_H_ 3022 #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