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

Side by Side Diff: src/heap.h

Issue 140953002: Refactor string internalization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add virtual for real Created 6 years, 11 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 | « src/factory.cc ('k') | 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 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 1136
1137 // Copy the code and scope info part of the code object, but insert 1137 // Copy the code and scope info part of the code object, but insert
1138 // the provided data as the relocation information. 1138 // the provided data as the relocation information.
1139 MUST_USE_RESULT MaybeObject* CopyCode(Code* code, Vector<byte> reloc_info); 1139 MUST_USE_RESULT MaybeObject* CopyCode(Code* code, Vector<byte> reloc_info);
1140 1140
1141 // Finds the internalized copy for string in the string table. 1141 // Finds the internalized copy for string in the string table.
1142 // If not found, a new string is added to the table and returned. 1142 // If not found, a new string is added to the table and returned.
1143 // Returns Failure::RetryAfterGC(requested_bytes, space) if allocation 1143 // Returns Failure::RetryAfterGC(requested_bytes, space) if allocation
1144 // failed. 1144 // failed.
1145 // Please note this function does not perform a garbage collection. 1145 // Please note this function does not perform a garbage collection.
1146 MUST_USE_RESULT MaybeObject* InternalizeUtf8String(Vector<const char> str);
1147 MUST_USE_RESULT MaybeObject* InternalizeUtf8String(const char* str) { 1146 MUST_USE_RESULT MaybeObject* InternalizeUtf8String(const char* str) {
1148 return InternalizeUtf8String(CStrVector(str)); 1147 return InternalizeUtf8String(CStrVector(str));
1149 } 1148 }
1150 MUST_USE_RESULT MaybeObject* InternalizeOneByteString( 1149 MUST_USE_RESULT MaybeObject* InternalizeUtf8String(Vector<const char> str);
1151 Vector<const uint8_t> str); 1150
1152 MUST_USE_RESULT MaybeObject* InternalizeTwoByteString(Vector<const uc16> str);
1153 MUST_USE_RESULT MaybeObject* InternalizeString(String* str); 1151 MUST_USE_RESULT MaybeObject* InternalizeString(String* str);
1154 MUST_USE_RESULT MaybeObject* InternalizeOneByteString( 1152 MUST_USE_RESULT MaybeObject* InternalizeStringWithKey(HashTableKey* key);
1155 Handle<SeqOneByteString> string, int from, int length);
1156 1153
1157 bool InternalizeStringIfExists(String* str, String** result); 1154 bool InternalizeStringIfExists(String* str, String** result);
1158 bool InternalizeTwoCharsStringIfExists(String* str, String** result); 1155 bool InternalizeTwoCharsStringIfExists(String* str, String** result);
1159 1156
1160 // Compute the matching internalized string map for a string if possible. 1157 // Compute the matching internalized string map for a string if possible.
1161 // NULL is returned if string is in new space or not flattened. 1158 // NULL is returned if string is in new space or not flattened.
1162 Map* InternalizedStringMapForString(String* str); 1159 Map* InternalizedStringMapForString(String* str);
1163 1160
1164 // Tries to flatten a string before compare operation. 1161 // Tries to flatten a string before compare operation.
1165 // 1162 //
(...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after
3043 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 3040 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
3044 3041
3045 private: 3042 private:
3046 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3043 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3047 }; 3044 };
3048 #endif // DEBUG 3045 #endif // DEBUG
3049 3046
3050 } } // namespace v8::internal 3047 } } // namespace v8::internal
3051 3048
3052 #endif // V8_HEAP_H_ 3049 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698