Revision: 11394
Author: [email protected]
Date: Thu Apr 19 09:49:09 2012
Log: Finish refactoring done for ia32 for the other platforms.
Make non-templatized versions of LIR printing functions.
This avoid duplicating the code for each template instance.
BUG=v8:1803
Review URL: https://chromiumcodereview.appspot.com/10123011
http://code.google.com/p/v8/source/detail?r=11394
Modified:
/branches/bleeding_edge/src/arm/lithium-arm.cc
/branches/bleeding_edge/src/arm/lithium-arm.h
/branches/bleeding_edge/src/mips/lithium-mips.cc
/branches/bleeding_edge/src/mips/lithium-mips.h
/branches/bleeding_edge/src/x64/lithium-x64.cc
/branches/bleeding_edge/src/x64/lithium-x64.h
=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.cc Thu Apr 19 06:24:15 2012
+++ /branches/bleeding_edge/src/arm/lithium-arm.cc Thu Apr 19 09:49:09 2012
@@ -108,22 +108,17 @@
}
-template<int R, int I, int T>
-void LTemplateInstruction<R, I, T>::PrintDataTo(StringStream* stream) {
+void LInstruction::PrintDataTo(StringStream* stream) {
stream->Add("= ");
- for (int i = 0; i < inputs_.length(); i++) {
+ for (int i = 0; i < InputCount(); i++) {
if (i > 0) stream->Add(" ");
- inputs_[i]->PrintTo(stream);
+ InputAt(i)->PrintTo(stream);
}
}
-template<int R, int I, int T>
-void LTemplateInstruction<R, I, T>::PrintOutputOperandTo(StringStream*
stream) {
- for (int i = 0; i < results_.length(); i++) {
- if (i > 0) stream->Add(" ");
- results_[i]->PrintTo(stream);
- }
+void LInstruction::PrintOutputOperandTo(StringStream* stream) {
+ if (HasResult()) result()->PrintTo(stream);
}
=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.h Wed Apr 18 02:38:45 2012
+++ /branches/bleeding_edge/src/arm/lithium-arm.h Thu Apr 19 09:49:09 2012
@@ -211,8 +211,8 @@
virtual void CompileToNative(LCodeGen* generator) = 0;
virtual const char* Mnemonic() const = 0;
virtual void PrintTo(StringStream* stream);
- virtual void PrintDataTo(StringStream* stream) = 0;
- virtual void PrintOutputOperandTo(StringStream* stream) = 0;
+ virtual void PrintDataTo(StringStream* stream);
+ virtual void PrintOutputOperandTo(StringStream* stream);
enum Opcode {
// Declare a unique enum value for each instruction.
@@ -306,9 +306,6 @@
int TempCount() { return T; }
LOperand* TempAt(int i) { return temps_[i]; }
-
- virtual void PrintDataTo(StringStream* stream);
- virtual void PrintOutputOperandTo(StringStream* stream);
protected:
EmbeddedContainer<LOperand*, R> results_;
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.cc Thu Apr 19 06:24:15
2012
+++ /branches/bleeding_edge/src/mips/lithium-mips.cc Thu Apr 19 09:49:09
2012
@@ -108,22 +108,17 @@
}
-template<int R, int I, int T>
-void LTemplateInstruction<R, I, T>::PrintDataTo(StringStream* stream) {
+void LInstruction::PrintDataTo(StringStream* stream) {
stream->Add("= ");
- for (int i = 0; i < inputs_.length(); i++) {
+ for (int i = 0; i < InputCount(); i++) {
if (i > 0) stream->Add(" ");
- inputs_[i]->PrintTo(stream);
+ InputAt(i)->PrintTo(stream);
}
}
-template<int R, int I, int T>
-void LTemplateInstruction<R, I, T>::PrintOutputOperandTo(StringStream*
stream) {
- for (int i = 0; i < results_.length(); i++) {
- if (i > 0) stream->Add(" ");
- results_[i]->PrintTo(stream);
- }
+void LInstruction::PrintOutputOperandTo(StringStream* stream) {
+ if (HasResult()) result()->PrintTo(stream);
}
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.h Wed Apr 18 03:42:30 2012
+++ /branches/bleeding_edge/src/mips/lithium-mips.h Thu Apr 19 09:49:09 2012
@@ -210,8 +210,8 @@
virtual void CompileToNative(LCodeGen* generator) = 0;
virtual const char* Mnemonic() const = 0;
virtual void PrintTo(StringStream* stream);
- virtual void PrintDataTo(StringStream* stream) = 0;
- virtual void PrintOutputOperandTo(StringStream* stream) = 0;
+ virtual void PrintDataTo(StringStream* stream);
+ virtual void PrintOutputOperandTo(StringStream* stream);
enum Opcode {
// Declare a unique enum value for each instruction.
@@ -305,9 +305,6 @@
int TempCount() { return T; }
LOperand* TempAt(int i) { return temps_[i]; }
-
- virtual void PrintDataTo(StringStream* stream);
- virtual void PrintOutputOperandTo(StringStream* stream);
protected:
EmbeddedContainer<LOperand*, R> results_;
=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.cc Thu Apr 19 06:24:15 2012
+++ /branches/bleeding_edge/src/x64/lithium-x64.cc Thu Apr 19 09:49:09 2012
@@ -110,22 +110,17 @@
}
-template<int R, int I, int T>
-void LTemplateInstruction<R, I, T>::PrintDataTo(StringStream* stream) {
+void LInstruction::PrintDataTo(StringStream* stream) {
stream->Add("= ");
- for (int i = 0; i < inputs_.length(); i++) {
+ for (int i = 0; i < InputCount(); i++) {
if (i > 0) stream->Add(" ");
- inputs_[i]->PrintTo(stream);
+ InputAt(i)->PrintTo(stream);
}
}
-template<int R, int I, int T>
-void LTemplateInstruction<R, I, T>::PrintOutputOperandTo(StringStream*
stream) {
- for (int i = 0; i < results_.length(); i++) {
- if (i > 0) stream->Add(" ");
- results_[i]->PrintTo(stream);
- }
+void LInstruction::PrintOutputOperandTo(StringStream* stream) {
+ if (HasResult()) result()->PrintTo(stream);
}
=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.h Wed Apr 18 02:38:45 2012
+++ /branches/bleeding_edge/src/x64/lithium-x64.h Thu Apr 19 09:49:09 2012
@@ -212,8 +212,8 @@
virtual void CompileToNative(LCodeGen* generator) = 0;
virtual const char* Mnemonic() const = 0;
virtual void PrintTo(StringStream* stream);
- virtual void PrintDataTo(StringStream* stream) = 0;
- virtual void PrintOutputOperandTo(StringStream* stream) = 0;
+ virtual void PrintDataTo(StringStream* stream);
+ virtual void PrintOutputOperandTo(StringStream* stream);
enum Opcode {
// Declare a unique enum value for each instruction.
@@ -307,9 +307,6 @@
int TempCount() { return T; }
LOperand* TempAt(int i) { return temps_[i]; }
-
- virtual void PrintDataTo(StringStream* stream);
- virtual void PrintOutputOperandTo(StringStream* stream);
protected:
EmbeddedContainer<LOperand*, R> results_;
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev