| 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 3704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3715 if (FLAG_enable_ool_constant_pool && | 3715 if (FLAG_enable_ool_constant_pool && |
| 3716 code->constant_pool() != empty_constant_pool_array()) { | 3716 code->constant_pool() != empty_constant_pool_array()) { |
| 3717 // Copy the constant pool, since edits to the copied code may modify | 3717 // Copy the constant pool, since edits to the copied code may modify |
| 3718 // the constant pool. | 3718 // the constant pool. |
| 3719 allocation = CopyConstantPoolArray(code->constant_pool()); | 3719 allocation = CopyConstantPoolArray(code->constant_pool()); |
| 3720 if (!allocation.To(&new_constant_pool)) return allocation; | 3720 if (!allocation.To(&new_constant_pool)) return allocation; |
| 3721 } else { | 3721 } else { |
| 3722 new_constant_pool = empty_constant_pool_array(); | 3722 new_constant_pool = empty_constant_pool_array(); |
| 3723 } | 3723 } |
| 3724 | 3724 |
| 3725 HeapObject* result; | 3725 HeapObject* result = NULL; |
| 3726 // Allocate an object the same size as the code object. | 3726 // Allocate an object the same size as the code object. |
| 3727 int obj_size = code->Size(); | 3727 int obj_size = code->Size(); |
| 3728 allocation = AllocateRaw(obj_size, CODE_SPACE, CODE_SPACE); | 3728 allocation = AllocateRaw(obj_size, CODE_SPACE, CODE_SPACE); |
| 3729 if (!allocation.To(&result)) return allocation; | 3729 if (!allocation.To(&result)) return allocation; |
| 3730 | 3730 |
| 3731 // Copy code object. | 3731 // Copy code object. |
| 3732 Address old_addr = code->address(); | 3732 Address old_addr = code->address(); |
| 3733 Address new_addr = result->address(); | 3733 Address new_addr = result->address(); |
| 3734 CopyBlock(new_addr, old_addr, obj_size); | 3734 CopyBlock(new_addr, old_addr, obj_size); |
| 3735 Code* new_code = Code::cast(result); | 3735 Code* new_code = Code::cast(result); |
| (...skipping 2677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6413 static_cast<int>(object_sizes_last_time_[index])); | 6413 static_cast<int>(object_sizes_last_time_[index])); |
| 6414 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6414 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 6415 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6415 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 6416 | 6416 |
| 6417 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6417 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 6418 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6418 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 6419 ClearObjectStats(); | 6419 ClearObjectStats(); |
| 6420 } | 6420 } |
| 6421 } | 6421 } |
| 6422 } // namespace v8::internal | 6422 } // namespace v8::internal |
| OLD | NEW |