Index: src/code-stubs.h |
diff --git a/src/code-stubs.h b/src/code-stubs.h |
index d2101ae293b6cee60ef3ca597bc483ab9b4d18ba..2fadce35a0561d6d427689cc716f85bd62c59713 100644 |
--- a/src/code-stubs.h |
+++ b/src/code-stubs.h |
@@ -673,13 +673,18 @@ class FastCloneShallowObjectStub : public HydrogenCodeStub { |
// Maximum number of properties in copied object. |
static const int kMaximumClonedProperties = 6; |
- explicit FastCloneShallowObjectStub(int length) |
- : length_(length) { |
+ FastCloneShallowObjectStub(AllocationSiteMode allocation_site_mode, |
Michael Starzinger
2013/10/10 13:27:39
As discussed offline: I don't think it makes much
mvstanton
2013/10/10 14:09:04
Good comment, I added FLAG_allocation_site_pretenu
|
+ int length) |
+ : allocation_site_mode_(allocation_site_mode), |
+ length_(length) { |
ASSERT_GE(length_, 0); |
ASSERT_LE(length_, kMaximumClonedProperties); |
} |
int length() const { return length_; } |
+ AllocationSiteMode allocation_site_mode() const { |
+ return allocation_site_mode_; |
+ } |
virtual Handle<Code> GenerateCode(Isolate* isolate); |
@@ -688,10 +693,20 @@ class FastCloneShallowObjectStub : public HydrogenCodeStub { |
CodeStubInterfaceDescriptor* descriptor); |
private: |
+ AllocationSiteMode allocation_site_mode_; |
int length_; |
+ class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; |
+ class LengthBits: public BitField<int, 1, 4> {}; |
+ // Ensure data fits within available bits. |
+ STATIC_ASSERT(LAST_ALLOCATION_SITE_MODE == 1); |
+ STATIC_ASSERT(kMaximumClonedProperties < 16); |
+ |
Major MajorKey() { return FastCloneShallowObject; } |
- int NotMissMinorKey() { return length_; } |
+ int NotMissMinorKey() { |
+ return AllocationSiteModeBits::encode(allocation_site_mode_) |
+ | LengthBits::encode(length_); |
+ } |
DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub); |
}; |