Index: src/code-stubs.h |
diff --git a/src/code-stubs.h b/src/code-stubs.h |
index 05d4a0be792aab3c8121f15faf97e20f47543495..a81fa0a2f06f7161f8c4dcf428e8895c2a283573 100644 |
--- a/src/code-stubs.h |
+++ b/src/code-stubs.h |
@@ -431,8 +431,9 @@ class CodeStub BASE_EMBEDDED { |
#define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ |
public: \ |
+ typedef NAME##Descriptor Descriptor; \ |
CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { \ |
- return NAME##Descriptor(isolate()); \ |
+ return Descriptor(isolate()); \ |
} |
#define DEFINE_ON_STACK_CALL_INTERFACE_DESCRIPTOR(PARAMETER_COUNT) \ |
@@ -1023,9 +1024,6 @@ class NumberToStringStub final : public HydrogenCodeStub { |
public: |
explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
- // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
- static const int kNumber = 0; |
- |
DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); |
DEFINE_HYDROGEN_CODE_STUB(NumberToString, HydrogenCodeStub); |
}; |
@@ -1035,9 +1033,6 @@ class TypeofStub final : public HydrogenCodeStub { |
public: |
explicit TypeofStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
- // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
- static const int kObject = 0; |
- |
static void GenerateAheadOfTime(Isolate* isolate); |
DEFINE_CALL_INTERFACE_DESCRIPTOR(Typeof); |
@@ -1448,6 +1443,8 @@ class LoadFieldStub: public HandlerStub { |
private: |
class LoadFieldByIndexBits : public BitField<int, 0, 13> {}; |
+ // TODO(ishell): The stub uses only kReceiver parameter. |
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
DEFINE_HANDLER_CODE_STUB(LoadField, HandlerStub); |
}; |
@@ -1460,7 +1457,7 @@ class KeyedLoadSloppyArgumentsStub : public HandlerStub { |
protected: |
Code::Kind kind() const override { return Code::KEYED_LOAD_IC; } |
- private: |
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
DEFINE_HANDLER_CODE_STUB(KeyedLoadSloppyArguments, HandlerStub); |
}; |
@@ -1478,7 +1475,7 @@ class KeyedStoreSloppyArgumentsStub : public HandlerStub { |
protected: |
Code::Kind kind() const override { return Code::KEYED_STORE_IC; } |
- private: |
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
DEFINE_HANDLER_CODE_STUB(KeyedStoreSloppyArguments, HandlerStub); |
}; |
@@ -1500,6 +1497,8 @@ class LoadConstantStub : public HandlerStub { |
private: |
class ConstantIndexBits : public BitField<int, 0, kSubMinorKeyBits> {}; |
+ // TODO(ishell): The stub uses only kReceiver parameter. |
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
DEFINE_HANDLER_CODE_STUB(LoadConstant, HandlerStub); |
}; |
@@ -1558,6 +1557,8 @@ class StoreFieldStub : public HandlerStub { |
class StoreFieldByIndexBits : public BitField<int, 0, 13> {}; |
class RepresentationBits : public BitField<uint8_t, 13, 4> {}; |
+ // TODO(ishell): The stub uses only kReceiver and kValue parameters. |
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
DEFINE_HANDLER_CODE_STUB(StoreField, HandlerStub); |
}; |
@@ -1591,25 +1592,23 @@ class StoreTransitionHelper { |
return VectorStoreTransitionDescriptor::MapRegister(); |
} |
- static int ReceiverIndex() { |
- return StoreTransitionDescriptor::kReceiverIndex; |
- } |
+ static int ReceiverIndex() { return StoreTransitionDescriptor::kReceiver; } |
- static int NameIndex() { return StoreTransitionDescriptor::kReceiverIndex; } |
+ static int NameIndex() { return StoreTransitionDescriptor::kReceiver; } |
- static int ValueIndex() { return StoreTransitionDescriptor::kValueIndex; } |
+ static int ValueIndex() { return StoreTransitionDescriptor::kValue; } |
static int MapIndex() { |
- DCHECK(static_cast<int>(VectorStoreTransitionDescriptor::kMapIndex) == |
- static_cast<int>(StoreTransitionDescriptor::kMapIndex)); |
- return StoreTransitionDescriptor::kMapIndex; |
+ DCHECK(static_cast<int>(VectorStoreTransitionDescriptor::kMap) == |
+ static_cast<int>(StoreTransitionDescriptor::kMap)); |
+ return StoreTransitionDescriptor::kMap; |
} |
static int VectorIndex() { |
if (HasVirtualSlotArg()) { |
- return VectorStoreTransitionDescriptor::kVirtualSlotVectorIndex; |
+ return VectorStoreTransitionDescriptor::kVirtualSlotVector; |
} |
- return VectorStoreTransitionDescriptor::kVectorIndex; |
+ return VectorStoreTransitionDescriptor::kVector; |
} |
// Some platforms don't have a slot arg. |
@@ -1658,16 +1657,16 @@ class StoreTransitionStub : public HandlerStub { |
return StoreModeBits::decode(sub_minor_key()); |
} |
- CallInterfaceDescriptor GetCallInterfaceDescriptor() const override; |
- |
protected: |
Code::Kind kind() const override { return Code::STORE_IC; } |
+ void InitializeDescriptor(CodeStubDescriptor* descriptor) override; |
private: |
class StoreFieldByIndexBits : public BitField<int, 0, 13> {}; |
class RepresentationBits : public BitField<uint8_t, 13, 4> {}; |
class StoreModeBits : public BitField<StoreMode, 17, 2> {}; |
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreTransition); |
DEFINE_HANDLER_CODE_STUB(StoreTransition, HandlerStub); |
}; |
@@ -1733,10 +1732,12 @@ class StoreGlobalStub : public HandlerStub { |
class RepresentationBits : public BitField<Representation::Kind, 4, 8> {}; |
class CheckGlobalBits : public BitField<bool, 12, 1> {}; |
+ // TODO(ishell): The stub uses only kValue parameter. |
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
DEFINE_HANDLER_CODE_STUB(StoreGlobal, HandlerStub); |
}; |
- |
+// TODO(ishell): remove, once StoreGlobalIC is implemented. |
class StoreGlobalViaContextStub final : public PlatformCodeStub { |
public: |
static const int kMaximumDepth = 15; |
@@ -1847,10 +1848,6 @@ class BinaryOpICStub : public HydrogenCodeStub { |
void PrintState(std::ostream& os) const final; // NOLINT |
- // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
- static const int kLeft = 0; |
- static const int kRight = 1; |
- |
private: |
static void GenerateAheadOfTime(Isolate* isolate, |
const BinaryOpICState& state); |
@@ -1909,11 +1906,6 @@ class BinaryOpWithAllocationSiteStub final : public BinaryOpICStub { |
Code::Kind GetCodeKind() const final { return Code::STUB; } |
- // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
- static const int kAllocationSite = 0; |
- static const int kLeft = 1; |
- static const int kRight = 2; |
- |
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOpWithAllocationSite); |
DEFINE_HYDROGEN_CODE_STUB(BinaryOpWithAllocationSite, BinaryOpICStub); |
}; |
@@ -1936,10 +1928,6 @@ class StringAddStub final : public HydrogenCodeStub { |
return PretenureFlagBits::decode(sub_minor_key()); |
} |
- // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
- static const int kLeft = 0; |
- static const int kRight = 1; |
- |
private: |
class StringAddFlagsBits : public BitField<StringAddFlags, 0, 3> {}; |
class PretenureFlagBits : public BitField<PretenureFlag, 3, 1> {}; |
@@ -2103,11 +2091,6 @@ class RegExpConstructResultStub final : public HydrogenCodeStub { |
explicit RegExpConstructResultStub(Isolate* isolate) |
: HydrogenCodeStub(isolate) { } |
- // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
- static const int kLength = 0; |
- static const int kIndex = 1; |
- static const int kInput = 2; |
- |
DEFINE_CALL_INTERFACE_DESCRIPTOR(RegExpConstructResult); |
DEFINE_HYDROGEN_CODE_STUB(RegExpConstructResult, HydrogenCodeStub); |
}; |
@@ -2309,7 +2292,7 @@ class KeyedLoadGenericStub : public HydrogenCodeStub { |
Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
- DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
DEFINE_HYDROGEN_CODE_STUB(KeyedLoadGeneric, HydrogenCodeStub); |
}; |
@@ -2619,6 +2602,7 @@ class LoadScriptContextFieldStub : public ScriptContextFieldStub { |
private: |
Code::Kind kind() const override { return Code::LOAD_IC; } |
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
DEFINE_HANDLER_CODE_STUB(LoadScriptContextField, ScriptContextFieldStub); |
}; |
@@ -2632,6 +2616,7 @@ class StoreScriptContextFieldStub : public ScriptContextFieldStub { |
private: |
Code::Kind kind() const override { return Code::STORE_IC; } |
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
DEFINE_HANDLER_CODE_STUB(StoreScriptContextField, ScriptContextFieldStub); |
}; |
@@ -2664,6 +2649,7 @@ class LoadFastElementStub : public HandlerStub { |
class IsJSArrayBits: public BitField<bool, 8, 1> {}; |
class CanConvertHoleToUndefined : public BitField<bool, 9, 1> {}; |
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
DEFINE_HANDLER_CODE_STUB(LoadFastElement, HandlerStub); |
}; |
@@ -2690,10 +2676,6 @@ class StoreFastElementStub : public HydrogenCodeStub { |
return CommonStoreModeBits::decode(sub_minor_key()); |
} |
- CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { |
- return StoreWithVectorDescriptor(isolate()); |
- } |
- |
Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } |
@@ -2701,6 +2683,7 @@ class StoreFastElementStub : public HydrogenCodeStub { |
class ElementsKindBits : public BitField<ElementsKind, 3, 8> {}; |
class IsJSArrayBits : public BitField<bool, 11, 1> {}; |
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
DEFINE_HYDROGEN_CODE_STUB(StoreFastElement, HydrogenCodeStub); |
}; |
@@ -2996,7 +2979,6 @@ class ElementsTransitionAndStoreStub : public HydrogenCodeStub { |
return CommonStoreModeBits::decode(sub_minor_key()); |
} |
- CallInterfaceDescriptor GetCallInterfaceDescriptor() const override; |
Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } |
@@ -3005,6 +2987,7 @@ class ElementsTransitionAndStoreStub : public HydrogenCodeStub { |
class ToBits : public BitField<ElementsKind, 11, 8> {}; |
class IsJSArrayBits : public BitField<bool, 19, 1> {}; |
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreTransition); |
DEFINE_HYDROGEN_CODE_STUB(ElementsTransitionAndStore, HydrogenCodeStub); |
}; |