OLD | NEW |
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 11746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11757 DisallowHeapAllocation no_allocation_scope; | 11757 DisallowHeapAllocation no_allocation_scope; |
11758 DependentCode::GroupStartIndexes starts(this); | 11758 DependentCode::GroupStartIndexes starts(this); |
11759 int start = starts.at(group); | 11759 int start = starts.at(group); |
11760 int end = starts.at(group + 1); | 11760 int end = starts.at(group + 1); |
11761 int code_entries = starts.number_of_entries(); | 11761 int code_entries = starts.number_of_entries(); |
11762 if (start == end) return false; | 11762 if (start == end) return false; |
11763 | 11763 |
11764 // Mark all the code that needs to be deoptimized. | 11764 // Mark all the code that needs to be deoptimized. |
11765 bool marked = false; | 11765 bool marked = false; |
11766 for (int i = start; i < end; i++) { | 11766 for (int i = start; i < end; i++) { |
11767 Object* object = object_at(i); | 11767 if (is_code_at(i)) { |
11768 // TODO(hpayer): This is a temporary hack. Foreign objects move after | 11768 Code* code = code_at(i); |
11769 // new space evacuation. Since pretenuring may mark these objects as aborted | |
11770 // we have to follow the forwarding pointer in that case. | |
11771 MapWord map_word = HeapObject::cast(object)->map_word(); | |
11772 if (map_word.IsForwardingAddress()) { | |
11773 object = map_word.ToForwardingAddress(); | |
11774 } | |
11775 if (object->IsCode()) { | |
11776 Code* code = Code::cast(object); | |
11777 if (!code->marked_for_deoptimization()) { | 11769 if (!code->marked_for_deoptimization()) { |
11778 code->set_marked_for_deoptimization(true); | 11770 code->set_marked_for_deoptimization(true); |
11779 marked = true; | 11771 marked = true; |
11780 } | 11772 } |
11781 } else { | 11773 } else { |
11782 CompilationInfo* info = reinterpret_cast<CompilationInfo*>( | 11774 CompilationInfo* info = compilation_info_at(i); |
11783 Foreign::cast(object)->foreign_address()); | |
11784 info->AbortDueToDependencyChange(); | 11775 info->AbortDueToDependencyChange(); |
11785 } | 11776 } |
11786 } | 11777 } |
11787 // Compact the array by moving all subsequent groups to fill in the new holes. | 11778 // Compact the array by moving all subsequent groups to fill in the new holes. |
11788 for (int src = end, dst = start; src < code_entries; src++, dst++) { | 11779 for (int src = end, dst = start; src < code_entries; src++, dst++) { |
11789 copy(src, dst); | 11780 copy(src, dst); |
11790 } | 11781 } |
11791 // Now the holes are at the end of the array, zap them for heap-verifier. | 11782 // Now the holes are at the end of the array, zap them for heap-verifier. |
11792 int removed = end - start; | 11783 int removed = end - start; |
11793 for (int i = code_entries - removed; i < code_entries; i++) { | 11784 for (int i = code_entries - removed; i < code_entries; i++) { |
(...skipping 4712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16506 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16497 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16507 static const char* error_messages_[] = { | 16498 static const char* error_messages_[] = { |
16508 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16499 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16509 }; | 16500 }; |
16510 #undef ERROR_MESSAGES_TEXTS | 16501 #undef ERROR_MESSAGES_TEXTS |
16511 return error_messages_[reason]; | 16502 return error_messages_[reason]; |
16512 } | 16503 } |
16513 | 16504 |
16514 | 16505 |
16515 } } // namespace v8::internal | 16506 } } // namespace v8::internal |
OLD | NEW |