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

Side by Side Diff: src/objects.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
« src/heap.cc ('K') | « src/heap.cc ('k') | src/v8utils.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 8831 matching lines...) Expand 10 before | Expand all | Expand 10 after
8842 it.rinfo()->apply(delta); 8842 it.rinfo()->apply(delta);
8843 } 8843 }
8844 CPU::FlushICache(instruction_start(), instruction_size()); 8844 CPU::FlushICache(instruction_start(), instruction_size());
8845 } 8845 }
8846 8846
8847 8847
8848 void Code::CopyFrom(const CodeDesc& desc) { 8848 void Code::CopyFrom(const CodeDesc& desc) {
8849 ASSERT(Marking::Color(this) == Marking::WHITE_OBJECT); 8849 ASSERT(Marking::Color(this) == Marking::WHITE_OBJECT);
8850 8850
8851 // copy code 8851 // copy code
8852 CopyBytes(instruction_start(), desc.buffer, desc.instr_size); 8852 CopyBytes(instruction_start(), desc.buffer,
8853 static_cast<size_t>(desc.instr_size));
8853 8854
8854 // copy reloc info 8855 // copy reloc info
8855 CopyBytes(relocation_start(), 8856 CopyBytes(relocation_start(),
8856 desc.buffer + desc.buffer_size - desc.reloc_size, 8857 desc.buffer + desc.buffer_size - desc.reloc_size,
8857 desc.reloc_size); 8858 static_cast<size_t>(desc.reloc_size));
8858 8859
8859 // unbox handles and relocate 8860 // unbox handles and relocate
8860 intptr_t delta = instruction_start() - desc.buffer; 8861 intptr_t delta = instruction_start() - desc.buffer;
8861 int mode_mask = RelocInfo::kCodeTargetMask | 8862 int mode_mask = RelocInfo::kCodeTargetMask |
8862 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | 8863 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
8863 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | 8864 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) |
8864 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) | 8865 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) |
8865 RelocInfo::kApplyMask; 8866 RelocInfo::kApplyMask;
8866 // Needed to find target_object and runtime_entry on X64 8867 // Needed to find target_object and runtime_entry on X64
8867 Assembler* origin = desc.origin; 8868 Assembler* origin = desc.origin;
(...skipping 5501 matching lines...) Expand 10 before | Expand all | Expand 10 after
14369 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 14370 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
14370 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 14371 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
14371 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 14372 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
14372 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 14373 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
14373 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 14374 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
14374 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 14375 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
14375 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 14376 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
14376 } 14377 }
14377 14378
14378 } } // namespace v8::internal 14379 } } // namespace v8::internal
OLDNEW
« src/heap.cc ('K') | « src/heap.cc ('k') | src/v8utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698