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

Unified Diff: src/hydrogen-instructions.h

Issue 296113008: Allow HPushArgument to handle more than one argument. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase, and use int instead of unsigned 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 05b31162af5730e4b83bb5844ed1aad40615f823..0ecad2369ae14982a98c13f6f4548d54e7895943 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -127,7 +127,7 @@ class LChunkBuilder;
V(OsrEntry) \
V(Parameter) \
V(Power) \
- V(PushArgument) \
+ V(PushArguments) \
V(RegExpLiteral) \
V(Return) \
V(Ror) \
@@ -2175,23 +2175,66 @@ class HLeaveInlined V8_FINAL : public HTemplateInstruction<0> {
};
-class HPushArgument V8_FINAL : public HUnaryOperation {
+class HPushArguments V8_FINAL : public HInstruction {
public:
- DECLARE_INSTRUCTION_FACTORY_P1(HPushArgument, HValue*);
+ DECLARE_INSTRUCTION_FACTORY_P1(HPushArguments, Zone*);
+ DECLARE_INSTRUCTION_FACTORY_P2(HPushArguments, Zone*, HValue*);
+ DECLARE_INSTRUCTION_FACTORY_P3(HPushArguments, Zone*, HValue*, HValue*);
+ DECLARE_INSTRUCTION_FACTORY_P4(HPushArguments, Zone*,
+ HValue*, HValue*, HValue*);
+ DECLARE_INSTRUCTION_FACTORY_P5(HPushArguments, Zone*,
+ HValue*, HValue*, HValue*, HValue*);
virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
return Representation::Tagged();
}
- virtual int argument_delta() const V8_OVERRIDE { return 1; }
- HValue* argument() { return OperandAt(0); }
+ virtual int argument_delta() const V8_OVERRIDE { return inputs_.length(); }
+ HValue* argument(int i) { return OperandAt(i); }
- DECLARE_CONCRETE_INSTRUCTION(PushArgument)
+ virtual int OperandCount() V8_FINAL V8_OVERRIDE { return inputs_.length(); }
+ virtual HValue* OperandAt(int i) const V8_FINAL V8_OVERRIDE {
+ return inputs_[i];
+ }
+
+ void AddArgument(HValue* arg) {
+ inputs_.Add(NULL, zone_);
+ SetOperandAt(inputs_.length() - 1, arg);
+ }
+
+ DECLARE_CONCRETE_INSTRUCTION(PushArguments)
+
+ protected:
+ virtual void InternalSetOperandAt(int i, HValue* value) V8_FINAL V8_OVERRIDE {
+ inputs_[i] = value;
+ }
private:
- explicit HPushArgument(HValue* value) : HUnaryOperation(value) {
+ HPushArguments(Zone* zone,
+ HValue* arg1 = NULL, HValue* arg2 = NULL,
+ HValue* arg3 = NULL, HValue* arg4 = NULL)
+ : HInstruction(HType::Tagged()), zone_(zone), inputs_(4, zone) {
set_representation(Representation::Tagged());
+ if (arg1) {
+ inputs_.Add(NULL, zone);
+ SetOperandAt(0, arg1);
+ }
+ if (arg2) {
+ inputs_.Add(NULL, zone);
+ SetOperandAt(1, arg2);
+ }
+ if (arg3) {
+ inputs_.Add(NULL, zone);
+ SetOperandAt(2, arg3);
+ }
+ if (arg4) {
+ inputs_.Add(NULL, zone);
+ SetOperandAt(3, arg4);
+ }
}
+
+ Zone* zone_;
+ ZoneList<HValue*> inputs_;
};
« 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