Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: src/objects.cc

Issue 9836091: Reset function info counters after context disposal. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comment Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 7851 matching lines...) Expand 10 before | Expand all | Expand 10 after
7862 set_initial_map(map); 7862 set_initial_map(map);
7863 Builtins* builtins = map->GetHeap()->isolate()->builtins(); 7863 Builtins* builtins = map->GetHeap()->isolate()->builtins();
7864 ASSERT_EQ(builtins->builtin(Builtins::kJSConstructStubGeneric), 7864 ASSERT_EQ(builtins->builtin(Builtins::kJSConstructStubGeneric),
7865 *RawField(this, kConstructStubOffset)); 7865 *RawField(this, kConstructStubOffset));
7866 set_construct_stub(builtins->builtin(Builtins::kJSConstructStubCountdown)); 7866 set_construct_stub(builtins->builtin(Builtins::kJSConstructStubCountdown));
7867 // The map survived the gc, so there may be objects referencing it. 7867 // The map survived the gc, so there may be objects referencing it.
7868 set_live_objects_may_exist(true); 7868 set_live_objects_may_exist(true);
7869 } 7869 }
7870 7870
7871 7871
7872 void SharedFunctionInfo::ResetForNewContext(int new_ic_age) {
7873 code()->ClearInlineCaches();
7874 set_ic_age(new_ic_age);
7875 set_opt_count(0);
7876 set_profiler_ticks(0);
7877 }
7878
7879
7872 static void GetMinInobjectSlack(Map* map, void* data) { 7880 static void GetMinInobjectSlack(Map* map, void* data) {
7873 int slack = map->unused_property_fields(); 7881 int slack = map->unused_property_fields();
7874 if (*reinterpret_cast<int*>(data) > slack) { 7882 if (*reinterpret_cast<int*>(data) > slack) {
7875 *reinterpret_cast<int*>(data) = slack; 7883 *reinterpret_cast<int*>(data) = slack;
7876 } 7884 }
7877 } 7885 }
7878 7886
7879 7887
7880 static void ShrinkInstanceSize(Map* map, void* data) { 7888 static void ShrinkInstanceSize(Map* map, void* data) {
7881 int slack = *reinterpret_cast<int*>(data); 7889 int slack = *reinterpret_cast<int*>(data);
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
8109 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); 8117 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
8110 for (RelocIterator it(this, mask); !it.done(); it.next()) { 8118 for (RelocIterator it(this, mask); !it.done(); it.next()) {
8111 RelocInfo* info = it.rinfo(); 8119 RelocInfo* info = it.rinfo();
8112 Object* object = info->target_object(); 8120 Object* object = info->target_object();
8113 if (object->IsMap()) return Map::cast(object); 8121 if (object->IsMap()) return Map::cast(object);
8114 } 8122 }
8115 return NULL; 8123 return NULL;
8116 } 8124 }
8117 8125
8118 8126
8127 void Code::ClearInlineCaches() {
8128 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
8129 RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) |
8130 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID) |
8131 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_CONTEXT);
8132 for (RelocIterator it(this, mask); !it.done(); it.next()) {
8133 RelocInfo* info = it.rinfo();
8134 Code* target(Code::GetCodeFromTargetAddress(info->target_address()));
8135 if (target->is_inline_cache_stub()) {
8136 IC::Clear(info->pc());
8137 }
8138 }
8139 }
8140
8141
8119 #ifdef ENABLE_DISASSEMBLER 8142 #ifdef ENABLE_DISASSEMBLER
8120 8143
8121 void DeoptimizationInputData::DeoptimizationInputDataPrint(FILE* out) { 8144 void DeoptimizationInputData::DeoptimizationInputDataPrint(FILE* out) {
8122 disasm::NameConverter converter; 8145 disasm::NameConverter converter;
8123 int deopt_count = DeoptCount(); 8146 int deopt_count = DeoptCount();
8124 PrintF(out, "Deoptimization Input Data (deopt points = %d)\n", deopt_count); 8147 PrintF(out, "Deoptimization Input Data (deopt points = %d)\n", deopt_count);
8125 if (0 == deopt_count) return; 8148 if (0 == deopt_count) return;
8126 8149
8127 PrintF(out, "%6s %6s %6s %6s %12s\n", "index", "ast id", "argc", "pc", 8150 PrintF(out, "%6s %6s %6s %6s %12s\n", "index", "ast id", "argc", "pc",
8128 FLAG_print_code_verbose ? "commands" : ""); 8151 FLAG_print_code_verbose ? "commands" : "");
(...skipping 4808 matching lines...) Expand 10 before | Expand all | Expand 10 after
12937 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 12960 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
12938 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 12961 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
12939 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 12962 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
12940 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 12963 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
12941 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 12964 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
12942 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 12965 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
12943 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 12966 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
12944 } 12967 }
12945 12968
12946 } } // namespace v8::internal 12969 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698