OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_CODE_STUBS_H_ | 5 #ifndef V8_CODE_STUBS_H_ |
6 #define V8_CODE_STUBS_H_ | 6 #define V8_CODE_STUBS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/code-stub-assembler.h" | 10 #include "src/code-stub-assembler.h" |
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 }; | 1370 }; |
1371 | 1371 |
1372 | 1372 |
1373 // TODO(verwaest): Translate to hydrogen code stub. | 1373 // TODO(verwaest): Translate to hydrogen code stub. |
1374 class FunctionPrototypeStub : public PlatformCodeStub { | 1374 class FunctionPrototypeStub : public PlatformCodeStub { |
1375 public: | 1375 public: |
1376 explicit FunctionPrototypeStub(Isolate* isolate) | 1376 explicit FunctionPrototypeStub(Isolate* isolate) |
1377 : PlatformCodeStub(isolate) {} | 1377 : PlatformCodeStub(isolate) {} |
1378 | 1378 |
1379 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 1379 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 1380 ExtraICState GetExtraICState() const override { return Code::LOAD_IC; } |
1380 | 1381 |
1381 // TODO(mvstanton): only the receiver register is accessed. When this is | 1382 // TODO(mvstanton): only the receiver register is accessed. When this is |
1382 // translated to a hydrogen code stub, a new CallInterfaceDescriptor | 1383 // translated to a hydrogen code stub, a new CallInterfaceDescriptor |
1383 // should be created that just uses that register for more efficient code. | 1384 // should be created that just uses that register for more efficient code. |
1384 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { | 1385 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { |
1385 return LoadWithVectorDescriptor(isolate()); | 1386 return LoadWithVectorDescriptor(isolate()); |
1386 } | 1387 } |
1387 | 1388 |
1388 DEFINE_PLATFORM_CODE_STUB(FunctionPrototype, PlatformCodeStub); | 1389 DEFINE_PLATFORM_CODE_STUB(FunctionPrototype, PlatformCodeStub); |
1389 }; | 1390 }; |
1390 | 1391 |
1391 | 1392 |
1392 class LoadIndexedStringStub : public PlatformCodeStub { | 1393 class LoadIndexedStringStub : public PlatformCodeStub { |
1393 public: | 1394 public: |
1394 explicit LoadIndexedStringStub(Isolate* isolate) | 1395 explicit LoadIndexedStringStub(Isolate* isolate) |
1395 : PlatformCodeStub(isolate) {} | 1396 : PlatformCodeStub(isolate) {} |
1396 | 1397 |
1397 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 1398 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 1399 ExtraICState GetExtraICState() const override { return Code::KEYED_LOAD_IC; } |
1398 | 1400 |
1399 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 1401 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
1400 DEFINE_PLATFORM_CODE_STUB(LoadIndexedString, PlatformCodeStub); | 1402 DEFINE_PLATFORM_CODE_STUB(LoadIndexedString, PlatformCodeStub); |
1401 }; | 1403 }; |
1402 | 1404 |
1403 | 1405 |
1404 class HandlerStub : public HydrogenCodeStub { | 1406 class HandlerStub : public HydrogenCodeStub { |
1405 public: | 1407 public: |
1406 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 1408 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
1407 ExtraICState GetExtraICState() const override { return kind(); } | 1409 ExtraICState GetExtraICState() const override { return kind(); } |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2677 | 2679 |
2678 KeyedAccessStoreMode store_mode() const { | 2680 KeyedAccessStoreMode store_mode() const { |
2679 return CommonStoreModeBits::decode(sub_minor_key()); | 2681 return CommonStoreModeBits::decode(sub_minor_key()); |
2680 } | 2682 } |
2681 | 2683 |
2682 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { | 2684 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { |
2683 return StoreWithVectorDescriptor(isolate()); | 2685 return StoreWithVectorDescriptor(isolate()); |
2684 } | 2686 } |
2685 | 2687 |
2686 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 2688 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 2689 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } |
2687 | 2690 |
2688 private: | 2691 private: |
2689 class ElementsKindBits : public BitField<ElementsKind, 3, 8> {}; | 2692 class ElementsKindBits : public BitField<ElementsKind, 3, 8> {}; |
2690 class IsJSArrayBits : public BitField<bool, 11, 1> {}; | 2693 class IsJSArrayBits : public BitField<bool, 11, 1> {}; |
2691 | 2694 |
2692 DEFINE_HYDROGEN_CODE_STUB(StoreFastElement, HydrogenCodeStub); | 2695 DEFINE_HYDROGEN_CODE_STUB(StoreFastElement, HydrogenCodeStub); |
2693 }; | 2696 }; |
2694 | 2697 |
2695 | 2698 |
2696 class TransitionElementsKindStub : public HydrogenCodeStub { | 2699 class TransitionElementsKindStub : public HydrogenCodeStub { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2874 DCHECK_EQ(DICTIONARY_ELEMENTS, elements_kind); | 2877 DCHECK_EQ(DICTIONARY_ELEMENTS, elements_kind); |
2875 minor_key_ = ElementsKindBits::encode(elements_kind) | | 2878 minor_key_ = ElementsKindBits::encode(elements_kind) | |
2876 CommonStoreModeBits::encode(mode); | 2879 CommonStoreModeBits::encode(mode); |
2877 } | 2880 } |
2878 | 2881 |
2879 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { | 2882 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { |
2880 return StoreWithVectorDescriptor(isolate()); | 2883 return StoreWithVectorDescriptor(isolate()); |
2881 } | 2884 } |
2882 | 2885 |
2883 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 2886 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 2887 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } |
2884 | 2888 |
2885 private: | 2889 private: |
2886 ElementsKind elements_kind() const { | 2890 ElementsKind elements_kind() const { |
2887 return ElementsKindBits::decode(minor_key_); | 2891 return ElementsKindBits::decode(minor_key_); |
2888 } | 2892 } |
2889 | 2893 |
2890 class ElementsKindBits : public BitField<ElementsKind, 3, 8> {}; | 2894 class ElementsKindBits : public BitField<ElementsKind, 3, 8> {}; |
2891 | 2895 |
2892 DEFINE_PLATFORM_CODE_STUB(StoreElement, PlatformCodeStub); | 2896 DEFINE_PLATFORM_CODE_STUB(StoreElement, PlatformCodeStub); |
2893 }; | 2897 }; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2978 | 2982 |
2979 ElementsKind from_kind() const { return FromBits::decode(sub_minor_key()); } | 2983 ElementsKind from_kind() const { return FromBits::decode(sub_minor_key()); } |
2980 ElementsKind to_kind() const { return ToBits::decode(sub_minor_key()); } | 2984 ElementsKind to_kind() const { return ToBits::decode(sub_minor_key()); } |
2981 bool is_jsarray() const { return IsJSArrayBits::decode(sub_minor_key()); } | 2985 bool is_jsarray() const { return IsJSArrayBits::decode(sub_minor_key()); } |
2982 KeyedAccessStoreMode store_mode() const { | 2986 KeyedAccessStoreMode store_mode() const { |
2983 return CommonStoreModeBits::decode(sub_minor_key()); | 2987 return CommonStoreModeBits::decode(sub_minor_key()); |
2984 } | 2988 } |
2985 | 2989 |
2986 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override; | 2990 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override; |
2987 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 2991 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 2992 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } |
2988 | 2993 |
2989 private: | 2994 private: |
2990 class FromBits : public BitField<ElementsKind, 3, 8> {}; | 2995 class FromBits : public BitField<ElementsKind, 3, 8> {}; |
2991 class ToBits : public BitField<ElementsKind, 11, 8> {}; | 2996 class ToBits : public BitField<ElementsKind, 11, 8> {}; |
2992 class IsJSArrayBits : public BitField<bool, 19, 1> {}; | 2997 class IsJSArrayBits : public BitField<bool, 19, 1> {}; |
2993 | 2998 |
2994 DEFINE_HYDROGEN_CODE_STUB(ElementsTransitionAndStore, HydrogenCodeStub); | 2999 DEFINE_HYDROGEN_CODE_STUB(ElementsTransitionAndStore, HydrogenCodeStub); |
2995 }; | 3000 }; |
2996 | 3001 |
2997 | 3002 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3097 #undef DEFINE_HYDROGEN_CODE_STUB | 3102 #undef DEFINE_HYDROGEN_CODE_STUB |
3098 #undef DEFINE_CODE_STUB | 3103 #undef DEFINE_CODE_STUB |
3099 #undef DEFINE_CODE_STUB_BASE | 3104 #undef DEFINE_CODE_STUB_BASE |
3100 | 3105 |
3101 extern Representation RepresentationFromType(Type* type); | 3106 extern Representation RepresentationFromType(Type* type); |
3102 | 3107 |
3103 } // namespace internal | 3108 } // namespace internal |
3104 } // namespace v8 | 3109 } // namespace v8 |
3105 | 3110 |
3106 #endif // V8_CODE_STUBS_H_ | 3111 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |