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

Unified Diff: src/code-stubs.h

Issue 16206007: Turn off allocation site info for crankshafted array constructor calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/code-stubs-hydrogen.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..aec1e4fd5b3f2bec869f7860e484cc928d272924 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -1684,19 +1684,22 @@ class TransitionElementsKindStub : public HydrogenCodeStub {
class ArrayConstructorStubBase : public HydrogenCodeStub {
public:
- ArrayConstructorStubBase(ElementsKind kind, AllocationSiteMode mode) {
+ ArrayConstructorStubBase(ElementsKind kind, bool disable_allocation_sites) {
+ // 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.
+ ASSERT(!disable_allocation_sites ||
+ AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE);
bit_field_ = ElementsKindBits::encode(kind) |
- AllocationSiteModeBits::encode(mode == TRACK_ALLOCATION_SITE);
+ DisableAllocationSitesBits::encode(disable_allocation_sites);
}
ElementsKind elements_kind() const {
return ElementsKindBits::decode(bit_field_);
}
- AllocationSiteMode mode() const {
- return AllocationSiteModeBits::decode(bit_field_)
- ? TRACK_ALLOCATION_SITE
- : DONT_TRACK_ALLOCATION_SITE;
+ bool disable_allocation_sites() const {
Hannes Payer (out of office) 2013/06/04 12:25:54 This is not a real getter. The function name shoul
+ return DisableAllocationSitesBits::decode(bit_field_);
}
virtual bool IsPregenerated() { return true; }
@@ -1711,7 +1714,7 @@ class ArrayConstructorStubBase : public HydrogenCodeStub {
int NotMissMinorKey() { return bit_field_; }
class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
- class AllocationSiteModeBits: public BitField<bool, 8, 1> {};
+ class DisableAllocationSitesBits: public BitField<bool, 8, 1> {};
Hannes Payer (out of office) 2013/06/04 12:25:54 Do you want to rename it to DisableAllocationSites
uint32_t bit_field_;
DISALLOW_COPY_AND_ASSIGN(ArrayConstructorStubBase);
@@ -1722,8 +1725,8 @@ class ArrayNoArgumentConstructorStub : public ArrayConstructorStubBase {
public:
ArrayNoArgumentConstructorStub(
ElementsKind kind,
- AllocationSiteMode mode = TRACK_ALLOCATION_SITE)
- : ArrayConstructorStubBase(kind, mode) {
+ bool disable_allocation_sites = false)
+ : ArrayConstructorStubBase(kind, disable_allocation_sites) {
}
virtual Handle<Code> GenerateCode();
@@ -1743,8 +1746,8 @@ class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase {
public:
ArraySingleArgumentConstructorStub(
ElementsKind kind,
- AllocationSiteMode mode = TRACK_ALLOCATION_SITE)
- : ArrayConstructorStubBase(kind, mode) {
+ bool disable_allocation_sites = false)
+ : ArrayConstructorStubBase(kind, disable_allocation_sites) {
}
virtual Handle<Code> GenerateCode();
@@ -1764,8 +1767,8 @@ class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase {
public:
ArrayNArgumentsConstructorStub(
ElementsKind kind,
- AllocationSiteMode mode = TRACK_ALLOCATION_SITE) :
- ArrayConstructorStubBase(kind, mode) {
+ bool disable_allocation_sites = false)
+ : ArrayConstructorStubBase(kind, disable_allocation_sites) {
}
virtual Handle<Code> GenerateCode();
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698