| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index 64d85a0685a98470ad66df6207a6f18f8448eeae..208c75b8ac19df3054c0125efbca4fa7e1b1c2c0 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -1390,9 +1390,11 @@ void HeapObject::IterateBody(InstanceType type, int object_size,
|
| case EXTERNAL_FLOAT_ARRAY_TYPE:
|
| case EXTERNAL_DOUBLE_ARRAY_TYPE:
|
| break;
|
| - case SHARED_FUNCTION_INFO_TYPE:
|
| - SharedFunctionInfo::BodyDescriptor::IterateBody(this, v);
|
| + case SHARED_FUNCTION_INFO_TYPE: {
|
| + SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(this);
|
| + shared->SharedFunctionInfoIterateBody(v);
|
| break;
|
| + }
|
|
|
| #define MAKE_STRUCT_CASE(NAME, Name, name) \
|
| case NAME##_TYPE:
|
| @@ -7869,6 +7871,22 @@ void SharedFunctionInfo::AttachInitialMap(Map* map) {
|
| }
|
|
|
|
|
| +void SharedFunctionInfo::ResetForNewContext(int new_ic_age) {
|
| + code()->ClearInlineCaches();
|
| + set_ic_age(new_ic_age);
|
| + if (code()->kind() == Code::FUNCTION) {
|
| + code()->set_profiler_ticks(0);
|
| + if (optimization_disabled() &&
|
| + opt_count() >= Compiler::kDefaultMaxOptCount) {
|
| + // Re-enable optimizations if they were disabled due to opt_count limit.
|
| + set_optimization_disabled(false);
|
| + code()->set_optimizable(true);
|
| + }
|
| + set_opt_count(0);
|
| + }
|
| +}
|
| +
|
| +
|
| static void GetMinInobjectSlack(Map* map, void* data) {
|
| int slack = map->unused_property_fields();
|
| if (*reinterpret_cast<int*>(data) > slack) {
|
| @@ -7912,6 +7930,12 @@ void SharedFunctionInfo::CompleteInobjectSlackTracking() {
|
| }
|
|
|
|
|
| +void SharedFunctionInfo::SharedFunctionInfoIterateBody(ObjectVisitor* v) {
|
| + v->VisitSharedFunctionInfo(this);
|
| + SharedFunctionInfo::BodyDescriptor::IterateBody(this, v);
|
| +}
|
| +
|
| +
|
| #define DECLARE_TAG(ignore1, name, ignore2) name,
|
| const char* const VisitorSynchronization::kTags[
|
| VisitorSynchronization::kNumberOfSyncTags] = {
|
| @@ -7969,7 +7993,6 @@ void ObjectVisitor::VisitDebugTarget(RelocInfo* rinfo) {
|
| CHECK_EQ(target, old_target); // VisitPointer doesn't change Code* *target.
|
| }
|
|
|
| -
|
| void ObjectVisitor::VisitEmbeddedPointer(RelocInfo* rinfo) {
|
| ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT);
|
| VisitPointer(rinfo->target_object_address());
|
| @@ -8116,6 +8139,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()) {
|
| + IC::Clear(info->pc());
|
| + }
|
| + }
|
| +}
|
| +
|
| +
|
| #ifdef ENABLE_DISASSEMBLER
|
|
|
| void DeoptimizationInputData::DeoptimizationInputDataPrint(FILE* out) {
|
|
|