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

Unified Diff: src/hydrogen-instructions.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 | « src/code-stubs-hydrogen.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index ed4b065efad25123fe081ad40847db3b36213341..b69ce7952dd917a918beb470806486b1637e4708 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -6969,6 +6969,14 @@ class HStoreNamedField FINAL : public HTemplateInstruction<3> {
SetChangesFlag(kMaps);
}
+ void MarkReceiverAsCell() {
+ bit_field_ = ReceiverIsCellField::update(bit_field_, true);
+ }
+
+ bool receiver_is_cell() const {
+ return ReceiverIsCellField::decode(bit_field_);
+ }
+
bool NeedsWriteBarrier() const {
DCHECK(!field_representation().IsDouble() ||
(FLAG_unbox_double_fields && access_.IsInobject()) ||
@@ -6977,6 +6985,7 @@ class HStoreNamedField FINAL : public HTemplateInstruction<3> {
if (field_representation().IsSmi()) return false;
if (field_representation().IsInteger32()) return false;
if (field_representation().IsExternal()) return false;
+ if (receiver_is_cell()) return false;
return StoringValueNeedsWriteBarrier(value()) &&
ReceiverObjectNeedsWriteBarrier(object(), value(), dominator());
}
@@ -7036,6 +7045,7 @@ class HStoreNamedField FINAL : public HTemplateInstruction<3> {
class HasTransitionField : public BitField<bool, 0, 1> {};
class StoreModeField : public BitField<StoreFieldOrKeyedMode, 1, 1> {};
+ class ReceiverIsCellField : public BitField<bool, 2, 1> {};
HObjectAccess access_;
HValue* dominator_;
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698