Commit 6f21761e authored by lrn@chromium.org's avatar lrn@chromium.org

X64: Fix bug in boolean conversion of empty string.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2632 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3abd9bfa
...@@ -1669,7 +1669,7 @@ Object* Heap::AllocateSlicedString(String* buffer, ...@@ -1669,7 +1669,7 @@ Object* Heap::AllocateSlicedString(String* buffer,
int length = end - start; int length = end - start;
// If the resulting string is small make a sub string. // 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); return Heap::AllocateSubString(buffer, start, end);
} }
......
...@@ -4038,8 +4038,8 @@ class SlicedString: public String { ...@@ -4038,8 +4038,8 @@ class SlicedString: public String {
// Layout description // Layout description
#if V8_HOST_ARCH_64_BIT #if V8_HOST_ARCH_64_BIT
// Optimizations expect buffer to be located at same offset as a ConsString's // 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 // first substring. In 64 bit mode we have room for the start offset before
// buffer. // the buffer.
static const int kStartOffset = String::kSize; static const int kStartOffset = String::kSize;
static const int kBufferOffset = kStartOffset + kIntSize; static const int kBufferOffset = kStartOffset + kIntSize;
static const int kSize = kBufferOffset + kPointerSize; static const int kSize = kBufferOffset + kPointerSize;
......
...@@ -5695,7 +5695,7 @@ void ToBooleanStub::Generate(MacroAssembler* masm) { ...@@ -5695,7 +5695,7 @@ void ToBooleanStub::Generate(MacroAssembler* masm) {
__ and_(rcx, Immediate(kStringSizeMask)); __ and_(rcx, Immediate(kStringSizeMask));
__ cmpq(rcx, Immediate(kShortStringTag)); __ cmpq(rcx, Immediate(kShortStringTag));
__ j(not_equal, &true_result); // Empty string is always short. __ 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)); __ shr(rdx, Immediate(String::kShortLengthShift));
__ j(zero, &false_result); __ j(zero, &false_result);
__ jmp(&true_result); __ jmp(&true_result);
......
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