Commit dfb453d7 authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[objects.h splitting] Fix: inline Factory funcs again.

These were too aggressively de-inlined as part of
https://chromium-review.googlesource.com/c/528102 .

BUG=chromium:733161

Change-Id: I88e9f969dcd6142cbbbb2662edd8108ad687c522
Reviewed-on: https://chromium-review.googlesource.com/535640Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45942}
parent c94d9d41
...@@ -307,11 +307,6 @@ Handle<String> Factory::InternalizeStringWithKey(StringTableKey* key) { ...@@ -307,11 +307,6 @@ Handle<String> Factory::InternalizeStringWithKey(StringTableKey* key) {
return StringTable::LookupKey(isolate(), key); return StringTable::LookupKey(isolate(), key);
} }
Handle<Name> Factory::InternalizeName(Handle<Name> name) {
if (name->IsUniqueName()) return name;
return StringTable::LookupString(isolate(), Handle<String>::cast(name));
}
MaybeHandle<String> Factory::NewStringFromOneByte(Vector<const uint8_t> string, MaybeHandle<String> Factory::NewStringFromOneByte(Vector<const uint8_t> string,
PretenureFlag pretenure) { PretenureFlag pretenure) {
int length = string.length(); int length = string.length();
...@@ -832,11 +827,6 @@ Handle<String> Factory::NewProperSubString(Handle<String> str, ...@@ -832,11 +827,6 @@ Handle<String> Factory::NewProperSubString(Handle<String> str,
return slice; return slice;
} }
Handle<String> Factory::NewSubString(Handle<String> str, int begin, int end) {
if (begin == 0 && end == str->length()) return str;
return NewProperSubString(str, begin, end);
}
MaybeHandle<String> Factory::NewExternalStringFromOneByte( MaybeHandle<String> Factory::NewExternalStringFromOneByte(
const ExternalOneByteString::Resource* resource) { const ExternalOneByteString::Resource* resource) {
size_t length = resource->length(); size_t length = resource->length();
...@@ -2599,16 +2589,6 @@ Handle<String> Factory::NumberToString(Handle<Object> number, ...@@ -2599,16 +2589,6 @@ Handle<String> Factory::NumberToString(Handle<Object> number,
return js_string; return js_string;
} }
Handle<String> Factory::Uint32ToString(uint32_t value) {
Handle<String> result = NumberToString(NewNumberFromUint(value));
if (result->length() <= String::kMaxArrayIndexSize) {
uint32_t field = StringHasher::MakeArrayIndexHash(value, result->length());
result->set_hash_field(field);
}
return result;
}
Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) { Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
DCHECK(!shared->HasDebugInfo()); DCHECK(!shared->HasDebugInfo());
Heap* heap = isolate()->heap(); Heap* heap = isolate()->heap();
......
...@@ -136,7 +136,10 @@ class V8_EXPORT_PRIVATE Factory final { ...@@ -136,7 +136,10 @@ class V8_EXPORT_PRIVATE Factory final {
return StringTable::LookupString(isolate(), string); return StringTable::LookupString(isolate(), string);
} }
Handle<Name> InternalizeName(Handle<Name> name); Handle<Name> InternalizeName(Handle<Name> name) {
if (name->IsUniqueName()) return name;
return StringTable::LookupString(isolate(), Handle<String>::cast(name));
}
// String creation functions. Most of the string creation functions take // String creation functions. Most of the string creation functions take
// a Heap::PretenureFlag argument to optionally request that they be // a Heap::PretenureFlag argument to optionally request that they be
...@@ -253,7 +256,10 @@ class V8_EXPORT_PRIVATE Factory final { ...@@ -253,7 +256,10 @@ class V8_EXPORT_PRIVATE Factory final {
int end); int end);
// Create a new string object which holds a substring of a string. // Create a new string object which holds a substring of a string.
Handle<String> NewSubString(Handle<String> str, int begin, int end); Handle<String> NewSubString(Handle<String> str, int begin, int end) {
if (begin == 0 && end == str->length()) return str;
return NewProperSubString(str, begin, end);
}
// Creates a new external String object. There are two String encodings // Creates a new external String object. There are two String encodings
// in the system: one-byte and two-byte. Unlike other String types, it does // in the system: one-byte and two-byte. Unlike other String types, it does
...@@ -689,7 +695,16 @@ class V8_EXPORT_PRIVATE Factory final { ...@@ -689,7 +695,16 @@ class V8_EXPORT_PRIVATE Factory final {
Handle<String> NumberToString(Handle<Object> number, Handle<String> NumberToString(Handle<Object> number,
bool check_number_string_cache = true); bool check_number_string_cache = true);
Handle<String> Uint32ToString(uint32_t value); Handle<String> Uint32ToString(uint32_t value) {
Handle<String> result = NumberToString(NewNumberFromUint(value));
if (result->length() <= String::kMaxArrayIndexSize) {
uint32_t field =
StringHasher::MakeArrayIndexHash(value, result->length());
result->set_hash_field(field);
}
return result;
}
Handle<JSFunction> InstallMembers(Handle<JSFunction> function); Handle<JSFunction> InstallMembers(Handle<JSFunction> function);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment