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) \ | |
69 V(InternalArrayNArgumentsConstructor) \ | 68 V(InternalArrayNArgumentsConstructor) \ |
70 V(InternalArrayNoArgumentConstructor) \ | 69 V(InternalArrayNoArgumentConstructor) \ |
71 V(InternalArraySingleArgumentConstructor) \ | 70 V(InternalArraySingleArgumentConstructor) \ |
72 V(KeyedLoadGeneric) \ | 71 V(KeyedLoadGeneric) \ |
73 V(LoadScriptContextField) \ | 72 V(LoadScriptContextField) \ |
74 V(LoadDictionaryElement) \ | 73 V(LoadDictionaryElement) \ |
75 V(LoadFastElement) \ | 74 V(LoadFastElement) \ |
76 V(MegamorphicLoad) \ | 75 V(MegamorphicLoad) \ |
77 V(NameDictionaryLookup) \ | 76 V(NameDictionaryLookup) \ |
78 V(NumberToString) \ | 77 V(NumberToString) \ |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 explicit CreateAllocationSiteStub(Isolate* isolate) | 655 explicit CreateAllocationSiteStub(Isolate* isolate) |
657 : HydrogenCodeStub(isolate) { } | 656 : HydrogenCodeStub(isolate) { } |
658 | 657 |
659 static void GenerateAheadOfTime(Isolate* isolate); | 658 static void GenerateAheadOfTime(Isolate* isolate); |
660 | 659 |
661 DEFINE_CALL_INTERFACE_DESCRIPTOR(CreateAllocationSite); | 660 DEFINE_CALL_INTERFACE_DESCRIPTOR(CreateAllocationSite); |
662 DEFINE_HYDROGEN_CODE_STUB(CreateAllocationSite, HydrogenCodeStub); | 661 DEFINE_HYDROGEN_CODE_STUB(CreateAllocationSite, HydrogenCodeStub); |
663 }; | 662 }; |
664 | 663 |
665 | 664 |
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 | |
689 class InstanceofStub: public PlatformCodeStub { | 665 class InstanceofStub: public PlatformCodeStub { |
690 public: | 666 public: |
691 enum Flags { | 667 enum Flags { |
692 kNoFlags = 0, | 668 kNoFlags = 0, |
693 kArgsInRegisters = 1 << 0, | 669 kArgsInRegisters = 1 << 0, |
694 kCallSiteInlineCheck = 1 << 1, | 670 kCallSiteInlineCheck = 1 << 1, |
695 kReturnTrueFalseObject = 1 << 2 | 671 kReturnTrueFalseObject = 1 << 2 |
696 }; | 672 }; |
697 | 673 |
698 InstanceofStub(Isolate* isolate, Flags flags) : PlatformCodeStub(isolate) { | 674 InstanceofStub(Isolate* isolate, Flags flags) : PlatformCodeStub(isolate) { |
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2631 | 2607 |
2632 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2608 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
2633 #undef DEFINE_PLATFORM_CODE_STUB | 2609 #undef DEFINE_PLATFORM_CODE_STUB |
2634 #undef DEFINE_HANDLER_CODE_STUB | 2610 #undef DEFINE_HANDLER_CODE_STUB |
2635 #undef DEFINE_HYDROGEN_CODE_STUB | 2611 #undef DEFINE_HYDROGEN_CODE_STUB |
2636 #undef DEFINE_CODE_STUB | 2612 #undef DEFINE_CODE_STUB |
2637 #undef DEFINE_CODE_STUB_BASE | 2613 #undef DEFINE_CODE_STUB_BASE |
2638 } } // namespace v8::internal | 2614 } } // namespace v8::internal |
2639 | 2615 |
2640 #endif // V8_CODE_STUBS_H_ | 2616 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |