Reviewers: Toon Verwaest, danno, Paul Lind, kisg,

Description:
MIPS: Swap bitfield3 and backpointer.

Port r12034 (f17b84c0)

Original commit message:
Bitfield3 now has its own field, while the backpointer shares the field with the
descriptor array; which will become the transition array.

BUG=
TEST=


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

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

Affected files:
  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/mips/full-codegen-mips.cc
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc
index 079e8b3fe4f544eb53995763389d20f34e6ac3a0..9ae025d7b2ac4ec6d8e8404da1c1ba3ff1d8a0bc 100644
--- a/src/mips/full-codegen-mips.cc
+++ b/src/mips/full-codegen-mips.cc
@@ -1148,7 +1148,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {

   // We got a map in register v0. Get the enumeration cache from it.
   __ bind(&use_cache);
-  __ LoadInstanceDescriptors(v0, a1);
+  __ LoadInstanceDescriptors(v0, a1, a2);
   __ lw(a1, FieldMemOperand(a1, DescriptorArray::kEnumerationIndexOffset));
__ lw(a2, FieldMemOperand(a1, DescriptorArray::kEnumCacheBridgeCacheOffset));

@@ -2759,7 +2759,7 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf(
   // Look for valueOf symbol in the descriptor array, and indicate false if
   // found. The type is not checked, so if it is a transition it is a false
   // negative.
-  __ LoadInstanceDescriptors(a1, t0);
+  __ LoadInstanceDescriptors(a1, t0, a3);
   __ lw(a3, FieldMemOperand(t0, FixedArray::kLengthOffset));
   // t0: descriptor array
   // a3: length of descriptor array
Index: src/mips/lithium-codegen-mips.cc
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index c9256407fd43bb2158b0ff06ce4346d421585a9a..737aafcc9be733301fb5686e68d53bc3e2659fa0 100644
--- a/src/mips/lithium-codegen-mips.cc
+++ b/src/mips/lithium-codegen-mips.cc
@@ -5165,7 +5165,8 @@ void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
   Register map = ToRegister(instr->map());
   Register result = ToRegister(instr->result());
-  __ LoadInstanceDescriptors(map, result);
+  Register scratch = ToRegister(instr->scratch());
+  __ LoadInstanceDescriptors(map, result, scratch);
   __ lw(result,
         FieldMemOperand(result, DescriptorArray::kEnumerationIndexOffset));
   __ lw(result,
Index: src/mips/lithium-mips.cc
diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc
index 9426c2cac9f1cb40212d6071f57aad2cd04b9504..da5beb6186191ea70f99b2c1c1cc9821815a16e7 100644
--- a/src/mips/lithium-mips.cc
+++ b/src/mips/lithium-mips.cc
@@ -2200,8 +2200,9 @@ 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)));
+      new(zone()) LForInCacheArray(map, scratch)));
 }


Index: src/mips/lithium-mips.h
diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h
index b07d225399cab99584f2782dc43a0ef1542c2406..86b8f3397938ac581fdd2fe2882ad1f75a292509 100644
--- a/src/mips/lithium-mips.h
+++ b/src/mips/lithium-mips.h
@@ -2143,13 +2143,15 @@ class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> {
 };


-class LForInCacheArray: public LTemplateInstruction<1, 1, 0> {
+class LForInCacheArray: public LTemplateInstruction<1, 1, 1> {
  public:
-  explicit LForInCacheArray(LOperand* map) {
+  explicit LForInCacheArray(LOperand* map, LOperand* scratch) {
     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 1a6bc216ccc9d72c5e060249a9ec1bd42f8396eb..6233b830e01107ec939a74441dbf15057b0a67d3 100644
--- a/src/mips/macro-assembler-mips.cc
+++ b/src/mips/macro-assembler-mips.cc
@@ -5290,13 +5290,21 @@ void MacroAssembler::EnsureNotWhite(


 void MacroAssembler::LoadInstanceDescriptors(Register map,
-                                             Register descriptors) {
+                                             Register descriptors,
+                                             Register scratch) {
   lw(descriptors,
-     FieldMemOperand(map, Map::kInstanceDescriptorsOrBitField3Offset));
-  Label not_smi;
-  JumpIfNotSmi(descriptors, &not_smi);
+     FieldMemOperand(map, Map::kInstanceDescriptorsOrBackPointerOffset));
+
+  Label ok, fail;
+  CheckMap(descriptors,
+           scratch,
+           isolate()->factory()->fixed_array_map(),
+           &fail,
+           DONT_DO_SMI_CHECK);
+  jmp(&ok);
+  bind(&fail);
   LoadRoot(descriptors, Heap::kEmptyDescriptorArrayRootIndex);
-  bind(&not_smi);
+  bind(&ok);
 }


@@ -5320,8 +5328,13 @@ void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) {
   // check for an enum cache.  Leave the map in a2 for the subsequent
   // prototype load.
   lw(a2, FieldMemOperand(a1, HeapObject::kMapOffset));
-  lw(a3, FieldMemOperand(a2, Map::kInstanceDescriptorsOrBitField3Offset));
-  JumpIfSmi(a3, call_runtime);
+ lw(a3, FieldMemOperand(a2, Map::kInstanceDescriptorsOrBackPointerOffset));
+
+  CheckMap(a3,
+           t3,
+           isolate()->factory()->fixed_array_map(),
+           call_runtime,
+           DONT_DO_SMI_CHECK);

   // Check that there is an enum cache in the non-empty instance
   // descriptors (a3).  This is the case if the next enumeration
Index: src/mips/macro-assembler-mips.h
diff --git a/src/mips/macro-assembler-mips.h b/src/mips/macro-assembler-mips.h index bb3dc01e393f621326f1ee02a8db3d6311748d0a..dd8c1195b8032ef78a88f235dbbfedebd6dd6274 100644
--- a/src/mips/macro-assembler-mips.h
+++ b/src/mips/macro-assembler-mips.h
@@ -1396,7 +1396,9 @@ class MacroAssembler: public Assembler {
                           DoubleRegister temp_double_reg);


-  void LoadInstanceDescriptors(Register map, Register descriptors);
+  void LoadInstanceDescriptors(Register map,
+                               Register descriptors,
+                               Register scratch);


   // Activation support.


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

Reply via email to