OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 3673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3684 if (!allocation.To(&result)) return allocation; | 3684 if (!allocation.To(&result)) return allocation; |
3685 OnAllocationEvent(result, object_size); | 3685 OnAllocationEvent(result, object_size); |
3686 } | 3686 } |
3687 } | 3687 } |
3688 | 3688 |
3689 result->set_map_no_write_barrier(code_map()); | 3689 result->set_map_no_write_barrier(code_map()); |
3690 Code* code = Code::cast(result); | 3690 Code* code = Code::cast(result); |
3691 DCHECK(isolate_->code_range() == NULL || !isolate_->code_range()->valid() || | 3691 DCHECK(isolate_->code_range() == NULL || !isolate_->code_range()->valid() || |
3692 isolate_->code_range()->contains(code->address())); | 3692 isolate_->code_range()->contains(code->address())); |
3693 code->set_gc_metadata(Smi::FromInt(0)); | 3693 code->set_gc_metadata(Smi::FromInt(0)); |
| 3694 code->set_ic_age(global_ic_age_); |
3694 return code; | 3695 return code; |
3695 } | 3696 } |
3696 | 3697 |
3697 | 3698 |
3698 AllocationResult Heap::CopyCode(Code* code) { | 3699 AllocationResult Heap::CopyCode(Code* code) { |
3699 AllocationResult allocation; | 3700 AllocationResult allocation; |
3700 HeapObject* new_constant_pool; | 3701 HeapObject* new_constant_pool; |
3701 if (FLAG_enable_ool_constant_pool && | 3702 if (FLAG_enable_ool_constant_pool && |
3702 code->constant_pool() != empty_constant_pool_array()) { | 3703 code->constant_pool() != empty_constant_pool_array()) { |
3703 // Copy the constant pool, since edits to the copied code may modify | 3704 // Copy the constant pool, since edits to the copied code may modify |
(...skipping 2817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6521 static_cast<int>(object_sizes_last_time_[index])); | 6522 static_cast<int>(object_sizes_last_time_[index])); |
6522 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6523 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6523 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6524 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6524 | 6525 |
6525 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6526 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6526 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6527 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6527 ClearObjectStats(); | 6528 ClearObjectStats(); |
6528 } | 6529 } |
6529 } | 6530 } |
6530 } // namespace v8::internal | 6531 } // namespace v8::internal |
OLD | NEW |