Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index 8fbf1faef8191f39322006972cac241bfa90165b..148435f681da8929d73f3cda8058e8c31c7880ce 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -2581,7 +2581,7 @@ void MacroAssembler::EnsureNotWhite( |
ASSERT(SeqAsciiString::kMaxSize <= |
static_cast<int>(0xffffffffu >> (2 + kSmiTagSize))); |
imul(length, FieldOperand(value, String::kLengthOffset)); |
- shr(length, 2 + kSmiTagSize); |
+ shr(length, 2 + kSmiTagSize + kSmiShiftSize); |
add(Operand(length), |
Immediate(SeqString::kHeaderSize + kObjectAlignmentMask)); |
and_(Operand(length), |
@@ -2595,6 +2595,11 @@ void MacroAssembler::EnsureNotWhite( |
and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask)); |
add(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), |
length); |
+ if (FLAG_debug_code) { |
+ mov(length, Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); |
+ cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); |
+ Check(less_equal, "Live Bytes Count overflow chunk size"); |
+ } |
bind(&done); |
} |