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

Side by Side Diff: src/heap.h

Issue 148503002: A64: Synchronize with r15545. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/handles.cc ('k') | src/heap.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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 V(RegExp_string, "RegExp") \ 225 V(RegExp_string, "RegExp") \
226 V(source_string, "source") \ 226 V(source_string, "source") \
227 V(global_string, "global") \ 227 V(global_string, "global") \
228 V(ignore_case_string, "ignoreCase") \ 228 V(ignore_case_string, "ignoreCase") \
229 V(multiline_string, "multiline") \ 229 V(multiline_string, "multiline") \
230 V(input_string, "input") \ 230 V(input_string, "input") \
231 V(index_string, "index") \ 231 V(index_string, "index") \
232 V(last_index_string, "lastIndex") \ 232 V(last_index_string, "lastIndex") \
233 V(object_string, "object") \ 233 V(object_string, "object") \
234 V(payload_string, "payload") \ 234 V(payload_string, "payload") \
235 V(literals_string, "literals") \
235 V(prototype_string, "prototype") \ 236 V(prototype_string, "prototype") \
236 V(string_string, "string") \ 237 V(string_string, "string") \
237 V(String_string, "String") \ 238 V(String_string, "String") \
238 V(unknown_field_string, "unknownField") \ 239 V(unknown_field_string, "unknownField") \
239 V(symbol_string, "symbol") \ 240 V(symbol_string, "symbol") \
240 V(Symbol_string, "Symbol") \ 241 V(Symbol_string, "Symbol") \
241 V(Date_string, "Date") \ 242 V(Date_string, "Date") \
242 V(this_string, "this") \ 243 V(this_string, "this") \
243 V(to_string_string, "toString") \ 244 V(to_string_string, "toString") \
244 V(char_at_string, "CharAt") \ 245 V(char_at_string, "CharAt") \
245 V(undefined_string, "undefined") \ 246 V(undefined_string, "undefined") \
246 V(value_of_string, "valueOf") \ 247 V(value_of_string, "valueOf") \
247 V(stack_string, "stack") \ 248 V(stack_string, "stack") \
248 V(toJSON_string, "toJSON") \ 249 V(toJSON_string, "toJSON") \
249 V(InitializeVarGlobal_string, "InitializeVarGlobal") \ 250 V(InitializeVarGlobal_string, "InitializeVarGlobal") \
250 V(InitializeConstGlobal_string, "InitializeConstGlobal") \ 251 V(InitializeConstGlobal_string, "InitializeConstGlobal") \
251 V(KeyedLoadElementMonomorphic_string, \ 252 V(KeyedLoadElementMonomorphic_string, \
252 "KeyedLoadElementMonomorphic") \ 253 "KeyedLoadElementMonomorphic") \
253 V(KeyedStoreElementMonomorphic_string, \ 254 V(KeyedStoreElementMonomorphic_string, \
254 "KeyedStoreElementMonomorphic") \ 255 "KeyedStoreElementMonomorphic") \
255 V(stack_overflow_string, "kStackOverflowBoilerplate") \ 256 V(stack_overflow_string, "kStackOverflowBoilerplate") \
256 V(illegal_access_string, "illegal access") \ 257 V(illegal_access_string, "illegal access") \
257 V(out_of_memory_string, "out-of-memory") \ 258 V(out_of_memory_string, "out-of-memory") \
258 V(illegal_execution_state_string, "illegal execution state") \ 259 V(illegal_execution_state_string, "illegal execution state") \
259 V(get_string, "get") \ 260 V(get_string, "get") \
260 V(set_string, "set") \ 261 V(set_string, "set") \
261 V(map_field_string, "%map") \ 262 V(map_field_string, "%map") \
262 V(elements_field_string, "%elements") \ 263 V(elements_field_string, "%elements") \
263 V(length_field_string, "%length") \ 264 V(length_field_string, "%length") \
265 V(cell_value_string, "%cell_value") \
264 V(function_class_string, "Function") \ 266 V(function_class_string, "Function") \
265 V(properties_field_symbol, "%properties") \ 267 V(properties_field_symbol, "%properties") \
266 V(payload_field_symbol, "%payload") \ 268 V(payload_field_symbol, "%payload") \
267 V(illegal_argument_string, "illegal argument") \ 269 V(illegal_argument_string, "illegal argument") \
268 V(MakeReferenceError_string, "MakeReferenceError") \ 270 V(MakeReferenceError_string, "MakeReferenceError") \
269 V(MakeSyntaxError_string, "MakeSyntaxError") \ 271 V(MakeSyntaxError_string, "MakeSyntaxError") \
270 V(MakeTypeError_string, "MakeTypeError") \ 272 V(MakeTypeError_string, "MakeTypeError") \
271 V(invalid_lhs_in_assignment_string, "invalid_lhs_in_assignment") \ 273 V(invalid_lhs_in_assignment_string, "invalid_lhs_in_assignment") \
272 V(invalid_lhs_in_for_in_string, "invalid_lhs_in_for_in") \ 274 V(invalid_lhs_in_for_in_string, "invalid_lhs_in_for_in") \
273 V(invalid_lhs_in_postfix_op_string, "invalid_lhs_in_postfix_op") \ 275 V(invalid_lhs_in_postfix_op_string, "invalid_lhs_in_postfix_op") \
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 // constructor. 652 // constructor.
651 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 653 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
652 // failed. 654 // failed.
653 // Please note this does not perform a garbage collection. 655 // Please note this does not perform a garbage collection.
654 MUST_USE_RESULT MaybeObject* AllocateJSObject( 656 MUST_USE_RESULT MaybeObject* AllocateJSObject(
655 JSFunction* constructor, 657 JSFunction* constructor,
656 PretenureFlag pretenure = NOT_TENURED); 658 PretenureFlag pretenure = NOT_TENURED);
657 659
658 MUST_USE_RESULT MaybeObject* AllocateJSObjectWithAllocationSite( 660 MUST_USE_RESULT MaybeObject* AllocateJSObjectWithAllocationSite(
659 JSFunction* constructor, 661 JSFunction* constructor,
660 Handle<Object> allocation_site_info_payload); 662 Handle<AllocationSite> allocation_site);
661 663
662 MUST_USE_RESULT MaybeObject* AllocateJSGeneratorObject( 664 MUST_USE_RESULT MaybeObject* AllocateJSGeneratorObject(
663 JSFunction* function); 665 JSFunction* function);
664 666
665 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context, 667 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context,
666 ScopeInfo* scope_info); 668 ScopeInfo* scope_info);
667 669
668 // Allocate a JSArray with no elements 670 // Allocate a JSArray with no elements
669 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( 671 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray(
670 ElementsKind elements_kind, 672 ElementsKind elements_kind,
671 PretenureFlag pretenure = NOT_TENURED) { 673 PretenureFlag pretenure = NOT_TENURED) {
672 return AllocateJSArrayAndStorage(elements_kind, 0, 0, 674 return AllocateJSArrayAndStorage(elements_kind, 0, 0,
673 DONT_INITIALIZE_ARRAY_ELEMENTS, 675 DONT_INITIALIZE_ARRAY_ELEMENTS,
674 pretenure); 676 pretenure);
675 } 677 }
676 678
677 inline MUST_USE_RESULT MaybeObject* AllocateEmptyJSArrayWithAllocationSite( 679 inline MUST_USE_RESULT MaybeObject* AllocateEmptyJSArrayWithAllocationSite(
678 ElementsKind elements_kind, 680 ElementsKind elements_kind,
679 Handle<Object> allocation_site_payload); 681 Handle<AllocationSite> allocation_site);
680 682
681 // Allocate a JSArray with a specified length but elements that are left 683 // Allocate a JSArray with a specified length but elements that are left
682 // uninitialized. 684 // uninitialized.
683 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage( 685 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage(
684 ElementsKind elements_kind, 686 ElementsKind elements_kind,
685 int length, 687 int length,
686 int capacity, 688 int capacity,
687 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS, 689 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS,
688 PretenureFlag pretenure = NOT_TENURED); 690 PretenureFlag pretenure = NOT_TENURED);
689 691
690 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorageWithAllocationSite( 692 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorageWithAllocationSite(
691 ElementsKind elements_kind, 693 ElementsKind elements_kind,
692 int length, 694 int length,
693 int capacity, 695 int capacity,
694 Handle<Object> allocation_site_payload, 696 Handle<AllocationSite> allocation_site,
695 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS); 697 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS);
696 698
697 MUST_USE_RESULT MaybeObject* AllocateJSArrayStorage( 699 MUST_USE_RESULT MaybeObject* AllocateJSArrayStorage(
698 JSArray* array, 700 JSArray* array,
699 int length, 701 int length,
700 int capacity, 702 int capacity,
701 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS); 703 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS);
702 704
703 // Allocate a JSArray with no elements 705 // Allocate a JSArray with no elements
704 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements( 706 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements(
705 FixedArrayBase* array_base, 707 FixedArrayBase* array_base,
706 ElementsKind elements_kind, 708 ElementsKind elements_kind,
707 int length, 709 int length,
708 PretenureFlag pretenure = NOT_TENURED); 710 PretenureFlag pretenure = NOT_TENURED);
709 711
710 // Allocates and initializes a new global object based on a constructor. 712 // Allocates and initializes a new global object based on a constructor.
711 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 713 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
712 // failed. 714 // failed.
713 // Please note this does not perform a garbage collection. 715 // Please note this does not perform a garbage collection.
714 MUST_USE_RESULT MaybeObject* AllocateGlobalObject(JSFunction* constructor); 716 MUST_USE_RESULT MaybeObject* AllocateGlobalObject(JSFunction* constructor);
715 717
716 // Returns a deep copy of the JavaScript object. 718 // Returns a deep copy of the JavaScript object.
717 // Properties and elements are copied too. 719 // Properties and elements are copied too.
718 // Returns failure if allocation failed. 720 // Returns failure if allocation failed.
719 MUST_USE_RESULT MaybeObject* CopyJSObject(JSObject* source); 721 MUST_USE_RESULT MaybeObject* CopyJSObject(JSObject* source);
720 722
721 MUST_USE_RESULT MaybeObject* CopyJSObjectWithAllocationSite(JSObject* source); 723 MUST_USE_RESULT MaybeObject* CopyJSObjectWithAllocationSite(
724 JSObject* source, AllocationSite* site);
722 725
723 // Allocates the function prototype. 726 // Allocates the function prototype.
724 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 727 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
725 // failed. 728 // failed.
726 // Please note this does not perform a garbage collection. 729 // Please note this does not perform a garbage collection.
727 MUST_USE_RESULT MaybeObject* AllocateFunctionPrototype(JSFunction* function); 730 MUST_USE_RESULT MaybeObject* AllocateFunctionPrototype(JSFunction* function);
728 731
729 // Allocates a JS ArrayBuffer object. 732 // Allocates a JS ArrayBuffer object.
730 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 733 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
731 // failed. 734 // failed.
(...skipping 29 matching lines...) Expand all
761 JSFunction* constructor, JSGlobalProxy* global); 764 JSFunction* constructor, JSGlobalProxy* global);
762 765
763 // Allocates and initializes a new JavaScript object based on a map. 766 // Allocates and initializes a new JavaScript object based on a map.
764 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 767 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
765 // failed. 768 // failed.
766 // Please note this does not perform a garbage collection. 769 // Please note this does not perform a garbage collection.
767 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMap( 770 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMap(
768 Map* map, PretenureFlag pretenure = NOT_TENURED); 771 Map* map, PretenureFlag pretenure = NOT_TENURED);
769 772
770 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMapWithAllocationSite( 773 MUST_USE_RESULT MaybeObject* AllocateJSObjectFromMapWithAllocationSite(
771 Map* map, Handle<Object> allocation_site_info_payload); 774 Map* map, Handle<AllocationSite> allocation_site);
772 775
773 // Allocates a heap object based on the map. 776 // Allocates a heap object based on the map.
774 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 777 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
775 // failed. 778 // failed.
776 // Please note this function does not perform a garbage collection. 779 // Please note this function does not perform a garbage collection.
777 MUST_USE_RESULT MaybeObject* Allocate(Map* map, AllocationSpace space); 780 MUST_USE_RESULT MaybeObject* Allocate(Map* map, AllocationSpace space);
778 781
779 MUST_USE_RESULT MaybeObject* AllocateWithAllocationSite(Map* map, 782 MUST_USE_RESULT MaybeObject* AllocateWithAllocationSite(Map* map,
780 AllocationSpace space, Handle<Object> allocation_site_info_payload); 783 AllocationSpace space, Handle<AllocationSite> allocation_site);
781 784
782 // Allocates a JS Map in the heap. 785 // Allocates a JS Map in the heap.
783 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 786 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
784 // failed. 787 // failed.
785 // Please note this function does not perform a garbage collection. 788 // Please note this function does not perform a garbage collection.
786 MUST_USE_RESULT MaybeObject* AllocateMap( 789 MUST_USE_RESULT MaybeObject* AllocateMap(
787 InstanceType instance_type, 790 InstanceType instance_type,
788 int instance_size, 791 int instance_size,
789 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); 792 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND);
790 793
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 // Allocate a tenured JS global property cell. 951 // Allocate a tenured JS global property cell.
949 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 952 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
950 // failed. 953 // failed.
951 // Please note this does not perform a garbage collection. 954 // Please note this does not perform a garbage collection.
952 MUST_USE_RESULT MaybeObject* AllocatePropertyCell(Object* value); 955 MUST_USE_RESULT MaybeObject* AllocatePropertyCell(Object* value);
953 956
954 // Allocate Box. 957 // Allocate Box.
955 MUST_USE_RESULT MaybeObject* AllocateBox(Object* value, 958 MUST_USE_RESULT MaybeObject* AllocateBox(Object* value,
956 PretenureFlag pretenure); 959 PretenureFlag pretenure);
957 960
961 // Allocate a tenured AllocationSite. It's payload is null
962 MUST_USE_RESULT MaybeObject* AllocateAllocationSite();
963
958 // Allocates a fixed array initialized with undefined values 964 // Allocates a fixed array initialized with undefined values
959 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 965 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
960 // failed. 966 // failed.
961 // Please note this does not perform a garbage collection. 967 // Please note this does not perform a garbage collection.
962 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length, 968 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length,
963 PretenureFlag pretenure); 969 PretenureFlag pretenure);
964 // Allocates a fixed array initialized with undefined values 970 // Allocates a fixed array initialized with undefined values
965 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length); 971 MUST_USE_RESULT MaybeObject* AllocateFixedArray(int length);
966 972
967 // Allocates an uninitialized fixed array. It must be filled by the caller. 973 // Allocates an uninitialized fixed array. It must be filled by the caller.
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
1805 1811
1806 inline bool OldGenerationAllocationLimitReached(); 1812 inline bool OldGenerationAllocationLimitReached();
1807 1813
1808 inline void DoScavengeObject(Map* map, HeapObject** slot, HeapObject* obj) { 1814 inline void DoScavengeObject(Map* map, HeapObject** slot, HeapObject* obj) {
1809 scavenging_visitors_table_.GetVisitor(map)(map, slot, obj); 1815 scavenging_visitors_table_.GetVisitor(map)(map, slot, obj);
1810 } 1816 }
1811 1817
1812 void QueueMemoryChunkForFree(MemoryChunk* chunk); 1818 void QueueMemoryChunkForFree(MemoryChunk* chunk);
1813 void FreeQueuedChunks(); 1819 void FreeQueuedChunks();
1814 1820
1821 int gc_count() const { return gc_count_; }
1822
1815 // Completely clear the Instanceof cache (to stop it keeping objects alive 1823 // Completely clear the Instanceof cache (to stop it keeping objects alive
1816 // around a GC). 1824 // around a GC).
1817 inline void CompletelyClearInstanceofCache(); 1825 inline void CompletelyClearInstanceofCache();
1818 1826
1819 // The roots that have an index less than this are always in old space. 1827 // The roots that have an index less than this are always in old space.
1820 static const int kOldSpaceRoots = 0x20; 1828 static const int kOldSpaceRoots = 0x20;
1821 1829
1822 uint32_t HashSeed() { 1830 uint32_t HashSeed() {
1823 uint32_t seed = static_cast<uint32_t>(hash_seed()->value()); 1831 uint32_t seed = static_cast<uint32_t>(hash_seed()->value());
1824 ASSERT(FLAG_randomize_hashes || seed == 0); 1832 ASSERT(FLAG_randomize_hashes || seed == 0);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 1956
1949 // For keeping track of context disposals. 1957 // For keeping track of context disposals.
1950 int contexts_disposed_; 1958 int contexts_disposed_;
1951 1959
1952 int global_ic_age_; 1960 int global_ic_age_;
1953 1961
1954 bool flush_monomorphic_ics_; 1962 bool flush_monomorphic_ics_;
1955 1963
1956 int scan_on_scavenge_pages_; 1964 int scan_on_scavenge_pages_;
1957 1965
1958 #if defined(V8_TARGET_ARCH_X64) 1966 #if V8_TARGET_ARCH_X64
1959 static const int kMaxObjectSizeInNewSpace = 1024*KB; 1967 static const int kMaxObjectSizeInNewSpace = 1024*KB;
1960 #else 1968 #else
1961 static const int kMaxObjectSizeInNewSpace = 512*KB; 1969 static const int kMaxObjectSizeInNewSpace = 512*KB;
1962 #endif 1970 #endif
1963 1971
1964 NewSpace new_space_; 1972 NewSpace new_space_;
1965 OldSpace* old_pointer_space_; 1973 OldSpace* old_pointer_space_;
1966 OldSpace* old_data_space_; 1974 OldSpace* old_data_space_;
1967 OldSpace* code_space_; 1975 OldSpace* code_space_;
1968 MapSpace* map_space_; 1976 MapSpace* map_space_;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
2149 Object* to_number, 2157 Object* to_number,
2150 byte kind); 2158 byte kind);
2151 2159
2152 // Allocate a JSArray with no elements 2160 // Allocate a JSArray with no elements
2153 MUST_USE_RESULT MaybeObject* AllocateJSArray( 2161 MUST_USE_RESULT MaybeObject* AllocateJSArray(
2154 ElementsKind elements_kind, 2162 ElementsKind elements_kind,
2155 PretenureFlag pretenure = NOT_TENURED); 2163 PretenureFlag pretenure = NOT_TENURED);
2156 2164
2157 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithAllocationSite( 2165 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithAllocationSite(
2158 ElementsKind elements_kind, 2166 ElementsKind elements_kind,
2159 Handle<Object> allocation_site_info_payload); 2167 Handle<AllocationSite> allocation_site);
2160 2168
2161 // Allocate empty fixed array. 2169 // Allocate empty fixed array.
2162 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray(); 2170 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray();
2163 2171
2164 // Allocate empty external array of given type. 2172 // Allocate empty external array of given type.
2165 MUST_USE_RESULT MaybeObject* AllocateEmptyExternalArray( 2173 MUST_USE_RESULT MaybeObject* AllocateEmptyExternalArray(
2166 ExternalArrayType array_type); 2174 ExternalArrayType array_type);
2167 2175
2168 // Allocate empty fixed double array. 2176 // Allocate empty fixed double array.
2169 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedDoubleArray(); 2177 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedDoubleArray();
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
2945 // For evaluating value. 2953 // For evaluating value.
2946 friend class TranscendentalCache; 2954 friend class TranscendentalCache;
2947 2955
2948 DISALLOW_COPY_AND_ASSIGN(SubCache); 2956 DISALLOW_COPY_AND_ASSIGN(SubCache);
2949 }; 2957 };
2950 2958
2951 TranscendentalCache() { 2959 TranscendentalCache() {
2952 for (int i = 0; i < kNumberOfCaches; ++i) caches_[i] = NULL; 2960 for (int i = 0; i < kNumberOfCaches; ++i) caches_[i] = NULL;
2953 } 2961 }
2954 2962
2963 ~TranscendentalCache() {
2964 for (int i = 0; i < kNumberOfCaches; ++i) delete caches_[i];
2965 }
2966
2955 // Used to create an external reference. 2967 // Used to create an external reference.
2956 inline Address cache_array_address(); 2968 inline Address cache_array_address();
2957 2969
2958 // Instantiation 2970 // Instantiation
2959 friend class Isolate; 2971 friend class Isolate;
2960 // Inline implementation of the caching. 2972 // Inline implementation of the caching.
2961 friend class TranscendentalCacheStub; 2973 friend class TranscendentalCacheStub;
2962 // Allow access to the caches_ array as an ExternalReference. 2974 // Allow access to the caches_ array as an ExternalReference.
2963 friend class ExternalReference; 2975 friend class ExternalReference;
2964 2976
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
3074 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 3086 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
3075 3087
3076 private: 3088 private:
3077 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3089 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3078 }; 3090 };
3079 #endif // DEBUG 3091 #endif // DEBUG
3080 3092
3081 } } // namespace v8::internal 3093 } } // namespace v8::internal
3082 3094
3083 #endif // V8_HEAP_H_ 3095 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/handles.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698