| 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 3736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3747 if (FLAG_enable_ool_constant_pool && | 3747 if (FLAG_enable_ool_constant_pool && |
| 3748 code->constant_pool() != empty_constant_pool_array()) { | 3748 code->constant_pool() != empty_constant_pool_array()) { |
| 3749 // Copy the constant pool, since edits to the copied code may modify | 3749 // Copy the constant pool, since edits to the copied code may modify |
| 3750 // the constant pool. | 3750 // the constant pool. |
| 3751 allocation = CopyConstantPoolArray(code->constant_pool()); | 3751 allocation = CopyConstantPoolArray(code->constant_pool()); |
| 3752 if (!allocation.To(&new_constant_pool)) return allocation; | 3752 if (!allocation.To(&new_constant_pool)) return allocation; |
| 3753 } else { | 3753 } else { |
| 3754 new_constant_pool = empty_constant_pool_array(); | 3754 new_constant_pool = empty_constant_pool_array(); |
| 3755 } | 3755 } |
| 3756 | 3756 |
| 3757 HeapObject* result; | 3757 HeapObject* result = NULL; |
| 3758 // Allocate an object the same size as the code object. | 3758 // Allocate an object the same size as the code object. |
| 3759 int obj_size = code->Size(); | 3759 int obj_size = code->Size(); |
| 3760 allocation = AllocateRaw(obj_size, CODE_SPACE, CODE_SPACE); | 3760 allocation = AllocateRaw(obj_size, CODE_SPACE, CODE_SPACE); |
| 3761 if (!allocation.To(&result)) return allocation; | 3761 if (!allocation.To(&result)) return allocation; |
| 3762 | 3762 |
| 3763 // Copy code object. | 3763 // Copy code object. |
| 3764 Address old_addr = code->address(); | 3764 Address old_addr = code->address(); |
| 3765 Address new_addr = result->address(); | 3765 Address new_addr = result->address(); |
| 3766 CopyBlock(new_addr, old_addr, obj_size); | 3766 CopyBlock(new_addr, old_addr, obj_size); |
| 3767 Code* new_code = Code::cast(result); | 3767 Code* new_code = Code::cast(result); |
| (...skipping 2671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6439 static_cast<int>(object_sizes_last_time_[index])); | 6439 static_cast<int>(object_sizes_last_time_[index])); |
| 6440 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6440 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 6441 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6441 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 6442 | 6442 |
| 6443 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6443 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 6444 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6444 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 6445 ClearObjectStats(); | 6445 ClearObjectStats(); |
| 6446 } | 6446 } |
| 6447 } | 6447 } |
| 6448 } // namespace v8::internal | 6448 } // namespace v8::internal |
| OLD | NEW |