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

Side by Side Diff: src/heap.h

Issue 146213004: A64: Synchronize with r16849. (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/full-codegen.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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 628
629 // Allocate a JSArray with no elements 629 // Allocate a JSArray with no elements
630 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( 630 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray(
631 ElementsKind elements_kind, 631 ElementsKind elements_kind,
632 PretenureFlag pretenure = NOT_TENURED) { 632 PretenureFlag pretenure = NOT_TENURED) {
633 return AllocateJSArrayAndStorage(elements_kind, 0, 0, 633 return AllocateJSArrayAndStorage(elements_kind, 0, 0,
634 DONT_INITIALIZE_ARRAY_ELEMENTS, 634 DONT_INITIALIZE_ARRAY_ELEMENTS,
635 pretenure); 635 pretenure);
636 } 636 }
637 637
638 inline MUST_USE_RESULT MaybeObject* AllocateEmptyJSArrayWithAllocationSite(
639 ElementsKind elements_kind,
640 Handle<AllocationSite> allocation_site);
641
642 // Allocate a JSArray with a specified length but elements that are left 638 // Allocate a JSArray with a specified length but elements that are left
643 // uninitialized. 639 // uninitialized.
644 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage( 640 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorage(
645 ElementsKind elements_kind, 641 ElementsKind elements_kind,
646 int length, 642 int length,
647 int capacity, 643 int capacity,
648 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS, 644 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS,
649 PretenureFlag pretenure = NOT_TENURED); 645 PretenureFlag pretenure = NOT_TENURED);
650 646
651 MUST_USE_RESULT MaybeObject* AllocateJSArrayAndStorageWithAllocationSite(
652 ElementsKind elements_kind,
653 int length,
654 int capacity,
655 Handle<AllocationSite> allocation_site,
656 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS);
657
658 MUST_USE_RESULT MaybeObject* AllocateJSArrayStorage( 647 MUST_USE_RESULT MaybeObject* AllocateJSArrayStorage(
659 JSArray* array, 648 JSArray* array,
660 int length, 649 int length,
661 int capacity, 650 int capacity,
662 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS); 651 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS);
663 652
664 // Allocate a JSArray with no elements 653 // Allocate a JSArray with no elements
665 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements( 654 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithElements(
666 FixedArrayBase* array_base, 655 FixedArrayBase* array_base,
667 ElementsKind elements_kind, 656 ElementsKind elements_kind,
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 } 1254 }
1266 } 1255 }
1267 1256
1268 PromotionQueue* promotion_queue() { return &promotion_queue_; } 1257 PromotionQueue* promotion_queue() { return &promotion_queue_; }
1269 1258
1270 #ifdef DEBUG 1259 #ifdef DEBUG
1271 // Utility used with flag gc-greedy. 1260 // Utility used with flag gc-greedy.
1272 void GarbageCollectionGreedyCheck(); 1261 void GarbageCollectionGreedyCheck();
1273 #endif 1262 #endif
1274 1263
1275 void AddGCPrologueCallback( 1264 void AddGCPrologueCallback(v8::Isolate::GCPrologueCallback callback,
1276 GCPrologueCallback callback, GCType gc_type_filter); 1265 GCType gc_type_filter,
1277 void RemoveGCPrologueCallback(GCPrologueCallback callback); 1266 bool pass_isolate = true);
1267 void RemoveGCPrologueCallback(v8::Isolate::GCPrologueCallback callback);
1278 1268
1279 void AddGCEpilogueCallback( 1269 void AddGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback,
1280 GCEpilogueCallback callback, GCType gc_type_filter); 1270 GCType gc_type_filter,
1281 void RemoveGCEpilogueCallback(GCEpilogueCallback callback); 1271 bool pass_isolate = true);
1282 1272 void RemoveGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback);
1283 void SetGlobalGCPrologueCallback(GCCallback callback) {
1284 ASSERT((callback == NULL) ^ (global_gc_prologue_callback_ == NULL));
1285 global_gc_prologue_callback_ = callback;
1286 }
1287 void SetGlobalGCEpilogueCallback(GCCallback callback) {
1288 ASSERT((callback == NULL) ^ (global_gc_epilogue_callback_ == NULL));
1289 global_gc_epilogue_callback_ = callback;
1290 }
1291 1273
1292 // Heap root getters. We have versions with and without type::cast() here. 1274 // Heap root getters. We have versions with and without type::cast() here.
1293 // You can't use type::cast during GC because the assert fails. 1275 // You can't use type::cast during GC because the assert fails.
1294 // TODO(1490): Try removing the unchecked accessors, now that GC marking does 1276 // TODO(1490): Try removing the unchecked accessors, now that GC marking does
1295 // not corrupt the map. 1277 // not corrupt the map.
1296 #define ROOT_ACCESSOR(type, name, camel_name) \ 1278 #define ROOT_ACCESSOR(type, name, camel_name) \
1297 type* name() { \ 1279 type* name() { \
1298 return type::cast(roots_[k##camel_name##RootIndex]); \ 1280 return type::cast(roots_[k##camel_name##RootIndex]); \
1299 } \ 1281 } \
1300 type* raw_unchecked_##name() { \ 1282 type* raw_unchecked_##name() { \
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
2025 static const ConstantStringTable constant_string_table[]; 2007 static const ConstantStringTable constant_string_table[];
2026 static const StructTable struct_table[]; 2008 static const StructTable struct_table[];
2027 2009
2028 // The special hidden string which is an empty string, but does not match 2010 // The special hidden string which is an empty string, but does not match
2029 // any string when looked up in properties. 2011 // any string when looked up in properties.
2030 String* hidden_string_; 2012 String* hidden_string_;
2031 2013
2032 // GC callback function, called before and after mark-compact GC. 2014 // GC callback function, called before and after mark-compact GC.
2033 // Allocations in the callback function are disallowed. 2015 // Allocations in the callback function are disallowed.
2034 struct GCPrologueCallbackPair { 2016 struct GCPrologueCallbackPair {
2035 GCPrologueCallbackPair(GCPrologueCallback callback, GCType gc_type) 2017 GCPrologueCallbackPair(v8::Isolate::GCPrologueCallback callback,
2036 : callback(callback), gc_type(gc_type) { 2018 GCType gc_type,
2019 bool pass_isolate)
2020 : callback(callback), gc_type(gc_type), pass_isolate_(pass_isolate) {
2037 } 2021 }
2038 bool operator==(const GCPrologueCallbackPair& pair) const { 2022 bool operator==(const GCPrologueCallbackPair& pair) const {
2039 return pair.callback == callback; 2023 return pair.callback == callback;
2040 } 2024 }
2041 GCPrologueCallback callback; 2025 v8::Isolate::GCPrologueCallback callback;
2042 GCType gc_type; 2026 GCType gc_type;
2027 // TODO(dcarney): remove variable
2028 bool pass_isolate_;
2043 }; 2029 };
2044 List<GCPrologueCallbackPair> gc_prologue_callbacks_; 2030 List<GCPrologueCallbackPair> gc_prologue_callbacks_;
2045 2031
2046 struct GCEpilogueCallbackPair { 2032 struct GCEpilogueCallbackPair {
2047 GCEpilogueCallbackPair(GCEpilogueCallback callback, GCType gc_type) 2033 GCEpilogueCallbackPair(v8::Isolate::GCPrologueCallback callback,
2048 : callback(callback), gc_type(gc_type) { 2034 GCType gc_type,
2035 bool pass_isolate)
2036 : callback(callback), gc_type(gc_type), pass_isolate_(pass_isolate) {
2049 } 2037 }
2050 bool operator==(const GCEpilogueCallbackPair& pair) const { 2038 bool operator==(const GCEpilogueCallbackPair& pair) const {
2051 return pair.callback == callback; 2039 return pair.callback == callback;
2052 } 2040 }
2053 GCEpilogueCallback callback; 2041 v8::Isolate::GCPrologueCallback callback;
2054 GCType gc_type; 2042 GCType gc_type;
2043 // TODO(dcarney): remove variable
2044 bool pass_isolate_;
2055 }; 2045 };
2056 List<GCEpilogueCallbackPair> gc_epilogue_callbacks_; 2046 List<GCEpilogueCallbackPair> gc_epilogue_callbacks_;
2057 2047
2058 GCCallback global_gc_prologue_callback_;
2059 GCCallback global_gc_epilogue_callback_;
2060
2061 // Support for computing object sizes during GC. 2048 // Support for computing object sizes during GC.
2062 HeapObjectCallback gc_safe_size_of_old_object_; 2049 HeapObjectCallback gc_safe_size_of_old_object_;
2063 static int GcSafeSizeOfOldObject(HeapObject* object); 2050 static int GcSafeSizeOfOldObject(HeapObject* object);
2064 2051
2065 // Update the GC state. Called from the mark-compact collector. 2052 // Update the GC state. Called from the mark-compact collector.
2066 void MarkMapPointersAsEncoded(bool encoded) { 2053 void MarkMapPointersAsEncoded(bool encoded) {
2067 ASSERT(!encoded); 2054 ASSERT(!encoded);
2068 gc_safe_size_of_old_object_ = &GcSafeSizeOfOldObject; 2055 gc_safe_size_of_old_object_ = &GcSafeSizeOfOldObject;
2069 } 2056 }
2070 2057
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 2096
2110 MUST_USE_RESULT MaybeObject* CreateOddball(const char* to_string, 2097 MUST_USE_RESULT MaybeObject* CreateOddball(const char* to_string,
2111 Object* to_number, 2098 Object* to_number,
2112 byte kind); 2099 byte kind);
2113 2100
2114 // Allocate a JSArray with no elements 2101 // Allocate a JSArray with no elements
2115 MUST_USE_RESULT MaybeObject* AllocateJSArray( 2102 MUST_USE_RESULT MaybeObject* AllocateJSArray(
2116 ElementsKind elements_kind, 2103 ElementsKind elements_kind,
2117 PretenureFlag pretenure = NOT_TENURED); 2104 PretenureFlag pretenure = NOT_TENURED);
2118 2105
2119 MUST_USE_RESULT MaybeObject* AllocateJSArrayWithAllocationSite(
2120 ElementsKind elements_kind,
2121 Handle<AllocationSite> allocation_site);
2122
2123 // Allocate empty fixed array. 2106 // Allocate empty fixed array.
2124 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray(); 2107 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray();
2125 2108
2126 // Allocate empty external array of given type. 2109 // Allocate empty external array of given type.
2127 MUST_USE_RESULT MaybeObject* AllocateEmptyExternalArray( 2110 MUST_USE_RESULT MaybeObject* AllocateEmptyExternalArray(
2128 ExternalArrayType array_type); 2111 ExternalArrayType array_type);
2129 2112
2130 // Allocate empty fixed double array. 2113 // Allocate empty fixed double array.
2131 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedDoubleArray(); 2114 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedDoubleArray();
2132 2115
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
3040 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 3023 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
3041 3024
3042 private: 3025 private:
3043 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3026 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3044 }; 3027 };
3045 #endif // DEBUG 3028 #endif // DEBUG
3046 3029
3047 } } // namespace v8::internal 3030 } } // namespace v8::internal
3048 3031
3049 #endif // V8_HEAP_H_ 3032 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/full-codegen.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698