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

Side by Side Diff: src/objects.cc

Issue 12937004: Add more instrumentation for Code::CopyFrom crasher. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Jakob Kummerow. 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 | « src/heap.cc ('k') | no next file » | 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 8795 matching lines...) Expand 10 before | Expand all | Expand 10 after
8806 it.rinfo()->apply(delta); 8806 it.rinfo()->apply(delta);
8807 } 8807 }
8808 CPU::FlushICache(instruction_start(), instruction_size()); 8808 CPU::FlushICache(instruction_start(), instruction_size());
8809 } 8809 }
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());
8817 CHECK(relocation_info()->IsByteArray());
8818 CHECK(reinterpret_cast<intptr_t>(instruction_start()) ==
8819 reinterpret_cast<intptr_t>(this) + Code::kHeaderSize - kHeapObjectTag);
8816 memmove(instruction_start(), desc.buffer, desc.instr_size); 8820 memmove(instruction_start(), desc.buffer, desc.instr_size);
8817 8821
8818 // copy reloc info 8822 // copy reloc info
8819 // TODO(mstarzinger): Remove once we found the bug. 8823 // TODO(mstarzinger): Remove once we found the bug.
8824 CHECK(IsCode());
8820 CHECK(relocation_info()->IsByteArray()); 8825 CHECK(relocation_info()->IsByteArray());
8821 memmove(relocation_start(), 8826 memmove(relocation_start(),
8822 desc.buffer + desc.buffer_size - desc.reloc_size, 8827 desc.buffer + desc.buffer_size - desc.reloc_size,
8823 desc.reloc_size); 8828 desc.reloc_size);
8824 8829
8825 // unbox handles and relocate 8830 // unbox handles and relocate
8826 intptr_t delta = instruction_start() - desc.buffer; 8831 intptr_t delta = instruction_start() - desc.buffer;
8827 int mode_mask = RelocInfo::kCodeTargetMask | 8832 int mode_mask = RelocInfo::kCodeTargetMask |
8828 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | 8833 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
8829 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | 8834 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) |
(...skipping 5498 matching lines...) Expand 10 before | Expand all | Expand 10 after
14328 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 14333 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
14329 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 14334 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
14330 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 14335 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
14331 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 14336 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
14332 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 14337 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
14333 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 14338 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
14334 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 14339 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
14335 } 14340 }
14336 14341
14337 } } // namespace v8::internal 14342 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698