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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10541135: Some cleanups, started implementing checked instance calls, better equality operation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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.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 8617)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -36,6 +36,7 @@
M(StoreContext, StoreContextComp) \
M(ClosureCall, ClosureCallComp) \
M(InstanceCall, InstanceCallComp) \
+ M(PolymorphicInstanceCall, PolymorphicInstanceCallComp) \
M(StaticCall, StaticCallComp) \
M(LoadLocal, LoadLocalComp) \
M(StoreLocal, StoreLocalComp) \
@@ -147,6 +148,8 @@
static LocationSummary* MakeCallSummary();
+ void ReplaceWith(Computation* other);
+
// Declare an enum value used to define type-test predicates.
enum ComputationType {
#define DECLARE_COMPUTATION_TYPE(ShortName, ClassName) k##ShortName,
@@ -504,6 +507,41 @@
};
+class PolymorphicInstanceCallComp : public Computation {
+ public:
+ PolymorphicInstanceCallComp(InstanceCallComp* comp,
+ const ZoneGrowableArray<intptr_t>& class_ids,
+ const ZoneGrowableArray<Function*>& targets)
+ : instance_call_(comp),
+ class_ids_(class_ids),
+ targets_(targets) {
+ ASSERT(instance_call_ != NULL);
+ }
+
+ InstanceCallComp* instance_call() const { return instance_call_; }
+ const ZoneGrowableArray<intptr_t>& class_ids() const { return class_ids_; }
+ const ZoneGrowableArray<Function*>& targets() const { return targets_; }
+
+ virtual intptr_t InputCount() const { return instance_call()->InputCount(); }
+ virtual Value* InputAt(intptr_t i) const {
+ return instance_call()->ArgumentAt(i);
+ }
+
+ virtual void PrintOperandsTo(BufferFormatter* f) const {
+ instance_call()->PrintOperandsTo(f);
+ }
+
+ DECLARE_COMPUTATION(PolymorphicInstanceCall)
+
+ private:
+ InstanceCallComp* instance_call_;
+ const ZoneGrowableArray<intptr_t>& class_ids_;
+ const ZoneGrowableArray<Function*>& targets_;
+
+ DISALLOW_COPY_AND_ASSIGN(PolymorphicInstanceCallComp);
+};
+
+
class ComparisonComp : public TemplateComputation<2> {
public:
ComparisonComp(Value* left, Value* right)
@@ -519,6 +557,7 @@
}
BranchInstr* fused_with_branch() const {
+ ASSERT(is_fused_with_branch());
return fused_with_branch_;
}
@@ -562,19 +601,25 @@
Value* right)
: ComparisonComp(left, right),
token_index_(token_index),
- try_index_(try_index) {
+ try_index_(try_index),
+ operands_class_id_(kObject) {
}
DECLARE_COMPUTATION(EqualityCompare)
intptr_t token_index() const { return token_index_; }
intptr_t try_index() const { return try_index_; }
+ void set_operands_class_id(intptr_t value) {
+ operands_class_id_ = value;
+ }
+ intptr_t operands_class_id() const { return operands_class_id_; }
virtual void PrintOperandsTo(BufferFormatter* f) const;
private:
const intptr_t token_index_;
const intptr_t try_index_;
+ intptr_t operands_class_id_; // class id of both operands.
DISALLOW_COPY_AND_ASSIGN(EqualityCompareComp);
};
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698