| Index: runtime/vm/flow_graph_compiler.h
|
| diff --git a/runtime/vm/flow_graph_compiler.h b/runtime/vm/flow_graph_compiler.h
|
| index 7262d0e9c03589ab3ea89fe9f7cd40f2a74a2dc7..599851e1dcd7bcf6baaeafa6693714655cafdbc1 100644
|
| --- a/runtime/vm/flow_graph_compiler.h
|
| +++ b/runtime/vm/flow_graph_compiler.h
|
| @@ -233,22 +233,6 @@ class SlowPathCode : public ZoneAllocated {
|
| };
|
|
|
|
|
| -struct CidRangeTarget {
|
| - intptr_t cid_start;
|
| - intptr_t cid_end;
|
| - Function* target;
|
| - intptr_t count;
|
| - 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) {}
|
| -};
|
| -
|
| -
|
| class FlowGraphCompiler : public ValueObject {
|
| private:
|
| class BlockInfo : public ZoneAllocated {
|
| @@ -434,17 +418,20 @@ class FlowGraphCompiler : public ValueObject {
|
| TokenPosition token_pos,
|
| LocationSummary* locs);
|
|
|
| - void EmitPolymorphicInstanceCall(const ICData& ic_data,
|
| - intptr_t argument_count,
|
| - const Array& argument_names,
|
| - intptr_t deopt_id,
|
| - TokenPosition token_pos,
|
| - LocationSummary* locs,
|
| - bool complete,
|
| - intptr_t total_call_count);
|
| + void EmitPolymorphicInstanceCall(
|
| + const PolymorphicTargets& targets,
|
| + const InstanceCallInstr& original_instruction,
|
| + intptr_t argument_count,
|
| + const Array& argument_names,
|
| + intptr_t deopt_id,
|
| + TokenPosition token_pos,
|
| + LocationSummary* locs,
|
| + bool complete,
|
| + intptr_t total_call_count);
|
|
|
| // Pass a value for try-index where block is not available (e.g. slow path).
|
| - void EmitMegamorphicInstanceCall(const ICData& ic_data,
|
| + void EmitMegamorphicInstanceCall(const String& function_name,
|
| + const Array& arguments_descriptor,
|
| intptr_t argument_count,
|
| intptr_t deopt_id,
|
| TokenPosition token_pos,
|
| @@ -458,7 +445,8 @@ class FlowGraphCompiler : public ValueObject {
|
| TokenPosition token_pos,
|
| LocationSummary* locs);
|
|
|
| - void EmitTestAndCall(const ICData& ic_data,
|
| + void EmitTestAndCall(const PolymorphicTargets& targets,
|
| + const String& function_name,
|
| intptr_t arg_count,
|
| const Array& arg_names,
|
| Label* failed,
|
| @@ -587,7 +575,7 @@ class FlowGraphCompiler : public ValueObject {
|
|
|
| // Returns 'sorted' array in decreasing count order.
|
| static void SortICDataByCount(const ICData& ic_data,
|
| - GrowableArray<CidRangeTarget>* sorted,
|
| + ZoneGrowableArray<CidRangeTarget>* sorted,
|
| bool drop_smi);
|
|
|
| // Use in unoptimized compilation to preserve/reuse ICData.
|
| @@ -601,8 +589,10 @@ class FlowGraphCompiler : public ValueObject {
|
| const Array& arguments_descriptor,
|
| intptr_t num_args_tested);
|
|
|
| - static const ICData& TrySpecializeICDataByReceiverCid(const ICData& ic_data,
|
| - intptr_t cid);
|
| + static const PolymorphicTargets* TrySpecializeByReceiverCid(
|
| + const Array& args_desc_array,
|
| + const String& selector,
|
| + intptr_t cid);
|
|
|
| const ZoneGrowableArray<const ICData*>& deopt_id_to_ic_data() const {
|
| return *deopt_id_to_ic_data_;
|
| @@ -621,6 +611,11 @@ class FlowGraphCompiler : public ValueObject {
|
| void BeginCodeSourceRange();
|
| void EndCodeSourceRange(TokenPosition token_pos);
|
|
|
| + static bool LookupMethodFor(int class_id,
|
| + const ArgumentsDescriptor& args_desc,
|
| + const String& name,
|
| + Function* fn_return);
|
| +
|
| #if defined(TARGET_ARCH_DBC)
|
| enum CallResult {
|
| kHasResult,
|
| @@ -666,9 +661,8 @@ class FlowGraphCompiler : public ValueObject {
|
|
|
| // Helper for TestAndCall that calculates a good bias that
|
| // allows more compact instructions to be emitted.
|
| - intptr_t ComputeGoodBiasForCidComparison(
|
| - const GrowableArray<CidRangeTarget>& sorted,
|
| - intptr_t max_immediate);
|
| + intptr_t ComputeGoodBiasForCidComparison(const PolymorphicTargets& sorted,
|
| + intptr_t max_immediate);
|
|
|
| // DBC handles type tests differently from all other architectures due
|
| // to its interpreted nature.
|
|
|