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

Unified Diff: runtime/vm/intermediate_language.h

Issue 806973002: Cleanup access to Instruction's fields (especially deopt_id_). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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
===================================================================
--- runtime/vm/intermediate_language.h (revision 42367)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -619,7 +619,7 @@
intptr_t deopt_id() const {
ASSERT(CanDeoptimize() || CanBecomeDeoptimizationTarget());
- return deopt_id_;
+ return GetDeoptId();
}
const ICData* GetICData(
@@ -717,11 +717,13 @@
// Returns structure describing location constraints required
// to emit native code for this instruction.
- virtual LocationSummary* locs() {
+ LocationSummary* locs() {
ASSERT(locs_ != NULL);
return locs_;
}
+ bool HasLocs() const { return locs_ != NULL; }
+
virtual LocationSummary* MakeLocationSummary(Isolate* isolate,
bool is_optimizing) const = 0;
@@ -848,24 +850,26 @@
bool IsDominatedBy(Instruction* dom);
+ void ClearEnv() { env_ = NULL; }
+
protected:
+ // GetDeoptId and/or CopyDeoptIdFrom.
+ friend class CallSiteInliner;
+ friend class LICM;
+ friend class ComparisonInstr;
+ friend class Scheduler;
+ friend class BlockEntryInstr;
+
// Fetch deopt id without checking if this computation can deoptimize.
intptr_t GetDeoptId() const {
return deopt_id_;
}
+ void CopyDeoptIdFrom(const Instruction& instr) {
+ deopt_id_ = instr.deopt_id_;
+ }
+
private:
- friend class FlowGraphPrinter;
- friend class Definition; // Needed for InsertBefore, InsertAfter.
- friend class CallSiteInliner;
-
- // deopt_id_ write access.
- friend class ComparisonInstr;
- friend class LICM;
- friend class Scheduler;
- friend class BlockEntryInstr;
- friend class BranchSimplifier;
-
virtual void RawSetInputAt(intptr_t i, Value* value) = 0;
enum {
@@ -2240,8 +2244,8 @@
virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler,
BranchLabels labels) = 0;
- void SetDeoptId(intptr_t deopt_id) {
- deopt_id_ = deopt_id;
+ void SetDeoptId(const Instruction& instr) {
Cutch 2014/12/16 16:49:30 Why not unify this with CopyDeoptIdFrom?
srdjan 2014/12/16 16:54:06 CopyDeoptId is protected, few classes can do it. H
+ CopyDeoptIdFrom(instr);
}
// Operation class id is computed from collected ICData.
« 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