Inline Array.shift() fast path instead of using a code stub.
authorbmeurer@chromium.org <bmeurer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 2 Jun 2014 07:02:24 +0000 (07:02 +0000)
committerbmeurer@chromium.org <bmeurer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 2 Jun 2014 07:02:24 +0000 (07:02 +0000)
TEST=mjsunit/array-shift,mjsunit/array-shift2,mjsunit/array-shift3
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/308793010

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21592 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

29 files changed:
src/arm/code-stubs-arm.cc
src/arm/lithium-arm.cc
src/arm/lithium-arm.h
src/arm/lithium-codegen-arm.cc
src/arm64/code-stubs-arm64.cc
src/arm64/lithium-arm64.cc
src/arm64/lithium-arm64.h
src/arm64/lithium-codegen-arm64.cc
src/code-stubs-hydrogen.cc
src/code-stubs.h
src/hydrogen-instructions.cc
src/hydrogen-instructions.h
src/hydrogen.cc
src/ia32/code-stubs-ia32.cc
src/ia32/lithium-codegen-ia32.cc
src/ia32/lithium-ia32.cc
src/ia32/lithium-ia32.h
src/mips/code-stubs-mips.cc
src/mips/lithium-codegen-mips.cc
src/mips/lithium-mips.cc
src/mips/lithium-mips.h
src/x64/code-stubs-x64.cc
src/x64/lithium-codegen-x64.cc
src/x64/lithium-x64.cc
src/x64/lithium-x64.h
src/x87/code-stubs-x87.cc
src/x87/lithium-codegen-x87.cc
src/x87/lithium-x87.cc
src/x87/lithium-x87.h

index 599e4be078e483d09792ecceb511cdf42e6f7194..57d84e82fe26bdad96942647e2ff44bd9eea5d5c 100644 (file)
@@ -319,16 +319,6 @@ void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
 }
 
 
-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(
     CodeStubInterfaceDescriptor* descriptor) {
   static Register registers[] = { r1, r0 };
index ac192f6731218d10f99915092ad7d528666e2ba0..4073f8d8e33c1102c92c909fc43575429fef35e1 100644 (file)
@@ -2284,14 +2284,6 @@ LInstruction* LChunkBuilder::DoTransitionElementsKind(
 }
 
 
-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(
     HTrapAllocationMemento* instr) {
   LOperand* object = UseRegister(instr->object());
index 52c479910286248a45ad27f63712ece5a8393c38..a7c6ac485bb0a1c2d21648022b82af4f83e30e10 100644 (file)
@@ -26,7 +26,6 @@ class LCodeGen;
   V(ArgumentsLength)                            \
   V(ArithmeticD)                                \
   V(ArithmeticT)                                \
-  V(ArrayShift)                                 \
   V(BitI)                                       \
   V(BoundsCheck)                                \
   V(Branch)                                     \
@@ -2283,21 +2282,6 @@ class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 1> {
 };
 
 
-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,
index b342bf44b63c73570b60f929f5018f710c1303c6..846c25041dc84ad6eb05da808919a78c390dd313 100644 (file)
@@ -4402,15 +4402,6 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
 }
 
 
-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) {
   Register object = ToRegister(instr->object());
   Register temp = ToRegister(instr->temp());
index bbcbdd3f14a7f68bf8ad19c5716187bb0ee63643..c8558957b173a390ec8deaffb115db85d8f184f3 100644 (file)
@@ -356,17 +356,6 @@ void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
 }
 
 
-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(
     CodeStubInterfaceDescriptor* descriptor) {
   // x1: left operand
index db284632aaf4feab162b4c5ac93928ec2c31f296..02127066536aa8dead082292d77f04a50b4f21de 100644 (file)
@@ -2517,14 +2517,6 @@ LInstruction* LChunkBuilder::DoTransitionElementsKind(
 }
 
 
-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(
     HTrapAllocationMemento* instr) {
   LOperand* object = UseRegister(instr->object());
index 1487226c7b5839c25e47455787e405c3f4e3d7dd..be053ddbbda026ab18a97d07433d04b43f8fbcc3 100644 (file)
@@ -28,7 +28,6 @@ class LCodeGen;
   V(ArgumentsLength)                            \
   V(ArithmeticD)                                \
   V(ArithmeticT)                                \
-  V(ArrayShift)                                 \
   V(BitI)                                       \
   V(BitS)                                       \
   V(BoundsCheck)                                \
@@ -2888,21 +2887,6 @@ class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 2> {
 };
 
 
-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) {
index ef492a66ea25fed1954c69c5747e36eaf2125fe3..1d4f6ebd16fd766d6461a4fba87b2c2e87dc52d2 100644 (file)
@@ -5754,15 +5754,6 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
 }
 
 
-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) {
   Register object = ToRegister(instr->object());
   Register temp1 = ToRegister(instr->temp1());
index f60dea2e679534fe496fc1972734786e18b5338a..96ee32e614caf2d041cdf8338c3f5ab1c616b638 100644 (file)
@@ -1120,86 +1120,6 @@ Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() {
 }
 
 
-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(
     HValue* js_function,
     HValue* native_context,
index c7fc94496307a45e8e12e87109597fafd03d208e..cb0edc698b026d48921450026ade5c69dd6b21f6 100644 (file)
@@ -16,7 +16,6 @@ namespace internal {
 
 // 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 ElementsTransitionAndStoreStub : public HydrogenCodeStub {
 };
 
 
-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)
index a91b9b7f343362043dbbf1d58f6a80c4b4ee5f59..6303cd13c7a583d13e906651c7cb81e39698c49d 100644 (file)
@@ -779,11 +779,9 @@ bool HInstruction::CanDeoptimize() {
     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 @@ bool HInstruction::CanDeoptimize() {
     case HValue::kBitwise:
     case HValue::kBoundsCheck:
     case HValue::kBranch:
+    case HValue::kCallJSFunction:
     case HValue::kCallRuntime:
     case HValue::kChange:
     case HValue::kCheckHeapObject:
@@ -3609,12 +3608,6 @@ void HTransitionElementsKind::PrintDataTo(StringStream* stream) {
 }
 
 
-void HArrayShift::PrintDataTo(StringStream* stream) {
-  object()->PrintNameTo(stream);
-  stream->Add(" [%s]", ElementsAccessor::ForKind(kind())->name());
-}
-
-
 void HLoadGlobalCell::PrintDataTo(StringStream* stream) {
   stream->Add("[%p]", *cell().handle());
   if (!details_.IsDontDelete()) stream->Add(" (deleteable)");
index ef88d2b9a5082538bfec73368aa6c4e5158bf1af..d413af0c15455c3ea2f82a2f61938fd5526f5c31 100644 (file)
@@ -51,7 +51,6 @@ class LChunkBuilder;
   V(ArgumentsElements)                         \
   V(ArgumentsLength)                           \
   V(ArgumentsObject)                           \
-  V(ArrayShift)                                \
   V(Bitwise)                                   \
   V(BlockEntry)                                \
   V(BoundsCheck)                               \
@@ -7090,52 +7089,6 @@ class HTransitionElementsKind V8_FINAL : public HTemplateInstruction<2> {
 };
 
 
-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,
index 851a05d6f8082126eeb824c89c3b27216c754162..c836dc21653129de5d7255a3c8d8b2e9c63e71c0 100644 (file)
@@ -7940,13 +7940,96 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall(
           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;
+
+      {
+        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);
 
-      receiver = AddCheckMap(receiver, receiver_map);
-      HInstruction* result = NewUncasted<HArrayShift>(receiver, kind);
-      ast_context()->ReturnInstruction(result, expr->id());
+            // 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:
index abf2a6344d9f8abde0bc0dda7053afbb24612533..d472d1983964a408bc1bc8b32a27d98c1eac99ea 100644 (file)
@@ -323,16 +323,6 @@ void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
 }
 
 
-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(
     CodeStubInterfaceDescriptor* descriptor) {
   static Register registers[] = { edx, eax };
index c2d602be656b681fe9a9333fbf604a62afbc49d6..d468f6970cd9553d91572cd42d8d451d5c5ae210 100644 (file)
@@ -4298,15 +4298,6 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
 }
 
 
-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) {
   class DeferredStringCharCodeAt V8_FINAL : public LDeferredCode {
    public:
index 5d024faaf46b2b38d5fb87e16d829a8f99fd933f..6272f234c0848515a7ca126ed29eea4761dc979c 100644 (file)
@@ -2319,14 +2319,6 @@ LInstruction* LChunkBuilder::DoTransitionElementsKind(
 }
 
 
-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(
     HTrapAllocationMemento* instr) {
   LOperand* object = UseRegister(instr->object());
index 731f66be6c4ced5c836136c46c54af1b60015ff7..d7b2fab5f08b389a33c6db02d7497ef520039b87 100644 (file)
@@ -26,7 +26,6 @@ class LCodeGen;
   V(ArgumentsLength)                            \
   V(ArithmeticD)                                \
   V(ArithmeticT)                                \
-  V(ArrayShift)                                 \
   V(BitI)                                       \
   V(BoundsCheck)                                \
   V(Branch)                                     \
@@ -2282,21 +2281,6 @@ class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 2> {
 };
 
 
-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,
index 962c2f030e24eafc7bf538a735d3e91b67277dac..ae23a6e09f00132bcafbbbbfb1117deef342d2c8 100644 (file)
@@ -320,16 +320,6 @@ void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
 }
 
 
-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(
     CodeStubInterfaceDescriptor* descriptor) {
   static Register registers[] = { a1, a0 };
index 950ece9a83d86ee99d90b5c4448a79449bb336d5..cb22cd615e956b14d6fc8e5dd8e83ef578d14adc 100644 (file)
@@ -4404,15 +4404,6 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
 }
 
 
-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) {
   Register object = ToRegister(instr->object());
   Register temp = ToRegister(instr->temp());
index 333d8499c4fa2e6474f23d82116671b183c587d7..c7939157f9cc1a95d94dde2d652f56bf331dcb8d 100644 (file)
@@ -2235,14 +2235,6 @@ LInstruction* LChunkBuilder::DoTransitionElementsKind(
 }
 
 
-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(
     HTrapAllocationMemento* instr) {
   LOperand* object = UseRegister(instr->object());
index 20345b066effa5bcdd5f235a5dd70187a502fdd0..211d37bca5105e66394211f5199a1b2181aa8376 100644 (file)
@@ -26,7 +26,6 @@ class LCodeGen;
   V(ArgumentsLength)                            \
   V(ArithmeticD)                                \
   V(ArithmeticT)                                \
-  V(ArrayShift)                                 \
   V(BitI)                                       \
   V(BoundsCheck)                                \
   V(Branch)                                     \
@@ -2238,21 +2237,6 @@ class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 1> {
 };
 
 
-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,
index 20d722c40a2534f86bf86e9781b424358f5444f1..bda7938c2e968198709679586edfe09f86301365 100644 (file)
@@ -319,16 +319,6 @@ void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
 }
 
 
-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(
     CodeStubInterfaceDescriptor* descriptor) {
   static Register registers[] = { rdx, rax };
index 2cfda626613b41c248dad99fb945c5f1a91eedb2..3033c46d99b69ffc605f61c58ca75c9ffbb445b2 100644 (file)
@@ -4377,15 +4377,6 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
 }
 
 
-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) {
   Register object = ToRegister(instr->object());
   Register temp = ToRegister(instr->temp());
index 5465056bc7fc2e36c5bb7677cdc9fd25a2b02aba..81ae43e25bb02fc21a746da1d27816a993bb829e 100644 (file)
@@ -2258,14 +2258,6 @@ LInstruction* LChunkBuilder::DoTransitionElementsKind(
 }
 
 
-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(
     HTrapAllocationMemento* instr) {
   LOperand* object = UseRegister(instr->object());
index 96d349e7989af6206febac26703ad0781b685921..4ccd02173bde1859b5c0a012ee1aae050cb58107 100644 (file)
@@ -26,7 +26,6 @@ class LCodeGen;
   V(ArgumentsLength)                            \
   V(ArithmeticD)                                \
   V(ArithmeticT)                                \
-  V(ArrayShift)                                 \
   V(BitI)                                       \
   V(BoundsCheck)                                \
   V(Branch)                                     \
@@ -2245,21 +2244,6 @@ class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 2> {
 };
 
 
-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,
index 8c23bf30bd409e4145126472c1a78bb2066b8d13..1ca9dd79eb610276b282a0d96317892b03fc5431 100644 (file)
@@ -323,16 +323,6 @@ void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
 }
 
 
-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(
     CodeStubInterfaceDescriptor* descriptor) {
   static Register registers[] = { edx, eax };
index c15e5225b5cff4647ade8e4a143b29179ec7b0bf..e391ebbdc5847b59f9b5ffe5158e80e4f06ca383 100644 (file)
@@ -4233,15 +4233,6 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
 }
 
 
-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) {
   class DeferredStringCharCodeAt V8_FINAL : public LDeferredCode {
    public:
index 0dddc32b1d498e3c03bd4db6e2d125416af5ff88..1a862fd88dc7c039adf05c20d4f0de0e58a06834 100644 (file)
@@ -2309,14 +2309,6 @@ LInstruction* LChunkBuilder::DoTransitionElementsKind(
 }
 
 
-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(
     HTrapAllocationMemento* instr) {
   LOperand* object = UseRegister(instr->object());
index 79c6c74ecc7dc0528a2a3309fb9f3819411af818..5c7b5899cee49f07f17f42bb395d25bca2f6965b 100644 (file)
@@ -26,7 +26,6 @@ class LCodeGen;
   V(ArgumentsLength)                            \
   V(ArithmeticD)                                \
   V(ArithmeticT)                                \
-  V(ArrayShift)                                 \
   V(BitI)                                       \
   V(BoundsCheck)                                \
   V(Branch)                                     \
@@ -2292,21 +2291,6 @@ class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 2> {
 };
 
 
-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,