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

Unified Diff: src/code-stubs.h

Issue 898723002: Use weak cell to embed property cell in StoreGlobal. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comment about weak cells in FindAndReplace 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 | « no previous file | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index f8009a2697428b0241558a77015080b98000f1e0..2c9f1fb94d264c93044d0386dc097dcdbea7f10b 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -1084,7 +1084,7 @@ class StoreGlobalStub : public HandlerStub {
CheckGlobalBits::encode(check_global));
}
- static Handle<HeapObject> global_placeholder(Isolate* isolate) {
+ static Handle<HeapObject> property_cell_placeholder(Isolate* isolate) {
return isolate->factory()->uninitialized_value();
}
@@ -1094,11 +1094,13 @@ class StoreGlobalStub : public HandlerStub {
Code::FindAndReplacePattern pattern;
pattern.Add(isolate()->factory()->meta_map(),
Map::WeakCellForMap(Handle<Map>(global->map())));
- pattern.Add(isolate()->factory()->global_property_cell_map(), cell);
+ pattern.Add(Handle<Map>(property_cell_placeholder(isolate())->map()),
+ isolate()->factory()->NewWeakCell(cell));
return CodeStub::GetCodeCopy(pattern);
} else {
Code::FindAndReplacePattern pattern;
- pattern.Add(isolate()->factory()->global_property_cell_map(), cell);
+ pattern.Add(Handle<Map>(property_cell_placeholder(isolate())->map()),
+ isolate()->factory()->NewWeakCell(cell));
return CodeStub::GetCodeCopy(pattern);
}
}
« no previous file with comments | « no previous file | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698