Pretty printing for array code stubs. The minor keys encode things like...

Pretty printing for array code stubs. The minor keys encode things like specialized ElementsKind for each stub. This can be useful to see in disassembly traces.

R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/110103002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18369 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3c7aae75
...@@ -585,6 +585,28 @@ void CallConstructStub::PrintName(StringStream* stream) { ...@@ -585,6 +585,28 @@ void CallConstructStub::PrintName(StringStream* stream) {
} }
void ArrayConstructorStub::PrintName(StringStream* stream) {
stream->Add("ArrayConstructorStub");
switch (argument_count_) {
case ANY: stream->Add("_Any"); break;
case NONE: stream->Add("_None"); break;
case ONE: stream->Add("_One"); break;
case MORE_THAN_ONE: stream->Add("_More_Than_One"); break;
}
}
void ArrayConstructorStubBase::BasePrintName(const char* name,
StringStream* stream) {
stream->Add(name);
stream->Add("_");
stream->Add(ElementsKindToString(elements_kind()));
if (override_mode() == DISABLE_ALLOCATION_SITES) {
stream->Add("_DISABLE_ALLOCATION_SITES");
}
}
bool ToBooleanStub::UpdateStatus(Handle<Object> object) { bool ToBooleanStub::UpdateStatus(Handle<Object> object) {
Types old_types(types_); Types old_types(types_);
bool to_boolean_value = types_.UpdateStatus(object); bool to_boolean_value = types_.UpdateStatus(object);
......
...@@ -741,6 +741,7 @@ class ArrayConstructorStub: public PlatformCodeStub { ...@@ -741,6 +741,7 @@ class ArrayConstructorStub: public PlatformCodeStub {
private: private:
void GenerateDispatchToArrayStub(MacroAssembler* masm, void GenerateDispatchToArrayStub(MacroAssembler* masm,
AllocationSiteOverrideMode mode); AllocationSiteOverrideMode mode);
virtual void PrintName(StringStream* stream);
virtual CodeStub::Major MajorKey() { return ArrayConstructor; } virtual CodeStub::Major MajorKey() { return ArrayConstructor; }
virtual int MinorKey() { return argument_count_; } virtual int MinorKey() { return argument_count_; }
...@@ -1933,6 +1934,9 @@ class ArrayConstructorStubBase : public HydrogenCodeStub { ...@@ -1933,6 +1934,9 @@ class ArrayConstructorStubBase : public HydrogenCodeStub {
static const int kConstructor = 0; static const int kConstructor = 0;
static const int kPropertyCell = 1; static const int kPropertyCell = 1;
protected:
void BasePrintName(const char* name, StringStream* stream);
private: private:
int NotMissMinorKey() { return bit_field_; } int NotMissMinorKey() { return bit_field_; }
...@@ -1968,6 +1972,10 @@ class ArrayNoArgumentConstructorStub : public ArrayConstructorStubBase { ...@@ -1968,6 +1972,10 @@ class ArrayNoArgumentConstructorStub : public ArrayConstructorStubBase {
private: private:
Major MajorKey() { return ArrayNoArgumentConstructor; } Major MajorKey() { return ArrayNoArgumentConstructor; }
virtual void PrintName(StringStream* stream) {
BasePrintName("ArrayNoArgumentConstructorStub", stream);
}
DISALLOW_COPY_AND_ASSIGN(ArrayNoArgumentConstructorStub); DISALLOW_COPY_AND_ASSIGN(ArrayNoArgumentConstructorStub);
}; };
...@@ -1990,6 +1998,10 @@ class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase { ...@@ -1990,6 +1998,10 @@ class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase {
private: private:
Major MajorKey() { return ArraySingleArgumentConstructor; } Major MajorKey() { return ArraySingleArgumentConstructor; }
virtual void PrintName(StringStream* stream) {
BasePrintName("ArraySingleArgumentConstructorStub", stream);
}
DISALLOW_COPY_AND_ASSIGN(ArraySingleArgumentConstructorStub); DISALLOW_COPY_AND_ASSIGN(ArraySingleArgumentConstructorStub);
}; };
...@@ -2012,6 +2024,10 @@ class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase { ...@@ -2012,6 +2024,10 @@ class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase {
private: private:
Major MajorKey() { return ArrayNArgumentsConstructor; } Major MajorKey() { return ArrayNArgumentsConstructor; }
virtual void PrintName(StringStream* stream) {
BasePrintName("ArrayNArgumentsConstructorStub", stream);
}
DISALLOW_COPY_AND_ASSIGN(ArrayNArgumentsConstructorStub); DISALLOW_COPY_AND_ASSIGN(ArrayNArgumentsConstructorStub);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment