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

Side by Side Diff: src/code-stubs.h

Issue 15094018: Create AllocationSite objects, pointed to by AllocationSiteInfo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comment response Created 7 years, 5 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
« no previous file with comments | « src/builtins.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 V(Instanceof) \ 59 V(Instanceof) \
60 V(ConvertToDouble) \ 60 V(ConvertToDouble) \
61 V(WriteInt32ToHeapNumber) \ 61 V(WriteInt32ToHeapNumber) \
62 V(StackCheck) \ 62 V(StackCheck) \
63 V(Interrupt) \ 63 V(Interrupt) \
64 V(FastNewClosure) \ 64 V(FastNewClosure) \
65 V(FastNewContext) \ 65 V(FastNewContext) \
66 V(FastNewBlockContext) \ 66 V(FastNewBlockContext) \
67 V(FastCloneShallowArray) \ 67 V(FastCloneShallowArray) \
68 V(FastCloneShallowObject) \ 68 V(FastCloneShallowObject) \
69 V(CreateAllocationSite) \
69 V(ToBoolean) \ 70 V(ToBoolean) \
70 V(ToNumber) \ 71 V(ToNumber) \
71 V(ArgumentsAccess) \ 72 V(ArgumentsAccess) \
72 V(RegExpConstructResult) \ 73 V(RegExpConstructResult) \
73 V(NumberToString) \ 74 V(NumberToString) \
74 V(CEntry) \ 75 V(CEntry) \
75 V(JSEntry) \ 76 V(JSEntry) \
76 V(KeyedLoadElement) \ 77 V(KeyedLoadElement) \
77 V(ArrayNoArgumentConstructor) \ 78 V(ArrayNoArgumentConstructor) \
78 V(ArraySingleArgumentConstructor) \ 79 V(ArraySingleArgumentConstructor) \
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 private: 732 private:
732 int length_; 733 int length_;
733 734
734 Major MajorKey() { return FastCloneShallowObject; } 735 Major MajorKey() { return FastCloneShallowObject; }
735 int NotMissMinorKey() { return length_; } 736 int NotMissMinorKey() { return length_; }
736 737
737 DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub); 738 DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub);
738 }; 739 };
739 740
740 741
742 class CreateAllocationSiteStub : public HydrogenCodeStub {
743 public:
744 explicit CreateAllocationSiteStub() { }
745
746 virtual Handle<Code> GenerateCode();
747
748 virtual bool IsPregenerated() { return true; }
749
750 static void GenerateAheadOfTime(Isolate* isolate);
751
752 virtual void InitializeInterfaceDescriptor(
753 Isolate* isolate,
754 CodeStubInterfaceDescriptor* descriptor);
755
756 private:
757 Major MajorKey() { return CreateAllocationSite; }
758 int NotMissMinorKey() { return 0; }
759
760 DISALLOW_COPY_AND_ASSIGN(CreateAllocationSiteStub);
761 };
762
763
741 class InstanceofStub: public PlatformCodeStub { 764 class InstanceofStub: public PlatformCodeStub {
742 public: 765 public:
743 enum Flags { 766 enum Flags {
744 kNoFlags = 0, 767 kNoFlags = 0,
745 kArgsInRegisters = 1 << 0, 768 kArgsInRegisters = 1 << 0,
746 kCallSiteInlineCheck = 1 << 1, 769 kCallSiteInlineCheck = 1 << 1,
747 kReturnTrueFalseObject = 1 << 2 770 kReturnTrueFalseObject = 1 << 2
748 }; 771 };
749 772
750 explicit InstanceofStub(Flags flags) : flags_(flags) { } 773 explicit InstanceofStub(Flags flags) : flags_(flags) { }
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1866 1889
1867 1890
1868 class ArrayConstructorStubBase : public HydrogenCodeStub { 1891 class ArrayConstructorStubBase : public HydrogenCodeStub {
1869 public: 1892 public:
1870 ArrayConstructorStubBase(ElementsKind kind, ContextCheckMode context_mode, 1893 ArrayConstructorStubBase(ElementsKind kind, ContextCheckMode context_mode,
1871 AllocationSiteOverrideMode override_mode) { 1894 AllocationSiteOverrideMode override_mode) {
1872 // It only makes sense to override local allocation site behavior 1895 // It only makes sense to override local allocation site behavior
1873 // if there is a difference between the global allocation site policy 1896 // if there is a difference between the global allocation site policy
1874 // for an ElementsKind and the desired usage of the stub. 1897 // for an ElementsKind and the desired usage of the stub.
1875 ASSERT(override_mode != DISABLE_ALLOCATION_SITES || 1898 ASSERT(override_mode != DISABLE_ALLOCATION_SITES ||
1876 AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); 1899 AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE);
1877 bit_field_ = ElementsKindBits::encode(kind) | 1900 bit_field_ = ElementsKindBits::encode(kind) |
1878 AllocationSiteOverrideModeBits::encode(override_mode) | 1901 AllocationSiteOverrideModeBits::encode(override_mode) |
1879 ContextCheckModeBits::encode(context_mode); 1902 ContextCheckModeBits::encode(context_mode);
1880 } 1903 }
1881 1904
1882 ElementsKind elements_kind() const { 1905 ElementsKind elements_kind() const {
1883 return ElementsKindBits::decode(bit_field_); 1906 return ElementsKindBits::decode(bit_field_);
1884 } 1907 }
1885 1908
1886 AllocationSiteOverrideMode override_mode() const { 1909 AllocationSiteOverrideMode override_mode() const {
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2293 int MinorKey() { return 0; } 2316 int MinorKey() { return 0; }
2294 2317
2295 void Generate(MacroAssembler* masm); 2318 void Generate(MacroAssembler* masm);
2296 2319
2297 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); 2320 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub);
2298 }; 2321 };
2299 2322
2300 } } // namespace v8::internal 2323 } } // namespace v8::internal
2301 2324
2302 #endif // V8_CODE_STUBS_H_ 2325 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698