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

Side by Side Diff: src/objects.cc

Issue 254623002: Simplify feedback vector creation and store in SharedFunctionInfo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 11243 matching lines...) Expand 10 before | Expand all | Expand 10 after
11254 if (target->is_inline_cache_stub()) { 11254 if (target->is_inline_cache_stub()) {
11255 if (kind == NULL || *kind == target->kind()) { 11255 if (kind == NULL || *kind == target->kind()) {
11256 IC::Clear(this->GetIsolate(), info->pc(), 11256 IC::Clear(this->GetIsolate(), info->pc(),
11257 info->host()->constant_pool()); 11257 info->host()->constant_pool());
11258 } 11258 }
11259 } 11259 }
11260 } 11260 }
11261 } 11261 }
11262 11262
11263 11263
11264 void Code::ClearTypeFeedbackInfo(Heap* heap) { 11264 void SharedFunctionInfo::ClearTypeFeedbackInfo(Heap* heap) {
Benedikt Meurer 2014/04/28 19:17:00 Nit: Please remove the useless Heap parameter and
mvstanton 2014/04/30 08:31:18 Done.
11265 if (kind() != FUNCTION) return; 11265 FixedArray* vector = feedback_vector();
11266 Object* raw_info = type_feedback_info(); 11266 for (int i = 0; i < vector->length(); i++) {
11267 if (raw_info->IsTypeFeedbackInfo()) { 11267 Object* obj = vector->get(i);
11268 FixedArray* feedback_vector = 11268 if (!obj->IsAllocationSite()) {
11269 TypeFeedbackInfo::cast(raw_info)->feedback_vector(); 11269 vector->set(
11270 for (int i = 0; i < feedback_vector->length(); i++) { 11270 i,
11271 Object* obj = feedback_vector->get(i); 11271 TypeFeedbackInfo::RawUninitializedSentinel(heap),
11272 if (!obj->IsAllocationSite()) { 11272 SKIP_WRITE_BARRIER);
11273 // TODO(mvstanton): Can't I avoid a write barrier for this sentinel?
11274 feedback_vector->set(i,
11275 TypeFeedbackInfo::RawUninitializedSentinel(heap));
11276 }
11277 } 11273 }
11278 } 11274 }
11279 } 11275 }
11280 11276
11281 11277
11282 BailoutId Code::TranslatePcOffsetToAstId(uint32_t pc_offset) { 11278 BailoutId Code::TranslatePcOffsetToAstId(uint32_t pc_offset) {
11283 DisallowHeapAllocation no_gc; 11279 DisallowHeapAllocation no_gc;
11284 ASSERT(kind() == FUNCTION); 11280 ASSERT(kind() == FUNCTION);
11285 BackEdgeTable back_edges(this, &no_gc); 11281 BackEdgeTable back_edges(this, &no_gc);
11286 for (uint32_t i = 0; i < back_edges.length(); i++) { 11282 for (uint32_t i = 0; i < back_edges.length(); i++) {
(...skipping 6055 matching lines...) Expand 10 before | Expand all | Expand 10 after
17342 #define ERROR_MESSAGES_TEXTS(C, T) T, 17338 #define ERROR_MESSAGES_TEXTS(C, T) T,
17343 static const char* error_messages_[] = { 17339 static const char* error_messages_[] = {
17344 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 17340 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
17345 }; 17341 };
17346 #undef ERROR_MESSAGES_TEXTS 17342 #undef ERROR_MESSAGES_TEXTS
17347 return error_messages_[reason]; 17343 return error_messages_[reason];
17348 } 17344 }
17349 17345
17350 17346
17351 } } // namespace v8::internal 17347 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698