Revision: 2632 Author: [email protected] Date: Thu Aug 6 03:22:38 2009 Log: X64: Fix bug in boolean conversion of empty string.
Review URL: http://codereview.chromium.org/165043 http://code.google.com/p/v8/source/detail?r=2632 Modified: /branches/bleeding_edge/src/heap.cc /branches/bleeding_edge/src/objects.h /branches/bleeding_edge/src/x64/codegen-x64.cc ======================================= --- /branches/bleeding_edge/src/heap.cc Mon Aug 3 04:05:26 2009 +++ /branches/bleeding_edge/src/heap.cc Thu Aug 6 03:22:38 2009 @@ -1669,7 +1669,7 @@ int length = end - start; // If the resulting string is small make a sub string. - if (end - start <= String::kMinNonFlatLength) { + if (length <= String::kMinNonFlatLength) { return Heap::AllocateSubString(buffer, start, end); } ======================================= --- /branches/bleeding_edge/src/objects.h Thu Jul 30 02:13:48 2009 +++ /branches/bleeding_edge/src/objects.h Thu Aug 6 03:22:38 2009 @@ -4038,8 +4038,8 @@ // Layout description #if V8_HOST_ARCH_64_BIT // Optimizations expect buffer to be located at same offset as a ConsString's - // first substring. In 64 bit mode we have room for the size before the - // buffer. + // first substring. In 64 bit mode we have room for the start offset before + // the buffer. static const int kStartOffset = String::kSize; static const int kBufferOffset = kStartOffset + kIntSize; static const int kSize = kBufferOffset + kPointerSize; ======================================= --- /branches/bleeding_edge/src/x64/codegen-x64.cc Wed Aug 5 05:52:31 2009 +++ /branches/bleeding_edge/src/x64/codegen-x64.cc Thu Aug 6 03:22:38 2009 @@ -5695,7 +5695,7 @@ __ and_(rcx, Immediate(kStringSizeMask)); __ cmpq(rcx, Immediate(kShortStringTag)); __ j(not_equal, &true_result); // Empty string is always short. - __ movq(rdx, FieldOperand(rax, String::kLengthOffset)); + __ movl(rdx, FieldOperand(rax, String::kLengthOffset)); __ shr(rdx, Immediate(String::kShortLengthShift)); __ j(zero, &false_result); __ jmp(&true_result); --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
