Commit cfd62682 authored by ricow@chromium.org's avatar ricow@chromium.org

Fix wrong assertion in assembler causing the shell to crash with --code-comments.

Since writting a code comment can include a pc-jump the assertion
should just check that we are greater than or equal to
kMinRelocCommentSize (renamed from kRelocCommentSize), not that we are
actually equal to.


Review URL: http://codereview.chromium.org/6580028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6928 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5572d24f
......@@ -252,7 +252,7 @@ void RelocInfoWriter::Write(const RelocInfo* rinfo) {
WriteExtraTaggedPC(pc_delta, kPCJumpTag);
WriteExtraTaggedData(rinfo->data() - last_data_, kCommentTag);
last_data_ = rinfo->data();
ASSERT(begin_pos - pos_ == RelocInfo::kRelocCommentSize);
ASSERT(begin_pos - pos_ >= RelocInfo::kMinRelocCommentSize);
} else {
// For all other modes we simply use the mode as the extra tag.
// None of these modes need a data component.
......
......@@ -184,10 +184,10 @@ class RelocInfo BASE_EMBEDDED {
// we do not normally record relocation info.
static const char* kFillerCommentString;
// The size of a comment is equal to tree bytes for the extra tagged pc +
// the tag for the data, and kPointerSize for the actual pointer to the
// The minimum size of a comment is equal to three bytes for the extra tagged
// pc + the tag for the data, and kPointerSize for the actual pointer to the
// comment.
static const int kRelocCommentSize = 3 + kPointerSize;
static const int kMinRelocCommentSize = 3 + kPointerSize;
// The maximum size for a call instruction including pc-jump.
static const int kMaxCallSize = 6;
......
......@@ -127,7 +127,7 @@ bool LCodeGen::GenerateRelocPadding() {
int reloc_size = masm()->relocation_writer_size();
while (reloc_size < deoptimization_reloc_size.min_size) {
__ RecordComment(RelocInfo::kFillerCommentString, true);
reloc_size += RelocInfo::kRelocCommentSize;
reloc_size += RelocInfo::kMinRelocCommentSize;
}
return !is_aborted();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment