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

Side by Side Diff: src/heap.cc

Issue 151163005: A64: Synchronize with r16356. (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/heap.h ('k') | src/heap-inl.h » ('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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 incremental_marking()->WorthActivating() && 697 incremental_marking()->WorthActivating() &&
698 NextGCIsLikelyToBeFull()) { 698 NextGCIsLikelyToBeFull()) {
699 incremental_marking()->Start(); 699 incremental_marking()->Start();
700 } 700 }
701 701
702 return next_gc_likely_to_collect_more; 702 return next_gc_likely_to_collect_more;
703 } 703 }
704 704
705 705
706 int Heap::NotifyContextDisposed() { 706 int Heap::NotifyContextDisposed() {
707 if (FLAG_parallel_recompilation) { 707 if (FLAG_concurrent_recompilation) {
708 // Flush the queued recompilation tasks. 708 // Flush the queued recompilation tasks.
709 isolate()->optimizing_compiler_thread()->Flush(); 709 isolate()->optimizing_compiler_thread()->Flush();
710 } 710 }
711 flush_monomorphic_ics_ = true; 711 flush_monomorphic_ics_ = true;
712 return ++contexts_disposed_; 712 return ++contexts_disposed_;
713 } 713 }
714 714
715 715
716 void Heap::PerformScavenge() { 716 void Heap::PerformScavenge() {
717 GCTracer tracer(this, NULL, NULL); 717 GCTracer tracer(this, NULL, NULL);
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2081 if (alignment != kObjectAlignment) { 2081 if (alignment != kObjectAlignment) {
2082 ASSERT(alignment == kDoubleAlignment); 2082 ASSERT(alignment == kDoubleAlignment);
2083 allocation_size += kPointerSize; 2083 allocation_size += kPointerSize;
2084 } 2084 }
2085 2085
2086 Heap* heap = map->GetHeap(); 2086 Heap* heap = map->GetHeap();
2087 if (heap->ShouldBePromoted(object->address(), object_size)) { 2087 if (heap->ShouldBePromoted(object->address(), object_size)) {
2088 MaybeObject* maybe_result; 2088 MaybeObject* maybe_result;
2089 2089
2090 if (object_contents == DATA_OBJECT) { 2090 if (object_contents == DATA_OBJECT) {
2091 // TODO(mstarzinger): Turn this check into a regular assert soon!
2092 CHECK(heap->AllowedToBeMigrated(object, OLD_DATA_SPACE));
2091 maybe_result = heap->old_data_space()->AllocateRaw(allocation_size); 2093 maybe_result = heap->old_data_space()->AllocateRaw(allocation_size);
2092 } else { 2094 } else {
2093 maybe_result = 2095 // TODO(mstarzinger): Turn this check into a regular assert soon!
2094 heap->old_pointer_space()->AllocateRaw(allocation_size); 2096 CHECK(heap->AllowedToBeMigrated(object, OLD_POINTER_SPACE));
2097 maybe_result = heap->old_pointer_space()->AllocateRaw(allocation_size);
2095 } 2098 }
2096 2099
2097 Object* result = NULL; // Initialization to please compiler. 2100 Object* result = NULL; // Initialization to please compiler.
2098 if (maybe_result->ToObject(&result)) { 2101 if (maybe_result->ToObject(&result)) {
2099 HeapObject* target = HeapObject::cast(result); 2102 HeapObject* target = HeapObject::cast(result);
2100 2103
2101 if (alignment != kObjectAlignment) { 2104 if (alignment != kObjectAlignment) {
2102 target = EnsureDoubleAligned(heap, target, allocation_size); 2105 target = EnsureDoubleAligned(heap, target, allocation_size);
2103 } 2106 }
2104 2107
2105 // Order is important: slot might be inside of the target if target 2108 // Order is important: slot might be inside of the target if target
2106 // was allocated over a dead object and slot comes from the store 2109 // was allocated over a dead object and slot comes from the store
2107 // buffer. 2110 // buffer.
2108 *slot = target; 2111 *slot = target;
2109 MigrateObject(heap, object, target, object_size); 2112 MigrateObject(heap, object, target, object_size);
2110 2113
2111 if (object_contents == POINTER_OBJECT) { 2114 if (object_contents == POINTER_OBJECT) {
2112 if (map->instance_type() == JS_FUNCTION_TYPE) { 2115 if (map->instance_type() == JS_FUNCTION_TYPE) {
2113 heap->promotion_queue()->insert( 2116 heap->promotion_queue()->insert(
2114 target, JSFunction::kNonWeakFieldsEndOffset); 2117 target, JSFunction::kNonWeakFieldsEndOffset);
2115 } else { 2118 } else {
2116 heap->promotion_queue()->insert(target, object_size); 2119 heap->promotion_queue()->insert(target, object_size);
2117 } 2120 }
2118 } 2121 }
2119 2122
2120 heap->tracer()->increment_promoted_objects_size(object_size); 2123 heap->tracer()->increment_promoted_objects_size(object_size);
2121 return; 2124 return;
2122 } 2125 }
2123 } 2126 }
2127 // TODO(mstarzinger): Turn this check into a regular assert soon!
2128 CHECK(heap->AllowedToBeMigrated(object, NEW_SPACE));
2124 MaybeObject* allocation = heap->new_space()->AllocateRaw(allocation_size); 2129 MaybeObject* allocation = heap->new_space()->AllocateRaw(allocation_size);
2125 heap->promotion_queue()->SetNewLimit(heap->new_space()->top()); 2130 heap->promotion_queue()->SetNewLimit(heap->new_space()->top());
2126 Object* result = allocation->ToObjectUnchecked(); 2131 Object* result = allocation->ToObjectUnchecked();
2127 HeapObject* target = HeapObject::cast(result); 2132 HeapObject* target = HeapObject::cast(result);
2128 2133
2129 if (alignment != kObjectAlignment) { 2134 if (alignment != kObjectAlignment) {
2130 target = EnsureDoubleAligned(heap, target, allocation_size); 2135 target = EnsureDoubleAligned(heap, target, allocation_size);
2131 } 2136 }
2132 2137
2133 // Order is important: slot might be inside of the target if target 2138 // Order is important: slot might be inside of the target if target
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
2417 } 2422 }
2418 2423
2419 2424
2420 MaybeObject* Heap::AllocateAccessorPair() { 2425 MaybeObject* Heap::AllocateAccessorPair() {
2421 AccessorPair* accessors; 2426 AccessorPair* accessors;
2422 { MaybeObject* maybe_accessors = AllocateStruct(ACCESSOR_PAIR_TYPE); 2427 { MaybeObject* maybe_accessors = AllocateStruct(ACCESSOR_PAIR_TYPE);
2423 if (!maybe_accessors->To(&accessors)) return maybe_accessors; 2428 if (!maybe_accessors->To(&accessors)) return maybe_accessors;
2424 } 2429 }
2425 accessors->set_getter(the_hole_value(), SKIP_WRITE_BARRIER); 2430 accessors->set_getter(the_hole_value(), SKIP_WRITE_BARRIER);
2426 accessors->set_setter(the_hole_value(), SKIP_WRITE_BARRIER); 2431 accessors->set_setter(the_hole_value(), SKIP_WRITE_BARRIER);
2432 accessors->set_access_flags(Smi::FromInt(0), SKIP_WRITE_BARRIER);
2427 return accessors; 2433 return accessors;
2428 } 2434 }
2429 2435
2430 2436
2431 MaybeObject* Heap::AllocateTypeFeedbackInfo() { 2437 MaybeObject* Heap::AllocateTypeFeedbackInfo() {
2432 TypeFeedbackInfo* info; 2438 TypeFeedbackInfo* info;
2433 { MaybeObject* maybe_info = AllocateStruct(TYPE_FEEDBACK_INFO_TYPE); 2439 { MaybeObject* maybe_info = AllocateStruct(TYPE_FEEDBACK_INFO_TYPE);
2434 if (!maybe_info->To(&info)) return maybe_info; 2440 if (!maybe_info->To(&info)) return maybe_info;
2435 } 2441 }
2436 info->initialize_storage(); 2442 info->initialize_storage();
(...skipping 4452 matching lines...) Expand 10 before | Expand all | Expand 10 after
6889 } else { 6895 } else {
6890 set_hash_seed(Smi::FromInt(FLAG_hash_seed)); 6896 set_hash_seed(Smi::FromInt(FLAG_hash_seed));
6891 } 6897 }
6892 } 6898 }
6893 6899
6894 LOG(isolate_, IntPtrTEvent("heap-capacity", Capacity())); 6900 LOG(isolate_, IntPtrTEvent("heap-capacity", Capacity()));
6895 LOG(isolate_, IntPtrTEvent("heap-available", Available())); 6901 LOG(isolate_, IntPtrTEvent("heap-available", Available()));
6896 6902
6897 store_buffer()->SetUp(); 6903 store_buffer()->SetUp();
6898 6904
6899 if (FLAG_parallel_recompilation) relocation_mutex_ = OS::CreateMutex(); 6905 if (FLAG_concurrent_recompilation) relocation_mutex_ = OS::CreateMutex();
6900 #ifdef DEBUG 6906 #ifdef DEBUG
6901 relocation_mutex_locked_by_optimizer_thread_ = false; 6907 relocation_mutex_locked_by_optimizer_thread_ = false;
6902 #endif // DEBUG 6908 #endif // DEBUG
6903 6909
6904 return true; 6910 return true;
6905 } 6911 }
6906 6912
6907 6913
6908 bool Heap::CreateHeapObjects() { 6914 bool Heap::CreateHeapObjects() {
6909 // Create initial maps. 6915 // Create initial maps.
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after
8040 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 8046 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
8041 #undef ADJUST_LAST_TIME_OBJECT_COUNT 8047 #undef ADJUST_LAST_TIME_OBJECT_COUNT
8042 8048
8043 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 8049 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
8044 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 8050 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
8045 ClearObjectStats(); 8051 ClearObjectStats();
8046 } 8052 }
8047 8053
8048 8054
8049 Heap::RelocationLock::RelocationLock(Heap* heap) : heap_(heap) { 8055 Heap::RelocationLock::RelocationLock(Heap* heap) : heap_(heap) {
8050 if (FLAG_parallel_recompilation) { 8056 if (FLAG_concurrent_recompilation) {
8051 heap_->relocation_mutex_->Lock(); 8057 heap_->relocation_mutex_->Lock();
8052 #ifdef DEBUG 8058 #ifdef DEBUG
8053 heap_->relocation_mutex_locked_by_optimizer_thread_ = 8059 heap_->relocation_mutex_locked_by_optimizer_thread_ =
8054 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 8060 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
8055 #endif // DEBUG 8061 #endif // DEBUG
8056 } 8062 }
8057 } 8063 }
8058 8064
8059 } } // namespace v8::internal 8065 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698