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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10446019: - Port AssertBool and AssertAssigneable to new location template. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 7960)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -296,54 +296,44 @@
#undef DECLARE_VALUE
-class AssertAssignableComp : public Computation {
+class AssertAssignableComp : public TemplateComputation<3> {
public:
AssertAssignableComp(intptr_t token_index,
intptr_t try_index,
Value* value,
- Value* instantiator, // Can be NULL.
- Value* instantiator_type_arguments, // Can be NULL.
+ Value* instantiator,
+ Value* instantiator_type_arguments,
const AbstractType& dst_type,
const String& dst_name)
: token_index_(token_index),
try_index_(try_index),
- value_(value),
- instantiator_(instantiator),
- instantiator_type_arguments_(instantiator_type_arguments),
dst_type_(dst_type),
dst_name_(dst_name) {
- ASSERT(value_ != NULL);
+ ASSERT(value != NULL);
+ ASSERT(instantiator != NULL);
+ ASSERT(instantiator_type_arguments != NULL);
ASSERT(!dst_type.IsNull());
ASSERT(!dst_name.IsNull());
+ inputs_[0] = value;
+ inputs_[1] = instantiator;
+ inputs_[2] = instantiator_type_arguments;
}
DECLARE_COMPUTATION(AssertAssignable)
intptr_t token_index() const { return token_index_; }
intptr_t try_index() const { return try_index_; }
- Value* value() const { return value_; }
- Value* instantiator() const { return instantiator_; }
- Value* instantiator_type_arguments() const {
- return instantiator_type_arguments_;
- }
+ Value* value() const { return inputs_[0]; }
+ Value* instantiator() const { return inputs_[1]; }
+ Value* instantiator_type_arguments() const { return inputs_[2]; }
const AbstractType& dst_type() const { return dst_type_; }
const String& dst_name() const { return dst_name_; }
- virtual intptr_t InputCount() const;
- virtual Value* InputAt(intptr_t i) const {
- if (i == 0) return value();
- if (i == 1) return instantiator_type_arguments();
- return NULL;
- }
-
virtual void PrintOperandsTo(BufferFormatter* f) const;
private:
const intptr_t token_index_;
const intptr_t try_index_;
- Value* value_;
- Value* instantiator_;
- Value* instantiator_type_arguments_;
const AbstractType& dst_type_;
const String& dst_name_;
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698