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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ic.cc ('k') | src/type-info.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "accessors.h" 7 #include "accessors.h"
8 #include "allocation-site-scopes.h" 8 #include "allocation-site-scopes.h"
9 #include "api.h" 9 #include "api.h"
10 #include "arguments.h" 10 #include "arguments.h"
(...skipping 11227 matching lines...) Expand 10 before | Expand all | Expand 10 after
11238 info->host()->constant_pool()); 11238 info->host()->constant_pool());
11239 } 11239 }
11240 } 11240 }
11241 } 11241 }
11242 } 11242 }
11243 11243
11244 11244
11245 void SharedFunctionInfo::ClearTypeFeedbackInfo() { 11245 void SharedFunctionInfo::ClearTypeFeedbackInfo() {
11246 FixedArray* vector = feedback_vector(); 11246 FixedArray* vector = feedback_vector();
11247 Heap* heap = GetHeap(); 11247 Heap* heap = GetHeap();
11248 for (int i = 0; i < vector->length(); i++) { 11248 Context* context = GetIsolate()->context();
11249 JSFunction* array_function = context != NULL
11250 ? context->native_context()->array_function()
11251 : NULL;
11252 int length = vector->length();
11253
11254 for (int i = 0; i < length; i++) {
11249 Object* obj = vector->get(i); 11255 Object* obj = vector->get(i);
11250 if (!obj->IsAllocationSite()) { 11256 if (obj->IsHeapObject()) {
11251 vector->set( 11257 InstanceType instance_type =
11252 i, 11258 HeapObject::cast(obj)->map()->instance_type();
11253 TypeFeedbackInfo::RawUninitializedSentinel(heap), 11259 switch (instance_type) {
11254 SKIP_WRITE_BARRIER); 11260 case ALLOCATION_SITE_TYPE:
11261 // AllocationSites are not cleared because they do not store
11262 // information that leaks.
11263 break;
11264 case JS_FUNCTION_TYPE:
11265 // No need to clear the native context array function.
11266 if (obj == array_function) break;
11267 // Fall through...
11268 default:
11269 vector->set(i, TypeFeedbackInfo::RawUninitializedSentinel(heap),
11270 SKIP_WRITE_BARRIER);
11271 }
11255 } 11272 }
11256 } 11273 }
11257 } 11274 }
11258 11275
11259 11276
11260 BailoutId Code::TranslatePcOffsetToAstId(uint32_t pc_offset) { 11277 BailoutId Code::TranslatePcOffsetToAstId(uint32_t pc_offset) {
11261 DisallowHeapAllocation no_gc; 11278 DisallowHeapAllocation no_gc;
11262 ASSERT(kind() == FUNCTION); 11279 ASSERT(kind() == FUNCTION);
11263 BackEdgeTable back_edges(this, &no_gc); 11280 BackEdgeTable back_edges(this, &no_gc);
11264 for (uint32_t i = 0; i < back_edges.length(); i++) { 11281 for (uint32_t i = 0; i < back_edges.length(); i++) {
(...skipping 6028 matching lines...) Expand 10 before | Expand all | Expand 10 after
17293 #define ERROR_MESSAGES_TEXTS(C, T) T, 17310 #define ERROR_MESSAGES_TEXTS(C, T) T,
17294 static const char* error_messages_[] = { 17311 static const char* error_messages_[] = {
17295 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 17312 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
17296 }; 17313 };
17297 #undef ERROR_MESSAGES_TEXTS 17314 #undef ERROR_MESSAGES_TEXTS
17298 return error_messages_[reason]; 17315 return error_messages_[reason];
17299 } 17316 }
17300 17317
17301 17318
17302 } } // namespace v8::internal 17319 } } // namespace v8::internal
OLDNEW
« 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