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

Side by Side Diff: src/objects.cc

Issue 23444029: Add OptimizedCodeList and DeoptimizedCodeList to native contexts. Both lists are weak. This makes i… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed final comments. Created 7 years, 3 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-inl.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 // 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 11379 matching lines...) Expand 10 before | Expand all | Expand 10 after
11390 Isolate* isolate, 11390 Isolate* isolate,
11391 DependentCode::DependencyGroup group) { 11391 DependentCode::DependencyGroup group) {
11392 ASSERT(AllowCodeDependencyChange::IsAllowed()); 11392 ASSERT(AllowCodeDependencyChange::IsAllowed());
11393 DisallowHeapAllocation no_allocation_scope; 11393 DisallowHeapAllocation no_allocation_scope;
11394 DependentCode::GroupStartIndexes starts(this); 11394 DependentCode::GroupStartIndexes starts(this);
11395 int start = starts.at(group); 11395 int start = starts.at(group);
11396 int end = starts.at(group + 1); 11396 int end = starts.at(group + 1);
11397 int code_entries = starts.number_of_entries(); 11397 int code_entries = starts.number_of_entries();
11398 if (start == end) return; 11398 if (start == end) return;
11399 11399
11400 // Collect all the code to deoptimize. 11400 // Mark all the code that needs to be deoptimized.
11401 Zone zone(isolate); 11401 bool marked = false;
11402 ZoneList<Code*> codes(end - start, &zone);
11403 for (int i = start; i < end; i++) { 11402 for (int i = start; i < end; i++) {
11404 if (is_code_at(i)) { 11403 if (is_code_at(i)) {
11405 Code* code = code_at(i); 11404 Code* code = code_at(i);
11406 if (!code->marked_for_deoptimization()) codes.Add(code, &zone); 11405 if (!code->marked_for_deoptimization()) {
11406 code->set_marked_for_deoptimization(true);
11407 marked = true;
11408 }
11407 } else { 11409 } else {
11408 CompilationInfo* info = compilation_info_at(i); 11410 CompilationInfo* info = compilation_info_at(i);
11409 info->AbortDueToDependencyChange(); 11411 info->AbortDueToDependencyChange();
11410 } 11412 }
11411 } 11413 }
11412 // Compact the array by moving all subsequent groups to fill in the new holes. 11414 // Compact the array by moving all subsequent groups to fill in the new holes.
11413 for (int src = end, dst = start; src < code_entries; src++, dst++) { 11415 for (int src = end, dst = start; src < code_entries; src++, dst++) {
11414 copy(src, dst); 11416 copy(src, dst);
11415 } 11417 }
11416 // Now the holes are at the end of the array, zap them for heap-verifier. 11418 // Now the holes are at the end of the array, zap them for heap-verifier.
11417 int removed = end - start; 11419 int removed = end - start;
11418 for (int i = code_entries - removed; i < code_entries; i++) { 11420 for (int i = code_entries - removed; i < code_entries; i++) {
11419 clear_at(i); 11421 clear_at(i);
11420 } 11422 }
11421 set_number_of_entries(group, 0); 11423 set_number_of_entries(group, 0);
11422 Deoptimizer::DeoptimizeCodeList(isolate, &codes); 11424
11425 if (marked) Deoptimizer::DeoptimizeMarkedCode(isolate);
11423 } 11426 }
11424 11427
11425 11428
11426 Handle<Object> JSObject::SetPrototype(Handle<JSObject> object, 11429 Handle<Object> JSObject::SetPrototype(Handle<JSObject> object,
11427 Handle<Object> value, 11430 Handle<Object> value,
11428 bool skip_hidden_prototypes) { 11431 bool skip_hidden_prototypes) {
11429 #ifdef DEBUG 11432 #ifdef DEBUG
11430 int size = object->Size(); 11433 int size = object->Size();
11431 #endif 11434 #endif
11432 11435
(...skipping 4587 matching lines...) Expand 10 before | Expand all | Expand 10 after
16020 #define ERROR_MESSAGES_TEXTS(C, T) T, 16023 #define ERROR_MESSAGES_TEXTS(C, T) T,
16021 static const char* error_messages_[] = { 16024 static const char* error_messages_[] = {
16022 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16025 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16023 }; 16026 };
16024 #undef ERROR_MESSAGES_TEXTS 16027 #undef ERROR_MESSAGES_TEXTS
16025 return error_messages_[reason]; 16028 return error_messages_[reason];
16026 } 16029 }
16027 16030
16028 16031
16029 } } // namespace v8::internal 16032 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698