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

Unified Diff: src/code-stubs.h

Issue 2024253002: [stubs] Remove N-argument Hydrogen-based Array constructor stub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm64 Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index d651b2e624983105b41a1e39b2578ed09f8e4ad7..f3439140bed3888f9a24c134b6aae83e26163c12 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -55,7 +55,6 @@ namespace internal {
V(VectorStoreIC) \
V(VectorKeyedStoreIC) \
/* HydrogenCodeStubs */ \
- V(ArrayNArgumentsConstructor) \
V(BinaryOpIC) \
V(BinaryOpWithAllocationSite) \
V(CreateAllocationSite) \
@@ -72,7 +71,6 @@ namespace internal {
V(FastNewSloppyArguments) \
V(FastNewStrictArguments) \
V(GrowArrayElements) \
- V(InternalArrayNArgumentsConstructor) \
V(KeyedLoadGeneric) \
V(LoadGlobalViaContext) \
V(LoadScriptContextField) \
@@ -103,6 +101,7 @@ namespace internal {
V(AllocateBool8x16) \
V(ArrayNoArgumentConstructor) \
V(ArraySingleArgumentConstructor) \
+ V(ArrayNArgumentsConstructor) \
V(StringLength) \
V(Add) \
V(Subtract) \
@@ -1307,7 +1306,7 @@ class ArrayConstructorStub: public PlatformCodeStub {
class ArgumentCountBits : public BitField<ArgumentCountKey, 0, 2> {};
- DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructor);
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayNArgumentsConstructor);
DEFINE_PLATFORM_CODE_STUB(ArrayConstructor, PlatformCodeStub);
};
@@ -1319,7 +1318,7 @@ class InternalArrayConstructorStub: public PlatformCodeStub {
private:
void GenerateCase(MacroAssembler* masm, ElementsKind kind);
- DEFINE_CALL_INTERFACE_DESCRIPTOR(InternalArrayConstructor);
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayNArgumentsConstructor);
DEFINE_PLATFORM_CODE_STUB(InternalArrayConstructor, PlatformCodeStub);
};
@@ -2807,50 +2806,6 @@ class AllocateHeapNumberStub : public TurboFanCodeStub {
SIMD128_TYPES(SIMD128_ALLOC_STUB)
#undef SIMD128_ALLOC_STUB
-class ArrayConstructorStubBase : public HydrogenCodeStub {
- public:
- ArrayConstructorStubBase(Isolate* isolate,
- ElementsKind kind,
- AllocationSiteOverrideMode override_mode)
- : HydrogenCodeStub(isolate) {
- // It only makes sense to override local allocation site behavior
- // if there is a difference between the global allocation site policy
- // for an ElementsKind and the desired usage of the stub.
- DCHECK(override_mode != DISABLE_ALLOCATION_SITES ||
- AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE);
- set_sub_minor_key(ElementsKindBits::encode(kind) |
- AllocationSiteOverrideModeBits::encode(override_mode));
- }
-
- ElementsKind elements_kind() const {
- return ElementsKindBits::decode(sub_minor_key());
- }
-
- AllocationSiteOverrideMode override_mode() const {
- return AllocationSiteOverrideModeBits::decode(sub_minor_key());
- }
-
- static void GenerateStubsAheadOfTime(Isolate* isolate);
-
- // Parameters accessed via CodeStubGraphBuilder::GetParameter()
- static const int kConstructor = 0;
- static const int kAllocationSite = 1;
-
- protected:
- std::ostream& BasePrintName(std::ostream& os,
- const char* name) const; // NOLINT
-
- private:
- // Ensure data fits within available bits.
- STATIC_ASSERT(LAST_ALLOCATION_SITE_OVERRIDE_MODE == 1);
-
- class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
- class AllocationSiteOverrideModeBits: public
- BitField<AllocationSiteOverrideMode, 8, 1> {}; // NOLINT
-
- DEFINE_CODE_STUB_BASE(ArrayConstructorStubBase, HydrogenCodeStub);
-};
-
class CommonArrayConstructorStub : public TurboFanCodeStub {
protected:
CommonArrayConstructorStub(Isolate* isolate, ElementsKind kind,
@@ -2881,6 +2836,8 @@ class CommonArrayConstructorStub : public TurboFanCodeStub {
return AllocationSiteOverrideModeBits::decode(sub_minor_key());
}
+ static void GenerateStubsAheadOfTime(Isolate* isolate);
+
private:
// Ensure data fits within available bits.
STATIC_ASSERT(LAST_ALLOCATION_SITE_OVERRIDE_MODE == 1);
@@ -2957,61 +2914,19 @@ class InternalArraySingleArgumentConstructorStub
CommonArrayConstructorStub);
};
-class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase {
+class ArrayNArgumentsConstructorStub : public PlatformCodeStub {
public:
- ArrayNArgumentsConstructorStub(
- Isolate* isolate,
- ElementsKind kind,
- AllocationSiteOverrideMode override_mode = DONT_OVERRIDE)
- : ArrayConstructorStubBase(isolate, kind, override_mode) {
- }
-
- private:
- void PrintName(std::ostream& os) const override { // NOLINT
- BasePrintName(os, "ArrayNArgumentsConstructorStub");
- }
-
- DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructor);
- DEFINE_HYDROGEN_CODE_STUB(ArrayNArgumentsConstructor,
- ArrayConstructorStubBase);
-};
-
-
-class InternalArrayConstructorStubBase : public HydrogenCodeStub {
- public:
- InternalArrayConstructorStubBase(Isolate* isolate, ElementsKind kind)
- : HydrogenCodeStub(isolate) {
- set_sub_minor_key(ElementsKindBits::encode(kind));
- }
-
- static void GenerateStubsAheadOfTime(Isolate* isolate);
-
- // Parameters accessed via CodeStubGraphBuilder::GetParameter()
- static const int kConstructor = 0;
+ explicit ArrayNArgumentsConstructorStub(Isolate* isolate)
+ : PlatformCodeStub(isolate) {}
- ElementsKind elements_kind() const {
- return ElementsKindBits::decode(sub_minor_key());
+ CallInterfaceDescriptor GetCallInterfaceDescriptor() const override {
+ return ArrayNArgumentsConstructorDescriptor(isolate());
}
private:
- class ElementsKindBits : public BitField<ElementsKind, 0, 8> {};
-
- DEFINE_CODE_STUB_BASE(InternalArrayConstructorStubBase, HydrogenCodeStub);
-};
-
-
-class InternalArrayNArgumentsConstructorStub : public
- InternalArrayConstructorStubBase {
- public:
- InternalArrayNArgumentsConstructorStub(Isolate* isolate, ElementsKind kind)
- : InternalArrayConstructorStubBase(isolate, kind) { }
-
- DEFINE_CALL_INTERFACE_DESCRIPTOR(InternalArrayConstructor);
- DEFINE_HYDROGEN_CODE_STUB(InternalArrayNArgumentsConstructor,
- InternalArrayConstructorStubBase);
+ DEFINE_PLATFORM_CODE_STUB(ArrayNArgumentsConstructor, PlatformCodeStub);
};
-
class StoreElementStub : public PlatformCodeStub {
public:
StoreElementStub(Isolate* isolate, ElementsKind elements_kind,

Powered by Google App Engine
This is Rietveld 408576698