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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10883063: Add explicit smi checks for unary smi operations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language_ia32.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 11386)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -1932,8 +1932,9 @@
public:
UnarySmiOpComp(Token::Kind op_kind,
InstanceCallComp* instance_call,
- Value* value)
+ Value* value)
: op_kind_(op_kind), instance_call_(instance_call) {
+ ASSERT((op_kind == Token::kNEGATE) || (op_kind == Token::kBIT_NOT));
ASSERT(value != NULL);
inputs_[0] = value;
}
@@ -1947,7 +1948,7 @@
DECLARE_COMPUTATION(UnarySmiOp)
- virtual bool CanDeoptimize() const { return true; }
+ virtual bool CanDeoptimize() const { return op_kind() == Token::kNEGATE; }
virtual intptr_t ResultCid() const { return kSmiCid; }
private:
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698