Chromium Code Reviews| Index: src/code-stubs.h |
| diff --git a/src/code-stubs.h b/src/code-stubs.h |
| index a02a9598d7dd6d0d348253b8a18c43558225114f..91d2ba0c24b3dc453a04c034331b925cab2bb879 100644 |
| --- a/src/code-stubs.h |
| +++ b/src/code-stubs.h |
| @@ -427,14 +427,16 @@ 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; |
| - FastCloneShallowArrayStub(Mode mode, int length) |
| + FastCloneShallowArrayStub(Mode mode, |
| + AllocationSiteMode allocation_site_mode, |
| + int length) |
| : mode_(mode), |
| + allocation_site_mode_(allocation_site_mode), |
| length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { |
| ASSERT_GE(length_, 0); |
| ASSERT_LE(length_, kMaximumClonedLength); |
| @@ -444,12 +446,20 @@ class FastCloneShallowArrayStub : public PlatformCodeStub { |
| private: |
| Mode mode_; |
| + AllocationSiteMode allocation_site_mode_; |
| int length_; |
| + class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; |
| + class ModeBits: public BitField<Mode, 1, 4> {}; |
| + class LengthBits: public BitField<int, 5, 5> {}; |
|
Toon Verwaest
2013/01/16 13:35:55
You only need 4 bits here.
mvstanton
2013/01/16 14:21:00
Done.
|
| + STATIC_ASSERT(LAST_ALLOCATION_SITE_MODE == 1); |
| + STATIC_ASSERT(kFastCloneModeCount <= 8); |
| + STATIC_ASSERT(kMaximumClonedLength <= 8); |
|
Toon Verwaest
2013/01/16 13:35:55
With 4 bits, this field supports < 16.
mvstanton
2013/01/16 14:21:00
Done.
|
| Major MajorKey() { return FastCloneShallowArray; } |
| int MinorKey() { |
| - ASSERT(mode_ >= 0 && mode_ <= LAST_CLONE_MODE); |
| - return length_ * kFastCloneModeCount + mode_; |
| + return AllocationSiteModeBits::encode(allocation_site_mode_) |
| + | ModeBits::encode(mode_) |
| + | LengthBits::encode(length_); |
| } |
| }; |