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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 12256038: Register dependent codes before populating deoptimization data, which can cause GC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « src/x64/lithium-codegen-x64.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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 GenerateDeferredCode() && 81 GenerateDeferredCode() &&
82 GenerateJumpTable() && 82 GenerateJumpTable() &&
83 GenerateSafepointTable(); 83 GenerateSafepointTable();
84 } 84 }
85 85
86 86
87 void LCodeGen::FinishCode(Handle<Code> code) { 87 void LCodeGen::FinishCode(Handle<Code> code) {
88 ASSERT(is_done()); 88 ASSERT(is_done());
89 code->set_stack_slots(GetStackSlotCount()); 89 code->set_stack_slots(GetStackSlotCount());
90 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); 90 code->set_safepoint_table_offset(safepoints_.GetCodeOffset());
91 if (FLAG_weak_embedded_maps_in_optimized_code) {
92 RegisterDependentCodeForEmbeddedMaps(code);
93 }
91 PopulateDeoptimizationData(code); 94 PopulateDeoptimizationData(code);
92 } 95 }
93 96
94 97
95 void LChunkBuilder::Abort(const char* reason) { 98 void LChunkBuilder::Abort(const char* reason) {
96 info()->set_bailout_reason(reason); 99 info()->set_bailout_reason(reason);
97 status_ = ABORTED; 100 status_ = ABORTED;
98 } 101 }
99 102
100 103
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 } 753 }
751 if (cc == no_condition) { 754 if (cc == no_condition) {
752 __ jmp(&jump_table_.last().label); 755 __ jmp(&jump_table_.last().label);
753 } else { 756 } else {
754 __ j(cc, &jump_table_.last().label); 757 __ j(cc, &jump_table_.last().label);
755 } 758 }
756 } 759 }
757 } 760 }
758 761
759 762
763 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) {
764 ZoneList<Handle<Map> > maps(1, zone());
765 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
766 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
767 RelocInfo::Mode mode = it.rinfo()->rmode();
768 if (mode == RelocInfo::EMBEDDED_OBJECT &&
769 it.rinfo()->target_object()->IsMap()) {
770 Handle<Map> map(Map::cast(it.rinfo()->target_object()));
771 if (map->CanTransition()) {
772 maps.Add(map, zone());
773 }
774 }
775 }
776 #ifdef VERIFY_HEAP
777 // This disables verification of weak embedded maps after full GC.
778 // AddDependentCode can cause a GC, which would observe the state where
779 // this code is not yet in the depended code lists of the embedded maps.
780 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps;
781 #endif
782 for (int i = 0; i < maps.length(); i++) {
783 maps.at(i)->AddDependentCode(code);
784 }
785 }
786
787
760 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { 788 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) {
761 int length = deoptimizations_.length(); 789 int length = deoptimizations_.length();
762 if (length == 0) return; 790 if (length == 0) return;
763 Handle<DeoptimizationInputData> data = 791 Handle<DeoptimizationInputData> data =
764 factory()->NewDeoptimizationInputData(length, TENURED); 792 factory()->NewDeoptimizationInputData(length, TENURED);
765 793
766 Handle<ByteArray> translations = translations_.CreateByteArray(); 794 Handle<ByteArray> translations = translations_.CreateByteArray();
767 data->SetTranslationByteArray(*translations); 795 data->SetTranslationByteArray(*translations);
768 data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); 796 data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_));
769 797
(...skipping 4960 matching lines...) Expand 10 before | Expand all | Expand 10 after
5730 FixedArray::kHeaderSize - kPointerSize)); 5758 FixedArray::kHeaderSize - kPointerSize));
5731 __ bind(&done); 5759 __ bind(&done);
5732 } 5760 }
5733 5761
5734 5762
5735 #undef __ 5763 #undef __
5736 5764
5737 } } // namespace v8::internal 5765 } } // namespace v8::internal
5738 5766
5739 #endif // V8_TARGET_ARCH_X64 5767 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698