Chromium Code Reviews| Index: src/objects.cc |
| diff --git a/src/objects.cc b/src/objects.cc |
| index fa4f943dca48f700965fda5f16d6d0b2fff723af..20b0737a957da0c7ae80a2fe7329da855f832fb4 100644 |
| --- a/src/objects.cc |
| +++ b/src/objects.cc |
| @@ -7869,6 +7869,14 @@ void SharedFunctionInfo::AttachInitialMap(Map* map) { |
| } |
| +void SharedFunctionInfo::ResetForNewContext(int new_ic_age) { |
| + code()->ClearInlineCaches(); |
| + set_ic_age(new_ic_age); |
| + set_opt_count(0); |
| + set_profiler_ticks(0); |
| +} |
| + |
| + |
| static void GetMinInobjectSlack(Map* map, void* data) { |
| int slack = map->unused_property_fields(); |
| if (*reinterpret_cast<int*>(data) > slack) { |
| @@ -8116,6 +8124,21 @@ Map* Code::FindFirstMap() { |
| } |
| +void Code::ClearInlineCaches() { |
| + int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) | |
| + RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) | |
| + RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID) | |
| + RelocInfo::ModeMask(RelocInfo::CODE_TARGET_CONTEXT); |
| + for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| + RelocInfo* info = it.rinfo(); |
| + Code* target(Code::GetCodeFromTargetAddress(info->target_address())); |
| + if (target->is_inline_cache_stub()) { |
|
Jakob Kummerow
2012/03/26 08:52:43
nit: indentation
|
| + IC::Clear(info->pc()); |
| + } |
| + } |
| +} |
| + |
| + |
| #ifdef ENABLE_DISASSEMBLER |
| void DeoptimizationInputData::DeoptimizationInputDataPrint(FILE* out) { |