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

Side by Side Diff: src/objects.cc

Issue 148493004: Check forwarding pointer when marking objects for deoptimization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 | « no previous file | 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 11727 matching lines...) Expand 10 before | Expand all | Expand 10 after
11738 DisallowHeapAllocation no_allocation_scope; 11738 DisallowHeapAllocation no_allocation_scope;
11739 DependentCode::GroupStartIndexes starts(this); 11739 DependentCode::GroupStartIndexes starts(this);
11740 int start = starts.at(group); 11740 int start = starts.at(group);
11741 int end = starts.at(group + 1); 11741 int end = starts.at(group + 1);
11742 int code_entries = starts.number_of_entries(); 11742 int code_entries = starts.number_of_entries();
11743 if (start == end) return false; 11743 if (start == end) return false;
11744 11744
11745 // Mark all the code that needs to be deoptimized. 11745 // Mark all the code that needs to be deoptimized.
11746 bool marked = false; 11746 bool marked = false;
11747 for (int i = start; i < end; i++) { 11747 for (int i = start; i < end; i++) {
11748 if (is_code_at(i)) { 11748 Object* object = object_at(i);
11749 Code* code = code_at(i); 11749 // TODO(hpayer): This is a temporary hack. Foreign objects move after
11750 // new space evacuation. Since pretenuring may mark these objects as aborted
11751 // we have to follow the forwarding pointer in that case.
11752 MapWord map_word = HeapObject::cast(object)->map_word();
11753 if (map_word.IsForwardingAddress()) {
11754 object = map_word.ToForwardingAddress();
11755 }
11756 if (object->IsCode()) {
11757 Code* code = Code::cast(object);
11750 if (!code->marked_for_deoptimization()) { 11758 if (!code->marked_for_deoptimization()) {
11751 code->set_marked_for_deoptimization(true); 11759 code->set_marked_for_deoptimization(true);
11752 marked = true; 11760 marked = true;
11753 } 11761 }
11754 } else { 11762 } else {
11755 CompilationInfo* info = compilation_info_at(i); 11763 CompilationInfo* info = reinterpret_cast<CompilationInfo*>(
11764 Foreign::cast(object)->foreign_address());
11756 info->AbortDueToDependencyChange(); 11765 info->AbortDueToDependencyChange();
11757 } 11766 }
11758 } 11767 }
11759 // Compact the array by moving all subsequent groups to fill in the new holes. 11768 // Compact the array by moving all subsequent groups to fill in the new holes.
11760 for (int src = end, dst = start; src < code_entries; src++, dst++) { 11769 for (int src = end, dst = start; src < code_entries; src++, dst++) {
11761 copy(src, dst); 11770 copy(src, dst);
11762 } 11771 }
11763 // Now the holes are at the end of the array, zap them for heap-verifier. 11772 // Now the holes are at the end of the array, zap them for heap-verifier.
11764 int removed = end - start; 11773 int removed = end - start;
11765 for (int i = code_entries - removed; i < code_entries; i++) { 11774 for (int i = code_entries - removed; i < code_entries; i++) {
(...skipping 4701 matching lines...) Expand 10 before | Expand all | Expand 10 after
16467 #define ERROR_MESSAGES_TEXTS(C, T) T, 16476 #define ERROR_MESSAGES_TEXTS(C, T) T,
16468 static const char* error_messages_[] = { 16477 static const char* error_messages_[] = {
16469 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16478 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16470 }; 16479 };
16471 #undef ERROR_MESSAGES_TEXTS 16480 #undef ERROR_MESSAGES_TEXTS
16472 return error_messages_[reason]; 16481 return error_messages_[reason];
16473 } 16482 }
16474 16483
16475 16484
16476 } } // namespace v8::internal 16485 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698