Chromium Code Reviews| Index: runtime/vm/object.cc |
| =================================================================== |
| --- runtime/vm/object.cc (revision 33386) |
| +++ runtime/vm/object.cc (working copy) |
| @@ -10964,10 +10964,12 @@ |
| RawFunction* ICData::GetTargetAt(intptr_t index) const { |
| - const Array& data = Array::Handle(ic_data()); |
| const intptr_t data_pos = index * TestEntryLength() + num_args_tested(); |
| - ASSERT(Object::Handle(data.At(data_pos)).IsFunction()); |
| - return reinterpret_cast<RawFunction*>(data.At(data_pos)); |
| + ASSERT(Object::Handle(Array::Handle(ic_data()).At(data_pos)).IsFunction()); |
| + |
| + NoGCScope no_gc; |
| + RawArray* raw_data = ic_data(); |
| + return reinterpret_cast<RawFunction*>(raw_data->ptr()->data()[data_pos]); |
| } |
| @@ -11112,11 +11114,12 @@ |
| // Returns true if all targets are the same. |
| // TODO(srdjan): if targets are native use their C_function to compare. |
| bool ICData::HasOneTarget() const { |
| - ASSERT(NumberOfChecks() > 0); |
| - const Function& first_target = Function::Handle(GetTargetAt(0)); |
| const intptr_t len = NumberOfChecks(); |
| + ASSERT(len > 0); |
| + NoGCScope no_gc; |
| + RawFunction* first_target = GetTargetAt(0); |
|
siva
2014/03/06 18:47:00
I am a little bit concerned about putting a NoGCSc
srdjan
2014/03/06 18:50:53
I agree with your concern, reverting code of this
|
| for (intptr_t i = 1; i < len; i++) { |
| - if (GetTargetAt(i) != first_target.raw()) { |
| + if (GetTargetAt(i) != first_target) { |
| return false; |
| } |
| } |
| @@ -11305,8 +11308,9 @@ |
| intptr_t SubtypeTestCache::NumberOfChecks() const { |
| + NoGCScope no_gc; |
| // Do not count the sentinel; |
| - return (Array::Handle(cache()).Length() / kTestEntryLength) - 1; |
| + return (Smi::Value(cache()->ptr()->length_) / kTestEntryLength) - 1; |
| } |