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

Unified Diff: runtime/vm/intermediate_language.h

Issue 14740005: Initial support for polymorphic inlining. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 6b560f62dc342595ebcd236f83530304097cde1e..0088b694fd971717b70bc0d6fdcfee6230b9f425 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -488,6 +488,7 @@ class EmbeddedArray<T, 0> {
M(TargetEntry) \
M(CatchBlockEntry) \
M(Phi) \
+ M(Redefinition) \
M(Parameter) \
M(ParallelMove) \
M(PushArgument) \
@@ -525,6 +526,7 @@ class EmbeddedArray<T, 0> {
M(LoadField) \
M(StoreVMField) \
M(LoadUntagged) \
+ M(LoadClassId) \
M(InstantiateTypeArguments) \
M(ExtractConstructorTypeArguments) \
M(ExtractConstructorInstantiator) \
@@ -859,6 +861,9 @@ FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CHECK)
friend class TargetEntryInstr;
friend class JoinEntryInstr;
friend class InstanceOfInstr;
+ friend class PolymorphicInstanceCallInstr;
+ friend class SmiToDoubleInstr;
+ friend class DoubleToIntegerInstr;
virtual void RawSetInputAt(intptr_t i, Value* value) = 0;
@@ -1292,6 +1297,7 @@ class JoinEntryInstr : public BlockEntryInstr {
// Classes that have access to predecessors_ when inlining.
friend class BlockEntryInstr;
friend class InlineExitCollector;
+ friend class PolymorphicInliner;
// Direct access to phis_ in order to resize it due to phi elimination.
friend class ConstantPropagator;
@@ -1983,7 +1989,7 @@ class StoreContextInstr : public TemplateInstruction<1> {
SetInputAt(0, value);
}
- DECLARE_INSTRUCTION(StoreContext);
+ DECLARE_INSTRUCTION(StoreContext)
virtual intptr_t ArgumentCount() const { return 0; }
@@ -2029,6 +2035,28 @@ class TemplateDefinition : public Definition {
};
+class RedefinitionInstr : public TemplateDefinition<1> {
+ public:
+ explicit RedefinitionInstr(Value* value) {
+ SetInputAt(0, value);
+ }
+
+ DECLARE_INSTRUCTION(Redefinition)
+
+ Value* value() const { return inputs_[0]; }
+
+ virtual CompileType ComputeType() const;
+ virtual bool RecomputeType();
+
+ virtual bool CanDeoptimize() const { return false; }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RedefinitionInstr);
+};
+
+
class RangeBoundary : public ValueObject {
public:
enum Kind { kUnknown, kSymbol, kConstant };
@@ -2529,6 +2557,7 @@ class PolymorphicInstanceCallInstr : public TemplateDefinition<0> {
ic_data_(ic_data),
with_checks_(with_checks) {
ASSERT(instance_call_ != NULL);
+ deopt_id_ = instance_call->deopt_id();
}
InstanceCallInstr* instance_call() const { return instance_call_; }
@@ -3135,7 +3164,7 @@ class LoadStaticFieldInstr : public TemplateDefinition<0> {
public:
explicit LoadStaticFieldInstr(const Field& field) : field_(field) {}
- DECLARE_INSTRUCTION(LoadStaticField);
+ DECLARE_INSTRUCTION(LoadStaticField)
virtual CompileType ComputeType() const;
const Field& field() const { return field_; }
@@ -3164,7 +3193,7 @@ class StoreStaticFieldInstr : public TemplateDefinition<1> {
SetInputAt(0, value);
}
- DECLARE_INSTRUCTION(StoreStaticField);
+ DECLARE_INSTRUCTION(StoreStaticField)
virtual CompileType* ComputeInitialType() const;
const Field& field() const { return field_; }
@@ -3543,7 +3572,7 @@ class CreateClosureInstr : public TemplateDefinition<0> {
class LoadUntaggedInstr : public TemplateDefinition<1> {
public:
- explicit LoadUntaggedInstr(Value* object, intptr_t offset) : offset_(offset) {
+ LoadUntaggedInstr(Value* object, intptr_t offset) : offset_(offset) {
SetInputAt(0, object);
}
@@ -3573,6 +3602,30 @@ class LoadUntaggedInstr : public TemplateDefinition<1> {
};
+class LoadClassIdInstr : public TemplateDefinition<1> {
+ public:
+ explicit LoadClassIdInstr(Value* object) {
+ SetInputAt(0, object);
+ }
+
+ virtual Representation representation() const {
+ return kTagged;
+ }
+ DECLARE_INSTRUCTION(LoadClassId)
+ virtual CompileType ComputeType() const;
+
+ Value* object() const { return inputs_[0]; }
+
+ virtual bool CanDeoptimize() const { return false; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const { return EffectSet::None(); }
+ virtual bool AttributesEqual(Instruction* other) const { return true; }
Florian Schneider 2013/05/03 10:41:36 This instructions could have AllowsCSE true, and D
Kevin Millikin (Google) 2013/05/03 11:47:38 Ouch, good catch. That was the intent, but CSE in
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(LoadClassIdInstr);
+};
+
+
class LoadFieldInstr : public TemplateDefinition<1> {
public:
LoadFieldInstr(Value* value,
@@ -3793,7 +3846,7 @@ class AllocateContextInstr : public TemplateDefinition<0> {
: token_pos_(token_pos),
num_context_variables_(num_context_variables) {}
- DECLARE_INSTRUCTION(AllocateContext);
+ DECLARE_INSTRUCTION(AllocateContext)
virtual CompileType ComputeType() const;
intptr_t token_pos() const { return token_pos_; }
@@ -4102,8 +4155,6 @@ class UnboxUint32x4Instr : public TemplateDefinition<1> {
return (value()->Type()->ToCid() != kUint32x4Cid);
}
- virtual bool HasSideEffect() const { return false; }
-
virtual Representation representation() const {
return kUnboxedUint32x4;
}
@@ -5009,6 +5060,7 @@ class DoubleToIntegerInstr : public TemplateDefinition<1> {
DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call)
: instance_call_(instance_call) {
SetInputAt(0, value);
+ deopt_id_ = instance_call->deopt_id();
}
Value* value() const { return inputs_[0]; }

Powered by Google App Engine
This is Rietveld 408576698