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

Unified Diff: vm/intermediate_language.h

Issue 10850014: Separate double binary operation into a separate instruction class. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: added ia32 Created 8 years, 5 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 | « vm/il_printer.cc ('k') | vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/intermediate_language.h
===================================================================
--- vm/intermediate_language.h (revision 10161)
+++ vm/intermediate_language.h (working copy)
@@ -97,6 +97,7 @@
M(CloneContext, CloneContextComp) \
M(CatchEntry, CatchEntryComp) \
M(BinaryOp, BinaryOpComp) \
+ M(DoubleBinaryOp, DoubleBinaryOpComp) \
M(UnarySmiOp, UnarySmiOpComp) \
M(NumberNegate, NumberNegateComp) \
M(CheckStackOverflow, CheckStackOverflowComp) \
@@ -492,7 +493,7 @@
intptr_t token_pos() const { return ast_node_.token_pos(); }
intptr_t try_index() const { return try_index_; }
- intptr_t ArgumentCount() const { return arguments_->length(); }
+ virtual intptr_t ArgumentCount() const { return arguments_->length(); }
PushArgumentInstr* ArgumentAt(intptr_t index) const {
return (*arguments_)[index];
}
@@ -541,7 +542,7 @@
intptr_t try_index() const { return try_index_; }
const String& function_name() const { return function_name_; }
Token::Kind token_kind() const { return token_kind_; }
- intptr_t ArgumentCount() const { return arguments_->length(); }
+ virtual intptr_t ArgumentCount() const { return arguments_->length(); }
PushArgumentInstr* ArgumentAt(intptr_t index) const {
return (*arguments_)[index];
}
@@ -732,7 +733,7 @@
intptr_t token_pos() const { return token_pos_; }
intptr_t try_index() const { return try_index_; }
- intptr_t ArgumentCount() const { return arguments_->length(); }
+ virtual intptr_t ArgumentCount() const { return arguments_->length(); }
PushArgumentInstr* ArgumentAt(intptr_t index) const {
return (*arguments_)[index];
}
@@ -1059,7 +1060,7 @@
intptr_t try_index() const { return try_index_; }
const String& field_name() const { return field_name_; }
- intptr_t ArgumentCount() const { return arguments_->length(); }
+ virtual intptr_t ArgumentCount() const { return arguments_->length(); }
PushArgumentInstr* ArgumentAt(intptr_t index) const {
return (*arguments_)[index];
}
@@ -1306,7 +1307,7 @@
intptr_t try_index() const { return try_index_; }
const Function& function() const { return ast_node_.function(); }
- intptr_t ArgumentCount() const { return arguments_->length(); }
+ virtual intptr_t ArgumentCount() const { return arguments_->length(); }
PushArgumentInstr* ArgumentAt(intptr_t index) const {
return (*arguments_)[index];
}
@@ -1632,6 +1633,31 @@
};
+class DoubleBinaryOpComp : public Computation {
+ public:
+ DoubleBinaryOpComp(Token::Kind op_kind, InstanceCallComp* instance_call)
+ : op_kind_(op_kind), instance_call_(instance_call) { }
+
+ Token::Kind op_kind() const { return op_kind_; }
+
+ InstanceCallComp* instance_call() const { return instance_call_; }
+
+ virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+ DECLARE_CALL_COMPUTATION(DoubleBinaryOp)
+
+ virtual intptr_t ArgumentCount() const { return 2; }
+
+ virtual bool CanDeoptimize() const { return true; }
+
+ private:
+ const Token::Kind op_kind_;
+ InstanceCallComp* instance_call_;
+
+ DISALLOW_COPY_AND_ASSIGN(DoubleBinaryOpComp);
+};
+
+
// Handles both Smi operations: BIT_OR and NEGATE.
class UnarySmiOpComp : public TemplateComputation<1> {
public:
« no previous file with comments | « vm/il_printer.cc ('k') | vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698