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

Unified Diff: runtime/vm/intermediate_language.h

Issue 197283004: Generate smaller unoptimized code for certain expressions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 33576)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -3430,17 +3430,25 @@
};
-class DropTempsInstr : public TemplateDefinition<1> {
+class DropTempsInstr : public Definition {
public:
- explicit DropTempsInstr(intptr_t num_temps, Value* value)
- : num_temps_(num_temps) {
- SetInputAt(0, value);
+ explicit DropTempsInstr(intptr_t num_temps, Value* value = NULL)
+ : num_temps_(num_temps), value_(NULL) {
+ if (value != NULL) {
+ SetInputAt(0, value);
srdjan 2014/03/12 18:18:30 I think it would be better do add a private method
Florian Schneider 2014/03/13 08:56:15 I would still need RawSetInputAt since it is used
+ }
}
DECLARE_INSTRUCTION(DropTemps)
- Value* value() const { return inputs_[0]; }
+ virtual intptr_t InputCount() const { return value_ != NULL ? 1 : 0; }
+ virtual Value* InputAt(intptr_t i) const {
+ ASSERT((value_ != NULL) && (i == 0));
+ return value_;
+ }
+ Value* value() const { return value_; }
+
intptr_t num_temps() const { return num_temps_; }
virtual CompileType* ComputeInitialType() const;
@@ -3460,7 +3468,12 @@
}
private:
+ virtual void RawSetInputAt(intptr_t i, Value* value) {
+ value_ = value;
+ }
+
intptr_t num_temps_;
srdjan 2014/03/12 18:18:30 const ?
Florian Schneider 2014/03/13 08:56:15 Done.
+ Value* value_;
DISALLOW_COPY_AND_ASSIGN(DropTempsInstr);
};

Powered by Google App Engine
This is Rietveld 408576698