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

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: Code 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/objects.h ('k') | src/objects-debug.cc » ('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 // 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() {
11265 if (kind() != FUNCTION) return; 11265 FixedArray* vector = feedback_vector();
11266 Object* raw_info = type_feedback_info(); 11266 Heap* heap = GetHeap();
11267 if (raw_info->IsTypeFeedbackInfo()) { 11267 for (int i = 0; i < vector->length(); i++) {
11268 FixedArray* feedback_vector = 11268 Object* obj = vector->get(i);
11269 TypeFeedbackInfo::cast(raw_info)->feedback_vector(); 11269 if (!obj->IsAllocationSite()) {
11270 for (int i = 0; i < feedback_vector->length(); i++) { 11270 vector->set(
11271 Object* obj = feedback_vector->get(i); 11271 i,
11272 if (!obj->IsAllocationSite()) { 11272 TypeFeedbackInfo::RawUninitializedSentinel(heap),
11273 // TODO(mvstanton): Can't I avoid a write barrier for this sentinel? 11273 SKIP_WRITE_BARRIER);
11274 feedback_vector->set(i,
11275 TypeFeedbackInfo::RawUninitializedSentinel(heap));
11276 }
11277 } 11274 }
11278 } 11275 }
11279 } 11276 }
11280 11277
11281 11278
11282 BailoutId Code::TranslatePcOffsetToAstId(uint32_t pc_offset) { 11279 BailoutId Code::TranslatePcOffsetToAstId(uint32_t pc_offset) {
11283 DisallowHeapAllocation no_gc; 11280 DisallowHeapAllocation no_gc;
11284 ASSERT(kind() == FUNCTION); 11281 ASSERT(kind() == FUNCTION);
11285 BackEdgeTable back_edges(this, &no_gc); 11282 BackEdgeTable back_edges(this, &no_gc);
11286 for (uint32_t i = 0; i < back_edges.length(); i++) { 11283 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, 17339 #define ERROR_MESSAGES_TEXTS(C, T) T,
17343 static const char* error_messages_[] = { 17340 static const char* error_messages_[] = {
17344 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 17341 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
17345 }; 17342 };
17346 #undef ERROR_MESSAGES_TEXTS 17343 #undef ERROR_MESSAGES_TEXTS
17347 return error_messages_[reason]; 17344 return error_messages_[reason];
17348 } 17345 }
17349 17346
17350 17347
17351 } } // namespace v8::internal 17348 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698