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

Side by Side Diff: src/hydrogen-instructions.h

Issue 308793010: Inline Array.shift() fast path instead of using a code stub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ 6 #define V8_HYDROGEN_INSTRUCTIONS_H_
7 7
8 #include "v8.h" 8 #include "v8.h"
9 9
10 #include "allocation.h" 10 #include "allocation.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \ 45 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \
46 V(AbnormalExit) \ 46 V(AbnormalExit) \
47 V(AccessArgumentsAt) \ 47 V(AccessArgumentsAt) \
48 V(Add) \ 48 V(Add) \
49 V(Allocate) \ 49 V(Allocate) \
50 V(ApplyArguments) \ 50 V(ApplyArguments) \
51 V(ArgumentsElements) \ 51 V(ArgumentsElements) \
52 V(ArgumentsLength) \ 52 V(ArgumentsLength) \
53 V(ArgumentsObject) \ 53 V(ArgumentsObject) \
54 V(ArrayShift) \
55 V(Bitwise) \ 54 V(Bitwise) \
56 V(BlockEntry) \ 55 V(BlockEntry) \
57 V(BoundsCheck) \ 56 V(BoundsCheck) \
58 V(BoundsCheckBaseIndexInformation) \ 57 V(BoundsCheckBaseIndexInformation) \
59 V(Branch) \ 58 V(Branch) \
60 V(CallWithDescriptor) \ 59 V(CallWithDescriptor) \
61 V(CallJSFunction) \ 60 V(CallJSFunction) \
62 V(CallFunction) \ 61 V(CallFunction) \
63 V(CallNew) \ 62 V(CallNew) \
64 V(CallNewArray) \ 63 V(CallNewArray) \
(...skipping 7018 matching lines...) Expand 10 before | Expand all | Expand 10 after
7083 set_representation(Representation::Tagged()); 7082 set_representation(Representation::Tagged());
7084 } 7083 }
7085 7084
7086 Unique<Map> original_map_; 7085 Unique<Map> original_map_;
7087 Unique<Map> transitioned_map_; 7086 Unique<Map> transitioned_map_;
7088 ElementsKind from_kind_; 7087 ElementsKind from_kind_;
7089 ElementsKind to_kind_; 7088 ElementsKind to_kind_;
7090 }; 7089 };
7091 7090
7092 7091
7093 class HArrayShift V8_FINAL : public HTemplateInstruction<2> {
7094 public:
7095 static HArrayShift* New(Zone* zone,
7096 HValue* context,
7097 HValue* object,
7098 ElementsKind kind) {
7099 return new(zone) HArrayShift(context, object, kind);
7100 }
7101
7102 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
7103 return Representation::Tagged();
7104 }
7105
7106 HValue* context() const { return OperandAt(0); }
7107 HValue* object() const { return OperandAt(1); }
7108 ElementsKind kind() const { return kind_; }
7109
7110 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
7111
7112 DECLARE_CONCRETE_INSTRUCTION(ArrayShift);
7113
7114 protected:
7115 virtual bool DataEquals(HValue* other) V8_OVERRIDE {
7116 HArrayShift* that = HArrayShift::cast(other);
7117 return this->kind_ == that->kind_;
7118 }
7119
7120 private:
7121 HArrayShift(HValue* context, HValue* object, ElementsKind kind)
7122 : kind_(kind) {
7123 SetOperandAt(0, context);
7124 SetOperandAt(1, object);
7125 SetChangesFlag(kArrayLengths);
7126 SetChangesFlag(kNewSpacePromotion);
7127 set_representation(Representation::Tagged());
7128 if (IsFastSmiOrObjectElementsKind(kind)) {
7129 SetChangesFlag(kArrayElements);
7130 } else {
7131 SetChangesFlag(kDoubleArrayElements);
7132 }
7133 }
7134
7135 ElementsKind kind_;
7136 };
7137
7138
7139 class HStringAdd V8_FINAL : public HBinaryOperation { 7092 class HStringAdd V8_FINAL : public HBinaryOperation {
7140 public: 7093 public:
7141 static HInstruction* New(Zone* zone, 7094 static HInstruction* New(Zone* zone,
7142 HValue* context, 7095 HValue* context,
7143 HValue* left, 7096 HValue* left,
7144 HValue* right, 7097 HValue* right,
7145 PretenureFlag pretenure_flag = NOT_TENURED, 7098 PretenureFlag pretenure_flag = NOT_TENURED,
7146 StringAddFlags flags = STRING_ADD_CHECK_BOTH, 7099 StringAddFlags flags = STRING_ADD_CHECK_BOTH,
7147 Handle<AllocationSite> allocation_site = 7100 Handle<AllocationSite> allocation_site =
7148 Handle<AllocationSite>::null()); 7101 Handle<AllocationSite>::null());
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
7717 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7670 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7718 }; 7671 };
7719 7672
7720 7673
7721 #undef DECLARE_INSTRUCTION 7674 #undef DECLARE_INSTRUCTION
7722 #undef DECLARE_CONCRETE_INSTRUCTION 7675 #undef DECLARE_CONCRETE_INSTRUCTION
7723 7676
7724 } } // namespace v8::internal 7677 } } // namespace v8::internal
7725 7678
7726 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7679 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« src/hydrogen.cc ('K') | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698