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

Unified Diff: runtime/vm/intermediate_language.h

Issue 14031035: Cleanup implementation of SmiToDouble to use unboxed double result. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: emit SmiToDouble only at monomorphic sites Created 7 years, 8 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
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index c8110bba0eea5b15d802ac9f1295657fde9d3bed..362e76bf7e9f3ef19aa57cea0035667acf362e31 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -4640,25 +4640,30 @@ class CheckStackOverflowInstr : public TemplateInstruction<0> {
};
-class SmiToDoubleInstr : public TemplateDefinition<0> {
+class SmiToDoubleInstr : public TemplateDefinition<1> {
public:
- explicit SmiToDoubleInstr(InstanceCallInstr* instance_call)
- : instance_call_(instance_call) { }
+ explicit SmiToDoubleInstr(Value* value) {
+ SetInputAt(0, value);
+ }
- InstanceCallInstr* instance_call() const { return instance_call_; }
+ Value* value() const { return inputs_[0]; }
DECLARE_INSTRUCTION(SmiToDouble)
virtual CompileType ComputeType() const;
+ virtual Representation representation() const {
+ return kUnboxedDouble;
+ }
+
virtual intptr_t ArgumentCount() const { return 1; }
- virtual bool CanDeoptimize() const { return true; }
+ virtual bool CanDeoptimize() const { return false; }
virtual bool HasSideEffect() const { return false; }
+ virtual bool AffectedBySideEffect() const { return false; }
+ virtual bool AttributesEqual(Instruction* other) const { return true; }
private:
- InstanceCallInstr* instance_call_;
-
DISALLOW_COPY_AND_ASSIGN(SmiToDoubleInstr);
};
@@ -4739,6 +4744,10 @@ class DoubleToDoubleInstr : public TemplateDefinition<1> {
virtual bool CanDeoptimize() const { return false; }
virtual bool HasSideEffect() const { return false; }
+ virtual bool AffectedBySideEffect() const { return false; }
+ virtual bool AttributesEqual(Instruction* other) const {
+ return other->AsDoubleToDouble()->recognized_kind() == recognized_kind();
+ }
virtual Representation representation() const {
return kUnboxedDouble;
@@ -4777,6 +4786,10 @@ class InvokeMathCFunctionInstr : public Definition {
virtual bool CanDeoptimize() const { return false; }
virtual bool HasSideEffect() const { return false; }
+ virtual bool AffectedBySideEffect() const { return false; }
+ virtual bool AttributesEqual(Instruction* other) const {
+ return other->AsDoubleToDouble()->recognized_kind() == recognized_kind();
+ }
virtual Representation representation() const {
return kUnboxedDouble;
« 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