| Index: runtime/vm/object.cc
|
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
|
| index 3314c72efe8a016b79b7350f1873ae1c91e2eb9d..99fa73e936e9893c35b857777c8b70f528ba1b77 100644
|
| --- a/runtime/vm/object.cc
|
| +++ b/runtime/vm/object.cc
|
| @@ -11732,6 +11732,18 @@ RawFunction* ICData::GetTargetForReceiverClassId(intptr_t class_id) const {
|
| }
|
|
|
|
|
| +RawICData* ICData::AsUnaryClassChecksForCid(
|
| + intptr_t cid, const Function& target) const {
|
| + ASSERT(!IsNull());
|
| + const intptr_t kNumArgsTested = 1;
|
| + ICData& result = ICData::Handle(ICData::NewFrom(*this, kNumArgsTested));
|
| +
|
| + // Copy count so that we copy the state "count == 0" vs "count > 0".
|
| + result.AddReceiverCheck(cid, target, GetCountAt(0));
|
| + return result.raw();
|
| +}
|
| +
|
| +
|
| RawICData* ICData::AsUnaryClassChecksForArgNr(intptr_t arg_nr) const {
|
| ASSERT(!IsNull());
|
| ASSERT(NumArgsTested() > arg_nr);
|
| @@ -11740,12 +11752,7 @@ RawICData* ICData::AsUnaryClassChecksForArgNr(intptr_t arg_nr) const {
|
| return raw();
|
| }
|
| const intptr_t kNumArgsTested = 1;
|
| - ICData& result = ICData::Handle(ICData::New(
|
| - Function::Handle(owner()),
|
| - String::Handle(target_name()),
|
| - Array::Handle(arguments_descriptor()),
|
| - deopt_id(),
|
| - kNumArgsTested));
|
| + ICData& result = ICData::Handle(ICData::NewFrom(*this, kNumArgsTested));
|
| const intptr_t len = NumberOfChecks();
|
| for (intptr_t i = 0; i < len; i++) {
|
| const intptr_t class_id = GetClassIdAt(i, arg_nr);
|
| @@ -11773,8 +11780,6 @@ RawICData* ICData::AsUnaryClassChecksForArgNr(intptr_t arg_nr) const {
|
| count);
|
| }
|
| }
|
| - // Copy deoptimization reasons.
|
| - result.SetDeoptReasons(DeoptReasons());
|
|
|
| return result.raw();
|
| }
|
| @@ -11897,6 +11902,19 @@ RawICData* ICData::New(const Function& owner,
|
| }
|
|
|
|
|
| +RawICData* ICData::NewFrom(const ICData& from, intptr_t num_args_tested) {
|
| + const ICData& result = ICData::Handle(ICData::New(
|
| + Function::Handle(from.owner()),
|
| + String::Handle(from.target_name()),
|
| + Array::Handle(from.arguments_descriptor()),
|
| + from.deopt_id(),
|
| + num_args_tested));
|
| + // Copy deoptimization reasons.
|
| + result.SetDeoptReasons(from.DeoptReasons());
|
| + return result.raw();
|
| +}
|
| +
|
| +
|
| void ICData::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| Object::PrintJSONImpl(stream, ref);
|
| }
|
|
|