Add lithium support for %_GetCachedArrayIndex for IA32 and X64
BUG=v8:1093 Review URL: http://codereview.chromium.org/6611014 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7037 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
1c210fc221
commit
98d82ea9de
@ -1519,7 +1519,7 @@ LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) {
|
||||
LInstruction* LChunkBuilder::DoGetCachedArrayIndex(
|
||||
HGetCachedArrayIndex* instr) {
|
||||
ASSERT(instr->value()->representation().IsTagged());
|
||||
LOperand* value = UseRegister(instr->value());
|
||||
LOperand* value = UseRegisterAtStart(instr->value());
|
||||
|
||||
return DefineAsRegister(new LGetCachedArrayIndex(value));
|
||||
}
|
||||
|
@ -728,17 +728,6 @@ class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> {
|
||||
};
|
||||
|
||||
|
||||
class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
|
||||
public:
|
||||
explicit LHasCachedArrayIndex(LOperand* value) {
|
||||
inputs_[0] = value;
|
||||
}
|
||||
|
||||
DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index")
|
||||
DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex)
|
||||
};
|
||||
|
||||
|
||||
class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
|
||||
public:
|
||||
explicit LGetCachedArrayIndex(LOperand* value) {
|
||||
@ -750,6 +739,17 @@ class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
|
||||
};
|
||||
|
||||
|
||||
class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
|
||||
public:
|
||||
explicit LHasCachedArrayIndex(LOperand* value) {
|
||||
inputs_[0] = value;
|
||||
}
|
||||
|
||||
DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index")
|
||||
DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex)
|
||||
};
|
||||
|
||||
|
||||
class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> {
|
||||
public:
|
||||
explicit LHasCachedArrayIndexAndBranch(LOperand* value) {
|
||||
|
@ -1711,10 +1711,13 @@ void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
|
||||
void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
|
||||
Register input = ToRegister(instr->InputAt(0));
|
||||
Register result = ToRegister(instr->result());
|
||||
Register scratch = scratch0();
|
||||
|
||||
__ ldr(scratch, FieldMemOperand(input, String::kHashFieldOffset));
|
||||
__ IndexFromHash(scratch, result);
|
||||
if (FLAG_debug_code) {
|
||||
__ AbortIfNotString(input);
|
||||
}
|
||||
|
||||
__ ldr(result, FieldMemOperand(input, String::kHashFieldOffset));
|
||||
__ IndexFromHash(result, result);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1654,6 +1654,19 @@ void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
|
||||
}
|
||||
|
||||
|
||||
void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
|
||||
Register input = ToRegister(instr->InputAt(0));
|
||||
Register result = ToRegister(instr->result());
|
||||
|
||||
if (FLAG_debug_code) {
|
||||
__ AbortIfNotString(input);
|
||||
}
|
||||
|
||||
__ mov(result, FieldOperand(input, String::kHashFieldOffset));
|
||||
__ IndexFromHash(result, result);
|
||||
}
|
||||
|
||||
|
||||
void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) {
|
||||
Register input = ToRegister(instr->InputAt(0));
|
||||
Register result = ToRegister(instr->result());
|
||||
@ -1663,7 +1676,7 @@ void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) {
|
||||
__ test(FieldOperand(input, String::kHashFieldOffset),
|
||||
Immediate(String::kContainsCachedArrayIndexMask));
|
||||
NearLabel done;
|
||||
__ j(not_zero, &done);
|
||||
__ j(zero, &done);
|
||||
__ mov(result, Factory::false_value());
|
||||
__ bind(&done);
|
||||
}
|
||||
@ -1678,7 +1691,7 @@ void LCodeGen::DoHasCachedArrayIndexAndBranch(
|
||||
|
||||
__ test(FieldOperand(input, String::kHashFieldOffset),
|
||||
Immediate(String::kContainsCachedArrayIndexMask));
|
||||
EmitBranch(true_block, false_block, not_equal);
|
||||
EmitBranch(true_block, false_block, equal);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1541,8 +1541,10 @@ LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) {
|
||||
|
||||
LInstruction* LChunkBuilder::DoGetCachedArrayIndex(
|
||||
HGetCachedArrayIndex* instr) {
|
||||
Abort("Unimplemented: %s", "DoGetCachedArrayIndex");
|
||||
return NULL;
|
||||
ASSERT(instr->value()->representation().IsTagged());
|
||||
LOperand* value = UseRegisterAtStart(instr->value());
|
||||
|
||||
return DefineAsRegister(new LGetCachedArrayIndex(value));
|
||||
}
|
||||
|
||||
|
||||
|
@ -92,6 +92,7 @@ class LCodeGen;
|
||||
V(FixedArrayLength) \
|
||||
V(FunctionLiteral) \
|
||||
V(Gap) \
|
||||
V(GetCachedArrayIndex) \
|
||||
V(GlobalObject) \
|
||||
V(GlobalReceiver) \
|
||||
V(Goto) \
|
||||
@ -743,6 +744,17 @@ class LHasInstanceTypeAndBranch: public LControlInstruction<1, 1> {
|
||||
};
|
||||
|
||||
|
||||
class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
|
||||
public:
|
||||
explicit LGetCachedArrayIndex(LOperand* value) {
|
||||
inputs_[0] = value;
|
||||
}
|
||||
|
||||
DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
|
||||
DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
|
||||
};
|
||||
|
||||
|
||||
class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
|
||||
public:
|
||||
explicit LHasCachedArrayIndex(LOperand* value) {
|
||||
|
@ -1637,6 +1637,20 @@ void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
|
||||
}
|
||||
|
||||
|
||||
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 @@ void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) {
|
||||
__ 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 @@ void LCodeGen::DoHasCachedArrayIndexAndBranch(
|
||||
|
||||
__ testl(FieldOperand(input, String::kHashFieldOffset),
|
||||
Immediate(String::kContainsCachedArrayIndexMask));
|
||||
EmitBranch(true_block, false_block, not_equal);
|
||||
EmitBranch(true_block, false_block, equal);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1522,8 +1522,10 @@ LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) {
|
||||
|
||||
LInstruction* LChunkBuilder::DoGetCachedArrayIndex(
|
||||
HGetCachedArrayIndex* instr) {
|
||||
Abort("Unimplemented: %s", "DoGetCachedArrayIndex");
|
||||
return NULL;
|
||||
ASSERT(instr->value()->representation().IsTagged());
|
||||
LOperand* value = UseRegisterAtStart(instr->value());
|
||||
|
||||
return DefineAsRegister(new LGetCachedArrayIndex(value));
|
||||
}
|
||||
|
||||
|
||||
|
@ -89,6 +89,7 @@ class LCodeGen;
|
||||
V(DoubleToI) \
|
||||
V(FunctionLiteral) \
|
||||
V(Gap) \
|
||||
V(GetCachedArrayIndex) \
|
||||
V(GlobalObject) \
|
||||
V(GlobalReceiver) \
|
||||
V(Goto) \
|
||||
@ -730,6 +731,17 @@ class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> {
|
||||
};
|
||||
|
||||
|
||||
class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
|
||||
public:
|
||||
explicit LGetCachedArrayIndex(LOperand* value) {
|
||||
inputs_[0] = value;
|
||||
}
|
||||
|
||||
DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
|
||||
DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
|
||||
};
|
||||
|
||||
|
||||
class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
|
||||
public:
|
||||
explicit LHasCachedArrayIndex(LOperand* value) {
|
||||
|
Loading…
Reference in New Issue
Block a user