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

Side by Side Diff: src/objects.cc

Issue 12593014: Use internal memcpy when initializing code objects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Jakob Kummerow's offline comments. Created 7 years, 9 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 | « no previous file | 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 8799 matching lines...) Expand 10 before | Expand all | Expand 10 after
8810 8810
8811 8811
8812 void Code::CopyFrom(const CodeDesc& desc) { 8812 void Code::CopyFrom(const CodeDesc& desc) {
8813 ASSERT(Marking::Color(this) == Marking::WHITE_OBJECT); 8813 ASSERT(Marking::Color(this) == Marking::WHITE_OBJECT);
8814 8814
8815 // copy code 8815 // copy code
8816 CHECK(IsCode()); 8816 CHECK(IsCode());
8817 CHECK(relocation_info()->IsByteArray()); 8817 CHECK(relocation_info()->IsByteArray());
8818 CHECK(reinterpret_cast<intptr_t>(instruction_start()) == 8818 CHECK(reinterpret_cast<intptr_t>(instruction_start()) ==
8819 reinterpret_cast<intptr_t>(this) + Code::kHeaderSize - kHeapObjectTag); 8819 reinterpret_cast<intptr_t>(this) + Code::kHeaderSize - kHeapObjectTag);
8820 memmove(instruction_start(), desc.buffer, desc.instr_size); 8820 CopyBytes<byte>(instruction_start(), desc.buffer, desc.instr_size);
8821 8821
8822 // copy reloc info 8822 // copy reloc info
8823 // TODO(mstarzinger): Remove once we found the bug. 8823 // TODO(mstarzinger): Remove once we found the bug.
8824 CHECK(IsCode()); 8824 CHECK(IsCode());
8825 CHECK(relocation_info()->IsByteArray()); 8825 CHECK(relocation_info()->IsByteArray());
8826 memmove(relocation_start(), 8826 CopyBytes<byte>(relocation_start(),
8827 desc.buffer + desc.buffer_size - desc.reloc_size, 8827 desc.buffer + desc.buffer_size - desc.reloc_size,
8828 desc.reloc_size); 8828 desc.reloc_size);
8829 8829
8830 // unbox handles and relocate 8830 // unbox handles and relocate
8831 intptr_t delta = instruction_start() - desc.buffer; 8831 intptr_t delta = instruction_start() - desc.buffer;
8832 int mode_mask = RelocInfo::kCodeTargetMask | 8832 int mode_mask = RelocInfo::kCodeTargetMask |
8833 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | 8833 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
8834 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | 8834 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) |
8835 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) | 8835 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) |
8836 RelocInfo::kApplyMask; 8836 RelocInfo::kApplyMask;
8837 // Needed to find target_object and runtime_entry on X64 8837 // Needed to find target_object and runtime_entry on X64
8838 Assembler* origin = desc.origin; 8838 Assembler* origin = desc.origin;
(...skipping 5494 matching lines...) Expand 10 before | Expand all | Expand 10 after
14333 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 14333 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
14334 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 14334 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
14335 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 14335 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
14336 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 14336 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
14337 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 14337 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
14338 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 14338 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
14339 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 14339 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
14340 } 14340 }
14341 14341
14342 } } // namespace v8::internal 14342 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/v8utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698