| Index: src/x64/lithium-codegen-x64.cc
|
| diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
|
| index a28d6c6f4086c6b6eef3f1b2fc9c34e9bfc7a0f8..16db0f728e9f5d086c26e237424a7c6b110410db 100644
|
| --- a/src/x64/lithium-codegen-x64.cc
|
| +++ b/src/x64/lithium-codegen-x64.cc
|
| @@ -5336,14 +5336,15 @@ Condition LCodeGen::EmitTypeofIs(LTypeofIsAndBranch* instr, Register input) {
|
| Label::Distance false_distance = right_block == next_block ? Label::kNear
|
| : Label::kFar;
|
| Condition final_branch_condition = no_condition;
|
| - if (type_name->Equals(heap()->number_string())) {
|
| + Factory* factory = isolate()->factory();
|
| + if (String::Equals(type_name, factory->number_string())) {
|
| __ JumpIfSmi(input, true_label, true_distance);
|
| __ CompareRoot(FieldOperand(input, HeapObject::kMapOffset),
|
| Heap::kHeapNumberMapRootIndex);
|
|
|
| final_branch_condition = equal;
|
|
|
| - } else if (type_name->Equals(heap()->string_string())) {
|
| + } else if (String::Equals(type_name, factory->string_string())) {
|
| __ JumpIfSmi(input, false_label, false_distance);
|
| __ CmpObjectType(input, FIRST_NONSTRING_TYPE, input);
|
| __ j(above_equal, false_label, false_distance);
|
| @@ -5351,22 +5352,23 @@ Condition LCodeGen::EmitTypeofIs(LTypeofIsAndBranch* instr, Register input) {
|
| Immediate(1 << Map::kIsUndetectable));
|
| final_branch_condition = zero;
|
|
|
| - } else if (type_name->Equals(heap()->symbol_string())) {
|
| + } else if (String::Equals(type_name, factory->symbol_string())) {
|
| __ JumpIfSmi(input, false_label, false_distance);
|
| __ CmpObjectType(input, SYMBOL_TYPE, input);
|
| final_branch_condition = equal;
|
|
|
| - } else if (type_name->Equals(heap()->boolean_string())) {
|
| + } else if (String::Equals(type_name, factory->boolean_string())) {
|
| __ CompareRoot(input, Heap::kTrueValueRootIndex);
|
| __ j(equal, true_label, true_distance);
|
| __ CompareRoot(input, Heap::kFalseValueRootIndex);
|
| final_branch_condition = equal;
|
|
|
| - } else if (FLAG_harmony_typeof && type_name->Equals(heap()->null_string())) {
|
| + } else if (FLAG_harmony_typeof &&
|
| + String::Equals(type_name, factory->null_string())) {
|
| __ CompareRoot(input, Heap::kNullValueRootIndex);
|
| final_branch_condition = equal;
|
|
|
| - } else if (type_name->Equals(heap()->undefined_string())) {
|
| + } else if (String::Equals(type_name, factory->undefined_string())) {
|
| __ CompareRoot(input, Heap::kUndefinedValueRootIndex);
|
| __ j(equal, true_label, true_distance);
|
| __ JumpIfSmi(input, false_label, false_distance);
|
| @@ -5376,7 +5378,7 @@ Condition LCodeGen::EmitTypeofIs(LTypeofIsAndBranch* instr, Register input) {
|
| Immediate(1 << Map::kIsUndetectable));
|
| final_branch_condition = not_zero;
|
|
|
| - } else if (type_name->Equals(heap()->function_string())) {
|
| + } else if (String::Equals(type_name, factory->function_string())) {
|
| STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
|
| __ JumpIfSmi(input, false_label, false_distance);
|
| __ CmpObjectType(input, JS_FUNCTION_TYPE, input);
|
| @@ -5384,7 +5386,7 @@ Condition LCodeGen::EmitTypeofIs(LTypeofIsAndBranch* instr, Register input) {
|
| __ CmpInstanceType(input, JS_FUNCTION_PROXY_TYPE);
|
| final_branch_condition = equal;
|
|
|
| - } else if (type_name->Equals(heap()->object_string())) {
|
| + } else if (String::Equals(type_name, factory->object_string())) {
|
| __ JumpIfSmi(input, false_label, false_distance);
|
| if (!FLAG_harmony_typeof) {
|
| __ CompareRoot(input, Heap::kNullValueRootIndex);
|
|
|