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

Unified Diff: src/factory.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.h ('k') | src/func-name-inferrer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 25f197b82e6c6385bbd0703d7605dbcd5319b534..855c1494a3e53f1e243cc71db819879a032d48ed 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -157,41 +157,39 @@ Handle<TypeFeedbackInfo> Factory::NewTypeFeedbackInfo() {
}
-// Symbols are created in the old generation (data space).
-Handle<String> Factory::LookupUtf8Symbol(Vector<const char> string) {
+// Internalized strings are created in the old generation (data space).
+Handle<String> Factory::InternalizeUtf8String(Vector<const char> string) {
CALL_HEAP_FUNCTION(isolate(),
- isolate()->heap()->LookupUtf8Symbol(string),
+ isolate()->heap()->InternalizeUtf8String(string),
String);
}
-// Symbols are created in the old generation (data space).
-Handle<String> Factory::LookupSymbol(Handle<String> string) {
+// Internalized strings are created in the old generation (data space).
+Handle<String> Factory::InternalizeString(Handle<String> string) {
CALL_HEAP_FUNCTION(isolate(),
- isolate()->heap()->LookupSymbol(*string),
+ isolate()->heap()->InternalizeString(*string),
String);
}
-Handle<String> Factory::LookupOneByteSymbol(Vector<const uint8_t> string) {
+Handle<String> Factory::InternalizeOneByteString(Vector<const uint8_t> string) {
CALL_HEAP_FUNCTION(isolate(),
- isolate()->heap()->LookupOneByteSymbol(string),
+ isolate()->heap()->InternalizeOneByteString(string),
String);
}
-Handle<String> Factory::LookupOneByteSymbol(Handle<SeqOneByteString> string,
- int from,
- int length) {
+Handle<String> Factory::InternalizeOneByteString(
+ Handle<SeqOneByteString> string, int from, int length) {
CALL_HEAP_FUNCTION(isolate(),
- isolate()->heap()->LookupOneByteSymbol(string,
- from,
- length),
+ isolate()->heap()->InternalizeOneByteString(
+ string, from, length),
String);
}
-Handle<String> Factory::LookupTwoByteSymbol(Vector<const uc16> string) {
+Handle<String> Factory::InternalizeTwoByteString(Vector<const uc16> string) {
CALL_HEAP_FUNCTION(isolate(),
- isolate()->heap()->LookupTwoByteSymbol(string),
+ isolate()->heap()->InternalizeTwoByteString(string),
String);
}
@@ -741,7 +739,7 @@ Handle<String> Factory::EmergencyNewError(const char* type,
Handle<Object> Factory::NewError(const char* maker,
const char* type,
Handle<JSArray> args) {
- Handle<String> make_str = LookupUtf8Symbol(maker);
+ Handle<String> make_str = InternalizeUtf8String(maker);
Handle<Object> fun_obj(
isolate()->js_builtins_object()->GetPropertyNoExceptionThrown(*make_str));
// If the builtins haven't been properly configured yet this error
@@ -750,7 +748,7 @@ Handle<Object> Factory::NewError(const char* maker,
return EmergencyNewError(type, args);
}
Handle<JSFunction> fun = Handle<JSFunction>::cast(fun_obj);
- Handle<Object> type_obj = LookupUtf8Symbol(type);
+ Handle<Object> type_obj = InternalizeUtf8String(type);
Handle<Object> argv[] = { type_obj, args };
// Invoke the JavaScript factory method. If an exception is thrown while
@@ -772,7 +770,7 @@ Handle<Object> Factory::NewError(Handle<String> message) {
Handle<Object> Factory::NewError(const char* constructor,
Handle<String> message) {
- Handle<String> constr = LookupUtf8Symbol(constructor);
+ Handle<String> constr = InternalizeUtf8String(constructor);
Handle<JSFunction> fun = Handle<JSFunction>(
JSFunction::cast(isolate()->js_builtins_object()->
GetPropertyNoExceptionThrown(*constr)));
@@ -850,7 +848,7 @@ Handle<JSFunction> Factory::NewFunctionWithPrototype(Handle<String> name,
// Currently safe because it is only invoked from Genesis.
CHECK_NOT_EMPTY_HANDLE(isolate(),
JSObject::SetLocalPropertyIgnoreAttributes(
- prototype, constructor_symbol(),
+ prototype, constructor_string(),
function, DONT_ENUM));
return function;
}
@@ -908,9 +906,9 @@ Handle<Code> Factory::CopyCode(Handle<Code> code, Vector<byte> reloc_info) {
}
-Handle<String> Factory::SymbolFromString(Handle<String> value) {
+Handle<String> Factory::InternalizedStringFromString(Handle<String> value) {
CALL_HEAP_FUNCTION(isolate(),
- isolate()->heap()->LookupSymbol(*value), String);
+ isolate()->heap()->InternalizeString(*value), String);
}
@@ -1255,7 +1253,7 @@ Handle<JSFunction> Factory::CreateApiFunction(
ASSERT(type != INVALID_TYPE);
Handle<JSFunction> result =
- NewFunction(Factory::empty_symbol(),
+ NewFunction(Factory::empty_string(),
type,
instance_size,
code,
@@ -1439,9 +1437,9 @@ void Factory::ConfigureInstance(Handle<FunctionTemplateInfo> desc,
Handle<Object> Factory::GlobalConstantFor(Handle<String> name) {
Heap* h = isolate()->heap();
- if (name->Equals(h->undefined_symbol())) return undefined_value();
- if (name->Equals(h->nan_symbol())) return nan_value();
- if (name->Equals(h->infinity_symbol())) return infinity_value();
+ if (name->Equals(h->undefined_string())) return undefined_value();
+ if (name->Equals(h->nan_string())) return nan_value();
+ if (name->Equals(h->infinity_string())) return infinity_value();
return Handle<Object>::null();
}
« no previous file with comments | « src/factory.h ('k') | src/func-name-inferrer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698