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

Unified Diff: src/hydrogen-instructions.cc

Issue 5964005: Shorten live ranges of argument subexpressions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years 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
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 3f39888e9bfbb6dfb547274339b3b5f2c9092412..e5ae1b2da8cc43130e8f92c9a8516863ae4d9d5a 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -521,20 +521,14 @@ void HInstruction::Verify() const {
#endif
-HCall::HCall(int count) : arguments_(Zone::NewArray<HValue*>(count), count) {
- for (int i = 0; i < count; ++i) arguments_[i] = NULL;
+HCall::HCall(int argument_count) : argument_count_(argument_count) {
set_representation(Representation::Tagged());
SetFlagMask(AllSideEffects());
}
void HCall::PrintDataTo(StringStream* stream) const {
- stream->Add("(");
- for (int i = 0; i < arguments_.length(); ++i) {
- if (i != 0) stream->Add(", ");
- arguments_.at(i)->PrintNameTo(stream);
- }
- stream->Add(")");
+ stream->Add("#%d", argument_count());
}
@@ -554,12 +548,6 @@ void HAccessArgumentsAt::PrintDataTo(StringStream* stream) const {
}
-void HCall::SetArgumentAt(int index, HPushArgument* push_argument) {
- push_argument->set_argument_index(index);
- SetOperandAt(index, push_argument);
-}
-
-
void HCallConstantFunction::PrintDataTo(StringStream* stream) const {
if (IsApplyFunction()) {
stream->Add("SPECIAL function: apply");
@@ -662,14 +650,6 @@ void HTypeofIs::PrintDataTo(StringStream* stream) const {
}
-void HPushArgument::PrintDataTo(StringStream* stream) const {
- HUnaryOperation::PrintDataTo(stream);
- if (argument_index() != -1) {
- stream->Add(" [%d]", argument_index_);
- }
-}
-
-
void HChange::PrintDataTo(StringStream* stream) const {
HUnaryOperation::PrintDataTo(stream);
stream->Add(" %s to %s", from_.Mnemonic(), to_.Mnemonic());
@@ -701,12 +681,7 @@ void HCheckFunction::PrintDataTo(StringStream* stream) const {
void HCallKeyed::PrintDataTo(StringStream* stream) const {
stream->Add("[");
key()->PrintNameTo(stream);
- stream->Add("](");
- for (int i = 1; i < arguments_.length(); ++i) {
- if (i != 1) stream->Add(", ");
- arguments_.at(i)->PrintNameTo(stream);
- }
- stream->Add(")");
+ stream->Add("]");
}
@@ -724,12 +699,23 @@ void HCallGlobal::PrintDataTo(StringStream* stream) const {
}
+void HCallKnownGlobal::PrintDataTo(StringStream* stream) const {
+ receiver()->PrintNameTo(stream);
+}
+
+
+void HCallNew::PrintDataTo(StringStream* stream) const {
+ constructor()->PrintNameTo(stream);
+}
+
+
void HCallRuntime::PrintDataTo(StringStream* stream) const {
SmartPointer<char> name_string = name()->ToCString();
stream->Add("%s ", *name_string);
HCall::PrintDataTo(stream);
}
+
void HCallStub::PrintDataTo(StringStream* stream) const {
stream->Add("%s(%d)",
CodeStub::MajorName(major_key_, false),

Powered by Google App Engine
This is Rietveld 408576698