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

Unified Diff: src/lithium-codegen.cc

Issue 866723002: Treat pointers in optimized code as strong before all weak dependencies are registered. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix check Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/lithium.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lithium-codegen.cc
diff --git a/src/lithium-codegen.cc b/src/lithium-codegen.cc
index 27c5c01b0108e7e654ff4db96b9a68a2d4be42aa..3ca47e1e8da75c6556f0d54e6c649a7ada190ce9 100644
--- a/src/lithium-codegen.cc
+++ b/src/lithium-codegen.cc
@@ -170,66 +170,6 @@ int LCodeGenBase::GetNextEmittedBlock() const {
}
-static void AddWeakObjectToCodeDependency(Isolate* isolate,
- Handle<Object> object,
- Handle<Code> code) {
- Heap* heap = isolate->heap();
- heap->EnsureWeakObjectToCodeTable();
- Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(object));
- dep = DependentCode::Insert(dep, DependentCode::kWeakCodeGroup, code);
- heap->AddWeakObjectToCodeDependency(object, dep);
-}
-
-
-void LCodeGenBase::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) {
- DCHECK(code->is_optimized_code());
- ZoneList<Handle<Map> > maps(1, zone());
- ZoneList<Handle<JSObject> > objects(1, zone());
- ZoneList<Handle<Cell> > cells(1, zone());
- int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
- RelocInfo::ModeMask(RelocInfo::CELL);
- for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
- RelocInfo::Mode mode = it.rinfo()->rmode();
- if (mode == RelocInfo::CELL &&
- code->IsWeakObjectInOptimizedCode(it.rinfo()->target_cell())) {
- Handle<Cell> cell(it.rinfo()->target_cell());
- cells.Add(cell, zone());
- } else if (mode == RelocInfo::EMBEDDED_OBJECT &&
- code->IsWeakObjectInOptimizedCode(it.rinfo()->target_object())) {
- if (it.rinfo()->target_object()->IsMap()) {
- Handle<Map> map(Map::cast(it.rinfo()->target_object()));
- maps.Add(map, zone());
- } else if (it.rinfo()->target_object()->IsJSObject()) {
- Handle<JSObject> object(JSObject::cast(it.rinfo()->target_object()));
- objects.Add(object, zone());
- } else if (it.rinfo()->target_object()->IsCell()) {
- Handle<Cell> cell(Cell::cast(it.rinfo()->target_object()));
- cells.Add(cell, zone());
- }
- }
- }
- if (FLAG_enable_ool_constant_pool) {
- code->constant_pool()->set_weak_object_state(
- ConstantPoolArray::WEAK_OBJECTS_IN_OPTIMIZED_CODE);
- }
-#ifdef VERIFY_HEAP
- // This disables verification of weak embedded objects after full GC.
- // AddDependentCode can cause a GC, which would observe the state where
- // this code is not yet in the depended code lists of the embedded maps.
- NoWeakObjectVerificationScope disable_verification_of_embedded_objects;
-#endif
- for (int i = 0; i < maps.length(); i++) {
- Map::AddDependentCode(maps.at(i), DependentCode::kWeakCodeGroup, code);
- }
- for (int i = 0; i < objects.length(); i++) {
- AddWeakObjectToCodeDependency(isolate(), objects.at(i), code);
- }
- for (int i = 0; i < cells.length(); i++) {
- AddWeakObjectToCodeDependency(isolate(), cells.at(i), code);
- }
-}
-
-
void LCodeGenBase::Abort(BailoutReason reason) {
info()->AbortOptimization(reason);
status_ = ABORTED;
« no previous file with comments | « src/lithium.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698