Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: src/code-stubs.h

Issue 143213003: Turn ArrayPush into a stub specialized on the elements kind and argc. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Properly bind label Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698