Reviewers: marja,
Description:
Purge unused internalized string accessors.
R=ma...@chromium.org
Please review this at https://codereview.chromium.org/471923002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+37, -58 lines):
M include/v8.h
M src/api.cc
M src/arm/full-codegen-arm.cc
M src/arm/lithium-codegen-arm.cc
M src/arm64/full-codegen-arm64.cc
M src/arm64/lithium-codegen-arm64.cc
M src/bootstrapper.cc
M src/heap/heap.h
M src/hydrogen.cc
M src/hydrogen-instructions.cc
M src/ia32/full-codegen-ia32.cc
M src/ia32/lithium-codegen-ia32.cc
M src/mips/full-codegen-mips.cc
M src/mips/lithium-codegen-mips.cc
M src/mips64/full-codegen-mips64.cc
M src/mips64/lithium-codegen-mips64.cc
M src/objects.cc
M src/runtime.cc
M src/x64/full-codegen-x64.cc
M src/x64/lithium-codegen-x64.cc
M src/x87/full-codegen-x87.cc
M src/x87/lithium-codegen-x87.cc
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index
ef0bda63f43d82e36eed2269462be9990111dbe9..86685d3748771e7f3ed25d3eee812d99d5d54d19
100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5611,7 +5611,7 @@ class Internals {
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.
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index
4a6345910f978176c56c6476f232dd0e58e496c8..64672bd9ce276820dcd77218bd5017891f35e2ce
100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3296,7 +3296,8 @@ Local<String> v8::Object::ObjectProtoToString() {
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 ";
Index: src/arm/full-codegen-arm.cc
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
index
09459e4e35bece6c6870c904683d5f2683d9ebe6..bc4b2e3951660164e3463146bfabd0d3be2e36aa
100644
--- a/src/arm/full-codegen-arm.cc
+++ b/src/arm/full-codegen-arm.cc
@@ -3318,7 +3318,7 @@ void FullCodeGenerator::EmitClassOf(CallRuntime*
expr) {
// 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'.
Index: src/arm/lithium-codegen-arm.cc
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
index
ff09e287f76cfff73a251e2e92e3f63e2a1e7aa7..d096087b4283f16bf93adba20324692376ca549c
100644
--- a/src/arm/lithium-codegen-arm.cc
+++ b/src/arm/lithium-codegen-arm.cc
@@ -2689,7 +2689,7 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
__ 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);
Index: src/arm64/full-codegen-arm64.cc
diff --git a/src/arm64/full-codegen-arm64.cc
b/src/arm64/full-codegen-arm64.cc
index
2e63814bd394c7820be34199ec5b909ac9cf89d1..24b10492e1d1eb249b7fe823bd06da3ff82f1516
100644
--- a/src/arm64/full-codegen-arm64.cc
+++ b/src/arm64/full-codegen-arm64.cc
@@ -3015,7 +3015,7 @@ void FullCodeGenerator::EmitClassOf(CallRuntime*
expr) {
// 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'.
Index: src/arm64/lithium-codegen-arm64.cc
diff --git a/src/arm64/lithium-codegen-arm64.cc
b/src/arm64/lithium-codegen-arm64.cc
index
53a1cfac42a692dced70c11e55a0e5ba18452b26..be1603cbbeb9e9b0587f53ad76d80ae55c4fb550
100644
--- a/src/arm64/lithium-codegen-arm64.cc
+++ b/src/arm64/lithium-codegen-arm64.cc
@@ -2358,7 +2358,7 @@ void
LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) {
__ 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 @@ void
LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) {
__ 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 {
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index
240be719187df946dd347f6583c8f3e3868a4d2a..3e64343b4e89873a6f4527c531e5b18a607de668
100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -821,8 +821,7 @@ Handle<JSGlobalProxy> Genesis::CreateNewGlobals(
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 @@ void Genesis::HookUpGlobalObject(Handle<GlobalObject>
global_object) {
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 @@ void Genesis::InitializeGlobal(Handle<GlobalObject>
global_object,
// 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 @@ bool Genesis::InstallNatives() {
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());
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index
b10a47665cf96ae35dc6f8bc3d3d67f7dd7ea352..d9d9d1a1945dac466b3f220fe37c4bdeba08a06b
100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -256,13 +256,10 @@ namespace internal {
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 @@ namespace internal {
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 @@ namespace internal {
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 @@ namespace internal {
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 @@ namespace internal {
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")
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index
b75bec0f5ec58ad1c3543b67615b2695a2b11eec..896efcf65f68c1d75ec5a19c9c6823d1541daf69
100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -4675,9 +4675,8 @@ HObjectAccess HObjectAccess::ForField(Handle<Map> map,
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());
}
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index
3ddd7cce83d1fb7464cf2c476324731ae0dff23f..957f2476de093e56f4d4f62326806647be3a66bb
100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -7201,7 +7201,9 @@ bool
HOptimizedGraphBuilder::TryArgumentsAccess(Property* expr) {
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);
Index: src/ia32/full-codegen-ia32.cc
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
index
aacaeeb6a6becee2adfab0f392d048d05fc9cb3f..04fb4830c7ee8297e4cfa226d51327e29bb4eb62
100644
--- a/src/ia32/full-codegen-ia32.cc
+++ b/src/ia32/full-codegen-ia32.cc
@@ -3247,7 +3247,7 @@ void FullCodeGenerator::EmitClassOf(CallRuntime*
expr) {
// 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'.
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc
b/src/ia32/lithium-codegen-ia32.cc
index
245dcdc482acc08992b5433f9c78f0d3cd667e3d..d216581ba79c42cd56d422bc195ed81efe9d0870
100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -2536,7 +2536,7 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
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 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
__ 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);
Index: src/mips/full-codegen-mips.cc
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc
index
31eaad46826c5ea986c012bfd425da651f064f23..1327bf6c2d8aa638cc8b0c5da85d969b3832d94d
100644
--- a/src/mips/full-codegen-mips.cc
+++ b/src/mips/full-codegen-mips.cc
@@ -3315,7 +3315,7 @@ void FullCodeGenerator::EmitClassOf(CallRuntime*
expr) {
// 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'.
Index: src/mips/lithium-codegen-mips.cc
diff --git a/src/mips/lithium-codegen-mips.cc
b/src/mips/lithium-codegen-mips.cc
index
f599c2d65749b632a188c220c5cc4f4015d8bb1d..193db1e9b76d6cd75ef2151edd2bdd776ecbe96c
100644
--- a/src/mips/lithium-codegen-mips.cc
+++ b/src/mips/lithium-codegen-mips.cc
@@ -2598,7 +2598,7 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
__ 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 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
// 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));
Index: src/mips64/full-codegen-mips64.cc
diff --git a/src/mips64/full-codegen-mips64.cc
b/src/mips64/full-codegen-mips64.cc
index
c69ceccec7aa2aee2b542d4e0fb3df0335c552ca..b874625b4e329bf268fdbb00646c5da9b8119581
100644
--- a/src/mips64/full-codegen-mips64.cc
+++ b/src/mips64/full-codegen-mips64.cc
@@ -3314,7 +3314,7 @@ void FullCodeGenerator::EmitClassOf(CallRuntime*
expr) {
// 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'.
Index: src/mips64/lithium-codegen-mips64.cc
diff --git a/src/mips64/lithium-codegen-mips64.cc
b/src/mips64/lithium-codegen-mips64.cc
index
4d8d6afdf8e57bd2e13e27b782f6890a2e8b1387..ab0d8c7c78fa4aa07e32b4add3eced73b381860e
100644
--- a/src/mips64/lithium-codegen-mips64.cc
+++ b/src/mips64/lithium-codegen-mips64.cc
@@ -2577,7 +2577,7 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
__ 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 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
// 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));
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index
29af1d83373193db4face20c934c39f939a276be..6da50a44e87079dc3c9d2b739b01e94cfc5a9056
100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1739,7 +1739,7 @@ void HeapNumber::HeapNumberPrint(OStream& os) { //
NOLINT
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());
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index
50a4cc9598cdd60d22d6a7c7dc7d0b7564e0aa69..0b8c61f3ccb5037689af28323b1106025ebaa660
100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -14472,7 +14472,7 @@ RUNTIME_FUNCTION(Runtime_BreakIteratorBreakType) {
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) {
Index: src/x64/full-codegen-x64.cc
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
index
38b594c2bc23918ad887bc255b0ef8123bb69822..69807096cd741e86df8e6573a753803f3684161e
100644
--- a/src/x64/full-codegen-x64.cc
+++ b/src/x64/full-codegen-x64.cc
@@ -3231,7 +3231,7 @@ void FullCodeGenerator::EmitClassOf(CallRuntime*
expr) {
// 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'.
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index
4457c2029734ccb3876b58052bbd0ae718d838fc..34674a64096514f8327bf8e6c3258f8969845b78
100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -2578,7 +2578,7 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
__ 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 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
// 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);
Index: src/x87/full-codegen-x87.cc
diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc
index
2e8b8651ffd284476412d2e236e1ce94a3d42476..c360353146ea277ae0118c756d18cfe97d446377
100644
--- a/src/x87/full-codegen-x87.cc
+++ b/src/x87/full-codegen-x87.cc
@@ -3241,7 +3241,7 @@ void FullCodeGenerator::EmitClassOf(CallRuntime*
expr) {
// 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'.
Index: src/x87/lithium-codegen-x87.cc
diff --git a/src/x87/lithium-codegen-x87.cc b/src/x87/lithium-codegen-x87.cc
index
8ba73c62367520db89d3d7edb0b57717acec08b1..4116b4656a5e6851f3bc84db4c411982ecc729ac
100644
--- a/src/x87/lithium-codegen-x87.cc
+++ b/src/x87/lithium-codegen-x87.cc
@@ -2671,7 +2671,7 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
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 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
__ 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
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.