From: mstarzinger@chromium.org Date: Thu, 17 Apr 2014 14:58:03 +0000 (+0000) Subject: Make Heap::AllocateRaw*String private. X-Git-Tag: upstream/4.7.83~9521 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1213ecb50b978167bd70b73fc3a981ac59f9b55a;p=platform%2Fupstream%2Fv8.git Make Heap::AllocateRaw*String private. R=yangguo@chromium.org Review URL: https://codereview.chromium.org/241023002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20856 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/heap.cc b/src/heap.cc index 0738ffb..557294c 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -3390,7 +3390,7 @@ MaybeObject* Heap::LookupSingleCharacterStringFromCode(uint16_t code) { } SeqTwoByteString* result; - { MaybeObject* maybe_result = AllocateRawTwoByteString(1); + { MaybeObject* maybe_result = AllocateRawTwoByteString(1, NOT_TENURED); if (!maybe_result->To(&result)) return maybe_result; } result->SeqTwoByteStringSet(0, code); diff --git a/src/heap.h b/src/heap.h index e8fdafb..409a01d 100644 --- a/src/heap.h +++ b/src/heap.h @@ -826,20 +826,6 @@ class Heap { MUST_USE_RESULT MaybeObject* AllocateInternalizedStringImpl( T t, int chars, uint32_t hash_field); - // Allocates and partially initializes a String. There are two String - // encodings: ASCII and two byte. These functions allocate a string of the - // given length and set its map and length fields. The characters of the - // string are uninitialized. - // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation - // failed. - // Please note this does not perform a garbage collection. - MUST_USE_RESULT MaybeObject* AllocateRawOneByteString( - int length, - PretenureFlag pretenure = NOT_TENURED); - MUST_USE_RESULT MaybeObject* AllocateRawTwoByteString( - int length, - PretenureFlag pretenure = NOT_TENURED); - // Computes a single character string where the character has code. // A cache is used for ASCII codes. // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation @@ -1989,7 +1975,7 @@ class Heap { return (pretenure == TENURED) ? preferred_old_space : NEW_SPACE; } - // Allocates an uninitialized object. The memory is non-executable if the + // Allocate an uninitialized object. The memory is non-executable if the // hardware and OS allow. This is the single choke-point for allocations // performed by the runtime and should not be bypassed (to extend this to // inlined allocations, use the Heap::DisableInlineAllocation() support). @@ -2009,6 +1995,15 @@ class Heap { MUST_USE_RESULT MaybeObject* AllocateFixedArrayWithFiller( int length, PretenureFlag pretenure, Object* filler); + // Allocate and partially initializes a String. There are two String + // encodings: ASCII and two byte. These functions allocate a string of the + // given length and set its map and length fields. The characters of the + // string are uninitialized. + MUST_USE_RESULT MaybeObject* AllocateRawOneByteString( + int length, PretenureFlag pretenure); + MUST_USE_RESULT MaybeObject* AllocateRawTwoByteString( + int length, PretenureFlag pretenure); + // Initializes a JSObject based on its map. void InitializeJSObjectFromMap(JSObject* obj, FixedArray* properties, diff --git a/test/cctest/test-alloc.cc b/test/cctest/test-alloc.cc index 0d3479a..0cc6f19 100644 --- a/test/cctest/test-alloc.cc +++ b/test/cctest/test-alloc.cc @@ -55,7 +55,7 @@ static MaybeObject* AllocateAfterFailures() { // Old data space. SimulateFullSpace(heap->old_data_space()); - CHECK(!heap->AllocateRawOneByteString(100, TENURED)->IsFailure()); + CHECK(!heap->AllocateByteArray(100, TENURED)->IsFailure()); // Old pointer space. SimulateFullSpace(heap->old_pointer_space());