Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: src/code-stubs.h

Issue 2608893002: [builtins] Move LoadGlobalICStub to builtins (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 V(InternalArrayConstructor) \ 42 V(InternalArrayConstructor) \
43 V(JSEntry) \ 43 V(JSEntry) \
44 V(LoadIndexedString) \ 44 V(LoadIndexedString) \
45 V(MathPow) \ 45 V(MathPow) \
46 V(ProfileEntryHook) \ 46 V(ProfileEntryHook) \
47 V(RecordWrite) \ 47 V(RecordWrite) \
48 V(RegExpExec) \ 48 V(RegExpExec) \
49 V(StoreBufferOverflow) \ 49 V(StoreBufferOverflow) \
50 V(StoreElement) \ 50 V(StoreElement) \
51 V(SubString) \ 51 V(SubString) \
52 V(LoadGlobalIC) \
53 V(FastNewRestParameter) \ 52 V(FastNewRestParameter) \
54 V(FastNewSloppyArguments) \ 53 V(FastNewSloppyArguments) \
55 V(FastNewStrictArguments) \ 54 V(FastNewStrictArguments) \
56 V(NameDictionaryLookup) \ 55 V(NameDictionaryLookup) \
57 /* This can be removed once there are no */ \ 56 /* This can be removed once there are no */ \
58 /* more deopting Hydrogen stubs. */ \ 57 /* more deopting Hydrogen stubs. */ \
59 V(StubFailureTrampoline) \ 58 V(StubFailureTrampoline) \
60 /* These are only called from FCG */ \ 59 /* These are only called from FCG */ \
61 /* They can be removed when only the TF */ \ 60 /* They can be removed when only the TF */ \
62 /* version of the corresponding stub is */ \ 61 /* version of the corresponding stub is */ \
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 V(NumberToString) \ 102 V(NumberToString) \
104 V(StringAdd) \ 103 V(StringAdd) \
105 V(GetProperty) \ 104 V(GetProperty) \
106 V(LoadICProtoArray) \ 105 V(LoadICProtoArray) \
107 V(StoreFastElement) \ 106 V(StoreFastElement) \
108 V(StoreGlobal) \ 107 V(StoreGlobal) \
109 V(StoreInterceptor) \ 108 V(StoreInterceptor) \
110 V(LoadApiGetter) \ 109 V(LoadApiGetter) \
111 V(LoadIndexedInterceptor) \ 110 V(LoadIndexedInterceptor) \
112 V(LoadField) \ 111 V(LoadField) \
113 V(GrowArrayElements) \ 112 V(GrowArrayElements)
114 /* These are only called from FGC and */ \
115 /* can be removed when we use ignition */ \
116 /* only */ \
117 V(LoadGlobalICTrampoline)
118 113
119 // List of code stubs only used on ARM 32 bits platforms. 114 // List of code stubs only used on ARM 32 bits platforms.
120 #if V8_TARGET_ARCH_ARM 115 #if V8_TARGET_ARCH_ARM
121 #define CODE_STUB_LIST_ARM(V) V(DirectCEntry) 116 #define CODE_STUB_LIST_ARM(V) V(DirectCEntry)
122 117
123 #else 118 #else
124 #define CODE_STUB_LIST_ARM(V) 119 #define CODE_STUB_LIST_ARM(V)
125 #endif 120 #endif
126 121
127 // List of code stubs only used on ARM 64 bits platforms. 122 // List of code stubs only used on ARM 64 bits platforms.
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after
1625 char_from_code_generator_.SkipSlow(masm, bailout); 1620 char_from_code_generator_.SkipSlow(masm, bailout);
1626 } 1621 }
1627 1622
1628 private: 1623 private:
1629 StringCharCodeAtGenerator char_code_at_generator_; 1624 StringCharCodeAtGenerator char_code_at_generator_;
1630 StringCharFromCodeGenerator char_from_code_generator_; 1625 StringCharFromCodeGenerator char_from_code_generator_;
1631 1626
1632 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); 1627 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator);
1633 }; 1628 };
1634 1629
1635 class LoadGlobalICTrampolineStub : public TurboFanCodeStub {
1636 public:
1637 explicit LoadGlobalICTrampolineStub(Isolate* isolate,
1638 const LoadGlobalICState& state)
1639 : TurboFanCodeStub(isolate) {
1640 minor_key_ = state.GetExtraICState();
1641 }
1642
1643 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; }
1644
1645 TypeofMode typeof_mode() const {
1646 LoadGlobalICState state(GetExtraICState());
1647 return state.typeof_mode();
1648 }
1649
1650 ExtraICState GetExtraICState() const final {
1651 return static_cast<ExtraICState>(minor_key_);
1652 }
1653
1654 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal);
1655 DEFINE_TURBOFAN_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub);
1656 };
1657
1658 class CallICTrampolineStub : public PlatformCodeStub { 1630 class CallICTrampolineStub : public PlatformCodeStub {
1659 public: 1631 public:
1660 CallICTrampolineStub(Isolate* isolate, const CallICState& state) 1632 CallICTrampolineStub(Isolate* isolate, const CallICState& state)
1661 : PlatformCodeStub(isolate) { 1633 : PlatformCodeStub(isolate) {
1662 minor_key_ = state.GetExtraICState(); 1634 minor_key_ = state.GetExtraICState();
1663 } 1635 }
1664 1636
1665 Code::Kind GetCodeKind() const override { return Code::CALL_IC; } 1637 Code::Kind GetCodeKind() const override { return Code::CALL_IC; }
1666 1638
1667 ExtraICState GetExtraICState() const final { 1639 ExtraICState GetExtraICState() const final {
(...skipping 26 matching lines...) Expand all
1694 return static_cast<ExtraICState>(minor_key_); 1666 return static_cast<ExtraICState>(minor_key_);
1695 } 1667 }
1696 1668
1697 private: 1669 private:
1698 class ThrowReferenceErrorIfNonexistentBits : public BitField<bool, 0, 1> {}; 1670 class ThrowReferenceErrorIfNonexistentBits : public BitField<bool, 0, 1> {};
1699 1671
1700 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadICProtoArray); 1672 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadICProtoArray);
1701 DEFINE_TURBOFAN_CODE_STUB(LoadICProtoArray, TurboFanCodeStub); 1673 DEFINE_TURBOFAN_CODE_STUB(LoadICProtoArray, TurboFanCodeStub);
1702 }; 1674 };
1703 1675
1704 class LoadGlobalICStub : public TurboFanCodeStub {
1705 public:
1706 explicit LoadGlobalICStub(Isolate* isolate, const LoadGlobalICState& state)
1707 : TurboFanCodeStub(isolate) {
1708 minor_key_ = state.GetExtraICState();
1709 }
1710
1711 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; }
1712
1713 TypeofMode typeof_mode() const {
1714 LoadGlobalICState state(GetExtraICState());
1715 return state.typeof_mode();
1716 }
1717
1718 ExtraICState GetExtraICState() const final {
1719 return static_cast<ExtraICState>(minor_key_);
1720 }
1721
1722 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector);
1723 DEFINE_TURBOFAN_CODE_STUB(LoadGlobalIC, TurboFanCodeStub);
1724 };
1725
1726 class DoubleToIStub : public PlatformCodeStub { 1676 class DoubleToIStub : public PlatformCodeStub {
1727 public: 1677 public:
1728 DoubleToIStub(Isolate* isolate, Register source, Register destination, 1678 DoubleToIStub(Isolate* isolate, Register source, Register destination,
1729 int offset, bool is_truncating, bool skip_fastpath = false) 1679 int offset, bool is_truncating, bool skip_fastpath = false)
1730 : PlatformCodeStub(isolate) { 1680 : PlatformCodeStub(isolate) {
1731 minor_key_ = SourceRegisterBits::encode(source.code()) | 1681 minor_key_ = SourceRegisterBits::encode(source.code()) |
1732 DestinationRegisterBits::encode(destination.code()) | 1682 DestinationRegisterBits::encode(destination.code()) |
1733 OffsetBits::encode(offset) | 1683 OffsetBits::encode(offset) |
1734 IsTruncatingBits::encode(is_truncating) | 1684 IsTruncatingBits::encode(is_truncating) |
1735 SkipFastPathBits::encode(skip_fastpath) | 1685 SkipFastPathBits::encode(skip_fastpath) |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
2215 #undef DEFINE_PLATFORM_CODE_STUB 2165 #undef DEFINE_PLATFORM_CODE_STUB
2216 #undef DEFINE_HANDLER_CODE_STUB 2166 #undef DEFINE_HANDLER_CODE_STUB
2217 #undef DEFINE_HYDROGEN_CODE_STUB 2167 #undef DEFINE_HYDROGEN_CODE_STUB
2218 #undef DEFINE_CODE_STUB 2168 #undef DEFINE_CODE_STUB
2219 #undef DEFINE_CODE_STUB_BASE 2169 #undef DEFINE_CODE_STUB_BASE
2220 2170
2221 } // namespace internal 2171 } // namespace internal
2222 } // namespace v8 2172 } // namespace v8
2223 2173
2224 #endif // V8_CODE_STUBS_H_ 2174 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698