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

Unified Diff: src/hydrogen-instructions.h

Issue 15734002: Add pretenuring support to HAllocateObject. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 f16efe6de83276be38aaf9b299f32586385761f0..4a22d7c1492bc4746986bd8ddef3234f74131c20 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -4840,8 +4840,14 @@ class HLoadGlobalGeneric: public HTemplateInstruction<2> {
class HAllocateObject: public HTemplateInstruction<1> {
public:
- HAllocateObject(HValue* context, Handle<JSFunction> constructor)
- : constructor_(constructor) {
+ enum Flags {
+ CAN_ALLOCATE_IN_NEW_SPACE = 1 << 0,
+ CAN_ALLOCATE_IN_OLD_POINTER_SPACE = 1 << 1
+ };
+
+ HAllocateObject(HValue* context, Handle<JSFunction> constructor, Flags flags)
+ : constructor_(constructor),
+ flags_(flags) {
SetOperandAt(0, context);
set_representation(Representation::Tagged());
SetGVNFlag(kChangesNewSpacePromotion);
@@ -4869,6 +4875,22 @@ class HAllocateObject: public HTemplateInstruction<1> {
}
virtual HType CalculateInferredType();
+ static Flags DefaultFlags() {
mvstanton 2013/05/23 12:47:46 It would be nice if these ~20 lines could be share
+ return CAN_ALLOCATE_IN_NEW_SPACE;
+ }
+
+ bool CanAllocateInNewSpace() const {
+ return (flags_ & CAN_ALLOCATE_IN_NEW_SPACE) != 0;
+ }
+
+ bool CanAllocateInOldPointerSpace() const {
+ return (flags_ & CAN_ALLOCATE_IN_OLD_POINTER_SPACE) != 0;
+ }
+
+ bool GuaranteedInNewSpace() const {
+ return CanAllocateInNewSpace() && !CanAllocateInOldPointerSpace();
+ }
+
DECLARE_CONCRETE_INSTRUCTION(AllocateObject)
private:
@@ -4877,6 +4899,7 @@ class HAllocateObject: public HTemplateInstruction<1> {
Handle<JSFunction> constructor_;
Handle<Map> constructor_initial_map_;
+ Flags flags_;
};
@@ -4999,7 +5022,9 @@ inline bool ReceiverObjectNeedsWriteBarrier(HValue* object,
new_space_dominator);
}
if (object != new_space_dominator) return true;
- if (object->IsAllocateObject()) return false;
+ if (object->IsAllocateObject()) {
+ return !HAllocateObject::cast(object)->GuaranteedInNewSpace();
+ }
if (object->IsAllocate()) {
return !HAllocate::cast(object)->GuaranteedInNewSpace();
}
« src/flag-definitions.h ('K') | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698