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

Unified Diff: src/hydrogen-instructions.h

Issue 297763006: Improve write barriers in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 years, 7 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
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 908faa8011d90142295ee522345fbaf69c0ac181..cdb9756f4e0f894858da4f2d76ddac2123fda219 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -5702,6 +5702,17 @@ inline bool ReceiverObjectNeedsWriteBarrier(HValue* object,
}
+inline bool ObjectIsInNewSpace(HValue* object,
+ HValue* dominator) {
+ while (object->IsInnerAllocatedObject()) {
+ object = HInnerAllocatedObject::cast(object)->base_object();
+ }
+ if (object != dominator) return false;
+ return (object->IsAllocate() &&
+ HAllocate::cast(object)->IsNewSpaceAllocation());
+}
+
+
class HStoreGlobalCell V8_FINAL : public HUnaryOperation {
public:
DECLARE_INSTRUCTION_FACTORY_P3(HStoreGlobalCell, HValue*,
@@ -6720,6 +6731,10 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> {
return INLINE_SMI_CHECK;
}
+ bool ValueIsInNewSpace() const {
+ return ObjectIsInNewSpace(value(), new_space_dominator());
+ }
+
Representation field_representation() const {
return access_.representation();
}
@@ -6878,9 +6893,9 @@ class HStoreKeyed V8_FINAL
return Representation::None();
}
- HValue* elements() { return OperandAt(0); }
- HValue* key() { return OperandAt(1); }
- HValue* value() { return OperandAt(2); }
+ HValue* elements() const { return OperandAt(0); }
+ HValue* key() const { return OperandAt(1); }
+ HValue* value() const { return OperandAt(2); }
bool value_is_smi() const {
return IsFastSmiElementsKind(elements_kind_);
}
@@ -6925,6 +6940,10 @@ class HStoreKeyed V8_FINAL
}
}
+ bool ValueIsInNewSpace() const {
+ return ObjectIsInNewSpace(value(), new_space_dominator());
+ }
+
bool NeedsCanonicalization();
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698