| Index: src/code-stubs.h
|
| ===================================================================
|
| --- src/code-stubs.h (revision 9808)
|
| +++ src/code-stubs.h (working copy)
|
| @@ -30,6 +30,7 @@
|
|
|
| #include "allocation.h"
|
| #include "globals.h"
|
| +#include "codegen.h"
|
|
|
| namespace v8 {
|
| namespace internal {
|
| @@ -69,7 +70,8 @@
|
| V(KeyedLoadElement) \
|
| V(KeyedStoreElement) \
|
| V(DebuggerStatement) \
|
| - V(StringDictionaryLookup)
|
| + V(StringDictionaryLookup) \
|
| + V(ElementsTransitionAndStore)
|
|
|
| // List of code stubs only used on ARM platforms.
|
| #ifdef V8_TARGET_ARCH_ARM
|
| @@ -362,6 +364,7 @@
|
|
|
| enum Mode {
|
| CLONE_ELEMENTS,
|
| + CLONE_DOUBLE_ELEMENTS,
|
| COPY_ON_WRITE_ELEMENTS
|
| };
|
|
|
| @@ -380,8 +383,8 @@
|
|
|
| Major MajorKey() { return FastCloneShallowArray; }
|
| int MinorKey() {
|
| - ASSERT(mode_ == 0 || mode_ == 1);
|
| - return (length_ << 1) | mode_;
|
| + ASSERT(mode_ == 0 || mode_ == 1 || mode_ == 2);
|
| + return length_ * 3 + mode_;
|
| }
|
| };
|
|
|
| @@ -1025,6 +1028,42 @@
|
| Types types_;
|
| };
|
|
|
| +
|
| +class ElementsTransitionAndStoreStub : public CodeStub {
|
| + public:
|
| + ElementsTransitionAndStoreStub(ElementsKind from,
|
| + ElementsKind to,
|
| + bool is_jsarray,
|
| + StrictModeFlag strict_mode)
|
| + : from_(from),
|
| + to_(to),
|
| + is_jsarray_(is_jsarray),
|
| + strict_mode_(strict_mode) {}
|
| +
|
| + private:
|
| + class FromBits: public BitField<ElementsKind, 0, 8> {};
|
| + class ToBits: public BitField<ElementsKind, 8, 8> {};
|
| + class IsJSArrayBits: public BitField<bool, 16, 8> {};
|
| + class StrictModeBits: public BitField<StrictModeFlag, 24, 8> {};
|
| +
|
| + Major MajorKey() { return ElementsTransitionAndStore; }
|
| + int MinorKey() {
|
| + return FromBits::encode(from_) |
|
| + ToBits::encode(to_) |
|
| + IsJSArrayBits::encode(is_jsarray_) |
|
| + StrictModeBits::encode(strict_mode_);
|
| + }
|
| +
|
| + void Generate(MacroAssembler* masm);
|
| +
|
| + ElementsKind from_;
|
| + ElementsKind to_;
|
| + bool is_jsarray_;
|
| + StrictModeFlag strict_mode_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub);
|
| +};
|
| +
|
| } } // namespace v8::internal
|
|
|
| #endif // V8_CODE_STUBS_H_
|
|
|