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

Unified Diff: src/code-stubs.h

Issue 14576005: Adapt hydrogen-based Array constructor to also support InternalArray and function call (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Adapt to bugfix for 244461 Created 7 years, 7 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
« no previous file with comments | « src/builtins-decls.h ('k') | src/code-stubs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index 513ad9a7c2937912675eb389975a9e8bb465f077..4c0d4eee769d721d02b8549418d4b2ff81b4ea1e 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -77,6 +77,9 @@ namespace internal {
V(ArrayNoArgumentConstructor) \
V(ArraySingleArgumentConstructor) \
V(ArrayNArgumentsConstructor) \
+ V(InternalArrayNoArgumentConstructor) \
+ V(InternalArraySingleArgumentConstructor) \
+ V(InternalArrayNArgumentsConstructor) \
V(KeyedStoreElement) \
V(DebuggerStatement) \
V(NameDictionaryLookup) \
@@ -85,6 +88,7 @@ namespace internal {
V(StoreArrayLiteralElement) \
V(StubFailureTrampoline) \
V(ArrayConstructor) \
+ V(InternalArrayConstructor) \
V(ProfileEntryHook) \
/* IC Handler stubs */ \
V(LoadField) \
@@ -670,6 +674,20 @@ class ArrayConstructorStub: public PlatformCodeStub {
};
+class InternalArrayConstructorStub: public PlatformCodeStub {
+ public:
+ explicit InternalArrayConstructorStub(Isolate* isolate);
+
+ void Generate(MacroAssembler* masm);
+
+ private:
+ virtual CodeStub::Major MajorKey() { return InternalArrayConstructor; }
+ virtual int MinorKey() { return 0; }
+
+ void GenerateCase(MacroAssembler* masm, ElementsKind kind);
+};
+
+
class MathPowStub: public PlatformCodeStub {
public:
enum ExponentType { INTEGER, DOUBLE, TAGGED, ON_STACK };
@@ -1712,6 +1730,7 @@ class ArrayConstructorStubBase : public HydrogenCodeStub {
class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
class AllocationSiteModeBits: public BitField<bool, 8, 1> {};
+
uint32_t bit_field_;
DISALLOW_COPY_AND_ASSIGN(ArrayConstructorStubBase);
@@ -1764,8 +1783,8 @@ class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase {
public:
ArrayNArgumentsConstructorStub(
ElementsKind kind,
- AllocationSiteMode mode = TRACK_ALLOCATION_SITE) :
- ArrayConstructorStubBase(kind, mode) {
+ AllocationSiteMode mode = TRACK_ALLOCATION_SITE)
+ : ArrayConstructorStubBase(kind, mode) {
}
virtual Handle<Code> GenerateCode();
@@ -1781,6 +1800,87 @@ class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase {
};
+class InternalArrayConstructorStubBase : public HydrogenCodeStub {
+ public:
+ explicit InternalArrayConstructorStubBase(ElementsKind kind) {
+ kind_ = kind;
+ }
+
+ virtual bool IsPregenerated() { return true; }
+ static void GenerateStubsAheadOfTime(Isolate* isolate);
+ static void InstallDescriptors(Isolate* isolate);
+
+ // Parameters accessed via CodeStubGraphBuilder::GetParameter()
+ static const int kConstructor = 0;
+
+ ElementsKind elements_kind() const { return kind_; }
+
+ private:
+ int NotMissMinorKey() { return kind_; }
+
+ ElementsKind kind_;
+
+ DISALLOW_COPY_AND_ASSIGN(InternalArrayConstructorStubBase);
+};
+
+
+class InternalArrayNoArgumentConstructorStub : public
+ InternalArrayConstructorStubBase {
+ public:
+ explicit InternalArrayNoArgumentConstructorStub(ElementsKind kind)
+ : InternalArrayConstructorStubBase(kind) { }
+
+ virtual Handle<Code> GenerateCode();
+
+ virtual void InitializeInterfaceDescriptor(
+ Isolate* isolate,
+ CodeStubInterfaceDescriptor* descriptor);
+
+ private:
+ Major MajorKey() { return InternalArrayNoArgumentConstructor; }
+
+ DISALLOW_COPY_AND_ASSIGN(InternalArrayNoArgumentConstructorStub);
+};
+
+
+class InternalArraySingleArgumentConstructorStub : public
+ InternalArrayConstructorStubBase {
+ public:
+ explicit InternalArraySingleArgumentConstructorStub(ElementsKind kind)
+ : InternalArrayConstructorStubBase(kind) { }
+
+ virtual Handle<Code> GenerateCode();
+
+ virtual void InitializeInterfaceDescriptor(
+ Isolate* isolate,
+ CodeStubInterfaceDescriptor* descriptor);
+
+ private:
+ Major MajorKey() { return InternalArraySingleArgumentConstructor; }
+
+ DISALLOW_COPY_AND_ASSIGN(InternalArraySingleArgumentConstructorStub);
+};
+
+
+class InternalArrayNArgumentsConstructorStub : public
+ InternalArrayConstructorStubBase {
+ public:
+ explicit InternalArrayNArgumentsConstructorStub(ElementsKind kind)
+ : InternalArrayConstructorStubBase(kind) { }
+
+ virtual Handle<Code> GenerateCode();
+
+ virtual void InitializeInterfaceDescriptor(
+ Isolate* isolate,
+ CodeStubInterfaceDescriptor* descriptor);
+
+ private:
+ Major MajorKey() { return InternalArrayNArgumentsConstructor; }
+
+ DISALLOW_COPY_AND_ASSIGN(InternalArrayNArgumentsConstructorStub);
+};
+
+
class KeyedStoreElementStub : public PlatformCodeStub {
public:
KeyedStoreElementStub(bool is_js_array,
« no previous file with comments | « src/builtins-decls.h ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698