Index: src/code-stubs.h |
diff --git a/src/code-stubs.h b/src/code-stubs.h |
index c567e7544b83e48fb88458b93aa97b1b3d2a6801..62eb71f05014ce3a94e85409b346b61a4979195c 100644 |
--- a/src/code-stubs.h |
+++ b/src/code-stubs.h |
@@ -78,6 +78,7 @@ namespace internal { |
V(CEntry) \ |
V(JSEntry) \ |
V(KeyedLoadElement) \ |
+ V(ArrayPush) \ |
V(ArrayNoArgumentConstructor) \ |
V(ArraySingleArgumentConstructor) \ |
V(ArrayNArgumentsConstructor) \ |
@@ -1151,6 +1152,30 @@ class BinaryOpICStub : public HydrogenCodeStub { |
}; |
+class ArrayPushStub: public PlatformCodeStub { |
+ public: |
+ ArrayPushStub(ElementsKind kind, int argc) { |
+ bit_field_ = ElementsKindBits::encode(kind) | ArgcBits::encode(argc); |
+ } |
+ |
+ void Generate(MacroAssembler* masm); |
+ |
+ private: |
+ int arguments_count() { return ArgcBits::decode(bit_field_); } |
+ ElementsKind elements_kind() { |
+ return ElementsKindBits::decode(bit_field_); |
+ } |
+ |
+ virtual CodeStub::Major MajorKey() { return ArrayPush; } |
+ virtual int MinorKey() { return bit_field_; } |
+ |
+ class ElementsKindBits: public BitField<ElementsKind, 0, 3> {}; |
+ class ArgcBits: public BitField<int, 3, Code::kArgumentsBits> {}; |
+ |
+ int bit_field_; |
+}; |
+ |
+ |
// TODO(bmeurer): Merge this into the BinaryOpICStub once we have proper tail |
// call support for stubs in Hydrogen. |
class BinaryOpICWithAllocationSiteStub V8_FINAL : public PlatformCodeStub { |