Revision: 17116
Author:   [email protected]
Date:     Fri Oct  4 19:04:34 2013 UTC
Log:      Get rid of the HInstanceSize instruction.

[email protected]

Review URL: https://codereview.chromium.org/25666006
http://code.google.com/p/v8/source/detail?r=17116

Modified:
 /branches/bleeding_edge/src/arm/lithium-arm.cc
 /branches/bleeding_edge/src/arm/lithium-arm.h
 /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc
 /branches/bleeding_edge/src/code-stubs-hydrogen.cc
 /branches/bleeding_edge/src/hydrogen-instructions.h
 /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc
 /branches/bleeding_edge/src/ia32/lithium-ia32.cc
 /branches/bleeding_edge/src/ia32/lithium-ia32.h
 /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
 /branches/bleeding_edge/src/mips/lithium-mips.cc
 /branches/bleeding_edge/src/mips/lithium-mips.h
 /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc
 /branches/bleeding_edge/src/x64/lithium-x64.cc
 /branches/bleeding_edge/src/x64/lithium-x64.h

=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.cc Wed Oct 2 15:27:51 2013 UTC +++ /branches/bleeding_edge/src/arm/lithium-arm.cc Fri Oct 4 19:04:34 2013 UTC
@@ -1080,12 +1080,6 @@
           FixedTemp(r4));
   return MarkAsCall(DefineFixed(result, r0), instr);
 }
-
-
-LInstruction* LChunkBuilder::DoInstanceSize(HInstanceSize* instr) {
-  LOperand* object = UseRegisterAtStart(instr->object());
-  return DefineAsRegister(new(zone()) LInstanceSize(object));
-}


 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) {
=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.h Wed Oct 2 11:43:41 2013 UTC +++ /branches/bleeding_edge/src/arm/lithium-arm.h Fri Oct 4 19:04:34 2013 UTC
@@ -105,7 +105,6 @@
   V(InnerAllocatedObject)                       \
   V(InstanceOf)                                 \
   V(InstanceOfKnownGlobal)                      \
-  V(InstanceSize)                               \
   V(InstructionGap)                             \
   V(Integer32ToDouble)                          \
   V(Integer32ToSmi)                             \
@@ -1148,19 +1147,6 @@
 };


-class LInstanceSize V8_FINAL : public LTemplateInstruction<1, 1, 0> {
- public:
-  explicit LInstanceSize(LOperand* object) {
-    inputs_[0] = object;
-  }
-
-  LOperand* object() { return inputs_[0]; }
-
-  DECLARE_CONCRETE_INSTRUCTION(InstanceSize, "instance-size")
-  DECLARE_HYDROGEN_ACCESSOR(InstanceSize)
-};
-
-
 class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> {
  public:
   LBoundsCheck(LOperand* index, LOperand* length) {
=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Fri Oct 4 07:25:24 2013 UTC +++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Fri Oct 4 19:04:34 2013 UTC
@@ -2845,14 +2845,6 @@
   // restore all registers.
   __ StoreToSafepointRegisterSlot(result, result);
 }
-
-
-void LCodeGen::DoInstanceSize(LInstanceSize* instr) {
-  Register object = ToRegister(instr->object());
-  Register result = ToRegister(instr->result());
-  __ ldr(result, FieldMemOperand(object, HeapObject::kMapOffset));
-  __ ldrb(result, FieldMemOperand(result, Map::kInstanceSizeOffset));
-}


 void LCodeGen::DoCmpT(LCmpT* instr) {
=======================================
--- /branches/bleeding_edge/src/code-stubs-hydrogen.cc Fri Oct 4 08:17:11 2013 UTC +++ /branches/bleeding_edge/src/code-stubs-hydrogen.cc Fri Oct 4 19:04:34 2013 UTC
@@ -434,7 +434,6 @@

 template <>
 HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() {
-  Zone* zone = this->zone();
   HValue* undefined = graph()->GetConstantUndefined();

   HInstruction* boilerplate = Add<HLoadKeyed>(GetParameter(0),
@@ -448,8 +447,10 @@
   checker.And();

int size = JSObject::kHeaderSize + casted_stub()->length() * kPointerSize;
-  HValue* boilerplate_size =
-      AddInstruction(new(zone) HInstanceSize(boilerplate));
+  HValue* boilerplate_map = Add<HLoadNamedField>(
+      boilerplate, HObjectAccess::ForMap());
+  HValue* boilerplate_size = Add<HLoadNamedField>(
+      boilerplate_map, HObjectAccess::ForMapInstanceSize());
   HValue* size_in_words = Add<HConstant>(size >> kPointerSizeLog2);
   checker.If<HCompareNumericAndBranch>(boilerplate_size,
                                        size_in_words, Token::EQ);
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Fri Oct 4 08:17:11 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Fri Oct 4 19:04:34 2013 UTC
@@ -126,7 +126,6 @@
   V(InnerAllocatedObject)                      \
   V(InstanceOf)                                \
   V(InstanceOfKnownGlobal)                     \
-  V(InstanceSize)                              \
   V(InvokeFunction)                            \
   V(IsConstructCallAndBranch)                  \
   V(IsObjectAndBranch)                         \
@@ -4473,26 +4472,6 @@
 };


-// TODO(mstarzinger): This instruction should be modeled as a load of the map -// field followed by a load of the instance size field once HLoadNamedField is
-// flexible enough to accommodate byte-field loads.
-class HInstanceSize V8_FINAL : public HTemplateInstruction<1> {
- public:
-  explicit HInstanceSize(HValue* object) {
-    SetOperandAt(0, object);
-    set_representation(Representation::Integer32());
-  }
-
-  HValue* object() { return OperandAt(0); }
-
- virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
-    return Representation::Tagged();
-  }
-
-  DECLARE_CONCRETE_INSTRUCTION(InstanceSize)
-};
-
-
 class HPower V8_FINAL : public HTemplateInstruction<2> {
  public:
   static HInstruction* New(Zone* zone,
@@ -5827,6 +5806,12 @@
   static HObjectAccess ForMap() {
     return HObjectAccess(kMaps, JSObject::kMapOffset);
   }
+
+  static HObjectAccess ForMapInstanceSize() {
+    return HObjectAccess(kInobject,
+                         Map::kInstanceSizeOffset,
+                         Representation::Byte());
+  }

   static HObjectAccess ForPropertyCellValue() {
     return HObjectAccess(kInobject, PropertyCell::kValueOffset);
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Fri Oct 4 08:17:11 2013 UTC +++ /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Fri Oct 4 19:04:34 2013 UTC
@@ -3001,14 +3001,6 @@
   // Put the result value into the eax slot and restore all registers.
   __ StoreToSafepointRegisterSlot(eax, eax);
 }
-
-
-void LCodeGen::DoInstanceSize(LInstanceSize* instr) {
-  Register object = ToRegister(instr->object());
-  Register result = ToRegister(instr->result());
-  __ mov(result, FieldOperand(object, HeapObject::kMapOffset));
-  __ movzx_b(result, FieldOperand(result, Map::kInstanceSizeOffset));
-}


 void LCodeGen::DoCmpT(LCmpT* instr) {
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.cc Fri Oct 4 07:13:43 2013 UTC +++ /branches/bleeding_edge/src/ia32/lithium-ia32.cc Fri Oct 4 19:04:34 2013 UTC
@@ -1148,12 +1148,6 @@
           FixedTemp(edi));
   return MarkAsCall(DefineFixed(result, eax), instr);
 }
-
-
-LInstruction* LChunkBuilder::DoInstanceSize(HInstanceSize* instr) {
-  LOperand* object = UseRegisterAtStart(instr->object());
-  return DefineAsRegister(new(zone()) LInstanceSize(object));
-}


 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) {
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.h Wed Oct 2 11:43:41 2013 UTC +++ /branches/bleeding_edge/src/ia32/lithium-ia32.h Fri Oct 4 19:04:34 2013 UTC
@@ -107,7 +107,6 @@
   V(InnerAllocatedObject)                       \
   V(InstanceOf)                                 \
   V(InstanceOfKnownGlobal)                      \
-  V(InstanceSize)                               \
   V(InstructionGap)                             \
   V(Integer32ToDouble)                          \
   V(Integer32ToSmi)                             \
@@ -1131,19 +1130,6 @@
 };


-class LInstanceSize V8_FINAL : public LTemplateInstruction<1, 1, 0> {
- public:
-  explicit LInstanceSize(LOperand* object) {
-    inputs_[0] = object;
-  }
-
-  LOperand* object() { return inputs_[0]; }
-
-  DECLARE_CONCRETE_INSTRUCTION(InstanceSize, "instance-size")
-  DECLARE_HYDROGEN_ACCESSOR(InstanceSize)
-};
-
-
 class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> {
  public:
   LBoundsCheck(LOperand* index, LOperand* length) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Fri Oct 4 07:25:24 2013 UTC +++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Fri Oct 4 19:04:34 2013 UTC
@@ -2692,14 +2692,6 @@
   // restore all registers.
   __ StoreToSafepointRegisterSlot(result, result);
 }
-
-
-void LCodeGen::DoInstanceSize(LInstanceSize* instr) {
-  Register object = ToRegister(instr->object());
-  Register result = ToRegister(instr->result());
-  __ lw(result, FieldMemOperand(object, HeapObject::kMapOffset));
-  __ lbu(result, FieldMemOperand(result, Map::kInstanceSizeOffset));
-}


 void LCodeGen::DoCmpT(LCmpT* instr) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.cc Wed Oct 2 18:19:44 2013 UTC +++ /branches/bleeding_edge/src/mips/lithium-mips.cc Fri Oct 4 19:04:34 2013 UTC
@@ -1080,12 +1080,6 @@
           FixedTemp(t0));
   return MarkAsCall(DefineFixed(result, v0), instr);
 }
-
-
-LInstruction* LChunkBuilder::DoInstanceSize(HInstanceSize* instr) {
-  LOperand* object = UseRegisterAtStart(instr->object());
-  return DefineAsRegister(new(zone()) LInstanceSize(object));
-}


 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.h Wed Oct 2 16:58:37 2013 UTC +++ /branches/bleeding_edge/src/mips/lithium-mips.h Fri Oct 4 19:04:34 2013 UTC
@@ -105,7 +105,6 @@
   V(InnerAllocatedObject)                       \
   V(InstanceOf)                                 \
   V(InstanceOfKnownGlobal)                      \
-  V(InstanceSize)                               \
   V(InstructionGap)                             \
   V(Integer32ToDouble)                          \
   V(Integer32ToSmi)                             \
@@ -1143,19 +1142,6 @@
 };


-class LInstanceSize V8_FINAL : public LTemplateInstruction<1, 1, 0> {
- public:
-  explicit LInstanceSize(LOperand* object) {
-    inputs_[0] = object;
-  }
-
-  LOperand* object() { return inputs_[0]; }
-
-  DECLARE_CONCRETE_INSTRUCTION(InstanceSize, "instance-size")
-  DECLARE_HYDROGEN_ACCESSOR(InstanceSize)
-};
-
-
 class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> {
  public:
   LBoundsCheck(LOperand* index, LOperand* length) {
=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Fri Oct 4 07:25:24 2013 UTC +++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Fri Oct 4 19:04:34 2013 UTC
@@ -2537,14 +2537,6 @@
   __ LoadRoot(rax, Heap::kFalseValueRootIndex);
   __ bind(&done);
 }
-
-
-void LCodeGen::DoInstanceSize(LInstanceSize* instr) {
-  Register object = ToRegister(instr->object());
-  Register result = ToRegister(instr->result());
-  __ movq(result, FieldOperand(object, HeapObject::kMapOffset));
-  __ movzxbq(result, FieldOperand(result, Map::kInstanceSizeOffset));
-}


 void LCodeGen::DoCmpT(LCmpT* instr) {
=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.cc Fri Oct 4 07:13:43 2013 UTC +++ /branches/bleeding_edge/src/x64/lithium-x64.cc Fri Oct 4 19:04:34 2013 UTC
@@ -1075,12 +1075,6 @@
                                          FixedTemp(rdi));
   return MarkAsCall(DefineFixed(result, rax), instr);
 }
-
-
-LInstruction* LChunkBuilder::DoInstanceSize(HInstanceSize* instr) {
-  LOperand* object = UseRegisterAtStart(instr->object());
-  return DefineAsRegister(new(zone()) LInstanceSize(object));
-}


 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) {
=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.h Wed Oct 2 11:43:41 2013 UTC +++ /branches/bleeding_edge/src/x64/lithium-x64.h Fri Oct 4 19:04:34 2013 UTC
@@ -105,7 +105,6 @@
   V(InnerAllocatedObject)                       \
   V(InstanceOf)                                 \
   V(InstanceOfKnownGlobal)                      \
-  V(InstanceSize)                               \
   V(InstructionGap)                             \
   V(Integer32ToDouble)                          \
   V(Integer32ToSmi)                             \
@@ -1078,19 +1077,6 @@
 };


-class LInstanceSize V8_FINAL : public LTemplateInstruction<1, 1, 0> {
- public:
-  explicit LInstanceSize(LOperand* object) {
-    inputs_[0] = object;
-  }
-
-  LOperand* object() { return inputs_[0]; }
-
-  DECLARE_CONCRETE_INSTRUCTION(InstanceSize, "instance-size")
-  DECLARE_HYDROGEN_ACCESSOR(InstanceSize)
-};
-
-
 class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> {
  public:
   LBoundsCheck(LOperand* index, LOperand* length) {

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to