Reviewers: danno,

Message:
PTAL.
Left-over cleanup related to moving descriptors into the map.

Description:
Remove scratch register requirement from LoadInstanceDescriptors on arm and
mips.


Please review this at https://chromiumcodereview.appspot.com/11193022/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/arm/full-codegen-arm.cc
  M src/arm/lithium-arm.h
  M src/arm/lithium-arm.cc
  M src/arm/lithium-codegen-arm.cc
  M src/arm/macro-assembler-arm.h
  M src/arm/macro-assembler-arm.cc
  M src/mips/full-codegen-mips.cc
  M src/mips/lithium-codegen-mips.cc
  M src/mips/lithium-mips.h
  M src/mips/lithium-mips.cc
  M src/mips/macro-assembler-mips.h
  M src/mips/macro-assembler-mips.cc


Index: src/arm/full-codegen-arm.cc
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
index 1209372ef17f53e03de7efc944804d6e4614c841..89f3b034cead49b9e784714e1032af62a8013591 100644
--- a/src/arm/full-codegen-arm.cc
+++ b/src/arm/full-codegen-arm.cc
@@ -1137,7 +1137,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));

@@ -2683,7 +2683,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);
Index: src/arm/lithium-arm.cc
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc
index d513083c0f61d33180f9145fa18f5e9302eeede1..21c549f175fbbe83c5b1b7e81d2ddba2146f9a11 100644
--- a/src/arm/lithium-arm.cc
+++ b/src/arm/lithium-arm.cc
@@ -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)));
 }


Index: src/arm/lithium-arm.h
diff --git a/src/arm/lithium-arm.h b/src/arm/lithium-arm.h
index 5e1c9918e9099e821381707fbaf2c5891b2e5096..fb36fe9c0d9dc9191b49b8f23d792a5250bcf01d 100644
--- a/src/arm/lithium-arm.h
+++ b/src/arm/lithium-arm.h
@@ -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")

Index: src/arm/lithium-codegen-arm.cc
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
index d5b67a7a1ba65078c8eec836adc8967404dd6f05..46fa908b7da2b93e1874c47ce62346e81ad1b5a5 100644
--- a/src/arm/lithium-codegen-arm.cc
+++ b/src/arm/lithium-codegen-arm.cc
@@ -5621,7 +5621,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)));
@@ -5630,7 +5629,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,
Index: src/arm/macro-assembler-arm.cc
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc
index 4409e2643afa32b79a7c0d309f3a4d22f1a7d4a1..5668bb81dff7d0fd34e5a2f46ee126205f63ed8d 100644
--- a/src/arm/macro-assembler-arm.cc
+++ b/src/arm/macro-assembler-arm.cc
@@ -3740,8 +3740,7 @@ void MacroAssembler::ClampDoubleToUint8(Register result_reg,


 void MacroAssembler::LoadInstanceDescriptors(Register map,
-                                             Register descriptors,
-                                             Register scratch) {
+                                             Register descriptors) {
   ldr(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset));
 }

Index: src/arm/macro-assembler-arm.h
diff --git a/src/arm/macro-assembler-arm.h b/src/arm/macro-assembler-arm.h
index c7032bafb162e3d24e84eba83bddea70165a697f..35935c14d7ad6b8748fe212e29902b596fe817b4 100644
--- a/src/arm/macro-assembler-arm.h
+++ b/src/arm/macro-assembler-arm.h
@@ -1281,9 +1281,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);

Index: src/mips/full-codegen-mips.cc
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc
index 4f097471227a198af8599b4e6b7478cbaad67a91..3e89fb43b4a1a5f3b2009f111b2122aae05be25a 100644
--- a/src/mips/full-codegen-mips.cc
+++ b/src/mips/full-codegen-mips.cc
@@ -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);
Index: src/mips/lithium-codegen-mips.cc
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 77d4b9b09665e7f793ffef98394890489778ee60..4c2182bdb004ebf57b1ac3fff3f0cdfbdf43b59b 100644
--- a/src/mips/lithium-codegen-mips.cc
+++ b/src/mips/lithium-codegen-mips.cc
@@ -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,
Index: src/mips/lithium-mips.cc
diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc
index 4a6a1fdc437d538fe7ff204808403b7b8c7d7bce..0b6dcaea51eeef24192f5573750a2749d2a27258 100644
--- a/src/mips/lithium-mips.cc
+++ b/src/mips/lithium-mips.cc
@@ -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)));
 }


Index: src/mips/lithium-mips.h
diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h
index 939fc676b29d602ba44820b0736d497c65510628..3a9aa7accfbe4c2ee8c16561adb39dfa1b877437 100644
--- a/src/mips/lithium-mips.h
+++ b/src/mips/lithium-mips.h
@@ -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")

Index: src/mips/macro-assembler-mips.cc
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc index dacfc0ed5c8a74b6bc40142f2b48cf10374b0f8e..052387ab0156f5587089cd6e288b93d59cf62209 100644
--- a/src/mips/macro-assembler-mips.cc
+++ b/src/mips/macro-assembler-mips.cc
@@ -5302,8 +5302,7 @@ void MacroAssembler::EnsureNotWhite(


 void MacroAssembler::LoadInstanceDescriptors(Register map,
-                                             Register descriptors,
-                                             Register scratch) {
+                                             Register descriptors) {
   lw(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset));
 }

Index: src/mips/macro-assembler-mips.h
diff --git a/src/mips/macro-assembler-mips.h b/src/mips/macro-assembler-mips.h index a13c8ecf2da48516be2ad6b2ddbcb8268885e0cc..b57e51486c510b9391814a60ac460acb48522eaa 100644
--- a/src/mips/macro-assembler-mips.h
+++ b/src/mips/macro-assembler-mips.h
@@ -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);



--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to