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) { ...@@ -1140,7 +1140,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ cmp(r1, Operand(Smi::FromInt(0))); __ cmp(r1, Operand(Smi::FromInt(0)));
__ b(eq, &no_descriptors); __ b(eq, &no_descriptors);
__ LoadInstanceDescriptors(r0, r2, r4); __ LoadInstanceDescriptors(r0, r2);
__ ldr(r2, FieldMemOperand(r2, DescriptorArray::kEnumCacheOffset)); __ ldr(r2, FieldMemOperand(r2, DescriptorArray::kEnumCacheOffset));
__ ldr(r2, FieldMemOperand(r2, DescriptorArray::kEnumCacheBridgeCacheOffset)); __ ldr(r2, FieldMemOperand(r2, DescriptorArray::kEnumCacheBridgeCacheOffset));
...@@ -2688,7 +2688,7 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( ...@@ -2688,7 +2688,7 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf(
__ cmp(r3, Operand(0)); __ cmp(r3, Operand(0));
__ b(eq, &done); __ b(eq, &done);
__ LoadInstanceDescriptors(r1, r4, r2); __ LoadInstanceDescriptors(r1, r4);
// r4: descriptor array. // r4: descriptor array.
// r3: valid entries in the descriptor array. // r3: valid entries in the descriptor array.
STATIC_ASSERT(kSmiTag == 0); STATIC_ASSERT(kSmiTag == 0);
......
...@@ -2294,9 +2294,7 @@ LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) { ...@@ -2294,9 +2294,7 @@ LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) {
LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) { LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) {
LOperand* map = UseRegister(instr->map()); LOperand* map = UseRegister(instr->map());
LOperand* scratch = TempRegister(); return AssignEnvironment(DefineAsRegister(new(zone()) LForInCacheArray(map)));
return AssignEnvironment(DefineAsRegister(
new(zone()) LForInCacheArray(map, scratch)));
} }
......
...@@ -2398,15 +2398,13 @@ class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> { ...@@ -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: public:
explicit LForInCacheArray(LOperand* map, LOperand* scratch) { explicit LForInCacheArray(LOperand* map) {
inputs_[0] = map; inputs_[0] = map;
temps_[0] = scratch;
} }
LOperand* map() { return inputs_[0]; } LOperand* map() { return inputs_[0]; }
LOperand* scratch() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array") DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
......
...@@ -5628,7 +5628,6 @@ void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { ...@@ -5628,7 +5628,6 @@ void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
Register map = ToRegister(instr->map()); Register map = ToRegister(instr->map());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register scratch = ToRegister(instr->scratch());
Label load_cache, done; Label load_cache, done;
__ EnumLength(result, map); __ EnumLength(result, map);
__ cmp(result, Operand(Smi::FromInt(0))); __ cmp(result, Operand(Smi::FromInt(0)));
...@@ -5637,7 +5636,7 @@ void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { ...@@ -5637,7 +5636,7 @@ void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
__ jmp(&done); __ jmp(&done);
__ bind(&load_cache); __ bind(&load_cache);
__ LoadInstanceDescriptors(map, result, scratch); __ LoadInstanceDescriptors(map, result);
__ ldr(result, __ ldr(result,
FieldMemOperand(result, DescriptorArray::kEnumCacheOffset)); FieldMemOperand(result, DescriptorArray::kEnumCacheOffset));
__ ldr(result, __ ldr(result,
......
...@@ -3752,8 +3752,7 @@ void MacroAssembler::ClampDoubleToUint8(Register result_reg, ...@@ -3752,8 +3752,7 @@ void MacroAssembler::ClampDoubleToUint8(Register result_reg,
void MacroAssembler::LoadInstanceDescriptors(Register map, void MacroAssembler::LoadInstanceDescriptors(Register map,
Register descriptors, Register descriptors) {
Register scratch) {
ldr(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset)); ldr(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset));
} }
......
...@@ -1289,9 +1289,7 @@ class MacroAssembler: public Assembler { ...@@ -1289,9 +1289,7 @@ class MacroAssembler: public Assembler {
DoubleRegister temp_double_reg); DoubleRegister temp_double_reg);
void LoadInstanceDescriptors(Register map, void LoadInstanceDescriptors(Register map, Register descriptors);
Register descriptors,
Register scratch);
void EnumLength(Register dst, Register map); void EnumLength(Register dst, Register map);
void NumberOfOwnDescriptors(Register dst, Register map); void NumberOfOwnDescriptors(Register dst, Register map);
......
...@@ -1152,7 +1152,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { ...@@ -1152,7 +1152,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ EnumLength(a1, v0); __ EnumLength(a1, v0);
__ Branch(&no_descriptors, eq, a1, Operand(Smi::FromInt(0))); __ 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::kEnumCacheOffset));
__ lw(a2, FieldMemOperand(a2, DescriptorArray::kEnumCacheBridgeCacheOffset)); __ lw(a2, FieldMemOperand(a2, DescriptorArray::kEnumCacheBridgeCacheOffset));
...@@ -2712,7 +2712,7 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( ...@@ -2712,7 +2712,7 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf(
__ NumberOfOwnDescriptors(a3, a1); __ NumberOfOwnDescriptors(a3, a1);
__ Branch(&done, eq, a3, Operand(zero_reg)); __ Branch(&done, eq, a3, Operand(zero_reg));
__ LoadInstanceDescriptors(a1, t0, a2); __ LoadInstanceDescriptors(a1, t0);
// t0: descriptor array. // t0: descriptor array.
// a3: valid entries in the descriptor array. // a3: valid entries in the descriptor array.
STATIC_ASSERT(kSmiTag == 0); STATIC_ASSERT(kSmiTag == 0);
......
...@@ -5391,7 +5391,6 @@ void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { ...@@ -5391,7 +5391,6 @@ void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
Register map = ToRegister(instr->map()); Register map = ToRegister(instr->map());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register scratch = ToRegister(instr->scratch());
Label load_cache, done; Label load_cache, done;
__ EnumLength(result, map); __ EnumLength(result, map);
__ Branch(&load_cache, ne, result, Operand(Smi::FromInt(0))); __ Branch(&load_cache, ne, result, Operand(Smi::FromInt(0)));
...@@ -5399,7 +5398,7 @@ void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { ...@@ -5399,7 +5398,7 @@ void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
__ jmp(&done); __ jmp(&done);
__ bind(&load_cache); __ bind(&load_cache);
__ LoadInstanceDescriptors(map, result, scratch); __ LoadInstanceDescriptors(map, result);
__ lw(result, __ lw(result,
FieldMemOperand(result, DescriptorArray::kEnumCacheOffset)); FieldMemOperand(result, DescriptorArray::kEnumCacheOffset));
__ lw(result, __ lw(result,
......
...@@ -2234,9 +2234,7 @@ LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) { ...@@ -2234,9 +2234,7 @@ LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) {
LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) { LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) {
LOperand* map = UseRegister(instr->map()); LOperand* map = UseRegister(instr->map());
LOperand* scratch = TempRegister(); return AssignEnvironment(DefineAsRegister(new(zone()) LForInCacheArray(map)));
return AssignEnvironment(DefineAsRegister(
new(zone()) LForInCacheArray(map, scratch)));
} }
......
...@@ -2379,15 +2379,13 @@ class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> { ...@@ -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: public:
explicit LForInCacheArray(LOperand* map, LOperand* scratch) { explicit LForInCacheArray(LOperand* map) {
inputs_[0] = map; inputs_[0] = map;
temps_[0] = scratch;
} }
LOperand* map() { return inputs_[0]; } LOperand* map() { return inputs_[0]; }
LOperand* scratch() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array") DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
......
...@@ -5302,8 +5302,7 @@ void MacroAssembler::EnsureNotWhite( ...@@ -5302,8 +5302,7 @@ void MacroAssembler::EnsureNotWhite(
void MacroAssembler::LoadInstanceDescriptors(Register map, void MacroAssembler::LoadInstanceDescriptors(Register map,
Register descriptors, Register descriptors) {
Register scratch) {
lw(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset)); lw(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset));
} }
......
...@@ -1398,9 +1398,7 @@ class MacroAssembler: public Assembler { ...@@ -1398,9 +1398,7 @@ class MacroAssembler: public Assembler {
DoubleRegister temp_double_reg); DoubleRegister temp_double_reg);
void LoadInstanceDescriptors(Register map, void LoadInstanceDescriptors(Register map, Register descriptors);
Register descriptors,
Register scratch);
void EnumLength(Register dst, Register map); void EnumLength(Register dst, Register map);
void NumberOfOwnDescriptors(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