Revision: 21592
Author:   [email protected]
Date:     Mon Jun  2 07:02:24 2014 UTC
Log:      Inline Array.shift() fast path instead of using a code stub.

TEST=mjsunit/array-shift,mjsunit/array-shift2,mjsunit/array-shift3
[email protected]

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

Modified:
 /branches/bleeding_edge/src/arm/code-stubs-arm.cc
 /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/arm64/code-stubs-arm64.cc
 /branches/bleeding_edge/src/arm64/lithium-arm64.cc
 /branches/bleeding_edge/src/arm64/lithium-arm64.h
 /branches/bleeding_edge/src/arm64/lithium-codegen-arm64.cc
 /branches/bleeding_edge/src/code-stubs-hydrogen.cc
 /branches/bleeding_edge/src/code-stubs.h
 /branches/bleeding_edge/src/hydrogen-instructions.cc
 /branches/bleeding_edge/src/hydrogen-instructions.h
 /branches/bleeding_edge/src/hydrogen.cc
 /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc
 /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/code-stubs-mips.cc
 /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/code-stubs-x64.cc
 /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/x87/code-stubs-x87.cc
 /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc
 /branches/bleeding_edge/src/x87/lithium-x87.cc
 /branches/bleeding_edge/src/x87/lithium-x87.h

=======================================
--- /branches/bleeding_edge/src/arm/code-stubs-arm.cc Wed May 28 11:29:55 2014 UTC +++ /branches/bleeding_edge/src/arm/code-stubs-arm.cc Mon Jun 2 07:02:24 2014 UTC
@@ -317,16 +317,6 @@
   descriptor->deoptimization_handler_ =
       FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss);
 }
-
-
-void ArrayShiftStub::InitializeInterfaceDescriptor(
-    CodeStubInterfaceDescriptor* descriptor) {
-  static Register registers[] = { r0 };
-  descriptor->register_param_count_ = 1;
-  descriptor->register_params_ = registers;
-  descriptor->deoptimization_handler_ =
-      Builtins::c_function_address(Builtins::c_ArrayShift);
-}


 void BinaryOpICStub::InitializeInterfaceDescriptor(
=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.cc Mon Jun 2 05:33:35 2014 UTC +++ /branches/bleeding_edge/src/arm/lithium-arm.cc Mon Jun 2 07:02:24 2014 UTC
@@ -2282,14 +2282,6 @@
     return MarkAsCall(result, instr);
   }
 }
-
-
-LInstruction* LChunkBuilder::DoArrayShift(HArrayShift* instr) {
-  LOperand* object = UseFixed(instr->object(), r0);
-  LOperand* context = UseFixed(instr->context(), cp);
-  LArrayShift* result = new(zone()) LArrayShift(context, object);
- return MarkAsCall(DefineFixed(result, r0), instr, CANNOT_DEOPTIMIZE_EAGERLY);
-}


 LInstruction* LChunkBuilder::DoTrapAllocationMemento(
=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.h Mon Jun 2 05:33:35 2014 UTC +++ /branches/bleeding_edge/src/arm/lithium-arm.h Mon Jun 2 07:02:24 2014 UTC
@@ -26,7 +26,6 @@
   V(ArgumentsLength)                            \
   V(ArithmeticD)                                \
   V(ArithmeticT)                                \
-  V(ArrayShift)                                 \
   V(BitI)                                       \
   V(BoundsCheck)                                \
   V(Branch)                                     \
@@ -2283,21 +2282,6 @@
 };


-class LArrayShift V8_FINAL : public LTemplateInstruction<1, 2, 0> {
- public:
-  LArrayShift(LOperand* context, LOperand* object) {
-    inputs_[0] = context;
-    inputs_[1] = object;
-  }
-
-  LOperand* context() const { return inputs_[0]; }
-  LOperand* object() const { return inputs_[1]; }
-
-  DECLARE_CONCRETE_INSTRUCTION(ArrayShift, "array-shift")
-  DECLARE_HYDROGEN_ACCESSOR(ArrayShift)
-};
-
-
class LTrapAllocationMemento V8_FINAL : public LTemplateInstruction<0, 1, 1> {
  public:
   LTrapAllocationMemento(LOperand* object,
=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Thu May 29 04:13:50 2014 UTC +++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Mon Jun 2 07:02:24 2014 UTC
@@ -4400,15 +4400,6 @@
   }
   __ bind(&not_applicable);
 }
-
-
-void LCodeGen::DoArrayShift(LArrayShift* instr) {
-  ASSERT(ToRegister(instr->context()).is(cp));
-  ASSERT(ToRegister(instr->object()).is(r0));
-  ASSERT(ToRegister(instr->result()).is(r0));
-  ArrayShiftStub stub(isolate(), instr->hydrogen()->kind());
-  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
-}


 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
=======================================
--- /branches/bleeding_edge/src/arm64/code-stubs-arm64.cc Wed May 28 11:29:55 2014 UTC +++ /branches/bleeding_edge/src/arm64/code-stubs-arm64.cc Mon Jun 2 07:02:24 2014 UTC
@@ -354,17 +354,6 @@
   descriptor->deoptimization_handler_ =
       FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss);
 }
-
-
-void ArrayShiftStub::InitializeInterfaceDescriptor(
-    CodeStubInterfaceDescriptor* descriptor) {
-  // x0: receiver
-  static Register registers[] = { x0 };
- descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
-  descriptor->register_params_ = registers;
-  descriptor->deoptimization_handler_ =
-      Builtins::c_function_address(Builtins::c_ArrayShift);
-}


 void BinaryOpICStub::InitializeInterfaceDescriptor(
=======================================
--- /branches/bleeding_edge/src/arm64/lithium-arm64.cc Mon Jun 2 05:33:35 2014 UTC +++ /branches/bleeding_edge/src/arm64/lithium-arm64.cc Mon Jun 2 07:02:24 2014 UTC
@@ -2515,14 +2515,6 @@
     return MarkAsCall(result, instr);
   }
 }
-
-
-LInstruction* LChunkBuilder::DoArrayShift(HArrayShift* instr) {
-  LOperand* object = UseFixed(instr->object(), x0);
-  LOperand* context = UseFixed(instr->context(), cp);
-  LArrayShift* result = new(zone()) LArrayShift(context, object);
- return MarkAsCall(DefineFixed(result, x0), instr, CANNOT_DEOPTIMIZE_EAGERLY);
-}


 LInstruction* LChunkBuilder::DoTrapAllocationMemento(
=======================================
--- /branches/bleeding_edge/src/arm64/lithium-arm64.h Mon Jun 2 05:33:35 2014 UTC +++ /branches/bleeding_edge/src/arm64/lithium-arm64.h Mon Jun 2 07:02:24 2014 UTC
@@ -28,7 +28,6 @@
   V(ArgumentsLength)                            \
   V(ArithmeticD)                                \
   V(ArithmeticT)                                \
-  V(ArrayShift)                                 \
   V(BitI)                                       \
   V(BitS)                                       \
   V(BoundsCheck)                                \
@@ -2888,21 +2887,6 @@
 };


-class LArrayShift V8_FINAL : public LTemplateInstruction<1, 2, 0> {
- public:
-  LArrayShift(LOperand* context, LOperand* object) {
-    inputs_[0] = context;
-    inputs_[1] = object;
-  }
-
-  LOperand* context() const { return inputs_[0]; }
-  LOperand* object() const { return inputs_[1]; }
-
-  DECLARE_CONCRETE_INSTRUCTION(ArrayShift, "array-shift")
-  DECLARE_HYDROGEN_ACCESSOR(ArrayShift)
-};
-
-
class LTrapAllocationMemento V8_FINAL : public LTemplateInstruction<0, 1, 2> {
  public:
LTrapAllocationMemento(LOperand* object, LOperand* temp1, LOperand* temp2) {
=======================================
--- /branches/bleeding_edge/src/arm64/lithium-codegen-arm64.cc Thu May 29 04:13:50 2014 UTC +++ /branches/bleeding_edge/src/arm64/lithium-codegen-arm64.cc Mon Jun 2 07:02:24 2014 UTC
@@ -5752,15 +5752,6 @@
   }
   __ Bind(&not_applicable);
 }
-
-
-void LCodeGen::DoArrayShift(LArrayShift* instr) {
-  ASSERT(ToRegister(instr->context()).is(cp));
-  ASSERT(ToRegister(instr->object()).is(x0));
-  ASSERT(ToRegister(instr->result()).is(x0));
-  ArrayShiftStub stub(isolate(), instr->hydrogen()->kind());
-  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
-}


 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
=======================================
--- /branches/bleeding_edge/src/code-stubs-hydrogen.cc Mon Jun 2 06:42:56 2014 UTC +++ /branches/bleeding_edge/src/code-stubs-hydrogen.cc Mon Jun 2 07:02:24 2014 UTC
@@ -1118,86 +1118,6 @@
 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() {
   return DoGenerateCode(this);
 }
-
-
-template <>
-HValue* CodeStubGraphBuilder<ArrayShiftStub>::BuildCodeStub() {
-  HValue* receiver = GetParameter(ArrayShiftStub::kReceiver);
-  ElementsKind kind = casted_stub()->kind();
-
-  // We may use double registers for copying.
-  if (IsFastDoubleElementsKind(kind)) info()->MarkAsSavesCallerDoubles();
-
-  HValue* length = Add<HLoadNamedField>(
-      receiver, static_cast<HValue*>(NULL),
-      HObjectAccess::ForArrayLength(kind));
-
-  IfBuilder if_lengthiszero(this);
-  HValue* lengthiszero = if_lengthiszero.If<HCompareNumericAndBranch>(
-      length, graph()->GetConstant0(), Token::EQ);
-  if_lengthiszero.Then();
-  {
-    Push(graph()->GetConstantUndefined());
-  }
-  if_lengthiszero.Else();
-  {
-    // Check if array length is below threshold.
-    IfBuilder if_inline(this);
-    if_inline.If<HCompareNumericAndBranch>(
- length, Add<HConstant>(ArrayShiftStub::kInlineThreshold), Token::LTE);
-    if_inline.Then();
-    if_inline.ElseDeopt("Array length exceeds threshold");
-    if_inline.End();
-
-    // We cannot handle copy-on-write backing stores here.
-    HValue* elements = AddLoadElements(receiver);
-    if (IsFastSmiOrObjectElementsKind(kind)) {
-      Add<HCheckMaps>(elements, isolate()->factory()->fixed_array_map());
-    }
-
-    // Remember the result.
-    Push(AddElementAccess(elements, graph()->GetConstant0(), NULL,
-                          lengthiszero, kind, LOAD));
-
-    // Compute the new length.
- HValue* new_length = AddUncasted<HSub>(length, graph()->GetConstant1());
-    new_length->ClearFlag(HValue::kCanOverflow);
-
-    // Copy the remaining elements.
-    LoopBuilder loop(this, context(), LoopBuilder::kPostIncrement);
-    {
-      HValue* new_key = loop.BeginBody(
-          graph()->GetConstant0(), new_length, Token::LT);
-      HValue* key = AddUncasted<HAdd>(new_key, graph()->GetConstant1());
-      key->ClearFlag(HValue::kCanOverflow);
-      HValue* element = AddUncasted<HLoadKeyed>(
-          elements, key, lengthiszero, kind, ALLOW_RETURN_HOLE);
- HStoreKeyed* store = Add<HStoreKeyed>(elements, new_key, element, kind);
-      store->SetFlag(HValue::kAllowUndefinedAsNaN);
-    }
-    loop.EndBody();
-
-    // Put a hole at the end.
-    HValue* hole = IsFastSmiOrObjectElementsKind(kind)
-        ? Add<HConstant>(isolate()->factory()->the_hole_value())
-        : Add<HConstant>(FixedDoubleArray::hole_nan_as_double());
-    if (IsFastSmiOrObjectElementsKind(kind)) kind = FAST_HOLEY_ELEMENTS;
-    Add<HStoreKeyed>(elements, new_length, hole, kind, INITIALIZING_STORE);
-
-    // Remember new length.
-    Add<HStoreNamedField>(
-        receiver, HObjectAccess::ForArrayLength(kind),
-        new_length, STORE_TO_INITIALIZED_ENTRY);
-  }
-  if_lengthiszero.End();
-
-  return Pop();
-}
-
-
-Handle<Code> ArrayShiftStub::GenerateCode() {
-  return DoGenerateCode(this);
-}


 void CodeStubGraphBuilderBase::BuildCheckAndInstallOptimizedCode(
=======================================
--- /branches/bleeding_edge/src/code-stubs.h    Wed May 28 16:00:52 2014 UTC
+++ /branches/bleeding_edge/src/code-stubs.h    Mon Jun  2 07:02:24 2014 UTC
@@ -16,7 +16,6 @@

 // List of code stubs used on all platforms.
 #define CODE_STUB_LIST_ALL_PLATFORMS(V)  \
-  V(ArrayShift)                          \
   V(CallFunction)                        \
   V(CallConstruct)                       \
   V(BinaryOpIC)                          \
@@ -2412,36 +2411,6 @@
 };


-class ArrayShiftStub V8_FINAL : public HydrogenCodeStub {
- public:
-  ArrayShiftStub(Isolate* isolate, ElementsKind kind)
-      : HydrogenCodeStub(isolate), kind_(kind) { }
-
-  ElementsKind kind() const { return kind_; }
-
-  virtual Handle<Code> GenerateCode() V8_OVERRIDE;
-
-  virtual void InitializeInterfaceDescriptor(
-      CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
-
-  // Inline Array.shift() for arrays up to this length.
-  static const int kInlineThreshold = 16;
-
-  // Parameters accessed via CodeStubGraphBuilder::GetParameter()
-  static const int kReceiver = 0;
-
- private:
-  Major MajorKey() { return ArrayShift; }
-  int NotMissMinorKey() {
-    return kind_;
-  }
-
-  ElementsKind kind_;
-
-  DISALLOW_COPY_AND_ASSIGN(ArrayShiftStub);
-};
-
-
 class StoreArrayLiteralElementStub : public PlatformCodeStub {
  public:
   explicit StoreArrayLiteralElementStub(Isolate* isolate)
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Mon Jun 2 06:42:56 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.cc Mon Jun 2 07:02:24 2014 UTC
@@ -779,11 +779,9 @@
     case HValue::kArgumentsElements:
     case HValue::kArgumentsLength:
     case HValue::kArgumentsObject:
-    case HValue::kArrayShift:
     case HValue::kBlockEntry:
     case HValue::kBoundsCheckBaseIndexInformation:
     case HValue::kCallFunction:
-    case HValue::kCallJSFunction:
     case HValue::kCallNew:
     case HValue::kCallNewArray:
     case HValue::kCallStub:
@@ -849,6 +847,7 @@
     case HValue::kBitwise:
     case HValue::kBoundsCheck:
     case HValue::kBranch:
+    case HValue::kCallJSFunction:
     case HValue::kCallRuntime:
     case HValue::kChange:
     case HValue::kCheckHeapObject:
@@ -3607,12 +3606,6 @@
               ElementsAccessor::ForKind(to_kind)->name());
if (IsSimpleMapChangeTransition(from_kind, to_kind)) stream->Add(" (simple)");
 }
-
-
-void HArrayShift::PrintDataTo(StringStream* stream) {
-  object()->PrintNameTo(stream);
-  stream->Add(" [%s]", ElementsAccessor::ForKind(kind())->name());
-}


 void HLoadGlobalCell::PrintDataTo(StringStream* stream) {
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Mon Jun 2 06:42:56 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Mon Jun 2 07:02:24 2014 UTC
@@ -51,7 +51,6 @@
   V(ArgumentsElements)                         \
   V(ArgumentsLength)                           \
   V(ArgumentsObject)                           \
-  V(ArrayShift)                                \
   V(Bitwise)                                   \
   V(BlockEntry)                                \
   V(BoundsCheck)                               \
@@ -7090,52 +7089,6 @@
 };


-class HArrayShift V8_FINAL : public HTemplateInstruction<2> {
- public:
-  static HArrayShift* New(Zone* zone,
-                          HValue* context,
-                          HValue* object,
-                          ElementsKind kind) {
-    return new(zone) HArrayShift(context, object, kind);
-  }
-
- virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
-    return Representation::Tagged();
-  }
-
-  HValue* context() const { return OperandAt(0); }
-  HValue* object() const { return OperandAt(1); }
-  ElementsKind kind() const { return kind_; }
-
-  virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
-
-  DECLARE_CONCRETE_INSTRUCTION(ArrayShift);
-
- protected:
-  virtual bool DataEquals(HValue* other) V8_OVERRIDE {
-    HArrayShift* that = HArrayShift::cast(other);
-    return this->kind_ == that->kind_;
-  }
-
- private:
-  HArrayShift(HValue* context, HValue* object, ElementsKind kind)
-      : kind_(kind) {
-    SetOperandAt(0, context);
-    SetOperandAt(1, object);
-    SetChangesFlag(kArrayLengths);
-    SetChangesFlag(kNewSpacePromotion);
-    set_representation(Representation::Tagged());
-    if (IsFastSmiOrObjectElementsKind(kind)) {
-      SetChangesFlag(kArrayElements);
-    } else {
-      SetChangesFlag(kDoubleArrayElements);
-    }
-  }
-
-  ElementsKind kind_;
-};
-
-
 class HStringAdd V8_FINAL : public HBinaryOperation {
  public:
   static HInstruction* New(Zone* zone,
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Mon Jun  2 06:42:56 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Mon Jun  2 07:02:24 2014 UTC
@@ -7940,13 +7940,96 @@
           handle(JSObject::cast(receiver_map->prototype()), isolate()),
           Handle<JSObject>::null());

+      // Threshold for fast inlined Array.shift().
+ HConstant* inline_threshold = Add<HConstant>(static_cast<int32_t>(16));
+
       Drop(expr->arguments()->length());
       HValue* receiver = Pop();
-      Drop(1);  // function
+      HValue* function = Pop();
+      HValue* result;

-      receiver = AddCheckMap(receiver, receiver_map);
-      HInstruction* result = NewUncasted<HArrayShift>(receiver, kind);
-      ast_context()->ReturnInstruction(result, expr->id());
+      {
+        NoObservableSideEffectsScope scope(this);
+
+        HValue* length = Add<HLoadNamedField>(
+            receiver, static_cast<HValue*>(NULL),
+            HObjectAccess::ForArrayLength(kind));
+
+        IfBuilder if_lengthiszero(this);
+ HValue* lengthiszero = if_lengthiszero.If<HCompareNumericAndBranch>(
+            length, graph()->GetConstant0(), Token::EQ);
+        if_lengthiszero.Then();
+        {
+ if (!ast_context()->IsEffect()) Push(graph()->GetConstantUndefined());
+        }
+        if_lengthiszero.Else();
+        {
+          HValue* elements = AddLoadElements(receiver);
+
+          // Check if we can use the fast inlined Array.shift().
+          IfBuilder if_inline(this);
+          if_inline.If<HCompareNumericAndBranch>(
+              length, inline_threshold, Token::LTE);
+          if (IsFastSmiOrObjectElementsKind(kind)) {
+            // We cannot handle copy-on-write backing stores here.
+            if_inline.AndIf<HCompareMap>(
+                elements, isolate()->factory()->fixed_array_map());
+          }
+          if_inline.Then();
+          {
+            // Remember the result.
+            if (!ast_context()->IsEffect()) {
+ Push(AddElementAccess(elements, graph()->GetConstant0(), NULL,
+                                    lengthiszero, kind, LOAD));
+            }
+
+            // Compute the new length.
+            HValue* new_length = AddUncasted<HSub>(
+                length, graph()->GetConstant1());
+            new_length->ClearFlag(HValue::kCanOverflow);
+
+            // Copy the remaining elements.
+            LoopBuilder loop(this, context(), LoopBuilder::kPostIncrement);
+            {
+              HValue* new_key = loop.BeginBody(
+                  graph()->GetConstant0(), new_length, Token::LT);
+ HValue* key = AddUncasted<HAdd>(new_key, graph()->GetConstant1());
+              key->ClearFlag(HValue::kCanOverflow);
+              HValue* element = AddUncasted<HLoadKeyed>(
+                  elements, key, lengthiszero, kind, ALLOW_RETURN_HOLE);
+              HStoreKeyed* store = Add<HStoreKeyed>(
+                  elements, new_key, element, kind);
+              store->SetFlag(HValue::kAllowUndefinedAsNaN);
+            }
+            loop.EndBody();
+
+            // Put a hole at the end.
+            HValue* hole = IsFastSmiOrObjectElementsKind(kind)
+                ? Add<HConstant>(isolate()->factory()->the_hole_value())
+                : Add<HConstant>(FixedDoubleArray::hole_nan_as_double());
+ if (IsFastSmiOrObjectElementsKind(kind)) kind = FAST_HOLEY_ELEMENTS;
+            Add<HStoreKeyed>(
+                elements, new_length, hole, kind, INITIALIZING_STORE);
+
+            // Remember new length.
+            Add<HStoreNamedField>(
+                receiver, HObjectAccess::ForArrayLength(kind),
+                new_length, STORE_TO_INITIALIZED_ENTRY);
+          }
+          if_inline.Else();
+          {
+            Add<HPushArguments>(receiver);
+            result = Add<HCallJSFunction>(function, 1, true);
+            if (!ast_context()->IsEffect()) Push(result);
+          }
+          if_inline.End();
+        }
+        if_lengthiszero.End();
+      }
+      result = ast_context()->IsEffect() ? graph()->GetConstant0() : Top();
+      Add<HSimulate>(expr->id(), REMOVABLE_SIMULATE);
+      if (!ast_context()->IsEffect()) Drop(1);
+      ast_context()->ReturnValue(result);
       return true;
     }
     default:
=======================================
--- /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Wed May 28 11:29:55 2014 UTC +++ /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Mon Jun 2 07:02:24 2014 UTC
@@ -321,16 +321,6 @@
   descriptor->deoptimization_handler_ =
       FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss);
 }
-
-
-void ArrayShiftStub::InitializeInterfaceDescriptor(
-    CodeStubInterfaceDescriptor* descriptor) {
-  static Register registers[] = { eax };
-  descriptor->register_param_count_ = 1;
-  descriptor->register_params_ = registers;
-  descriptor->deoptimization_handler_ =
-      Builtins::c_function_address(Builtins::c_ArrayShift);
-}


 void BinaryOpICStub::InitializeInterfaceDescriptor(
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Thu May 29 04:13:50 2014 UTC +++ /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Mon Jun 2 07:02:24 2014 UTC
@@ -4296,15 +4296,6 @@
   }
   __ bind(&not_applicable);
 }
-
-
-void LCodeGen::DoArrayShift(LArrayShift* instr) {
-  ASSERT(ToRegister(instr->context()).is(esi));
-  ASSERT(ToRegister(instr->object()).is(eax));
-  ASSERT(ToRegister(instr->result()).is(eax));
-  ArrayShiftStub stub(isolate(), instr->hydrogen()->kind());
-  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
-}


 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) {
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.cc Mon Jun 2 05:33:35 2014 UTC +++ /branches/bleeding_edge/src/ia32/lithium-ia32.cc Mon Jun 2 07:02:24 2014 UTC
@@ -2317,14 +2317,6 @@
     return MarkAsCall(result, instr);
   }
 }
-
-
-LInstruction* LChunkBuilder::DoArrayShift(HArrayShift* instr) {
-  LOperand* object = UseFixed(instr->object(), eax);
-  LOperand* context = UseFixed(instr->context(), esi);
-  LArrayShift* result = new(zone()) LArrayShift(context, object);
- return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY);
-}


 LInstruction* LChunkBuilder::DoTrapAllocationMemento(
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.h Mon Jun 2 05:33:35 2014 UTC +++ /branches/bleeding_edge/src/ia32/lithium-ia32.h Mon Jun 2 07:02:24 2014 UTC
@@ -26,7 +26,6 @@
   V(ArgumentsLength)                            \
   V(ArithmeticD)                                \
   V(ArithmeticT)                                \
-  V(ArrayShift)                                 \
   V(BitI)                                       \
   V(BoundsCheck)                                \
   V(Branch)                                     \
@@ -2282,21 +2281,6 @@
 };


-class LArrayShift V8_FINAL : public LTemplateInstruction<1, 2, 0> {
- public:
-  LArrayShift(LOperand* context, LOperand* object) {
-    inputs_[0] = context;
-    inputs_[1] = object;
-  }
-
-  LOperand* context() const { return inputs_[0]; }
-  LOperand* object() const { return inputs_[1]; }
-
-  DECLARE_CONCRETE_INSTRUCTION(ArrayShift, "array-shift")
-  DECLARE_HYDROGEN_ACCESSOR(ArrayShift)
-};
-
-
class LTrapAllocationMemento V8_FINAL : public LTemplateInstruction<0, 1, 1> {
  public:
   LTrapAllocationMemento(LOperand* object,
=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Wed May 28 11:29:55 2014 UTC +++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Mon Jun 2 07:02:24 2014 UTC
@@ -318,16 +318,6 @@
   descriptor->deoptimization_handler_ =
       FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss);
 }
-
-
-void ArrayShiftStub::InitializeInterfaceDescriptor(
-    CodeStubInterfaceDescriptor* descriptor) {
-  static Register registers[] = { a0 };
-  descriptor->register_param_count_ = 1;
-  descriptor->register_params_ = registers;
-  descriptor->deoptimization_handler_ =
-      Builtins::c_function_address(Builtins::c_ArrayShift);
-}


 void BinaryOpICStub::InitializeInterfaceDescriptor(
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Thu May 29 13:40:51 2014 UTC +++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Mon Jun 2 07:02:24 2014 UTC
@@ -4402,15 +4402,6 @@
   }
   __ bind(&not_applicable);
 }
-
-
-void LCodeGen::DoArrayShift(LArrayShift* instr) {
-  ASSERT(ToRegister(instr->context()).is(cp));
-  ASSERT(ToRegister(instr->object()).is(a0));
-  ASSERT(ToRegister(instr->result()).is(v0));
-  ArrayShiftStub stub(isolate(), instr->hydrogen()->kind());
-  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
-}


 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.cc Thu May 29 13:40:51 2014 UTC +++ /branches/bleeding_edge/src/mips/lithium-mips.cc Mon Jun 2 07:02:24 2014 UTC
@@ -2233,14 +2233,6 @@
     return MarkAsCall(result, instr);
   }
 }
-
-
-LInstruction* LChunkBuilder::DoArrayShift(HArrayShift* instr) {
-  LOperand* object = UseFixed(instr->object(), a0);
-  LOperand* context = UseFixed(instr->context(), cp);
-  LArrayShift* result = new(zone()) LArrayShift(context, object);
- return MarkAsCall(DefineFixed(result, v0), instr, CANNOT_DEOPTIMIZE_EAGERLY);
-}


 LInstruction* LChunkBuilder::DoTrapAllocationMemento(
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.h Tue May 27 17:06:40 2014 UTC +++ /branches/bleeding_edge/src/mips/lithium-mips.h Mon Jun 2 07:02:24 2014 UTC
@@ -26,7 +26,6 @@
   V(ArgumentsLength)                            \
   V(ArithmeticD)                                \
   V(ArithmeticT)                                \
-  V(ArrayShift)                                 \
   V(BitI)                                       \
   V(BoundsCheck)                                \
   V(Branch)                                     \
@@ -2238,21 +2237,6 @@
 };


-class LArrayShift V8_FINAL : public LTemplateInstruction<1, 2, 0> {
- public:
-  LArrayShift(LOperand* context, LOperand* object) {
-    inputs_[0] = context;
-    inputs_[1] = object;
-  }
-
-  LOperand* context() const { return inputs_[0]; }
-  LOperand* object() const { return inputs_[1]; }
-
-  DECLARE_CONCRETE_INSTRUCTION(ArrayShift, "array-shift")
-  DECLARE_HYDROGEN_ACCESSOR(ArrayShift)
-};
-
-
class LTrapAllocationMemento V8_FINAL : public LTemplateInstruction<0, 1, 1> {
  public:
   LTrapAllocationMemento(LOperand* object,
=======================================
--- /branches/bleeding_edge/src/x64/code-stubs-x64.cc Wed May 28 11:29:55 2014 UTC +++ /branches/bleeding_edge/src/x64/code-stubs-x64.cc Mon Jun 2 07:02:24 2014 UTC
@@ -317,16 +317,6 @@
   descriptor->deoptimization_handler_ =
       FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss);
 }
-
-
-void ArrayShiftStub::InitializeInterfaceDescriptor(
-    CodeStubInterfaceDescriptor* descriptor) {
-  static Register registers[] = { rax };
-  descriptor->register_param_count_ = 1;
-  descriptor->register_params_ = registers;
-  descriptor->deoptimization_handler_ =
-      Builtins::c_function_address(Builtins::c_ArrayShift);
-}


 void BinaryOpICStub::InitializeInterfaceDescriptor(
=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Thu May 29 04:13:50 2014 UTC +++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Mon Jun 2 07:02:24 2014 UTC
@@ -4375,15 +4375,6 @@
   }
   __ bind(&not_applicable);
 }
-
-
-void LCodeGen::DoArrayShift(LArrayShift* instr) {
-  ASSERT(ToRegister(instr->context()).is(rsi));
-  ASSERT(ToRegister(instr->object()).is(rax));
-  ASSERT(ToRegister(instr->result()).is(rax));
-  ArrayShiftStub stub(isolate(), instr->hydrogen()->kind());
-  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
-}


 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.cc Mon Jun 2 05:33:35 2014 UTC +++ /branches/bleeding_edge/src/x64/lithium-x64.cc Mon Jun 2 07:02:24 2014 UTC
@@ -2256,14 +2256,6 @@
     return MarkAsCall(result, instr);
   }
 }
-
-
-LInstruction* LChunkBuilder::DoArrayShift(HArrayShift* instr) {
-  LOperand* object = UseFixed(instr->object(), rax);
-  LOperand* context = UseFixed(instr->context(), rsi);
-  LArrayShift* result = new(zone()) LArrayShift(context, object);
- return MarkAsCall(DefineFixed(result, rax), instr, CANNOT_DEOPTIMIZE_EAGERLY);
-}


 LInstruction* LChunkBuilder::DoTrapAllocationMemento(
=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.h Mon Jun 2 05:33:35 2014 UTC +++ /branches/bleeding_edge/src/x64/lithium-x64.h Mon Jun 2 07:02:24 2014 UTC
@@ -26,7 +26,6 @@
   V(ArgumentsLength)                            \
   V(ArithmeticD)                                \
   V(ArithmeticT)                                \
-  V(ArrayShift)                                 \
   V(BitI)                                       \
   V(BoundsCheck)                                \
   V(Branch)                                     \
@@ -2245,21 +2244,6 @@
 };


-class LArrayShift V8_FINAL : public LTemplateInstruction<1, 2, 0> {
- public:
-  LArrayShift(LOperand* context, LOperand* object) {
-    inputs_[0] = context;
-    inputs_[1] = object;
-  }
-
-  LOperand* context() const { return inputs_[0]; }
-  LOperand* object() const { return inputs_[1]; }
-
-  DECLARE_CONCRETE_INSTRUCTION(ArrayShift, "array-shift")
-  DECLARE_HYDROGEN_ACCESSOR(ArrayShift)
-};
-
-
class LTrapAllocationMemento V8_FINAL : public LTemplateInstruction<0, 1, 1> {
  public:
   LTrapAllocationMemento(LOperand* object,
=======================================
--- /branches/bleeding_edge/src/x87/code-stubs-x87.cc Wed May 28 08:21:43 2014 UTC +++ /branches/bleeding_edge/src/x87/code-stubs-x87.cc Mon Jun 2 07:02:24 2014 UTC
@@ -321,16 +321,6 @@
   descriptor->deoptimization_handler_ =
       FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss);
 }
-
-
-void ArrayShiftStub::InitializeInterfaceDescriptor(
-    CodeStubInterfaceDescriptor* descriptor) {
-  static Register registers[] = { eax };
-  descriptor->register_param_count_ = 1;
-  descriptor->register_params_ = registers;
-  descriptor->deoptimization_handler_ =
-      Builtins::c_function_address(Builtins::c_ArrayShift);
-}


 void BinaryOpICStub::InitializeInterfaceDescriptor(
=======================================
--- /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc Thu May 29 13:11:55 2014 UTC +++ /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc Mon Jun 2 07:02:24 2014 UTC
@@ -4231,15 +4231,6 @@
   }
   __ bind(&not_applicable);
 }
-
-
-void LCodeGen::DoArrayShift(LArrayShift* instr) {
-  ASSERT(ToRegister(instr->context()).is(esi));
-  ASSERT(ToRegister(instr->object()).is(eax));
-  ASSERT(ToRegister(instr->result()).is(eax));
-  ArrayShiftStub stub(isolate(), instr->hydrogen()->kind());
-  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
-}


 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) {
=======================================
--- /branches/bleeding_edge/src/x87/lithium-x87.cc Thu May 29 13:11:55 2014 UTC +++ /branches/bleeding_edge/src/x87/lithium-x87.cc Mon Jun 2 07:02:24 2014 UTC
@@ -2307,14 +2307,6 @@
     return MarkAsCall(result, instr);
   }
 }
-
-
-LInstruction* LChunkBuilder::DoArrayShift(HArrayShift* instr) {
-  LOperand* object = UseFixed(instr->object(), eax);
-  LOperand* context = UseFixed(instr->context(), esi);
-  LArrayShift* result = new(zone()) LArrayShift(context, object);
- return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY);
-}


 LInstruction* LChunkBuilder::DoTrapAllocationMemento(
=======================================
--- /branches/bleeding_edge/src/x87/lithium-x87.h Wed May 28 08:19:43 2014 UTC +++ /branches/bleeding_edge/src/x87/lithium-x87.h Mon Jun 2 07:02:24 2014 UTC
@@ -26,7 +26,6 @@
   V(ArgumentsLength)                            \
   V(ArithmeticD)                                \
   V(ArithmeticT)                                \
-  V(ArrayShift)                                 \
   V(BitI)                                       \
   V(BoundsCheck)                                \
   V(Branch)                                     \
@@ -2292,21 +2291,6 @@
 };


-class LArrayShift V8_FINAL : public LTemplateInstruction<1, 2, 0> {
- public:
-  LArrayShift(LOperand* context, LOperand* object) {
-    inputs_[0] = context;
-    inputs_[1] = object;
-  }
-
-  LOperand* context() const { return inputs_[0]; }
-  LOperand* object() const { return inputs_[1]; }
-
-  DECLARE_CONCRETE_INSTRUCTION(ArrayShift, "array-shift")
-  DECLARE_HYDROGEN_ACCESSOR(ArrayShift)
-};
-
-
class LTrapAllocationMemento V8_FINAL : public LTemplateInstruction<0, 1, 1> {
  public:
   LTrapAllocationMemento(LOperand* object,

--
--
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/d/optout.

Reply via email to