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

Unified Diff: src/hydrogen-instructions.cc

Issue 6480030: Remove the uses of the arguments from all calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 10 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
« src/hydrogen-instructions.h ('K') | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index eb1c5927d28426fa127c1c4c543dc6cde5a5aac0..16100e46091d8a7a95287b10d718bcaf9a6112c0 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -290,61 +290,6 @@ void HLoadKeyedGeneric::InternalSetOperandAt(int index, HValue* value) {
}
-void HCallKeyed::InternalSetOperandAt(int index, HValue* value) {
- // The key and all the arguments are stored in the base class's arguments_
- // vector. The context is in the object itself. Ugly.
- if (index <= argument_count()) {
- arguments_[index] = value;
- } else {
- context_ = value;
- }
-}
-
-
-void HCallNamed::InternalSetOperandAt(int index, HValue* value) {
- // The arguments are in the base class's arguments_ vector. The context
- // is in the object itself.
- if (index < argument_count()) {
- arguments_[index] = value;
- } else {
- context_ = value;
- }
-}
-
-
-void HCallFunction::InternalSetOperandAt(int index, HValue* value) {
- // The arguments are in the base class's arguments_ vector. The context
- // is in the object itself.
- if (index < argument_count()) {
- arguments_[index] = value;
- } else {
- context_ = value;
- }
-}
-
-
-void HCallGlobal::InternalSetOperandAt(int index, HValue* value) {
- // The arguments are in the base class's arguments_ vector. The context
- // is in the object itself.
- if (index < argument_count()) {
- arguments_[index] = value;
- } else {
- context_ = value;
- }
-}
-
-
-void HCallNew::InternalSetOperandAt(int index, HValue* value) {
- // The arguments are in the base class's arguments_ vector. The context
- // is in the object itself.
- if (index < argument_count()) {
- arguments_[index] = value;
- } else {
- context_ = value;
- }
-}
-
-
void HStoreKeyedGeneric::InternalSetOperandAt(int index, HValue* value) {
if (index < 3) {
operands_[index] = value;
@@ -609,26 +554,64 @@ void HInstruction::Verify() {
#endif
-HCall::HCall(int count) : arguments_(Zone::NewArray<HValue*>(count), count) {
- for (int i = 0; i < count; ++i) arguments_[i] = NULL;
- set_representation(Representation::Tagged());
- SetAllSideEffects();
+void HCall::PrintDataTo(StringStream* stream) const {
+ stream->Add("#%d", argument_count());
}
-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);
+void HUnaryCall::PrintDataTo(StringStream* stream) const {
+ value()->PrintNameTo(stream);
+ stream->Add(" ");
+ HCall::PrintDataTo(stream);
+}
+
+
+void HBinaryCall::PrintDataTo(StringStream* stream) const {
+ first()->PrintNameTo(stream);
+ stream->Add(" ");
+ second()->PrintNameTo(stream);
+ stream->Add(" ");
+ HCall::PrintDataTo(stream);
+}
+
+
+void HCallConstantFunction::PrintDataTo(StringStream* stream) const {
+ if (IsApplyFunction()) {
+ stream->Add("optimized apply ");
+ } else {
+ stream->Add("%o ", function()->shared()->DebugName());
}
- stream->Add(")");
+ HCall::PrintDataTo(stream);
+}
+
+
+void HCallNamed::PrintDataTo(StringStream* stream) const {
+ stream->Add("%o ", *name());
+ HUnaryCall::PrintDataTo(stream);
+}
+
+
+void HCallGlobal::PrintDataTo(StringStream* stream) const {
+ stream->Add("%o ", *name());
+ HUnaryCall::PrintDataTo(stream);
+}
+
+
+void HCallKnownGlobal::PrintDataTo(StringStream* stream) const {
+ stream->Add("o ", target()->shared()->DebugName());
+ HCall::PrintDataTo(stream);
+}
+
+
+void HCallRuntime::PrintDataTo(StringStream* stream) const {
+ stream->Add("%o ", *name());
+ HCall::PrintDataTo(stream);
}
void HClassOfTest::PrintDataTo(StringStream* stream) const {
stream->Add("class_of_test(");
- value()->PrintTo(stream);
+ value()->PrintNameTo(stream);
stream->Add(", \"%o\")", *class_name());
}
@@ -642,22 +625,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");
- } else {
- stream->Add("%s", *(function()->shared()->DebugName()->ToCString()));
- }
- HCall::PrintDataTo(stream);
-}
-
-
void HControlInstruction::PrintDataTo(StringStream* stream) const {
if (FirstSuccessor() != NULL) {
int first_id = FirstSuccessor()->block_id();
@@ -745,14 +712,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());
@@ -781,44 +740,10 @@ 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(")");
-}
-
-
-void HCallNamed::PrintDataTo(StringStream* stream) const {
- SmartPointer<char> name_string = name()->ToCString();
- stream->Add("%s ", *name_string);
- HCall::PrintDataTo(stream);
-}
-
-
-void HCallGlobal::PrintDataTo(StringStream* stream) const {
- SmartPointer<char> name_string = name()->ToCString();
- stream->Add("%s ", *name_string);
- HCall::PrintDataTo(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 {
- HUnaryOperation::PrintDataTo(stream);
- stream->Add(" %s(%d)",
- CodeStub::MajorName(major_key_, false),
- argument_count_);
+ stream->Add("%s ",
+ CodeStub::MajorName(major_key_, false));
+ HUnaryCall::PrintDataTo(stream);
}
« src/hydrogen-instructions.h ('K') | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698