ASSERT(static_cast<int>(Deoptimizer::GetMaxDeoptTableSize()) >=
desc.instr_size);
chunk->CommitArea(desc.instr_size);
- CopyBytes(chunk->area_start(), desc.buffer, desc.instr_size);
+ CopyBytes(chunk->area_start(), desc.buffer,
+ static_cast<size_t>(desc.instr_size));
CPU::FlushICache(chunk->area_start(), desc.instr_size);
if (type == EAGER) {
Address new_addr = reinterpret_cast<HeapObject*>(result)->address();
// Copy header and instructions.
- CopyBytes(new_addr, old_addr, static_cast<int>(relocation_offset));
+ CopyBytes(new_addr, old_addr, relocation_offset);
Code* new_code = Code::cast(result);
new_code->set_relocation_info(ByteArray::cast(reloc_info_array));
// Copy patched rinfo.
CopyBytes(new_code->relocation_start(),
reloc_info.start(),
- reloc_info.length());
+ static_cast<size_t>(reloc_info.length()));
// Relocate the copy.
ASSERT(!isolate_->code_range()->exists() ||
ASSERT(Marking::Color(this) == Marking::WHITE_OBJECT);
// copy code
- CopyBytes(instruction_start(), desc.buffer, desc.instr_size);
+ CopyBytes(instruction_start(), desc.buffer,
+ static_cast<size_t>(desc.instr_size));
// copy reloc info
CopyBytes(relocation_start(),
desc.buffer + desc.buffer_size - desc.reloc_size,
- desc.reloc_size);
+ static_cast<size_t>(desc.reloc_size));
// unbox handles and relocate
intptr_t delta = instruction_start() - desc.buffer;
// Copies data from |src| to |dst|. The data spans must not overlap.
template <typename T>
-inline void CopyBytes(T* dst, T* src, int num_bytes) {
+inline void CopyBytes(T* dst, T* src, size_t num_bytes) {
STATIC_ASSERT(sizeof(T) == 1);
ASSERT(Min(dst, src) + num_bytes <= Max(dst, src));
- ASSERT(num_bytes >= 0);
if (num_bytes == 0) return;
// Use block copying OS::MemCopy if the segment we're copying is
// enough to justify the extra call/setup overhead.
static const int kBlockCopyLimit = OS::kMinComplexMemCopy;
- if (num_bytes >= kBlockCopyLimit) {
+ if (num_bytes >= static_cast<size_t>(kBlockCopyLimit)) {
OS::MemCopy(dst, src, num_bytes);
} else {
- int remaining = num_bytes;
+ size_t remaining = num_bytes;
do {
remaining--;
*dst++ = *src++;