Commit c9e86f4b authored by verwaest@chromium.org's avatar verwaest@chromium.org

Remove scratch register requirement from LoadInstanceDescriptors on arm and mips.

Review URL: https://chromiumcodereview.appspot.com/11193022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12776 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8148f972
......@@ -1140,7 +1140,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ cmp(r1, Operand(Smi::FromInt(0)));
__ b(eq, &no_descriptors);
__ LoadInstanceDescriptors(r0, r2, r4);
__ LoadInstanceDescriptors(r0, r2);
__ ldr(r2, FieldMemOperand(r2, DescriptorArray::kEnumCacheOffset));
__ ldr(r2, FieldMemOperand(r2, DescriptorArray::kEnumCacheBridgeCacheOffset));
......@@ -2688,7 +2688,7 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf(
__ cmp(r3, Operand(0));
__ b(eq, &done);
__ LoadInstanceDescriptors(r1, r4, r2);
__ LoadInstanceDescriptors(r1, r4);
// r4: descriptor array.
// r3: valid entries in the descriptor array.
STATIC_ASSERT(kSmiTag == 0);
......
......@@ -2294,9 +2294,7 @@ LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) {
LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) {
LOperand* map = UseRegister(instr->map());
LOperand* scratch = TempRegister();
return AssignEnvironment(DefineAsRegister(
new(zone()) LForInCacheArray(map, scratch)));
return AssignEnvironment(DefineAsRegister(new(zone()) LForInCacheArray(map)));
}
......
......@@ -2398,15 +2398,13 @@ class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> {
};
class LForInCacheArray: public LTemplateInstruction<1, 1, 1> {
class LForInCacheArray: public LTemplateInstruction<1, 1, 0> {
public:
explicit LForInCacheArray(LOperand* map, LOperand* scratch) {
explicit LForInCacheArray(LOperand* map) {
inputs_[0] = map;
temps_[0] = scratch;
}
LOperand* map() { return inputs_[0]; }
LOperand* scratch() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
......
......@@ -5628,7 +5628,6 @@ void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
Register map = ToRegister(instr->map());
Register result = ToRegister(instr->result());
Register scratch = ToRegister(instr->scratch());
Label load_cache, done;
__ EnumLength(result, map);
__ cmp(result, Operand(Smi::FromInt(0)));
......@@ -5637,7 +5636,7 @@ void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
__ jmp(&done);
__ bind(&load_cache);
__ LoadInstanceDescriptors(map, result, scratch);
__ LoadInstanceDescriptors(map, result);
__ ldr(result,
FieldMemOperand(result, DescriptorArray::kEnumCacheOffset));
__ ldr(result,
......
......@@ -3752,8 +3752,7 @@ void MacroAssembler::ClampDoubleToUint8(Register result_reg,
void MacroAssembler::LoadInstanceDescriptors(Register map,
Register descriptors,
Register scratch) {
Register descriptors) {
ldr(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset));
}
......
......@@ -1289,9 +1289,7 @@ class MacroAssembler: public Assembler {
DoubleRegister temp_double_reg);
void LoadInstanceDescriptors(Register map,
Register descriptors,
Register scratch);
void LoadInstanceDescriptors(Register map, Register descriptors);
void EnumLength(Register dst, Register map);
void NumberOfOwnDescriptors(Register dst, Register map);
......
......@@ -1152,7 +1152,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ EnumLength(a1, v0);
__ Branch(&no_descriptors, eq, a1, Operand(Smi::FromInt(0)));
__ LoadInstanceDescriptors(v0, a2, t0);
__ LoadInstanceDescriptors(v0, a2);
__ lw(a2, FieldMemOperand(a2, DescriptorArray::kEnumCacheOffset));
__ lw(a2, FieldMemOperand(a2, DescriptorArray::kEnumCacheBridgeCacheOffset));
......@@ -2712,7 +2712,7 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf(
__ NumberOfOwnDescriptors(a3, a1);
__ Branch(&done, eq, a3, Operand(zero_reg));
__ LoadInstanceDescriptors(a1, t0, a2);
__ LoadInstanceDescriptors(a1, t0);
// t0: descriptor array.
// a3: valid entries in the descriptor array.
STATIC_ASSERT(kSmiTag == 0);
......
......@@ -5391,7 +5391,6 @@ void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
Register map = ToRegister(instr->map());
Register result = ToRegister(instr->result());
Register scratch = ToRegister(instr->scratch());
Label load_cache, done;
__ EnumLength(result, map);
__ Branch(&load_cache, ne, result, Operand(Smi::FromInt(0)));
......@@ -5399,7 +5398,7 @@ void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
__ jmp(&done);
__ bind(&load_cache);
__ LoadInstanceDescriptors(map, result, scratch);
__ LoadInstanceDescriptors(map, result);
__ lw(result,
FieldMemOperand(result, DescriptorArray::kEnumCacheOffset));
__ lw(result,
......
......@@ -2234,9 +2234,7 @@ LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) {
LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) {
LOperand* map = UseRegister(instr->map());
LOperand* scratch = TempRegister();
return AssignEnvironment(DefineAsRegister(
new(zone()) LForInCacheArray(map, scratch)));
return AssignEnvironment(DefineAsRegister(new(zone()) LForInCacheArray(map)));
}
......
......@@ -2379,15 +2379,13 @@ class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> {
};
class LForInCacheArray: public LTemplateInstruction<1, 1, 1> {
class LForInCacheArray: public LTemplateInstruction<1, 1, 0> {
public:
explicit LForInCacheArray(LOperand* map, LOperand* scratch) {
explicit LForInCacheArray(LOperand* map) {
inputs_[0] = map;
temps_[0] = scratch;
}
LOperand* map() { return inputs_[0]; }
LOperand* scratch() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
......
......@@ -5302,8 +5302,7 @@ void MacroAssembler::EnsureNotWhite(
void MacroAssembler::LoadInstanceDescriptors(Register map,
Register descriptors,
Register scratch) {
Register descriptors) {
lw(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset));
}
......
......@@ -1398,9 +1398,7 @@ class MacroAssembler: public Assembler {
DoubleRegister temp_double_reg);
void LoadInstanceDescriptors(Register map,
Register descriptors,
Register scratch);
void LoadInstanceDescriptors(Register map, Register descriptors);
void EnumLength(Register dst, Register map);
void NumberOfOwnDescriptors(Register dst, Register map);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment