Index: runtime/vm/aot_optimizer.h |
diff --git a/runtime/vm/aot_optimizer.h b/runtime/vm/aot_optimizer.h |
index 359b116aff31cae745135ccb46c296b067fbcbd4..9b3148cde89c60b5839ce393011d0613cde853cd 100644 |
--- a/runtime/vm/aot_optimizer.h |
+++ b/runtime/vm/aot_optimizer.h |
@@ -53,7 +53,8 @@ class AotOptimizer : public FlowGraphVisitor { |
// Attempt to build ICData for call using propagated class-ids. |
bool TryCreateICData(InstanceCallInstr* call); |
- bool TryReplaceWithIndexedOp(InstanceCallInstr* call); |
+ bool TryReplaceWithIndexedOp(InstanceCallInstr* call, |
+ const ICData* unary_checks); |
bool TryReplaceWithBinaryOp(InstanceCallInstr* call, Token::Kind op_kind); |
bool TryReplaceWithUnaryOp(InstanceCallInstr* call, Token::Kind op_kind); |
@@ -78,14 +79,10 @@ class AotOptimizer : public FlowGraphVisitor { |
// environment 'deopt_environment'. The check is inserted immediately |
// before 'insert_before'. |
void AddCheckClass(Definition* to_check, |
- const ICData& unary_checks, |
+ const Cids& cids, |
intptr_t deopt_id, |
Environment* deopt_environment, |
Instruction* insert_before); |
- Instruction* GetCheckClass(Definition* to_check, |
- const ICData& unary_checks, |
- intptr_t deopt_id, |
- TokenPosition token_pos); |
// Insert a Smi check if needed. |
void AddCheckSmi(Definition* to_check, |
@@ -93,10 +90,18 @@ class AotOptimizer : public FlowGraphVisitor { |
Environment* deopt_environment, |
Instruction* insert_before); |
- // Add a class check for a call's first argument immediately before the |
+ // Add a class check for a call's nth argument immediately before the |
// call, using the call's IC data to determine the check, and the call's |
// deopt ID and deoptimization environment if the check fails. |
- void AddReceiverCheck(InstanceCallInstr* call); |
+ void AddChecksToArgNr(InstanceCallInstr* call, |
Vyacheslav Egorov (Google)
2017/05/09 21:07:27
s/ToArgNr/ForArgNr/ ?
erikcorry
2017/05/10 08:47:43
Done.
|
+ Definition* instr, |
+ int argument_number); |
+ |
+ // Convenience version of AddChecksToArgNr that works on the 0th argument |
+ // (receiver). |
+ void AddReceiverCheck(InstanceCallInstr* call) { |
+ AddChecksToArgNr(call, call->ArgumentAt(0), /* arg_number = */ 0); |
+ } |
void ReplaceCall(Definition* call, Definition* replacement); |