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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 | LengthBits::encode(length_); 666 | LengthBits::encode(length_);
667 } 667 }
668 }; 668 };
669 669
670 670
671 class FastCloneShallowObjectStub : public HydrogenCodeStub { 671 class FastCloneShallowObjectStub : public HydrogenCodeStub {
672 public: 672 public:
673 // Maximum number of properties in copied object. 673 // Maximum number of properties in copied object.
674 static const int kMaximumClonedProperties = 6; 674 static const int kMaximumClonedProperties = 6;
675 675
676 explicit FastCloneShallowObjectStub(int length) 676 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
677 : length_(length) { 677 int length)
678 : allocation_site_mode_(allocation_site_mode),
679 length_(length) {
678 ASSERT_GE(length_, 0); 680 ASSERT_GE(length_, 0);
679 ASSERT_LE(length_, kMaximumClonedProperties); 681 ASSERT_LE(length_, kMaximumClonedProperties);
680 } 682 }
681 683
682 int length() const { return length_; } 684 int length() const { return length_; }
685 AllocationSiteMode allocation_site_mode() const {
686 return allocation_site_mode_;
687 }
683 688
684 virtual Handle<Code> GenerateCode(Isolate* isolate); 689 virtual Handle<Code> GenerateCode(Isolate* isolate);
685 690
686 virtual void InitializeInterfaceDescriptor( 691 virtual void InitializeInterfaceDescriptor(
687 Isolate* isolate, 692 Isolate* isolate,
688 CodeStubInterfaceDescriptor* descriptor); 693 CodeStubInterfaceDescriptor* descriptor);
689 694
690 private: 695 private:
696 AllocationSiteMode allocation_site_mode_;
691 int length_; 697 int length_;
692 698
699 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {};
700 class LengthBits: public BitField<int, 1, 4> {};
701 // Ensure data fits within available bits.
702 STATIC_ASSERT(LAST_ALLOCATION_SITE_MODE == 1);
703 STATIC_ASSERT(kMaximumClonedProperties < 16);
704
693 Major MajorKey() { return FastCloneShallowObject; } 705 Major MajorKey() { return FastCloneShallowObject; }
694 int NotMissMinorKey() { return length_; } 706 int NotMissMinorKey() {
707 return AllocationSiteModeBits::encode(allocation_site_mode_)
708 | LengthBits::encode(length_);
709 }
695 710
696 DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub); 711 DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub);
697 }; 712 };
698 713
699 714
700 class CreateAllocationSiteStub : public HydrogenCodeStub { 715 class CreateAllocationSiteStub : public HydrogenCodeStub {
701 public: 716 public:
702 explicit CreateAllocationSiteStub() { } 717 explicit CreateAllocationSiteStub() { }
703 718
704 virtual Handle<Code> GenerateCode(Isolate* isolate); 719 virtual Handle<Code> GenerateCode(Isolate* isolate);
(...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after
2356 int MinorKey() { return 0; } 2371 int MinorKey() { return 0; }
2357 2372
2358 void Generate(MacroAssembler* masm); 2373 void Generate(MacroAssembler* masm);
2359 2374
2360 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); 2375 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub);
2361 }; 2376 };
2362 2377
2363 } } // namespace v8::internal 2378 } } // namespace v8::internal
2364 2379
2365 #endif // V8_CODE_STUBS_H_ 2380 #endif // V8_CODE_STUBS_H_
OLDNEW
« 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