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

Unified Diff: src/code-stubs.h

Issue 279743002: Improve Array.shift() performance for small arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Cosmetic fix Created 6 years, 7 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/arm64/lithium-codegen-arm64.cc ('k') | src/code-stubs-hydrogen.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 8380266d92edf0b13f644f38f3f2917c1fdaf119..b5c07e5a09ef774838257860e10c209060901e42 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -16,6 +16,7 @@ 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) \
@@ -2466,6 +2467,36 @@ 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)
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698