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

Unified Diff: runtime/vm/intermediate_language.h

Issue 2877713003: Eliminated with_checks variable (Closed)
Patch Set: Use return type from recognized methods for static calls Created 3 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
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 823f4774b718309cd26bfb9df3363c42e2245f6f..a578d3e94782666f2ba47b743aaecf48ae6674f2 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -2812,6 +2812,10 @@ class InstanceCallInstr : public TemplateDefinition<0, Throws> {
bool has_unique_selector() const { return has_unique_selector_; }
void set_has_unique_selector(bool b) { has_unique_selector_ = b; }
+ virtual intptr_t CallCount() const {
+ return ic_data() == NULL ? 0 : ic_data()->AggregateCount();
+ }
+
virtual bool ComputeCanDeoptimize() const { return true; }
virtual Definition* Canonicalize(FlowGraph* flow_graph);
@@ -2850,12 +2854,10 @@ class PolymorphicInstanceCallInstr : public TemplateDefinition<0, Throws> {
public:
PolymorphicInstanceCallInstr(InstanceCallInstr* instance_call,
const CallTargets& targets,
- bool with_checks,
bool complete)
: TemplateDefinition(instance_call->deopt_id()),
instance_call_(instance_call),
targets_(targets),
- with_checks_(with_checks),
complete_(complete) {
ASSERT(instance_call_ != NULL);
ASSERT(targets.length() != 0);
@@ -2863,8 +2865,6 @@ class PolymorphicInstanceCallInstr : public TemplateDefinition<0, Throws> {
}
InstanceCallInstr* instance_call() const { return instance_call_; }
- bool with_checks() const { return with_checks_; }
- void set_with_checks(bool b) { with_checks_ = b; }
bool complete() const { return complete_; }
virtual TokenPosition token_pos() const {
return instance_call_->token_pos();
@@ -2914,7 +2914,6 @@ class PolymorphicInstanceCallInstr : public TemplateDefinition<0, Throws> {
private:
InstanceCallInstr* instance_call_;
const CallTargets& targets_;
- bool with_checks_;
const bool complete_;
intptr_t total_call_count_;
@@ -3227,6 +3226,7 @@ class StaticCallInstr : public TemplateDefinition<0, Throws> {
const ZoneGrowableArray<const ICData*>& ic_data_array)
: TemplateDefinition(Thread::Current()->GetNextDeoptId()),
ic_data_(NULL),
+ call_count_(0),
token_pos_(token_pos),
function_(function),
argument_names_(argument_names),
@@ -3244,9 +3244,11 @@ class StaticCallInstr : public TemplateDefinition<0, Throws> {
const Function& function,
const Array& argument_names,
ZoneGrowableArray<PushArgumentInstr*>* arguments,
- intptr_t deopt_id)
+ intptr_t deopt_id,
+ intptr_t call_count)
: TemplateDefinition(deopt_id),
ic_data_(NULL),
+ call_count_(call_count),
token_pos_(token_pos),
function_(function),
argument_names_(argument_names),
@@ -3280,7 +3282,7 @@ class StaticCallInstr : public TemplateDefinition<0, Throws> {
}
virtual intptr_t CallCount() const {
- return ic_data() == NULL ? 0 : ic_data()->AggregateCount();
+ return ic_data() == NULL ? call_count_ : ic_data()->AggregateCount();
}
virtual bool ComputeCanDeoptimize() const { return true; }
@@ -3309,6 +3311,7 @@ class StaticCallInstr : public TemplateDefinition<0, Throws> {
private:
const ICData* ic_data_;
+ const intptr_t call_count_;
const TokenPosition token_pos_;
const Function& function_;
const Array& argument_names_;

Powered by Google App Engine
This is Rietveld 408576698