Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(847)

Side by Side Diff: src/heap.cc

Issue 13470008: Fix CopyBytes to accept size_t for num_bytes (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/deoptimizer.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3866 matching lines...) Expand 10 before | Expand all | Expand 10 after
3877 maybe_result = code_space_->AllocateRaw(new_obj_size); 3877 maybe_result = code_space_->AllocateRaw(new_obj_size);
3878 } 3878 }
3879 3879
3880 Object* result; 3880 Object* result;
3881 if (!maybe_result->ToObject(&result)) return maybe_result; 3881 if (!maybe_result->ToObject(&result)) return maybe_result;
3882 3882
3883 // Copy code object. 3883 // Copy code object.
3884 Address new_addr = reinterpret_cast<HeapObject*>(result)->address(); 3884 Address new_addr = reinterpret_cast<HeapObject*>(result)->address();
3885 3885
3886 // Copy header and instructions. 3886 // Copy header and instructions.
3887 CopyBytes(new_addr, old_addr, static_cast<int>(relocation_offset)); 3887 CopyBytes(new_addr, old_addr, static_cast<size_t>(relocation_offset));
Michael Starzinger 2013/04/02 13:13:53 The "relocation_offset" is already size_t, no need
3888 3888
3889 Code* new_code = Code::cast(result); 3889 Code* new_code = Code::cast(result);
3890 new_code->set_relocation_info(ByteArray::cast(reloc_info_array)); 3890 new_code->set_relocation_info(ByteArray::cast(reloc_info_array));
3891 3891
3892 // Copy patched rinfo. 3892 // Copy patched rinfo.
3893 CopyBytes(new_code->relocation_start(), 3893 CopyBytes(new_code->relocation_start(),
3894 reloc_info.start(), 3894 reloc_info.start(),
3895 reloc_info.length()); 3895 static_cast<size_t>(reloc_info.length()));
3896 3896
3897 // Relocate the copy. 3897 // Relocate the copy.
3898 ASSERT(!isolate_->code_range()->exists() || 3898 ASSERT(!isolate_->code_range()->exists() ||
3899 isolate_->code_range()->contains(code->address())); 3899 isolate_->code_range()->contains(code->address()));
3900 new_code->Relocate(new_addr - old_addr); 3900 new_code->Relocate(new_addr - old_addr);
3901 3901
3902 #ifdef VERIFY_HEAP 3902 #ifdef VERIFY_HEAP
3903 if (FLAG_verify_heap) { 3903 if (FLAG_verify_heap) {
3904 code->Verify(); 3904 code->Verify();
3905 } 3905 }
(...skipping 3914 matching lines...) Expand 10 before | Expand all | Expand 10 after
7820 static_cast<int>(object_sizes_last_time_[index])); 7820 static_cast<int>(object_sizes_last_time_[index]));
7821 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7821 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7822 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7822 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7823 7823
7824 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7824 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7825 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7825 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7826 ClearObjectStats(); 7826 ClearObjectStats();
7827 } 7827 }
7828 7828
7829 } } // namespace v8::internal 7829 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/deoptimizer.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698