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

Unified Diff: src/compiler/machine-type.h

Issue 515173002: Add MachineSignature, which is an encapsulation of the machine types for parameters and return valu… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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/compiler/machine-operator.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/machine-type.h
diff --git a/src/compiler/machine-type.h b/src/compiler/machine-type.h
index ca37527cb941a6bb9d44b5395b866d3ce25b37a8..6e749abb1596a5d067690ed0819292e96dc991e2 100644
--- a/src/compiler/machine-type.h
+++ b/src/compiler/machine-type.h
@@ -108,6 +108,32 @@ inline int ElementSizeOf(MachineType machine_type) {
}
}
+// Describes the inputs and outputs of a function or call in terms of machine
+// types.
+class MachineSignature {
+ public:
+ MachineSignature(uint8_t return_count, uint16_t param_count,
+ MachineType* reps)
+ : return_count_(return_count), param_count_(param_count), reps_(reps) {}
+
+ int GetReturnCount() const { return return_count_; }
+ int GetParamCount() const { return param_count_; }
+
+ MachineType GetParameterType(int index) const {
+ DCHECK(index >= 0 && index < param_count_);
+ return reps_[return_count_ + index];
+ }
+
+ MachineType GetReturnType(int index = 0) const {
+ DCHECK(index >= 0 && index < return_count_);
+ return reps_[index];
+ }
+
+ protected:
+ uint8_t return_count_;
+ uint16_t param_count_;
+ MachineType* reps_;
+};
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/machine-operator.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698