Index: src/code-stubs.h |
diff --git a/src/code-stubs.h b/src/code-stubs.h |
index a02a9598d7dd6d0d348253b8a18c43558225114f..1d0df1b552d7f24e7cca40843cf9ab7a1bbc7288 100644 |
--- a/src/code-stubs.h |
+++ b/src/code-stubs.h |
@@ -427,14 +427,15 @@ class FastCloneShallowArrayStub : public PlatformCodeStub { |
CLONE_DOUBLE_ELEMENTS, |
COPY_ON_WRITE_ELEMENTS, |
CLONE_ANY_ELEMENTS, |
- CLONE_ANY_ELEMENTS_WITH_ALLOCATION_SITE_INFO, |
- LAST_CLONE_MODE = CLONE_ANY_ELEMENTS_WITH_ALLOCATION_SITE_INFO |
+ LAST_CLONE_MODE = CLONE_ANY_ELEMENTS |
}; |
static const int kFastCloneModeCount = LAST_CLONE_MODE + 1; |
Toon Verwaest
2013/01/16 10:53:42
Keep empty line between these lines.
mvstanton
2013/01/16 13:01:56
Done.
|
- |
- FastCloneShallowArrayStub(Mode mode, int length) |
+ FastCloneShallowArrayStub(Mode mode, |
+ AllocationSiteInfoMode allocation_site_info_mode, |
+ int length) |
: mode_(mode), |
+ allocation_site_info_mode_(allocation_site_info_mode), |
length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { |
ASSERT_GE(length_, 0); |
ASSERT_LE(length_, kMaximumClonedLength); |
@@ -444,12 +445,19 @@ class FastCloneShallowArrayStub : public PlatformCodeStub { |
private: |
Mode mode_; |
+ AllocationSiteInfoMode allocation_site_info_mode_; |
int length_; |
+ class ModeBits: public BitField<Mode, 0, 8> {}; |
+ class AllocationSiteInfoModeBits: public |
+ BitField<AllocationSiteInfoMode, 8, 8> {}; |
Toon Verwaest
2013/01/16 10:53:42
You only need 1 bit for this field.
mvstanton
2013/01/16 13:01:56
Fixed, and added a static assert to support it.
|
+ class LengthBits: public BitField<int, 16, 16> {}; |
+ STATIC_ASSERT(kFastCloneModeCount <= 8); |
Major MajorKey() { return FastCloneShallowArray; } |
int MinorKey() { |
- ASSERT(mode_ >= 0 && mode_ <= LAST_CLONE_MODE); |
- return length_ * kFastCloneModeCount + mode_; |
+ return ModeBits::encode(mode_) |
+ | AllocationSiteInfoModeBits::encode(allocation_site_info_mode_) |
+ | LengthBits::encode(length_); |
} |
}; |