Revision: 23141
Author: [email protected]
Date: Mon Aug 18 07:54:19 2014 UTC
Log: Purge unused internalized string accessors.
[email protected]
Review URL: https://codereview.chromium.org/471923002
http://code.google.com/p/v8/source/detail?r=23141
Modified:
/branches/bleeding_edge/include/v8.h
/branches/bleeding_edge/src/api.cc
/branches/bleeding_edge/src/arm/full-codegen-arm.cc
/branches/bleeding_edge/src/arm/lithium-codegen-arm.cc
/branches/bleeding_edge/src/arm64/full-codegen-arm64.cc
/branches/bleeding_edge/src/arm64/lithium-codegen-arm64.cc
/branches/bleeding_edge/src/bootstrapper.cc
/branches/bleeding_edge/src/heap/heap.h
/branches/bleeding_edge/src/hydrogen-instructions.cc
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/src/ia32/full-codegen-ia32.cc
/branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc
/branches/bleeding_edge/src/mips/full-codegen-mips.cc
/branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
/branches/bleeding_edge/src/mips64/full-codegen-mips64.cc
/branches/bleeding_edge/src/mips64/lithium-codegen-mips64.cc
/branches/bleeding_edge/src/objects.cc
/branches/bleeding_edge/src/runtime.cc
/branches/bleeding_edge/src/x64/full-codegen-x64.cc
/branches/bleeding_edge/src/x64/lithium-codegen-x64.cc
/branches/bleeding_edge/src/x87/full-codegen-x87.cc
/branches/bleeding_edge/src/x87/lithium-codegen-x87.cc
=======================================
--- /branches/bleeding_edge/include/v8.h Wed Aug 13 13:06:30 2014 UTC
+++ /branches/bleeding_edge/include/v8.h Mon Aug 18 07:54:19 2014 UTC
@@ -5616,7 +5616,7 @@
static const int kNullValueRootIndex = 7;
static const int kTrueValueRootIndex = 8;
static const int kFalseValueRootIndex = 9;
- static const int kEmptyStringRootIndex = 164;
+ static const int kEmptyStringRootIndex = 161;
// The external allocation limit should be below 256 MB on all
architectures
// to avoid that resource-constrained embedders run low on memory.
=======================================
--- /branches/bleeding_edge/src/api.cc Thu Aug 14 08:40:11 2014 UTC
+++ /branches/bleeding_edge/src/api.cc Mon Aug 18 07:54:19 2014 UTC
@@ -3304,7 +3304,8 @@
return v8::String::NewFromUtf8(isolate, "[object ]");
} else {
i::Handle<i::String> class_name = i::Handle<i::String>::cast(name);
- if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Arguments"))) {
+ if (i::String::Equals(class_name,
+ i_isolate->factory()->Arguments_string())) {
return v8::String::NewFromUtf8(isolate, "[object Object]");
} else {
const char* prefix = "[object ";
=======================================
--- /branches/bleeding_edge/src/arm/full-codegen-arm.cc Mon Aug 4 11:34:54
2014 UTC
+++ /branches/bleeding_edge/src/arm/full-codegen-arm.cc Mon Aug 18 07:54:19
2014 UTC
@@ -3318,7 +3318,7 @@
// Functions have class 'Function'.
__ bind(&function);
- __ LoadRoot(r0, Heap::kfunction_class_stringRootIndex);
+ __ LoadRoot(r0, Heap::kFunction_stringRootIndex);
__ jmp(&done);
// Objects with a non-function constructor have class 'Object'.
=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Mon Aug 4
11:34:54 2014 UTC
+++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Mon Aug 18
07:54:19 2014 UTC
@@ -2689,7 +2689,7 @@
__ JumpIfSmi(input, is_false);
- if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Function"))) {
+ if (String::Equals(isolate()->factory()->Function_string(), class_name))
{
// Assuming the following assertions, we can use the same compares to
test
// for both being a function type and being in the object type range.
STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
=======================================
--- /branches/bleeding_edge/src/arm64/full-codegen-arm64.cc Mon Aug 4
11:34:54 2014 UTC
+++ /branches/bleeding_edge/src/arm64/full-codegen-arm64.cc Mon Aug 18
07:54:19 2014 UTC
@@ -3015,7 +3015,7 @@
// Functions have class 'Function'.
__ Bind(&function);
- __ LoadRoot(x0, Heap::kfunction_class_stringRootIndex);
+ __ LoadRoot(x0, Heap::kFunction_stringRootIndex);
__ B(&done);
// Objects with a non-function constructor have class 'Object'.
=======================================
--- /branches/bleeding_edge/src/arm64/lithium-codegen-arm64.cc Mon Aug 4
11:34:54 2014 UTC
+++ /branches/bleeding_edge/src/arm64/lithium-codegen-arm64.cc Mon Aug 18
07:54:19 2014 UTC
@@ -2358,7 +2358,7 @@
__ JumpIfSmi(input, false_label);
Register map = scratch2;
- if (class_name->IsUtf8EqualTo(CStrVector("Function"))) {
+ if (String::Equals(isolate()->factory()->Function_string(), class_name))
{
// Assuming the following assertions, we can use the same compares to
test
// for both being a function type and being in the object type range.
STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
@@ -2383,7 +2383,7 @@
__ Ldr(scratch1, FieldMemOperand(map, Map::kConstructorOffset));
// Objects with a non-function constructor have class 'Object'.
- if (class_name->IsUtf8EqualTo(CStrVector("Object"))) {
+ if (String::Equals(class_name, isolate()->factory()->Object_string())) {
__ JumpIfNotObjectType(
scratch1, scratch2, scratch2, JS_FUNCTION_TYPE, true_label);
} else {
=======================================
--- /branches/bleeding_edge/src/bootstrapper.cc Tue Aug 12 13:36:33 2014 UTC
+++ /branches/bleeding_edge/src/bootstrapper.cc Mon Aug 18 07:54:19 2014 UTC
@@ -821,8 +821,7 @@
factory()->GlobalProxyType);
}
- Handle<String> global_name = factory()->InternalizeOneByteString(
- STATIC_ASCII_VECTOR("global"));
+ Handle<String> global_name = factory()->global_string();
global_proxy_function->shared()->set_instance_class_name(*global_name);
global_proxy_function->initial_map()->set_is_access_check_needed(true);
@@ -861,11 +860,8 @@
native_context()->set_security_token(*global_object);
static const PropertyAttributes attributes =
static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE);
- Runtime::DefineObjectProperty(builtins_global,
- factory()->InternalizeOneByteString(
- STATIC_ASCII_VECTOR("global")),
- global_object,
- attributes).Assert();
+ Runtime::DefineObjectProperty(builtins_global,
factory()->global_string(),
+ global_object, attributes).Assert();
// Set up the reference from the global object to the builtins object.
JSGlobalObject::cast(*global_object)->set_builtins(*builtins_global);
TransferNamedProperties(global_object_from_snapshot, global_object);
@@ -1187,8 +1183,7 @@
// Make sure we can recognize argument objects at runtime.
// This is done by introducing an anonymous function with
// class_name equals 'Arguments'.
- Handle<String> arguments_string = factory->InternalizeOneByteString(
- STATIC_ASCII_VECTOR("Arguments"));
+ Handle<String> arguments_string = factory->Arguments_string();
Handle<Code> code(isolate->builtins()->builtin(Builtins::kIllegal));
Handle<JSFunction> function = factory->NewFunctionWithoutPrototype(
arguments_string, code);
@@ -1947,7 +1942,8 @@
HeapObject::cast(string_function->initial_map()->prototype())->map());
// Install Function.prototype.call and apply.
- { Handle<String> key = factory()->function_class_string();
+ {
+ Handle<String> key = factory()->Function_string();
Handle<JSFunction> function =
Handle<JSFunction>::cast(Object::GetProperty(
handle(native_context()->global_object()),
key).ToHandleChecked());
=======================================
--- /branches/bleeding_edge/src/heap/heap.h Tue Aug 12 17:54:41 2014 UTC
+++ /branches/bleeding_edge/src/heap/heap.h Mon Aug 18 07:54:19 2014 UTC
@@ -256,13 +256,10 @@
V(neander_map)
#define INTERNALIZED_STRING_LIST(V) \
- V(Array_string, "Array") \
V(Object_string, "Object") \
V(proto_string, "__proto__") \
V(arguments_string, "arguments") \
V(Arguments_string, "Arguments") \
- V(call_string, "call") \
- V(apply_string, "apply") \
V(caller_string, "caller") \
V(boolean_string, "boolean") \
V(Boolean_string, "Boolean") \
@@ -273,13 +270,13 @@
V(eval_string, "eval") \
V(empty_string, "") \
V(function_string, "function") \
+ V(Function_string, "Function") \
V(length_string, "length") \
V(name_string, "name") \
V(null_string, "null") \
V(number_string, "number") \
V(Number_string, "Number") \
V(nan_string, "NaN") \
- V(RegExp_string, "RegExp") \
V(source_string, "source") \
V(source_url_string, "source_url") \
V(source_mapping_url_string, "source_mapping_url") \
@@ -290,7 +287,6 @@
V(index_string, "index") \
V(last_index_string, "lastIndex") \
V(object_string, "object") \
- V(literals_string, "literals") \
V(prototype_string, "prototype") \
V(string_string, "string") \
V(String_string, "String") \
@@ -298,34 +294,20 @@
V(Symbol_string, "Symbol") \
V(for_string, "for") \
V(for_api_string, "for_api") \
- V(for_intern_string, "for_intern") \
V(private_api_string, "private_api") \
V(private_intern_string, "private_intern") \
V(Date_string, "Date") \
- V(to_string_string, "toString") \
V(char_at_string, "CharAt") \
V(undefined_string, "undefined") \
V(value_of_string, "valueOf") \
V(stack_string, "stack") \
V(toJSON_string, "toJSON") \
- V(InitializeVarGlobal_string, "InitializeVarGlobal") \
- V(InitializeConstGlobal_string, "InitializeConstGlobal") \
V(KeyedLoadMonomorphic_string, "KeyedLoadMonomorphic") \
V(KeyedStoreMonomorphic_string, "KeyedStoreMonomorphic") \
V(stack_overflow_string, "kStackOverflowBoilerplate") \
V(illegal_access_string, "illegal access") \
- V(get_string, "get") \
- V(set_string, "set") \
- V(map_field_string, "%map") \
- V(elements_field_string, "%elements") \
- V(length_field_string, "%length") \
V(cell_value_string, "%cell_value") \
- V(function_class_string, "Function") \
V(illegal_argument_string, "illegal argument") \
- V(space_string, " ") \
- V(exec_string, "exec") \
- V(zero_string, "0") \
- V(global_eval_string, "GlobalEval") \
V(identity_hash_string, "v8::IdentityHash") \
V(closure_string, "(closure)") \
V(dot_string, ".") \
@@ -341,7 +323,6 @@
V(next_string, "next") \
V(byte_length_string, "byteLength") \
V(byte_offset_string, "byteOffset") \
- V(buffer_string, "buffer") \
V(intl_initialized_marker_string, "v8::intl_initialized_marker") \
V(intl_impl_object_string, "v8::intl_object")
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Mon Aug 4
11:34:54 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen-instructions.cc Mon Aug 18
07:54:19 2014 UTC
@@ -4675,9 +4675,8 @@
HObjectAccess HObjectAccess::ForCellPayload(Isolate* isolate) {
- return HObjectAccess(
- kInobject, Cell::kValueOffset, Representation::Tagged(),
- Handle<String>(isolate->heap()->cell_value_string()));
+ return HObjectAccess(kInobject, Cell::kValueOffset,
Representation::Tagged(),
+ isolate->factory()->cell_value_string());
}
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Tue Aug 12 13:33:35 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc Mon Aug 18 07:54:19 2014 UTC
@@ -7201,7 +7201,9 @@
HInstruction* result = NULL;
if (expr->key()->IsPropertyName()) {
Handle<String> name = expr->key()->AsLiteral()->AsPropertyName();
- if (!name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("length"))) return
false;
+ if (!String::Equals(name, isolate()->factory()->length_string())) {
+ return false;
+ }
if (function_state()->outer() == NULL) {
HInstruction* elements = Add<HArgumentsElements>(false);
=======================================
--- /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Mon Aug 4
11:34:54 2014 UTC
+++ /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Mon Aug 18
07:54:19 2014 UTC
@@ -3247,7 +3247,7 @@
// Functions have class 'Function'.
__ bind(&function);
- __ mov(eax, isolate()->factory()->function_class_string());
+ __ mov(eax, isolate()->factory()->Function_string());
__ jmp(&done);
// Objects with a non-function constructor have class 'Object'.
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Mon Aug 4
11:34:54 2014 UTC
+++ /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Mon Aug 18
07:54:19 2014 UTC
@@ -2536,7 +2536,7 @@
DCHECK(!temp.is(temp2));
__ JumpIfSmi(input, is_false);
- if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Function"))) {
+ if (String::Equals(isolate()->factory()->Function_string(), class_name))
{
// Assuming the following assertions, we can use the same compares to
test
// for both being a function type and being in the object type range.
STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
@@ -2566,7 +2566,7 @@
__ mov(temp, FieldOperand(temp, Map::kConstructorOffset));
// Objects with a non-function constructor have class 'Object'.
__ CmpObjectType(temp, JS_FUNCTION_TYPE, temp2);
- if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Object"))) {
+ if (String::Equals(class_name, isolate()->factory()->Object_string())) {
__ j(not_equal, is_true);
} else {
__ j(not_equal, is_false);
=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Tue Aug 12
19:04:15 2014 UTC
+++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Mon Aug 18
07:54:19 2014 UTC
@@ -3315,7 +3315,7 @@
// Functions have class 'Function'.
__ bind(&function);
- __ LoadRoot(v0, Heap::kfunction_class_stringRootIndex);
+ __ LoadRoot(v0, Heap::kFunction_stringRootIndex);
__ jmp(&done);
// Objects with a non-function constructor have class 'Object'.
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Tue Aug 12
19:04:15 2014 UTC
+++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Mon Aug 18
07:54:19 2014 UTC
@@ -2598,7 +2598,7 @@
__ JumpIfSmi(input, is_false);
- if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Function"))) {
+ if (String::Equals(isolate()->factory()->Function_string(), class_name))
{
// Assuming the following assertions, we can use the same compares to
test
// for both being a function type and being in the object type range.
STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
@@ -2627,7 +2627,7 @@
// Objects with a non-function constructor have class 'Object'.
__ GetObjectType(temp, temp2, temp2);
- if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Object"))) {
+ if (String::Equals(class_name, isolate()->factory()->Object_string())) {
__ Branch(is_true, ne, temp2, Operand(JS_FUNCTION_TYPE));
} else {
__ Branch(is_false, ne, temp2, Operand(JS_FUNCTION_TYPE));
=======================================
--- /branches/bleeding_edge/src/mips64/full-codegen-mips64.cc Mon Aug 4
11:34:54 2014 UTC
+++ /branches/bleeding_edge/src/mips64/full-codegen-mips64.cc Mon Aug 18
07:54:19 2014 UTC
@@ -3314,7 +3314,7 @@
// Functions have class 'Function'.
__ bind(&function);
- __ LoadRoot(v0, Heap::kfunction_class_stringRootIndex);
+ __ LoadRoot(v0, Heap::kFunction_stringRootIndex);
__ jmp(&done);
// Objects with a non-function constructor have class 'Object'.
=======================================
--- /branches/bleeding_edge/src/mips64/lithium-codegen-mips64.cc Mon Aug 4
11:34:54 2014 UTC
+++ /branches/bleeding_edge/src/mips64/lithium-codegen-mips64.cc Mon Aug 18
07:54:19 2014 UTC
@@ -2577,7 +2577,7 @@
__ JumpIfSmi(input, is_false);
- if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Function"))) {
+ if (String::Equals(isolate()->factory()->Function_string(), class_name))
{
// Assuming the following assertions, we can use the same compares to
test
// for both being a function type and being in the object type range.
STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
@@ -2606,7 +2606,7 @@
// Objects with a non-function constructor have class 'Object'.
__ GetObjectType(temp, temp2, temp2);
- if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Object"))) {
+ if (String::Equals(class_name, isolate()->factory()->Object_string())) {
__ Branch(is_true, ne, temp2, Operand(JS_FUNCTION_TYPE));
} else {
__ Branch(is_false, ne, temp2, Operand(JS_FUNCTION_TYPE));
=======================================
--- /branches/bleeding_edge/src/objects.cc Thu Aug 14 13:02:49 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc Mon Aug 18 07:54:19 2014 UTC
@@ -1739,7 +1739,7 @@
String* JSReceiver::class_name() {
if (IsJSFunction() || IsJSFunctionProxy()) {
- return GetHeap()->function_class_string();
+ return GetHeap()->Function_string();
}
if (map()->constructor()->IsJSFunction()) {
JSFunction* constructor = JSFunction::cast(map()->constructor());
=======================================
--- /branches/bleeding_edge/src/runtime.cc Wed Aug 13 14:09:50 2014 UTC
+++ /branches/bleeding_edge/src/runtime.cc Mon Aug 18 07:54:19 2014 UTC
@@ -14463,7 +14463,7 @@
if (status >= UBRK_WORD_NONE && status < UBRK_WORD_NONE_LIMIT) {
return *isolate->factory()->NewStringFromStaticAscii("none");
} else if (status >= UBRK_WORD_NUMBER && status <
UBRK_WORD_NUMBER_LIMIT) {
- return *isolate->factory()->NewStringFromStaticAscii("number");
+ return *isolate->factory()->number_string();
} else if (status >= UBRK_WORD_LETTER && status <
UBRK_WORD_LETTER_LIMIT) {
return *isolate->factory()->NewStringFromStaticAscii("letter");
} else if (status >= UBRK_WORD_KANA && status < UBRK_WORD_KANA_LIMIT) {
=======================================
--- /branches/bleeding_edge/src/x64/full-codegen-x64.cc Mon Aug 4 11:34:54
2014 UTC
+++ /branches/bleeding_edge/src/x64/full-codegen-x64.cc Mon Aug 18 07:54:19
2014 UTC
@@ -3231,7 +3231,7 @@
// Functions have class 'Function'.
__ bind(&function);
- __ Move(rax, isolate()->factory()->function_class_string());
+ __ Move(rax, isolate()->factory()->Function_string());
__ jmp(&done);
// Objects with a non-function constructor have class 'Object'.
=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Mon Aug 4
11:34:54 2014 UTC
+++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Mon Aug 18
07:54:19 2014 UTC
@@ -2578,7 +2578,7 @@
__ JumpIfSmi(input, is_false);
- if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Function"))) {
+ if (String::Equals(isolate()->factory()->Function_string(), class_name))
{
// Assuming the following assertions, we can use the same compares to
test
// for both being a function type and being in the object type range.
STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
@@ -2609,7 +2609,7 @@
// Objects with a non-function constructor have class 'Object'.
__ CmpObjectType(temp, JS_FUNCTION_TYPE, kScratchRegister);
- if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Object"))) {
+ if (String::Equals(class_name, isolate()->factory()->Object_string())) {
__ j(not_equal, is_true);
} else {
__ j(not_equal, is_false);
=======================================
--- /branches/bleeding_edge/src/x87/full-codegen-x87.cc Mon Aug 4 11:34:54
2014 UTC
+++ /branches/bleeding_edge/src/x87/full-codegen-x87.cc Mon Aug 18 07:54:19
2014 UTC
@@ -3241,7 +3241,7 @@
// Functions have class 'Function'.
__ bind(&function);
- __ mov(eax, isolate()->factory()->function_class_string());
+ __ mov(eax, isolate()->factory()->Function_string());
__ jmp(&done);
// Objects with a non-function constructor have class 'Object'.
=======================================
--- /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc Mon Aug 4
11:34:54 2014 UTC
+++ /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc Mon Aug 18
07:54:19 2014 UTC
@@ -2671,7 +2671,7 @@
DCHECK(!temp.is(temp2));
__ JumpIfSmi(input, is_false);
- if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Function"))) {
+ if (String::Equals(isolate()->factory()->Function_string(), class_name))
{
// Assuming the following assertions, we can use the same compares to
test
// for both being a function type and being in the object type range.
STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
@@ -2701,7 +2701,7 @@
__ mov(temp, FieldOperand(temp, Map::kConstructorOffset));
// Objects with a non-function constructor have class 'Object'.
__ CmpObjectType(temp, JS_FUNCTION_TYPE, temp2);
- if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Object"))) {
+ if (String::Equals(class_name, isolate()->factory()->Object_string())) {
__ j(not_equal, is_true);
} else {
__ j(not_equal, is_false);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.