Chromium Code Reviews| Index: src/code-stubs.h |
| diff --git a/src/code-stubs.h b/src/code-stubs.h |
| index acfbd469f0ff568a1bdf768277f32c05a233d9a5..81368b8f20e6f5c6bad4188d6b6604ef004303ae 100644 |
| --- a/src/code-stubs.h |
| +++ b/src/code-stubs.h |
| @@ -69,7 +69,8 @@ namespace internal { |
| V(KeyedLoadElement) \ |
| V(KeyedStoreElement) \ |
| V(DebuggerStatement) \ |
| - V(StringDictionaryLookup) |
| + V(StringDictionaryLookup) \ |
| + V(FastElementsConversion) |
| // List of code stubs only used on ARM platforms. |
| #ifdef V8_TARGET_ARCH_ARM |
| @@ -1025,6 +1026,47 @@ class ToBooleanStub: public CodeStub { |
| Types types_; |
| }; |
| + |
| +class FastElementsConversionStub : public CodeStub { |
| + public: |
| + FastElementsConversionStub(ElementsKind from, |
| + ElementsKind to, |
| + bool is_jsarray, |
| + StrictModeFlag strict_mode) |
| + : from_(from), |
| + to_(to), |
| + is_jsarray_(is_jsarray), |
| + strict_mode_(strict_mode) {} |
| + |
| + private: |
|
Jakob Kummerow
2011/10/13 09:15:59
nit: classes, then methods, then data members. (se
Yang
2011/10/13 09:58:53
Done.
|
| + ElementsKind from_; |
| + ElementsKind to_; |
| + bool is_jsarray_; |
| + StrictModeFlag strict_mode_; |
| + |
| + 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 FastElementsConversion; } |
| + int MinorKey() { |
| + return FromBits::encode(from_) | |
| + ToBits::encode(to_) | |
| + IsJSArrayBits::encode(is_jsarray_) | |
| + StrictModeBits::encode(strict_mode_); |
| + } |
| + |
| + void Generate(MacroAssembler* masm); |
| + static void GenerateSmiOnlyToObject(MacroAssembler* masm); |
| + static void GenerateSmiOnlyToDouble(MacroAssembler* masm, |
| + StrictModeFlag strict_mode); |
| + static void GenerateDoubleToObject(MacroAssembler* masm, |
| + StrictModeFlag strict_mode); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(FastElementsConversionStub); |
| +}; |
| + |
| } } // namespace v8::internal |
| #endif // V8_CODE_STUBS_H_ |