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/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 V(ArraySingleArgumentConstructor) \ | 58 V(ArraySingleArgumentConstructor) \ |
59 V(BinaryOpIC) \ | 59 V(BinaryOpIC) \ |
60 V(BinaryOpWithAllocationSite) \ | 60 V(BinaryOpWithAllocationSite) \ |
61 V(CompareNilIC) \ | 61 V(CompareNilIC) \ |
62 V(CreateAllocationSite) \ | 62 V(CreateAllocationSite) \ |
63 V(ElementsTransitionAndStore) \ | 63 V(ElementsTransitionAndStore) \ |
64 V(FastCloneShallowArray) \ | 64 V(FastCloneShallowArray) \ |
65 V(FastCloneShallowObject) \ | 65 V(FastCloneShallowObject) \ |
66 V(FastNewClosure) \ | 66 V(FastNewClosure) \ |
67 V(FastNewContext) \ | 67 V(FastNewContext) \ |
| 68 V(GrowArrayElements) \ |
68 V(InternalArrayNArgumentsConstructor) \ | 69 V(InternalArrayNArgumentsConstructor) \ |
69 V(InternalArrayNoArgumentConstructor) \ | 70 V(InternalArrayNoArgumentConstructor) \ |
70 V(InternalArraySingleArgumentConstructor) \ | 71 V(InternalArraySingleArgumentConstructor) \ |
71 V(KeyedLoadGeneric) \ | 72 V(KeyedLoadGeneric) \ |
72 V(LoadScriptContextField) \ | 73 V(LoadScriptContextField) \ |
73 V(LoadDictionaryElement) \ | 74 V(LoadDictionaryElement) \ |
74 V(LoadFastElement) \ | 75 V(LoadFastElement) \ |
75 V(MegamorphicLoad) \ | 76 V(MegamorphicLoad) \ |
76 V(NameDictionaryLookup) \ | 77 V(NameDictionaryLookup) \ |
77 V(NumberToString) \ | 78 V(NumberToString) \ |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 explicit CreateAllocationSiteStub(Isolate* isolate) | 656 explicit CreateAllocationSiteStub(Isolate* isolate) |
656 : HydrogenCodeStub(isolate) { } | 657 : HydrogenCodeStub(isolate) { } |
657 | 658 |
658 static void GenerateAheadOfTime(Isolate* isolate); | 659 static void GenerateAheadOfTime(Isolate* isolate); |
659 | 660 |
660 DEFINE_CALL_INTERFACE_DESCRIPTOR(CreateAllocationSite); | 661 DEFINE_CALL_INTERFACE_DESCRIPTOR(CreateAllocationSite); |
661 DEFINE_HYDROGEN_CODE_STUB(CreateAllocationSite, HydrogenCodeStub); | 662 DEFINE_HYDROGEN_CODE_STUB(CreateAllocationSite, HydrogenCodeStub); |
662 }; | 663 }; |
663 | 664 |
664 | 665 |
| 666 class GrowArrayElementsStub : public HydrogenCodeStub { |
| 667 public: |
| 668 GrowArrayElementsStub(Isolate* isolate, bool is_js_array, ElementsKind kind) |
| 669 : HydrogenCodeStub(isolate) { |
| 670 set_sub_minor_key(ElementsKindBits::encode(kind) | |
| 671 IsJsArrayBits::encode(is_js_array)); |
| 672 } |
| 673 |
| 674 ElementsKind elements_kind() const { |
| 675 return ElementsKindBits::decode(sub_minor_key()); |
| 676 } |
| 677 |
| 678 bool is_js_array() const { return IsJsArrayBits::decode(sub_minor_key()); } |
| 679 |
| 680 private: |
| 681 class ElementsKindBits : public BitField<ElementsKind, 0, 8> {}; |
| 682 class IsJsArrayBits : public BitField<bool, ElementsKindBits::kNext, 1> {}; |
| 683 |
| 684 DEFINE_CALL_INTERFACE_DESCRIPTOR(GrowArrayElements); |
| 685 DEFINE_HYDROGEN_CODE_STUB(GrowArrayElements, HydrogenCodeStub); |
| 686 }; |
| 687 |
| 688 |
665 class InstanceofStub: public PlatformCodeStub { | 689 class InstanceofStub: public PlatformCodeStub { |
666 public: | 690 public: |
667 enum Flags { | 691 enum Flags { |
668 kNoFlags = 0, | 692 kNoFlags = 0, |
669 kArgsInRegisters = 1 << 0, | 693 kArgsInRegisters = 1 << 0, |
670 kCallSiteInlineCheck = 1 << 1, | 694 kCallSiteInlineCheck = 1 << 1, |
671 kReturnTrueFalseObject = 1 << 2 | 695 kReturnTrueFalseObject = 1 << 2 |
672 }; | 696 }; |
673 | 697 |
674 InstanceofStub(Isolate* isolate, Flags flags) : PlatformCodeStub(isolate) { | 698 InstanceofStub(Isolate* isolate, Flags flags) : PlatformCodeStub(isolate) { |
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2607 | 2631 |
2608 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2632 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
2609 #undef DEFINE_PLATFORM_CODE_STUB | 2633 #undef DEFINE_PLATFORM_CODE_STUB |
2610 #undef DEFINE_HANDLER_CODE_STUB | 2634 #undef DEFINE_HANDLER_CODE_STUB |
2611 #undef DEFINE_HYDROGEN_CODE_STUB | 2635 #undef DEFINE_HYDROGEN_CODE_STUB |
2612 #undef DEFINE_CODE_STUB | 2636 #undef DEFINE_CODE_STUB |
2613 #undef DEFINE_CODE_STUB_BASE | 2637 #undef DEFINE_CODE_STUB_BASE |
2614 } } // namespace v8::internal | 2638 } } // namespace v8::internal |
2615 | 2639 |
2616 #endif // V8_CODE_STUBS_H_ | 2640 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |