| Index: runtime/vm/intermediate_language.cc
|
| ===================================================================
|
| --- runtime/vm/intermediate_language.cc (revision 33059)
|
| +++ runtime/vm/intermediate_language.cc (working copy)
|
| @@ -84,10 +84,17 @@
|
| }
|
|
|
|
|
| +static int LowestFirst(const intptr_t* a, const intptr_t* b) {
|
| + return *a - *b;
|
| +}
|
| +
|
| +
|
| CheckClassInstr::CheckClassInstr(Value* value,
|
| intptr_t deopt_id,
|
| const ICData& unary_checks)
|
| - : unary_checks_(unary_checks), licm_hoisted_(false) {
|
| + : unary_checks_(unary_checks),
|
| + cids_(unary_checks.NumberOfChecks()),
|
| + licm_hoisted_(false) {
|
| ASSERT(unary_checks.IsZoneHandle());
|
| // Expected useful check data.
|
| ASSERT(!unary_checks_.IsNull());
|
| @@ -98,6 +105,10 @@
|
| // Otherwise use CheckSmiInstr.
|
| ASSERT((unary_checks_.NumberOfChecks() != 1) ||
|
| (unary_checks_.GetReceiverClassIdAt(0) != kSmiCid));
|
| + for (intptr_t i = 0; i < unary_checks.NumberOfChecks(); ++i) {
|
| + cids_.Add(unary_checks.GetReceiverClassIdAt(i));
|
| + }
|
| + cids_.Sort(LowestFirst);
|
| }
|
|
|
|
|
| @@ -140,6 +151,13 @@
|
| }
|
|
|
|
|
| +bool CheckClassInstr::IsDenseSwitch() const {
|
| + return unary_checks().GetReceiverClassIdAt(0) != kSmiCid
|
| + && cids_.length() > 2
|
| + && cids_[cids_.length() - 1] - cids_[0] < kBitsPerWord;
|
| +}
|
| +
|
| +
|
| bool LoadFieldInstr::IsUnboxedLoad() const {
|
| return FLAG_unbox_numeric_fields
|
| && (field() != NULL)
|
|
|