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

Unified Diff: src/hydrogen-instructions.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/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 1cdca4c46efa14ac1cfb764d52fff9c641790749..85d1e7549fa38aa6a051ab0f0feaa970878674ec 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -50,6 +50,7 @@ class LChunkBuilder;
V(ArgumentsElements) \
V(ArgumentsLength) \
V(ArgumentsObject) \
+ V(ArrayShift) \
V(Bitwise) \
V(BlockEntry) \
V(BoundsCheck) \
@@ -7077,6 +7078,51 @@ 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(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,
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698