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

Unified Diff: src/factory.cc

Issue 1110373002: Add comment to justify AllowDeferredHandleDereference in WeakCell factory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index d2a8d79dcf9cb2ea84c72358dc645c8f1b1200e3..133f74d9d6d21d8cb9dc32de838aa4cd4f4b2101 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -942,6 +942,8 @@ Handle<PropertyCell> Factory::NewPropertyCell() {
Handle<WeakCell> Factory::NewWeakCell(Handle<HeapObject> value) {
+ // It is safe to dereference the value because we are embedding it
+ // in cell and not inspecting its fields.
AllowDeferredHandleDereference convert_to_cell;
CALL_HEAP_FUNCTION(isolate(), isolate()->heap()->AllocateWeakCell(*value),
WeakCell);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698