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

Side by Side Diff: src/heap.h

Issue 11593007: Replace the use CharacterStreams in Heap::AllocateSymbolInternal and String::ComputeHash (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: issues addressed Created 8 years 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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 uint32_t hash_field); 757 uint32_t hash_field);
758 758
759 MUST_USE_RESULT inline MaybeObject* AllocateAsciiSymbol( 759 MUST_USE_RESULT inline MaybeObject* AllocateAsciiSymbol(
760 Vector<const char> str, 760 Vector<const char> str,
761 uint32_t hash_field); 761 uint32_t hash_field);
762 762
763 MUST_USE_RESULT inline MaybeObject* AllocateTwoByteSymbol( 763 MUST_USE_RESULT inline MaybeObject* AllocateTwoByteSymbol(
764 Vector<const uc16> str, 764 Vector<const uc16> str,
765 uint32_t hash_field); 765 uint32_t hash_field);
766 766
767 template<typename T>
768 static inline bool IsOneByte(T t, int chars);
769
770 template<typename T>
771 MUST_USE_RESULT inline MaybeObject* AllocateInternalSymbol(
772 T t, int chars, uint32_t hash_field);
773
774 template<bool is_one_byte, typename T>
767 MUST_USE_RESULT MaybeObject* AllocateInternalSymbol( 775 MUST_USE_RESULT MaybeObject* AllocateInternalSymbol(
768 unibrow::CharacterStream* buffer, int chars, uint32_t hash_field); 776 T t, int chars, uint32_t hash_field);
769
770 MUST_USE_RESULT MaybeObject* AllocateExternalSymbol(
771 Vector<const char> str,
772 int chars);
773 777
774 // Allocates and partially initializes a String. There are two String 778 // Allocates and partially initializes a String. There are two String
775 // encodings: ASCII and two byte. These functions allocate a string of the 779 // encodings: ASCII and two byte. These functions allocate a string of the
776 // given length and set its map and length fields. The characters of the 780 // given length and set its map and length fields. The characters of the
777 // string are uninitialized. 781 // string are uninitialized.
778 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 782 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
779 // failed. 783 // failed.
780 // Please note this does not perform a garbage collection. 784 // Please note this does not perform a garbage collection.
781 MUST_USE_RESULT MaybeObject* AllocateRawOneByteString( 785 MUST_USE_RESULT MaybeObject* AllocateRawOneByteString(
782 int length, 786 int length,
(...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after
2879 AssertNoAllocation no_alloc; // i.e. no gc allowed. 2883 AssertNoAllocation no_alloc; // i.e. no gc allowed.
2880 2884
2881 private: 2885 private:
2882 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2886 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2883 }; 2887 };
2884 #endif // DEBUG || LIVE_OBJECT_LIST 2888 #endif // DEBUG || LIVE_OBJECT_LIST
2885 2889
2886 } } // namespace v8::internal 2890 } } // namespace v8::internal
2887 2891
2888 #endif // V8_HEAP_H_ 2892 #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