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

Side by Side Diff: src/factory.h

Issue 12210083: Renamed "symbols" to "internalized strings" throughout the code base, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Yang's comments Created 7 years, 10 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/extensions/externalize-string-extension.cc ('k') | src/factory.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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 int deopt_entry_count, 72 int deopt_entry_count,
73 PretenureFlag pretenure); 73 PretenureFlag pretenure);
74 Handle<DeoptimizationOutputData> NewDeoptimizationOutputData( 74 Handle<DeoptimizationOutputData> NewDeoptimizationOutputData(
75 int deopt_entry_count, 75 int deopt_entry_count,
76 PretenureFlag pretenure); 76 PretenureFlag pretenure);
77 // Allocates a pre-tenured empty AccessorPair. 77 // Allocates a pre-tenured empty AccessorPair.
78 Handle<AccessorPair> NewAccessorPair(); 78 Handle<AccessorPair> NewAccessorPair();
79 79
80 Handle<TypeFeedbackInfo> NewTypeFeedbackInfo(); 80 Handle<TypeFeedbackInfo> NewTypeFeedbackInfo();
81 81
82 Handle<String> LookupUtf8Symbol(Vector<const char> str); 82 Handle<String> InternalizeUtf8String(Vector<const char> str);
83 Handle<String> LookupUtf8Symbol(const char* str) { 83 Handle<String> InternalizeUtf8String(const char* str) {
84 return LookupUtf8Symbol(CStrVector(str)); 84 return InternalizeUtf8String(CStrVector(str));
85 } 85 }
86 Handle<String> LookupSymbol(Handle<String> str); 86 Handle<String> InternalizeString(Handle<String> str);
87 Handle<String> LookupOneByteSymbol(Vector<const uint8_t> str); 87 Handle<String> InternalizeOneByteString(Vector<const uint8_t> str);
88 Handle<String> LookupOneByteSymbol(Handle<SeqOneByteString>, 88 Handle<String> InternalizeOneByteString(Handle<SeqOneByteString>,
89 int from, 89 int from,
90 int length); 90 int length);
91 Handle<String> LookupTwoByteSymbol(Vector<const uc16> str); 91 Handle<String> InternalizeTwoByteString(Vector<const uc16> str);
92 92
93 93
94 // String creation functions. Most of the string creation functions take 94 // String creation functions. Most of the string creation functions take
95 // a Heap::PretenureFlag argument to optionally request that they be 95 // a Heap::PretenureFlag argument to optionally request that they be
96 // allocated in the old generation. The pretenure flag defaults to 96 // allocated in the old generation. The pretenure flag defaults to
97 // DONT_TENURE. 97 // DONT_TENURE.
98 // 98 //
99 // Creates a new String object. There are two String encodings: ASCII and 99 // Creates a new String object. There are two String encodings: ASCII and
100 // two byte. One should choose between the three string factory functions 100 // two byte. One should choose between the three string factory functions
101 // based on the encoding of the string buffer that the string is 101 // based on the encoding of the string buffer that the string is
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // Create a 'with' context. 188 // Create a 'with' context.
189 Handle<Context> NewWithContext(Handle<JSFunction> function, 189 Handle<Context> NewWithContext(Handle<JSFunction> function,
190 Handle<Context> previous, 190 Handle<Context> previous,
191 Handle<JSObject> extension); 191 Handle<JSObject> extension);
192 192
193 // Create a block context. 193 // Create a block context.
194 Handle<Context> NewBlockContext(Handle<JSFunction> function, 194 Handle<Context> NewBlockContext(Handle<JSFunction> function,
195 Handle<Context> previous, 195 Handle<Context> previous,
196 Handle<ScopeInfo> scope_info); 196 Handle<ScopeInfo> scope_info);
197 197
198 // Return the Symbol matching the passed in string. 198 // Return the internalized version of the passed in string.
199 Handle<String> SymbolFromString(Handle<String> value); 199 Handle<String> InternalizedStringFromString(Handle<String> value);
200 200
201 // Allocate a new struct. The struct is pretenured (allocated directly in 201 // Allocate a new struct. The struct is pretenured (allocated directly in
202 // the old generation). 202 // the old generation).
203 Handle<Struct> NewStruct(InstanceType type); 203 Handle<Struct> NewStruct(InstanceType type);
204 204
205 Handle<AccessorInfo> NewAccessorInfo(); 205 Handle<AccessorInfo> NewAccessorInfo();
206 206
207 Handle<Script> NewScript(Handle<String> source); 207 Handle<Script> NewScript(Handle<String> source);
208 208
209 // Foreign objects are pretenured when allocated by the bootstrapper. 209 // Foreign objects are pretenured when allocated by the bootstrapper.
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 bool* pending_exception); 424 bool* pending_exception);
425 425
426 #define ROOT_ACCESSOR(type, name, camel_name) \ 426 #define ROOT_ACCESSOR(type, name, camel_name) \
427 inline Handle<type> name() { \ 427 inline Handle<type> name() { \
428 return Handle<type>(BitCast<type**>( \ 428 return Handle<type>(BitCast<type**>( \
429 &isolate()->heap()->roots_[Heap::k##camel_name##RootIndex])); \ 429 &isolate()->heap()->roots_[Heap::k##camel_name##RootIndex])); \
430 } 430 }
431 ROOT_LIST(ROOT_ACCESSOR) 431 ROOT_LIST(ROOT_ACCESSOR)
432 #undef ROOT_ACCESSOR_ACCESSOR 432 #undef ROOT_ACCESSOR_ACCESSOR
433 433
434 #define SYMBOL_ACCESSOR(name, str) \ 434 #define STRING_ACCESSOR(name, str) \
435 inline Handle<String> name() { \ 435 inline Handle<String> name() { \
436 return Handle<String>(BitCast<String**>( \ 436 return Handle<String>(BitCast<String**>( \
437 &isolate()->heap()->roots_[Heap::k##name##RootIndex])); \ 437 &isolate()->heap()->roots_[Heap::k##name##RootIndex])); \
438 } 438 }
439 SYMBOL_LIST(SYMBOL_ACCESSOR) 439 INTERNALIZED_STRING_LIST(STRING_ACCESSOR)
440 #undef SYMBOL_ACCESSOR 440 #undef STRING_ACCESSOR
441 441
442 Handle<String> hidden_symbol() { 442 Handle<String> hidden_string() {
443 return Handle<String>(&isolate()->heap()->hidden_symbol_); 443 return Handle<String>(&isolate()->heap()->hidden_string_);
444 } 444 }
445 445
446 Handle<SharedFunctionInfo> NewSharedFunctionInfo( 446 Handle<SharedFunctionInfo> NewSharedFunctionInfo(
447 Handle<String> name, 447 Handle<String> name,
448 int number_of_literals, 448 int number_of_literals,
449 Handle<Code> code, 449 Handle<Code> code,
450 Handle<ScopeInfo> scope_info); 450 Handle<ScopeInfo> scope_info);
451 Handle<SharedFunctionInfo> NewSharedFunctionInfo(Handle<String> name); 451 Handle<SharedFunctionInfo> NewSharedFunctionInfo(Handle<String> name);
452 452
453 Handle<JSMessageObject> NewJSMessageObject( 453 Handle<JSMessageObject> NewJSMessageObject(
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 // Update the map cache in the native context with (keys, map) 518 // Update the map cache in the native context with (keys, map)
519 Handle<MapCache> AddToMapCache(Handle<Context> context, 519 Handle<MapCache> AddToMapCache(Handle<Context> context,
520 Handle<FixedArray> keys, 520 Handle<FixedArray> keys,
521 Handle<Map> map); 521 Handle<Map> map);
522 }; 522 };
523 523
524 524
525 } } // namespace v8::internal 525 } } // namespace v8::internal
526 526
527 #endif // V8_FACTORY_H_ 527 #endif // V8_FACTORY_H_
OLDNEW
« no previous file with comments | « src/extensions/externalize-string-extension.cc ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698