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

Side by Side Diff: src/x64/codegen-x64.cc

Issue 165043: X64: Fix bug in boolean conversion of empty string. (Closed)
Patch Set: Created 11 years, 4 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
« no previous file with comments | « src/objects.h ('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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 5728 matching lines...) Expand 10 before | Expand all | Expand 10 after
5739 // JavaScript object => true. 5739 // JavaScript object => true.
5740 __ cmpq(rcx, Immediate(FIRST_JS_OBJECT_TYPE)); 5740 __ cmpq(rcx, Immediate(FIRST_JS_OBJECT_TYPE));
5741 __ j(above_equal, &true_result); 5741 __ j(above_equal, &true_result);
5742 5742
5743 // String value => false iff empty. 5743 // String value => false iff empty.
5744 __ cmpq(rcx, Immediate(FIRST_NONSTRING_TYPE)); 5744 __ cmpq(rcx, Immediate(FIRST_NONSTRING_TYPE));
5745 __ j(above_equal, &not_string); 5745 __ j(above_equal, &not_string);
5746 __ and_(rcx, Immediate(kStringSizeMask)); 5746 __ and_(rcx, Immediate(kStringSizeMask));
5747 __ cmpq(rcx, Immediate(kShortStringTag)); 5747 __ cmpq(rcx, Immediate(kShortStringTag));
5748 __ j(not_equal, &true_result); // Empty string is always short. 5748 __ j(not_equal, &true_result); // Empty string is always short.
5749 __ movq(rdx, FieldOperand(rax, String::kLengthOffset)); 5749 __ movl(rdx, FieldOperand(rax, String::kLengthOffset));
5750 __ shr(rdx, Immediate(String::kShortLengthShift)); 5750 __ shr(rdx, Immediate(String::kShortLengthShift));
5751 __ j(zero, &false_result); 5751 __ j(zero, &false_result);
5752 __ jmp(&true_result); 5752 __ jmp(&true_result);
5753 5753
5754 __ bind(&not_string); 5754 __ bind(&not_string);
5755 // HeapNumber => false iff +0, -0, or NaN. 5755 // HeapNumber => false iff +0, -0, or NaN.
5756 // These three cases set C3 when compared to zero in the FPU. 5756 // These three cases set C3 when compared to zero in the FPU.
5757 __ Cmp(rdx, Factory::heap_number_map()); 5757 __ Cmp(rdx, Factory::heap_number_map());
5758 __ j(not_equal, &true_result); 5758 __ j(not_equal, &true_result);
5759 // TODO(x64): Don't use fp stack, use MMX registers? 5759 // TODO(x64): Don't use fp stack, use MMX registers?
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
7261 int CompareStub::MinorKey() { 7261 int CompareStub::MinorKey() {
7262 // Encode the two parameters in a unique 16 bit value. 7262 // Encode the two parameters in a unique 16 bit value.
7263 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); 7263 ASSERT(static_cast<unsigned>(cc_) < (1 << 15));
7264 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); 7264 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0);
7265 } 7265 }
7266 7266
7267 7267
7268 #undef __ 7268 #undef __
7269 7269
7270 } } // namespace v8::internal 7270 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698