| Index: runtime/vm/precompiler.cc
|
| diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc
|
| index 5f0a33e75b9e94b8696e9132b8b1494175a9ec34..e919a5268b6e4d254ab12633f0d419b6dee4a02d 100644
|
| --- a/runtime/vm/precompiler.cc
|
| +++ b/runtime/vm/precompiler.cc
|
| @@ -1910,13 +1910,12 @@ void Precompiler::SwitchICCalls() {
|
| class SwitchICCallsVisitor : public FunctionVisitor {
|
| public:
|
| explicit SwitchICCallsVisitor(Zone* zone) :
|
| + zone_(zone),
|
| code_(Code::Handle(zone)),
|
| pool_(ObjectPool::Handle(zone)),
|
| entry_(Object::Handle(zone)),
|
| ic_(ICData::Handle(zone)),
|
| - target_(Function::Handle(zone)),
|
| - target_code_(Code::Handle(zone)),
|
| - entry_point_(Smi::Handle(zone)) {
|
| + target_code_(Code::Handle(zone)) {
|
| }
|
|
|
| void Visit(const Function& function) {
|
| @@ -1930,25 +1929,10 @@ void Precompiler::SwitchICCalls() {
|
| if (pool_.InfoAt(i) != ObjectPool::kTaggedObject) continue;
|
| entry_ = pool_.ObjectAt(i);
|
| if (entry_.IsICData()) {
|
| + // The only IC calls generated by precompilation are for switchable
|
| + // calls.
|
| ic_ ^= entry_.raw();
|
| -
|
| - if (ic_.NumArgsTested() != 1) continue;
|
| -
|
| - for (intptr_t j = 0; j < ic_.NumberOfChecks(); j++) {
|
| - entry_ = ic_.GetTargetOrCodeAt(j);
|
| - if (entry_.IsFunction()) {
|
| - target_ ^= entry_.raw();
|
| - ASSERT(target_.HasCode());
|
| - target_code_ = target_.CurrentCode();
|
| - entry_point_ =
|
| - Smi::FromAlignedAddress(target_code_.UncheckedEntryPoint());
|
| - ic_.SetCodeAt(j, target_code_);
|
| - ic_.SetEntryPointAt(j, entry_point_);
|
| - } else {
|
| - // We've already seen and switched this ICData.
|
| - ASSERT(entry_.IsCode());
|
| - }
|
| - }
|
| + ic_.ResetSwitchable(zone_);
|
| } else if (entry_.raw() ==
|
| StubCode::ICLookupThroughFunction_entry()->code()) {
|
| target_code_ = StubCode::ICLookupThroughCode_entry()->code();
|
| @@ -1958,13 +1942,12 @@ void Precompiler::SwitchICCalls() {
|
| }
|
|
|
| private:
|
| + Zone* zone_;
|
| Code& code_;
|
| ObjectPool& pool_;
|
| Object& entry_;
|
| ICData& ic_;
|
| - Function& target_;
|
| Code& target_code_;
|
| - Smi& entry_point_;
|
| };
|
|
|
| ASSERT(!I->compilation_allowed());
|
|
|