| OLD | NEW |
| 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 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2043 int size)) { | 2043 int size)) { |
| 2044 // Copy the content of source to target. | 2044 // Copy the content of source to target. |
| 2045 heap->CopyBlock(target->address(), source->address(), size); | 2045 heap->CopyBlock(target->address(), source->address(), size); |
| 2046 | 2046 |
| 2047 // Set the forwarding address. | 2047 // Set the forwarding address. |
| 2048 source->set_map_word(MapWord::FromForwardingAddress(target)); | 2048 source->set_map_word(MapWord::FromForwardingAddress(target)); |
| 2049 | 2049 |
| 2050 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) { | 2050 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) { |
| 2051 // Update NewSpace stats if necessary. | 2051 // Update NewSpace stats if necessary. |
| 2052 RecordCopiedObject(heap, target); | 2052 RecordCopiedObject(heap, target); |
| 2053 HEAP_PROFILE(heap, ObjectMoveEvent(source->address(), target->address())); | 2053 HEAP_PROFILE(heap, |
| 2054 ObjectMoveEvent(source->address(), target->address(), size)); |
| 2054 Isolate* isolate = heap->isolate(); | 2055 Isolate* isolate = heap->isolate(); |
| 2055 if (isolate->logger()->is_logging_code_events() || | 2056 if (isolate->logger()->is_logging_code_events() || |
| 2056 isolate->cpu_profiler()->is_profiling()) { | 2057 isolate->cpu_profiler()->is_profiling()) { |
| 2057 if (target->IsSharedFunctionInfo()) { | 2058 if (target->IsSharedFunctionInfo()) { |
| 2058 PROFILE(isolate, SharedFunctionInfoMoveEvent( | 2059 PROFILE(isolate, SharedFunctionInfoMoveEvent( |
| 2059 source->address(), target->address())); | 2060 source->address(), target->address())); |
| 2060 } | 2061 } |
| 2061 } | 2062 } |
| 2062 } | 2063 } |
| 2063 | 2064 |
| (...skipping 2955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5019 // Since we know the clone is allocated in new space, we can copy | 5020 // Since we know the clone is allocated in new space, we can copy |
| 5020 // the contents without worrying about updating the write barrier. | 5021 // the contents without worrying about updating the write barrier. |
| 5021 CopyBlock(HeapObject::cast(clone)->address(), | 5022 CopyBlock(HeapObject::cast(clone)->address(), |
| 5022 source->address(), | 5023 source->address(), |
| 5023 object_size); | 5024 object_size); |
| 5024 } | 5025 } |
| 5025 | 5026 |
| 5026 if (adjusted_object_size > object_size) { | 5027 if (adjusted_object_size > object_size) { |
| 5027 AllocationMemento* alloc_memento = reinterpret_cast<AllocationMemento*>( | 5028 AllocationMemento* alloc_memento = reinterpret_cast<AllocationMemento*>( |
| 5028 reinterpret_cast<Address>(clone) + object_size); | 5029 reinterpret_cast<Address>(clone) + object_size); |
| 5030 |
| 5031 HeapProfiler* profiler = this->isolate()->heap_profiler(); |
| 5032 profiler->RecordObjectAllocation(HeapObject::cast(clone)->address(), |
| 5033 object_size); |
| 5034 profiler->RecordObjectAllocation(alloc_memento->address(), |
| 5035 adjusted_object_size - object_size); |
| 5029 alloc_memento->set_map_no_write_barrier(allocation_memento_map()); | 5036 alloc_memento->set_map_no_write_barrier(allocation_memento_map()); |
| 5030 alloc_memento->set_allocation_site(site, SKIP_WRITE_BARRIER); | 5037 alloc_memento->set_allocation_site(site, SKIP_WRITE_BARRIER); |
| 5031 } | 5038 } |
| 5032 | 5039 |
| 5033 SLOW_ASSERT( | 5040 SLOW_ASSERT( |
| 5034 JSObject::cast(clone)->GetElementsKind() == source->GetElementsKind()); | 5041 JSObject::cast(clone)->GetElementsKind() == source->GetElementsKind()); |
| 5035 FixedArrayBase* elements = FixedArrayBase::cast(source->elements()); | 5042 FixedArrayBase* elements = FixedArrayBase::cast(source->elements()); |
| 5036 FixedArray* properties = FixedArray::cast(source->properties()); | 5043 FixedArray* properties = FixedArray::cast(source->properties()); |
| 5037 // Update elements if necessary. | 5044 // Update elements if necessary. |
| 5038 if (elements->length() > 0) { | 5045 if (elements->length() > 0) { |
| (...skipping 3006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8045 if (FLAG_parallel_recompilation) { | 8052 if (FLAG_parallel_recompilation) { |
| 8046 heap_->relocation_mutex_->Lock(); | 8053 heap_->relocation_mutex_->Lock(); |
| 8047 #ifdef DEBUG | 8054 #ifdef DEBUG |
| 8048 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 8055 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
| 8049 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 8056 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
| 8050 #endif // DEBUG | 8057 #endif // DEBUG |
| 8051 } | 8058 } |
| 8052 } | 8059 } |
| 8053 | 8060 |
| 8054 } } // namespace v8::internal | 8061 } } // namespace v8::internal |
| OLD | NEW |