| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 /* This can be removed once there are no */ \ | 53 /* This can be removed once there are no */ \ |
| 54 /* more deopting Hydrogen stubs. */ \ | 54 /* more deopting Hydrogen stubs. */ \ |
| 55 V(StubFailureTrampoline) \ | 55 V(StubFailureTrampoline) \ |
| 56 /* These are only called from FCG */ \ | 56 /* These are only called from FCG */ \ |
| 57 /* They can be removed when only the TF */ \ | 57 /* They can be removed when only the TF */ \ |
| 58 /* version of the corresponding stub is */ \ | 58 /* version of the corresponding stub is */ \ |
| 59 /* used universally */ \ | 59 /* used universally */ \ |
| 60 V(CallICTrampoline) \ | 60 V(CallICTrampoline) \ |
| 61 V(KeyedStoreICTrampoline) \ | 61 V(KeyedStoreICTrampoline) \ |
| 62 /* --- HydrogenCodeStubs --- */ \ | 62 /* --- HydrogenCodeStubs --- */ \ |
| 63 V(StringAdd) \ | |
| 64 /* These builtins w/ JS linkage are */ \ | 63 /* These builtins w/ JS linkage are */ \ |
| 65 /* just fast-cases of C++ builtins. They */ \ | 64 /* just fast-cases of C++ builtins. They */ \ |
| 66 /* require varg support from TF */ \ | 65 /* require varg support from TF */ \ |
| 67 V(FastArrayPush) \ | 66 V(FastArrayPush) \ |
| 68 V(FastFunctionBind) \ | 67 V(FastFunctionBind) \ |
| 69 /* These will be ported/eliminated */ \ | 68 /* These will be ported/eliminated */ \ |
| 70 /* as part of the new IC system, ask */ \ | 69 /* as part of the new IC system, ask */ \ |
| 71 /* ishell before doing anything */ \ | 70 /* ishell before doing anything */ \ |
| 72 V(LoadConstant) \ | 71 V(LoadConstant) \ |
| 73 V(LoadDictionaryElement) \ | 72 V(LoadDictionaryElement) \ |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 V(FastCloneRegExp) \ | 111 V(FastCloneRegExp) \ |
| 113 V(FastCloneShallowArray) \ | 112 V(FastCloneShallowArray) \ |
| 114 V(FastCloneShallowObject) \ | 113 V(FastCloneShallowObject) \ |
| 115 V(FastNewClosure) \ | 114 V(FastNewClosure) \ |
| 116 V(FastNewFunctionContext) \ | 115 V(FastNewFunctionContext) \ |
| 117 V(KeyedLoadSloppyArguments) \ | 116 V(KeyedLoadSloppyArguments) \ |
| 118 V(KeyedStoreSloppyArguments) \ | 117 V(KeyedStoreSloppyArguments) \ |
| 119 V(LoadScriptContextField) \ | 118 V(LoadScriptContextField) \ |
| 120 V(StoreScriptContextField) \ | 119 V(StoreScriptContextField) \ |
| 121 V(NumberToString) \ | 120 V(NumberToString) \ |
| 121 V(StringAdd) \ |
| 122 V(GetProperty) \ | 122 V(GetProperty) \ |
| 123 V(LoadIC) \ | 123 V(LoadIC) \ |
| 124 V(KeyedLoadICTF) \ | 124 V(KeyedLoadICTF) \ |
| 125 V(StoreFastElement) \ | 125 V(StoreFastElement) \ |
| 126 V(StoreField) \ | 126 V(StoreField) \ |
| 127 V(StoreGlobal) \ | 127 V(StoreGlobal) \ |
| 128 V(StoreIC) \ | 128 V(StoreIC) \ |
| 129 V(StoreInterceptor) \ | 129 V(StoreInterceptor) \ |
| 130 V(StoreMap) \ | 130 V(StoreMap) \ |
| 131 V(StoreTransition) \ | 131 V(StoreTransition) \ |
| (...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 | 1603 |
| 1604 BinaryOpWithAllocationSiteStub(Isolate* isolate, const BinaryOpICState& state) | 1604 BinaryOpWithAllocationSiteStub(Isolate* isolate, const BinaryOpICState& state) |
| 1605 : BinaryOpICStub(isolate, state) {} | 1605 : BinaryOpICStub(isolate, state) {} |
| 1606 | 1606 |
| 1607 Code::Kind GetCodeKind() const final { return Code::STUB; } | 1607 Code::Kind GetCodeKind() const final { return Code::STUB; } |
| 1608 | 1608 |
| 1609 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOpWithAllocationSite); | 1609 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOpWithAllocationSite); |
| 1610 DEFINE_HYDROGEN_CODE_STUB(BinaryOpWithAllocationSite, BinaryOpICStub); | 1610 DEFINE_HYDROGEN_CODE_STUB(BinaryOpWithAllocationSite, BinaryOpICStub); |
| 1611 }; | 1611 }; |
| 1612 | 1612 |
| 1613 | 1613 class StringAddStub final : public TurboFanCodeStub { |
| 1614 class StringAddStub final : public HydrogenCodeStub { | |
| 1615 public: | 1614 public: |
| 1616 StringAddStub(Isolate* isolate, StringAddFlags flags, | 1615 StringAddStub(Isolate* isolate, StringAddFlags flags, |
| 1617 PretenureFlag pretenure_flag) | 1616 PretenureFlag pretenure_flag) |
| 1618 : HydrogenCodeStub(isolate) { | 1617 : TurboFanCodeStub(isolate) { |
| 1619 set_sub_minor_key(StringAddFlagsBits::encode(flags) | | 1618 minor_key_ = (StringAddFlagsBits::encode(flags) | |
| 1620 PretenureFlagBits::encode(pretenure_flag)); | 1619 PretenureFlagBits::encode(pretenure_flag)); |
| 1621 } | 1620 } |
| 1622 | 1621 |
| 1623 StringAddFlags flags() const { | 1622 StringAddFlags flags() const { |
| 1624 return StringAddFlagsBits::decode(sub_minor_key()); | 1623 return StringAddFlagsBits::decode(minor_key_); |
| 1625 } | 1624 } |
| 1626 | 1625 |
| 1627 PretenureFlag pretenure_flag() const { | 1626 PretenureFlag pretenure_flag() const { |
| 1628 return PretenureFlagBits::decode(sub_minor_key()); | 1627 return PretenureFlagBits::decode(minor_key_); |
| 1629 } | 1628 } |
| 1630 | 1629 |
| 1631 private: | 1630 private: |
| 1632 class StringAddFlagsBits : public BitField<StringAddFlags, 0, 3> {}; | 1631 class StringAddFlagsBits : public BitField<StringAddFlags, 0, 3> {}; |
| 1633 class PretenureFlagBits : public BitField<PretenureFlag, 3, 1> {}; | 1632 class PretenureFlagBits : public BitField<PretenureFlag, 3, 1> {}; |
| 1634 | 1633 |
| 1635 void PrintBaseName(std::ostream& os) const override; // NOLINT | 1634 void PrintBaseName(std::ostream& os) const override; // NOLINT |
| 1636 | 1635 |
| 1637 DEFINE_CALL_INTERFACE_DESCRIPTOR(StringAdd); | 1636 DEFINE_CALL_INTERFACE_DESCRIPTOR(StringAdd); |
| 1638 DEFINE_HYDROGEN_CODE_STUB(StringAdd, HydrogenCodeStub); | 1637 DEFINE_TURBOFAN_CODE_STUB(StringAdd, TurboFanCodeStub); |
| 1639 }; | 1638 }; |
| 1640 | 1639 |
| 1641 | 1640 |
| 1642 class CompareICStub : public PlatformCodeStub { | 1641 class CompareICStub : public PlatformCodeStub { |
| 1643 public: | 1642 public: |
| 1644 CompareICStub(Isolate* isolate, Token::Value op, CompareICState::State left, | 1643 CompareICStub(Isolate* isolate, Token::Value op, CompareICState::State left, |
| 1645 CompareICState::State right, CompareICState::State state) | 1644 CompareICState::State right, CompareICState::State state) |
| 1646 : PlatformCodeStub(isolate) { | 1645 : PlatformCodeStub(isolate) { |
| 1647 DCHECK(Token::IsCompareOp(op)); | 1646 DCHECK(Token::IsCompareOp(op)); |
| 1648 DCHECK(OpBits::is_valid(op - Token::EQ)); | 1647 DCHECK(OpBits::is_valid(op - Token::EQ)); |
| (...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2749 #undef DEFINE_HYDROGEN_CODE_STUB | 2748 #undef DEFINE_HYDROGEN_CODE_STUB |
| 2750 #undef DEFINE_CODE_STUB | 2749 #undef DEFINE_CODE_STUB |
| 2751 #undef DEFINE_CODE_STUB_BASE | 2750 #undef DEFINE_CODE_STUB_BASE |
| 2752 | 2751 |
| 2753 extern Representation RepresentationFromMachineType(MachineType type); | 2752 extern Representation RepresentationFromMachineType(MachineType type); |
| 2754 | 2753 |
| 2755 } // namespace internal | 2754 } // namespace internal |
| 2756 } // namespace v8 | 2755 } // namespace v8 |
| 2757 | 2756 |
| 2758 #endif // V8_CODE_STUBS_H_ | 2757 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |