Reviewers: Massi,
Message:
Hi Massi,
Here is the small change I mentioned a few days ago, to print the key
dehoisting
in hydrogen output. I've verified that it doesn't confuse the c1visualizer
to
see <OBJ>[<KEY> + <number>]. It can still find all usages of <KEY>.
Description:
Add dehoisting to the string printout of hydrogen and lithium instructions.
This is nice when looking at hydrogen graphs, to see the real key offset.
[email protected]
BUG=
Please review this at https://codereview.chromium.org/11348176/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/arm/lithium-arm.h
M src/arm/lithium-arm.cc
M src/hydrogen-instructions.cc
M src/ia32/lithium-ia32.h
M src/ia32/lithium-ia32.cc
M src/mips/lithium-mips.h
M src/mips/lithium-mips.cc
M src/x64/lithium-x64.h
M src/x64/lithium-x64.cc
Index: src/arm/lithium-arm.cc
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc
index
5cd691461f6308949bb47ef62e66fc5f4edcd355..8cf2153fec73652a95f8c900e48164a519b75771
100644
--- a/src/arm/lithium-arm.cc
+++ b/src/arm/lithium-arm.cc
@@ -373,11 +373,27 @@ void LStoreNamedGeneric::PrintDataTo(StringStream*
stream) {
}
+void LLoadKeyed::PrintDataTo(StringStream* stream) {
+ elements()->PrintTo(stream);
+ stream->Add("[");
+ key()->PrintTo(stream);
+ if (hydrogen()->IsDehoisted()) {
+ stream->Add(" + %d]", additional_index());
+ } else {
+ stream->Add("]");
+ }
+}
+
+
void LStoreKeyed::PrintDataTo(StringStream* stream) {
elements()->PrintTo(stream);
stream->Add("[");
key()->PrintTo(stream);
- stream->Add("] <- ");
+ if (hydrogen()->IsDehoisted()) {
+ stream->Add(" + %d] <-", additional_index());
+ } else {
+ stream->Add("] <- ");
+ }
value()->PrintTo(stream);
}
Index: src/arm/lithium-arm.h
diff --git a/src/arm/lithium-arm.h b/src/arm/lithium-arm.h
index
0367fd3234abed7a836df1ca8d95bf1828476732..e25ba9d42761e1d70bd6e0cc18ffcf074af2e163
100644
--- a/src/arm/lithium-arm.h
+++ b/src/arm/lithium-arm.h
@@ -1391,6 +1391,7 @@ class LLoadKeyed: public LTemplateInstruction<1, 2,
0> {
DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed")
DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
+ virtual void PrintDataTo(StringStream* stream);
uint32_t additional_index() const { return hydrogen()->index_offset(); }
};
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index
ec23e1971b7923d14b11ca23622cb900dbcbcd24..d4c3d0e9511a1e15a50b62c2fb24e2612eae82b6
100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2014,7 +2014,12 @@ void HLoadKeyed::PrintDataTo(StringStream* stream) {
stream->Add("[");
key()->PrintNameTo(stream);
- stream->Add("] ");
+ if (IsDehoisted()) {
+ stream->Add(" + %d] ", index_offset());
+ } else {
+ stream->Add("] ");
+ }
+
dependency()->PrintNameTo(stream);
if (RequiresHoleCheck()) {
stream->Add(" check_hole");
@@ -2123,7 +2128,12 @@ void HStoreKeyed::PrintDataTo(StringStream* stream) {
stream->Add("[");
key()->PrintNameTo(stream);
- stream->Add("] = ");
+ if (IsDehoisted()) {
+ stream->Add(" + %d] = ", index_offset());
+ } else {
+ stream->Add("] = ");
+ }
+
value()->PrintNameTo(stream);
}
Index: src/ia32/lithium-ia32.cc
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc
index
a07b8d944daf187a2d745a847ee6df49268df361..f2bdd8016990ef8ffc20b963a50f290186cec42b
100644
--- a/src/ia32/lithium-ia32.cc
+++ b/src/ia32/lithium-ia32.cc
@@ -408,11 +408,27 @@ void LStoreNamedGeneric::PrintDataTo(StringStream*
stream) {
}
+void LLoadKeyed::PrintDataTo(StringStream* stream) {
+ elements()->PrintTo(stream);
+ stream->Add("[");
+ key()->PrintTo(stream);
+ if (hydrogen()->IsDehoisted()) {
+ stream->Add(" + %d]", additional_index());
+ } else {
+ stream->Add("]");
+ }
+}
+
+
void LStoreKeyed::PrintDataTo(StringStream* stream) {
elements()->PrintTo(stream);
stream->Add("[");
key()->PrintTo(stream);
- stream->Add("] <- ");
+ if (hydrogen()->IsDehoisted()) {
+ stream->Add(" + %d] <-", additional_index());
+ } else {
+ stream->Add("] <- ");
+ }
value()->PrintTo(stream);
}
Index: src/ia32/lithium-ia32.h
diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h
index
8ee3ca078cb84ee43cf8c1ce26b9de925e53f82a..c27c841e4ea0d3a68b48af9ba162c409833dcc75
100644
--- a/src/ia32/lithium-ia32.h
+++ b/src/ia32/lithium-ia32.h
@@ -1404,6 +1404,7 @@ class LLoadKeyed: public LTemplateInstruction<1, 2,
0> {
DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed")
DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
+ virtual void PrintDataTo(StringStream* stream);
uint32_t additional_index() const { return hydrogen()->index_offset(); }
};
Index: src/mips/lithium-mips.cc
diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc
index
fa84882718f43bee4472ac6c977c4e8054378d01..821e9ad4d5cac5d39ce8cd5caa8f3f116c14c1bb
100644
--- a/src/mips/lithium-mips.cc
+++ b/src/mips/lithium-mips.cc
@@ -373,20 +373,27 @@ void LStoreNamedGeneric::PrintDataTo(StringStream*
stream) {
}
-void LStoreKeyed::PrintDataTo(StringStream* stream) {
+void LLoadKeyed::PrintDataTo(StringStream* stream) {
elements()->PrintTo(stream);
stream->Add("[");
key()->PrintTo(stream);
- stream->Add("] <- ");
- value()->PrintTo(stream);
+ if (hydrogen()->IsDehoisted()) {
+ stream->Add(" + %d]", additional_index());
+ } else {
+ stream->Add("]");
+ }
}
-void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) {
- object()->PrintTo(stream);
+void LStoreKeyed::PrintDataTo(StringStream* stream) {
+ elements()->PrintTo(stream);
stream->Add("[");
key()->PrintTo(stream);
- stream->Add("] <- ");
+ if (hydrogen()->IsDehoisted()) {
+ stream->Add(" + %d] <-", additional_index());
+ } else {
+ stream->Add("] <- ");
+ }
value()->PrintTo(stream);
}
Index: src/mips/lithium-mips.h
diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h
index
3ea0aef98511cd9d92c6697ca0afcddb000b0999..36d9e53a65fa6d260c09b236cfbe369d753d56ca
100644
--- a/src/mips/lithium-mips.h
+++ b/src/mips/lithium-mips.h
@@ -1352,6 +1352,7 @@ class LLoadKeyed: public LTemplateInstruction<1, 2,
0> {
DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed")
DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
+ virtual void PrintDataTo(StringStream* stream);
uint32_t additional_index() const { return hydrogen()->index_offset(); }
};
Index: src/x64/lithium-x64.cc
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
index
45b15723dc7ac856ee6c7b19be4c7ea6ec524af9..bcb29e264ed1c098b943e7007d36a57f4b038e2c
100644
--- a/src/x64/lithium-x64.cc
+++ b/src/x64/lithium-x64.cc
@@ -395,11 +395,27 @@ void LStoreNamedGeneric::PrintDataTo(StringStream*
stream) {
}
+void LLoadKeyed::PrintDataTo(StringStream* stream) {
+ elements()->PrintTo(stream);
+ stream->Add("[");
+ key()->PrintTo(stream);
+ if (hydrogen()->IsDehoisted()) {
+ stream->Add(" + %d]", additional_index());
+ } else {
+ stream->Add("]");
+ }
+}
+
+
void LStoreKeyed::PrintDataTo(StringStream* stream) {
elements()->PrintTo(stream);
stream->Add("[");
key()->PrintTo(stream);
- stream->Add("] <- ");
+ if (hydrogen()->IsDehoisted()) {
+ stream->Add(" + %d] <-", additional_index());
+ } else {
+ stream->Add("] <- ");
+ }
value()->PrintTo(stream);
}
Index: src/x64/lithium-x64.h
diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h
index
52fe7aa8123c75f371228c84a5172ed162de00f9..3c52c9540880f32009a5fff86dbcd75039838f05
100644
--- a/src/x64/lithium-x64.h
+++ b/src/x64/lithium-x64.h
@@ -1364,6 +1364,7 @@ class LLoadKeyed: public LTemplateInstruction<1, 2,
0> {
}
LOperand* elements() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
+ virtual void PrintDataTo(StringStream* stream);
uint32_t additional_index() const { return hydrogen()->index_offset(); }
ElementsKind elements_kind() const {
return hydrogen()->elements_kind();
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev