| Index: src/x64/lithium-codegen-x64.cc
|
| ===================================================================
|
| --- src/x64/lithium-codegen-x64.cc (revision 7051)
|
| +++ src/x64/lithium-codegen-x64.cc (working copy)
|
| @@ -1637,6 +1637,20 @@
|
| }
|
|
|
|
|
| +void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
|
| + Register input = ToRegister(instr->InputAt(0));
|
| + Register result = ToRegister(instr->result());
|
| +
|
| + if (FLAG_debug_code) {
|
| + __ AbortIfNotString(input);
|
| + }
|
| +
|
| + __ movl(result, FieldOperand(input, String::kHashFieldOffset));
|
| + ASSERT(String::kHashShift >= kSmiTagSize);
|
| + __ IndexFromHash(result, result);
|
| +}
|
| +
|
| +
|
| void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) {
|
| Register input = ToRegister(instr->InputAt(0));
|
| Register result = ToRegister(instr->result());
|
| @@ -1646,7 +1660,7 @@
|
| __ testl(FieldOperand(input, String::kHashFieldOffset),
|
| Immediate(String::kContainsCachedArrayIndexMask));
|
| NearLabel done;
|
| - __ j(not_zero, &done);
|
| + __ j(zero, &done);
|
| __ LoadRoot(result, Heap::kFalseValueRootIndex);
|
| __ bind(&done);
|
| }
|
| @@ -1661,7 +1675,7 @@
|
|
|
| __ testl(FieldOperand(input, String::kHashFieldOffset),
|
| Immediate(String::kContainsCachedArrayIndexMask));
|
| - EmitBranch(true_block, false_block, not_equal);
|
| + EmitBranch(true_block, false_block, equal);
|
| }
|
|
|
|
|
| @@ -3471,12 +3485,11 @@
|
|
|
| } else if (type_name->Equals(HEAP->string_symbol())) {
|
| __ JumpIfSmi(input, false_label);
|
| - __ movq(input, FieldOperand(input, HeapObject::kMapOffset));
|
| + __ CmpObjectType(input, FIRST_NONSTRING_TYPE, input);
|
| + __ j(above_equal, false_label);
|
| __ testb(FieldOperand(input, Map::kBitFieldOffset),
|
| Immediate(1 << Map::kIsUndetectable));
|
| - __ j(not_zero, false_label);
|
| - __ CmpInstanceType(input, FIRST_NONSTRING_TYPE);
|
| - final_branch_condition = below;
|
| + final_branch_condition = zero;
|
|
|
| } else if (type_name->Equals(HEAP->boolean_symbol())) {
|
| __ CompareRoot(input, Heap::kTrueValueRootIndex);
|
| @@ -3501,17 +3514,16 @@
|
|
|
| } else if (type_name->Equals(HEAP->object_symbol())) {
|
| __ JumpIfSmi(input, false_label);
|
| - __ Cmp(input, FACTORY->null_value());
|
| + __ CompareRoot(input, Heap::kNullValueRootIndex);
|
| __ j(equal, true_label);
|
| + __ CmpObjectType(input, FIRST_JS_OBJECT_TYPE, input);
|
| + __ j(below, false_label);
|
| + __ CmpInstanceType(input, FIRST_FUNCTION_CLASS_TYPE);
|
| + __ j(above_equal, false_label);
|
| // Check for undetectable objects => false.
|
| __ testb(FieldOperand(input, Map::kBitFieldOffset),
|
| Immediate(1 << Map::kIsUndetectable));
|
| - __ j(not_zero, false_label);
|
| - // Check for JS objects that are not RegExp or Function => true.
|
| - __ CmpInstanceType(input, FIRST_JS_OBJECT_TYPE);
|
| - __ j(below, false_label);
|
| - __ CmpInstanceType(input, FIRST_FUNCTION_CLASS_TYPE);
|
| - final_branch_condition = below_equal;
|
| + final_branch_condition = zero;
|
|
|
| } else {
|
| final_branch_condition = never;
|
|
|