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

Side by Side Diff: src/objects.cc

Issue 59823002: Reset opt count on optimized code map lookup failure. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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
« src/heap.cc ('K') | « src/hydrogen-instructions.h ('k') | no next file » | 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 9539 matching lines...) Expand 10 before | Expand all | Expand 10 after
9550 FixedArray* literals) { 9550 FixedArray* literals) {
9551 ASSERT(code->kind() == Code::OPTIMIZED_FUNCTION); 9551 ASSERT(code->kind() == Code::OPTIMIZED_FUNCTION);
9552 ASSERT(native_context->IsNativeContext()); 9552 ASSERT(native_context->IsNativeContext());
9553 STATIC_ASSERT(kEntryLength == 3); 9553 STATIC_ASSERT(kEntryLength == 3);
9554 Heap* heap = GetHeap(); 9554 Heap* heap = GetHeap();
9555 FixedArray* new_code_map; 9555 FixedArray* new_code_map;
9556 Object* value = optimized_code_map(); 9556 Object* value = optimized_code_map();
9557 if (value->IsSmi()) { 9557 if (value->IsSmi()) {
9558 // No optimized code map. 9558 // No optimized code map.
9559 ASSERT_EQ(0, Smi::cast(value)->value()); 9559 ASSERT_EQ(0, Smi::cast(value)->value());
9560 // Crate 3 entries per context {context, code, literals}. 9560 // Create 3 entries per context {context, code, literals}.
9561 MaybeObject* maybe = heap->AllocateFixedArray(kInitialLength); 9561 MaybeObject* maybe = heap->AllocateFixedArray(kInitialLength);
9562 if (!maybe->To(&new_code_map)) return maybe; 9562 if (!maybe->To(&new_code_map)) return maybe;
9563 new_code_map->set(kEntriesStart + 0, native_context); 9563 new_code_map->set(kEntriesStart + 0, native_context);
9564 new_code_map->set(kEntriesStart + 1, code); 9564 new_code_map->set(kEntriesStart + 1, code);
9565 new_code_map->set(kEntriesStart + 2, literals); 9565 new_code_map->set(kEntriesStart + 2, literals);
9566 } else { 9566 } else {
9567 // Copy old map and append one new entry. 9567 // Copy old map and append one new entry.
9568 FixedArray* old_code_map = FixedArray::cast(value); 9568 FixedArray* old_code_map = FixedArray::cast(value);
9569 ASSERT_EQ(-1, SearchOptimizedCodeMap(native_context)); 9569 ASSERT_EQ(-1, SearchOptimizedCodeMap(native_context));
9570 int old_length = old_code_map->length(); 9570 int old_length = old_code_map->length();
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
10201 code()->ClearInlineCaches(); 10201 code()->ClearInlineCaches();
10202 set_ic_age(new_ic_age); 10202 set_ic_age(new_ic_age);
10203 if (code()->kind() == Code::FUNCTION) { 10203 if (code()->kind() == Code::FUNCTION) {
10204 code()->set_profiler_ticks(0); 10204 code()->set_profiler_ticks(0);
10205 if (optimization_disabled() && 10205 if (optimization_disabled() &&
10206 opt_count() >= FLAG_max_opt_count) { 10206 opt_count() >= FLAG_max_opt_count) {
10207 // Re-enable optimizations if they were disabled due to opt_count limit. 10207 // Re-enable optimizations if they were disabled due to opt_count limit.
10208 set_optimization_disabled(false); 10208 set_optimization_disabled(false);
10209 code()->set_optimizable(true); 10209 code()->set_optimizable(true);
10210 } 10210 }
10211 set_opt_count(0);
10212 set_deopt_count(0);
10213 } 10211 }
10212 set_opt_count(0);
10213 set_deopt_count(0);
10214 } 10214 }
10215 10215
10216 10216
10217 static void GetMinInobjectSlack(Map* map, void* data) { 10217 static void GetMinInobjectSlack(Map* map, void* data) {
10218 int slack = map->unused_property_fields(); 10218 int slack = map->unused_property_fields();
10219 if (*reinterpret_cast<int*>(data) > slack) { 10219 if (*reinterpret_cast<int*>(data) > slack) {
10220 *reinterpret_cast<int*>(data) = slack; 10220 *reinterpret_cast<int*>(data) = slack;
10221 } 10221 }
10222 } 10222 }
10223 10223
(...skipping 6239 matching lines...) Expand 10 before | Expand all | Expand 10 after
16463 #define ERROR_MESSAGES_TEXTS(C, T) T, 16463 #define ERROR_MESSAGES_TEXTS(C, T) T,
16464 static const char* error_messages_[] = { 16464 static const char* error_messages_[] = {
16465 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16465 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16466 }; 16466 };
16467 #undef ERROR_MESSAGES_TEXTS 16467 #undef ERROR_MESSAGES_TEXTS
16468 return error_messages_[reason]; 16468 return error_messages_[reason];
16469 } 16469 }
16470 16470
16471 16471
16472 } } // namespace v8::internal 16472 } } // namespace v8::internal
OLDNEW
« src/heap.cc ('K') | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698