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

Unified Diff: runtime/vm/intermediate_language.h

Issue 23757016: Simplify compilation of relational operators. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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_arm.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 27045)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -958,6 +958,7 @@
friend class DoubleToIntegerInstr;
friend class BranchSimplifier;
friend class BlockEntryInstr;
+ friend class RelationalOpInstr;
virtual void RawSetInputAt(intptr_t i, Value* value) = 0;
@@ -2671,6 +2672,7 @@
ASSERT(!arguments->is_empty());
ASSERT(argument_names.IsZoneHandle() || argument_names.InVMHeap());
ASSERT(Token::IsBinaryOperator(token_kind) ||
+ Token::IsRelationalOperator(token_kind) ||
Token::IsPrefixOperator(token_kind) ||
Token::IsIndexOperator(token_kind) ||
Token::IsTypeTestOperator(token_kind) ||
@@ -3000,32 +3002,25 @@
Token::Kind kind,
Value* left,
Value* right,
- const Array& ic_data_array)
- : ComparisonInstr(token_pos, kind, left, right),
- ic_data_(GetICData(ic_data_array)) {
+ intptr_t cid,
+ intptr_t deopt_id)
+ : ComparisonInstr(token_pos, kind, left, right) {
ASSERT(Token::IsRelationalOperator(kind));
+ set_operation_cid(cid);
+ deopt_id_ = deopt_id; // Override generated deopt-id.
}
DECLARE_INSTRUCTION(RelationalOp)
virtual CompileType ComputeType() const;
virtual bool RecomputeType();
- const ICData* ic_data() const { return ic_data_; }
- bool HasICData() const {
- return (ic_data() != NULL) && !ic_data()->IsNull();
- }
- void set_ic_data(const ICData* value) { ic_data_ = value; }
-
- bool IsInlinedNumericComparison() const {
- return (operation_cid() == kDoubleCid)
- || (operation_cid() == kMintCid)
- || (operation_cid() == kSmiCid);
- }
-
virtual void PrintOperandsTo(BufferFormatter* f) const;
- virtual bool CanDeoptimize() const {
- return !IsInlinedNumericComparison();
+ virtual bool CanDeoptimize() const { return false; }
+
+ virtual bool CanBecomeDeoptimizationTarget() const {
+ // RelationalOp can be merged into Branch and thus needs an environment.
+ return true;
}
virtual void EmitBranchCode(FlowGraphCompiler* compiler,
@@ -3044,14 +3039,12 @@
}
virtual EffectSet Effects() const {
- return IsInlinedNumericComparison() ? EffectSet::None() : EffectSet::All();
+ return EffectSet::None();
}
- virtual bool MayThrow() const { return !IsInlinedNumericComparison(); }
+ virtual bool MayThrow() const { return false; }
private:
- const ICData* ic_data_;
-
DISALLOW_COPY_AND_ASSIGN(RelationalOpInstr);
};
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698