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

Unified Diff: src/code-stubs.h

Issue 26827002: Allow FastCloneShallowObjectStub to use AllocationMementos. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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 d2101ae293b6cee60ef3ca597bc483ab9b4d18ba..2fadce35a0561d6d427689cc716f85bd62c59713 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -673,13 +673,18 @@ class FastCloneShallowObjectStub : public HydrogenCodeStub {
// Maximum number of properties in copied object.
static const int kMaximumClonedProperties = 6;
- explicit FastCloneShallowObjectStub(int length)
- : length_(length) {
+ FastCloneShallowObjectStub(AllocationSiteMode allocation_site_mode,
Michael Starzinger 2013/10/10 13:27:39 As discussed offline: I don't think it makes much
mvstanton 2013/10/10 14:09:04 Good comment, I added FLAG_allocation_site_pretenu
+ int length)
+ : allocation_site_mode_(allocation_site_mode),
+ length_(length) {
ASSERT_GE(length_, 0);
ASSERT_LE(length_, kMaximumClonedProperties);
}
int length() const { return length_; }
+ AllocationSiteMode allocation_site_mode() const {
+ return allocation_site_mode_;
+ }
virtual Handle<Code> GenerateCode(Isolate* isolate);
@@ -688,10 +693,20 @@ class FastCloneShallowObjectStub : public HydrogenCodeStub {
CodeStubInterfaceDescriptor* descriptor);
private:
+ AllocationSiteMode allocation_site_mode_;
int length_;
+ class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {};
+ class LengthBits: public BitField<int, 1, 4> {};
+ // Ensure data fits within available bits.
+ STATIC_ASSERT(LAST_ALLOCATION_SITE_MODE == 1);
+ STATIC_ASSERT(kMaximumClonedProperties < 16);
+
Major MajorKey() { return FastCloneShallowObject; }
- int NotMissMinorKey() { return length_; }
+ int NotMissMinorKey() {
+ return AllocationSiteModeBits::encode(allocation_site_mode_)
+ | LengthBits::encode(length_);
+ }
DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub);
};
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698