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

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: Incorporated review comments. Created 7 years, 7 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.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 dc33a3fe836bd2128b8eed52bae58c77f2c4faf9..bdd20cefb6483d96ca2ad0f863f66bdd9fdfb4f0 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -497,6 +497,7 @@ class EmbeddedArray<T, 0> {
M(TargetEntry) \
M(CatchBlockEntry) \
M(Phi) \
+ M(Redefinition) \
M(Parameter) \
M(ParallelMove) \
M(PushArgument) \
@@ -534,6 +535,7 @@ class EmbeddedArray<T, 0> {
M(LoadField) \
M(StoreVMField) \
M(LoadUntagged) \
+ M(LoadClassId) \
M(InstantiateTypeArguments) \
M(ExtractConstructorTypeArguments) \
M(ExtractConstructorInstantiator) \
@@ -876,6 +878,10 @@ FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CHECK)
friend class TargetEntryInstr;
friend class JoinEntryInstr;
friend class InstanceOfInstr;
+ friend class PolymorphicInstanceCallInstr;
+ friend class SmiToDoubleInstr;
+ friend class DoubleToIntegerInstr;
+ friend class BranchSimplifier;
virtual void RawSetInputAt(intptr_t i, Value* value) = 0;
@@ -1044,13 +1050,13 @@ class BlockEntryInstr : public Instruction {
intptr_t end_pos() const { return end_pos_; }
BlockEntryInstr* dominator() const { return dominator_; }
- void set_dominator(BlockEntryInstr* instr) { dominator_ = instr; }
const GrowableArray<BlockEntryInstr*>& dominated_blocks() {
return dominated_blocks_;
}
void AddDominatedBlock(BlockEntryInstr* block) {
+ block->set_dominator(this);
dominated_blocks_.Add(block);
}
void ClearDominatedBlocks() { dominated_blocks_.Clear(); }
@@ -1151,6 +1157,8 @@ class BlockEntryInstr : public Instruction {
virtual void ClearPredecessors() = 0;
virtual void AddPredecessor(BlockEntryInstr* predecessor) = 0;
+ void set_dominator(BlockEntryInstr* instr) { dominator_ = instr; }
+
intptr_t block_id_;
const intptr_t try_index_;
intptr_t preorder_number_;
@@ -1309,6 +1317,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;
@@ -2000,7 +2009,7 @@ class StoreContextInstr : public TemplateInstruction<1> {
SetInputAt(0, value);
}
- DECLARE_INSTRUCTION(StoreContext);
+ DECLARE_INSTRUCTION(StoreContext)
virtual intptr_t ArgumentCount() const { return 0; }
@@ -2046,6 +2055,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 };
@@ -2546,6 +2577,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_; }
@@ -3152,7 +3184,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_; }
@@ -3181,7 +3213,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_; }
@@ -3574,7 +3606,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);
}
@@ -3604,6 +3636,34 @@ 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 bool AllowsCSE() const { return true; }
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+ virtual EffectSet Dependencies() const {
+ return EffectSet::Externalization();
+ }
+ virtual bool AttributesEqual(Instruction* other) const { return true; }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(LoadClassIdInstr);
+};
+
+
class LoadFieldInstr : public TemplateDefinition<1> {
public:
LoadFieldInstr(Value* instance,
@@ -3824,7 +3884,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_; }
@@ -4137,8 +4197,6 @@ class UnboxUint32x4Instr : public TemplateDefinition<1> {
return (value()->Type()->ToCid() != kUint32x4Cid);
}
- virtual bool HasSideEffect() const { return false; }
-
virtual Representation representation() const {
return kUnboxedUint32x4;
}
@@ -5233,6 +5291,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]; }
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698