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 3862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3873 maybe_result = code_space_->AllocateRaw(new_obj_size); | 3873 maybe_result = code_space_->AllocateRaw(new_obj_size); |
3874 } | 3874 } |
3875 | 3875 |
3876 Object* result; | 3876 Object* result; |
3877 if (!maybe_result->ToObject(&result)) return maybe_result; | 3877 if (!maybe_result->ToObject(&result)) return maybe_result; |
3878 | 3878 |
3879 // Copy code object. | 3879 // Copy code object. |
3880 Address new_addr = reinterpret_cast<HeapObject*>(result)->address(); | 3880 Address new_addr = reinterpret_cast<HeapObject*>(result)->address(); |
3881 | 3881 |
3882 // Copy header and instructions. | 3882 // Copy header and instructions. |
3883 CopyBytes(new_addr, old_addr, relocation_offset); | 3883 CopyBytes(new_addr, old_addr, static_cast<int>(relocation_offset)); |
3884 | 3884 |
3885 Code* new_code = Code::cast(result); | 3885 Code* new_code = Code::cast(result); |
3886 new_code->set_relocation_info(ByteArray::cast(reloc_info_array)); | 3886 new_code->set_relocation_info(ByteArray::cast(reloc_info_array)); |
3887 | 3887 |
3888 // Copy patched rinfo. | 3888 // Copy patched rinfo. |
3889 CopyBytes(new_code->relocation_start(), | 3889 CopyBytes(new_code->relocation_start(), |
3890 reloc_info.start(), | 3890 reloc_info.start(), |
3891 reloc_info.length()); | 3891 reloc_info.length()); |
3892 | 3892 |
3893 // Relocate the copy. | 3893 // Relocate the copy. |
(...skipping 3918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7812 static_cast<int>(object_sizes_last_time_[index])); | 7812 static_cast<int>(object_sizes_last_time_[index])); |
7813 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | 7813 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) |
7814 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7814 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7815 | 7815 |
7816 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7816 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7817 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7817 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7818 ClearObjectStats(); | 7818 ClearObjectStats(); |
7819 } | 7819 } |
7820 | 7820 |
7821 } } // namespace v8::internal | 7821 } } // namespace v8::internal |
OLD | NEW |