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

Unified Diff: src/objects.cc

Issue 279423005: Customized support for feedback on calls to Array. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase and comments. Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic.cc ('k') | src/type-info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 5665889c17762ad243d845aa7c5f50e0ceba0701..77f00d550136e6b15b52e83d18c9589660fada0d 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -11245,13 +11245,30 @@ void Code::ClearInlineCaches(Code::Kind* kind) {
void SharedFunctionInfo::ClearTypeFeedbackInfo() {
FixedArray* vector = feedback_vector();
Heap* heap = GetHeap();
- for (int i = 0; i < vector->length(); i++) {
+ Context* context = GetIsolate()->context();
+ JSFunction* array_function = context != NULL
+ ? context->native_context()->array_function()
+ : NULL;
+ int length = vector->length();
+
+ for (int i = 0; i < length; i++) {
Object* obj = vector->get(i);
- if (!obj->IsAllocationSite()) {
- vector->set(
- i,
- TypeFeedbackInfo::RawUninitializedSentinel(heap),
- SKIP_WRITE_BARRIER);
+ if (obj->IsHeapObject()) {
+ InstanceType instance_type =
+ HeapObject::cast(obj)->map()->instance_type();
+ switch (instance_type) {
+ case ALLOCATION_SITE_TYPE:
+ // AllocationSites are not cleared because they do not store
+ // information that leaks.
+ break;
+ case JS_FUNCTION_TYPE:
+ // No need to clear the native context array function.
+ if (obj == array_function) break;
+ // Fall through...
+ default:
+ vector->set(i, TypeFeedbackInfo::RawUninitializedSentinel(heap),
+ SKIP_WRITE_BARRIER);
+ }
}
}
}
« no previous file with comments | « src/ic.cc ('k') | src/type-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698