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

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

Issue 23477061: Make objects embedded in optimized code weak. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix arm Created 7 years, 2 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/mark-compact.cc ('k') | src/objects.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 const Operand& src2) { 849 const Operand& src2) {
850 Deoptimizer::BailoutType bailout_type = info()->IsStub() 850 Deoptimizer::BailoutType bailout_type = info()->IsStub()
851 ? Deoptimizer::LAZY 851 ? Deoptimizer::LAZY
852 : Deoptimizer::EAGER; 852 : Deoptimizer::EAGER;
853 DeoptimizeIf(condition, environment, bailout_type, src1, src2); 853 DeoptimizeIf(condition, environment, bailout_type, src1, src2);
854 } 854 }
855 855
856 856
857 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { 857 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) {
858 ZoneList<Handle<Map> > maps(1, zone()); 858 ZoneList<Handle<Map> > maps(1, zone());
859 ZoneList<Handle<JSObject> > objects(1, zone());
859 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); 860 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
860 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { 861 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
861 RelocInfo::Mode mode = it.rinfo()->rmode(); 862 if (Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_object())) {
862 if (mode == RelocInfo::EMBEDDED_OBJECT && 863 if (it.rinfo()->target_object()->IsMap()) {
863 it.rinfo()->target_object()->IsMap()) { 864 Handle<Map> map(Map::cast(it.rinfo()->target_object()));
864 Handle<Map> map(Map::cast(it.rinfo()->target_object()));
865 if (map->CanTransition()) {
866 maps.Add(map, zone()); 865 maps.Add(map, zone());
866 } else if (it.rinfo()->target_object()->IsJSObject()) {
867 Handle<JSObject> object(JSObject::cast(it.rinfo()->target_object()));
868 objects.Add(object, zone());
867 } 869 }
868 } 870 }
869 } 871 }
870 #ifdef VERIFY_HEAP 872 #ifdef VERIFY_HEAP
871 // This disables verification of weak embedded maps after full GC. 873 // This disables verification of weak embedded objects after full GC.
872 // AddDependentCode can cause a GC, which would observe the state where 874 // AddDependentCode can cause a GC, which would observe the state where
873 // this code is not yet in the depended code lists of the embedded maps. 875 // this code is not yet in the depended code lists of the embedded maps.
874 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; 876 NoWeakObjectVerificationScope disable_verification_of_embedded_objects;
875 #endif 877 #endif
876 for (int i = 0; i < maps.length(); i++) { 878 for (int i = 0; i < maps.length(); i++) {
877 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); 879 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code);
878 } 880 }
881 for (int i = 0; i < objects.length(); i++) {
882 AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code);
883 }
879 } 884 }
880 885
881 886
882 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { 887 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) {
883 int length = deoptimizations_.length(); 888 int length = deoptimizations_.length();
884 if (length == 0) return; 889 if (length == 0) return;
885 Handle<DeoptimizationInputData> data = 890 Handle<DeoptimizationInputData> data =
886 factory()->NewDeoptimizationInputData(length, TENURED); 891 factory()->NewDeoptimizationInputData(length, TENURED);
887 892
888 Handle<ByteArray> translations = 893 Handle<ByteArray> translations =
(...skipping 4959 matching lines...) Expand 10 before | Expand all | Expand 10 after
5848 __ Subu(scratch, result, scratch); 5853 __ Subu(scratch, result, scratch);
5849 __ lw(result, FieldMemOperand(scratch, 5854 __ lw(result, FieldMemOperand(scratch,
5850 FixedArray::kHeaderSize - kPointerSize)); 5855 FixedArray::kHeaderSize - kPointerSize));
5851 __ bind(&done); 5856 __ bind(&done);
5852 } 5857 }
5853 5858
5854 5859
5855 #undef __ 5860 #undef __
5856 5861
5857 } } // namespace v8::internal 5862 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698