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

Side by Side Diff: src/heap/heap.h

Issue 1255173006: Introduce safe interface to "copy and grow" FixedArray. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed nits. Created 5 years, 4 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
« no previous file with comments | « src/factory.cc ('k') | src/heap/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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HEAP_HEAP_H_ 5 #ifndef V8_HEAP_HEAP_H_
6 #define V8_HEAP_HEAP_H_ 6 #define V8_HEAP_HEAP_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 10
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after
2012 MUST_USE_RESULT AllocationResult 2012 MUST_USE_RESULT AllocationResult
2013 AllocateInternalizedStringImpl(T t, int chars, uint32_t hash_field); 2013 AllocateInternalizedStringImpl(T t, int chars, uint32_t hash_field);
2014 2014
2015 template <typename T> 2015 template <typename T>
2016 MUST_USE_RESULT inline AllocationResult AllocateInternalizedStringImpl( 2016 MUST_USE_RESULT inline AllocationResult AllocateInternalizedStringImpl(
2017 T t, int chars, uint32_t hash_field); 2017 T t, int chars, uint32_t hash_field);
2018 2018
2019 // Allocates an uninitialized fixed array. It must be filled by the caller. 2019 // Allocates an uninitialized fixed array. It must be filled by the caller.
2020 MUST_USE_RESULT AllocationResult AllocateUninitializedFixedArray(int length); 2020 MUST_USE_RESULT AllocationResult AllocateUninitializedFixedArray(int length);
2021 2021
2022 // Make a copy of src and return it. Returns 2022 // Make a copy of src and return it.
2023 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed.
2024 MUST_USE_RESULT inline AllocationResult CopyFixedArray(FixedArray* src); 2023 MUST_USE_RESULT inline AllocationResult CopyFixedArray(FixedArray* src);
2025 2024
2026 // Make a copy of src, set the map, and return the copy. Returns 2025 // Make a copy of src, also grow the copy, and return the copy.
2027 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed. 2026 MUST_USE_RESULT AllocationResult
2027 CopyFixedArrayAndGrow(FixedArray* src, int grow_by);
2028
2029 // Make a copy of src, set the map, and return the copy.
2028 MUST_USE_RESULT AllocationResult 2030 MUST_USE_RESULT AllocationResult
2029 CopyFixedArrayWithMap(FixedArray* src, Map* map); 2031 CopyFixedArrayWithMap(FixedArray* src, Map* map);
2030 2032
2031 // Make a copy of src and return it. Returns 2033 // Make a copy of src and return it.
2032 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed.
2033 MUST_USE_RESULT inline AllocationResult CopyFixedDoubleArray( 2034 MUST_USE_RESULT inline AllocationResult CopyFixedDoubleArray(
2034 FixedDoubleArray* src); 2035 FixedDoubleArray* src);
2035 2036
2036 // Computes a single character string where the character has code. 2037 // Computes a single character string where the character has code.
2037 // A cache is used for one-byte (Latin1) codes. 2038 // A cache is used for one-byte (Latin1) codes.
2038 MUST_USE_RESULT AllocationResult 2039 MUST_USE_RESULT AllocationResult
2039 LookupSingleCharacterStringFromCode(uint16_t code); 2040 LookupSingleCharacterStringFromCode(uint16_t code);
2040 2041
2041 // Allocate a symbol in old space. 2042 // Allocate a symbol in old space.
2042 MUST_USE_RESULT AllocationResult AllocateSymbol(); 2043 MUST_USE_RESULT AllocationResult AllocateSymbol();
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
2828 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2829 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2829 2830
2830 private: 2831 private:
2831 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2832 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2832 }; 2833 };
2833 #endif // DEBUG 2834 #endif // DEBUG
2834 } 2835 }
2835 } // namespace v8::internal 2836 } // namespace v8::internal
2836 2837
2837 #endif // V8_HEAP_HEAP_H_ 2838 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698