Index: runtime/vm/flow_graph_compiler.h |
diff --git a/runtime/vm/flow_graph_compiler.h b/runtime/vm/flow_graph_compiler.h |
index b0f034d7f76a555b1e70b33b1aafb85f7dc47cee..5b5b031a555e0596bf4a2b28a24e34ea0a3f03c8 100644 |
--- a/runtime/vm/flow_graph_compiler.h |
+++ b/runtime/vm/flow_graph_compiler.h |
@@ -232,12 +232,19 @@ class SlowPathCode : public ZoneAllocated { |
}; |
-struct CidTarget { |
- intptr_t cid; |
+struct CidRangeTarget { |
+ intptr_t cid_start; |
+ intptr_t cid_end; |
Function* target; |
intptr_t count; |
- CidTarget(intptr_t cid_arg, Function* target_arg, intptr_t count_arg) |
- : cid(cid_arg), target(target_arg), count(count_arg) {} |
+ CidRangeTarget(intptr_t cid_start_arg, |
+ intptr_t cid_end_arg, |
+ Function* target_arg, |
+ intptr_t count_arg) |
+ : cid_start(cid_start_arg), |
+ cid_end(cid_end_arg), |
+ target(target_arg), |
+ count(count_arg) {} |
}; |
@@ -427,7 +434,8 @@ class FlowGraphCompiler : public ValueObject { |
intptr_t deopt_id, |
TokenPosition token_pos, |
LocationSummary* locs, |
- bool complete); |
+ bool complete, |
+ intptr_t total_ic_count); |
// Pass a value for try-index where block is not available (e.g. slow path). |
void EmitMegamorphicInstanceCall(const ICData& ic_data, |
@@ -452,7 +460,8 @@ class FlowGraphCompiler : public ValueObject { |
intptr_t deopt_id, |
TokenPosition token_index, |
LocationSummary* locs, |
- bool complete); |
+ bool complete, |
+ intptr_t total_ic_calls); |
Condition EmitEqualityRegConstCompare(Register reg, |
const Object& obj, |
@@ -560,7 +569,7 @@ class FlowGraphCompiler : public ValueObject { |
// Returns 'sorted' array in decreasing count order. |
static void SortICDataByCount(const ICData& ic_data, |
- GrowableArray<CidTarget>* sorted, |
+ GrowableArray<CidRangeTarget>* sorted, |
bool drop_smi); |
// Use in unoptimized compilation to preserve/reuse ICData. |
@@ -610,8 +619,6 @@ class FlowGraphCompiler : public ValueObject { |
private: |
friend class CheckStackOverflowSlowPath; // For pending_deoptimization_env_. |
- static bool ShouldInlineSmiStringHashCode(const ICData& ic_data); |
- |
void EmitFrameEntry(); |
void AddStaticCallTarget(const Function& function); |
@@ -637,6 +644,11 @@ class FlowGraphCompiler : public ValueObject { |
LocationSummary* locs, |
const ICData& ic_data); |
+ // Helper for TestAndCall that calculates a good bias that |
+ // allows more compact instructions to be emitted. |
+ intptr_t GetGoodBias(const GrowableArray<CidRangeTarget>& sorted, |
Vyacheslav Egorov (Google)
2017/03/10 10:31:30
ComputeGoodBiasForCidComparison(...)?
erikcorry
2017/03/10 13:30:01
Done.
|
+ intptr_t max_immediate); |
+ |
// DBC handles type tests differently from all other architectures due |
// to its interpreted nature. |
#if !defined(TARGET_ARCH_DBC) |