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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 3755012: Merge x64 minus-zero fix (bleeding_edge r5631) to 2.3 branch.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/2.3/
Patch Set: Created 10 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/version.cc ('k') | test/mjsunit/smi-negative-zero.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 1411
1412 if (negative_zero_ == kIgnoreNegativeZero) { 1412 if (negative_zero_ == kIgnoreNegativeZero) {
1413 __ SmiCompare(rax, Smi::FromInt(0)); 1413 __ SmiCompare(rax, Smi::FromInt(0));
1414 __ j(equal, &done); 1414 __ j(equal, &done);
1415 } 1415 }
1416 1416
1417 // Enter runtime system if the value of the smi is zero 1417 // Enter runtime system if the value of the smi is zero
1418 // to make sure that we switch between 0 and -0. 1418 // to make sure that we switch between 0 and -0.
1419 // Also enter it if the value of the smi is Smi::kMinValue. 1419 // Also enter it if the value of the smi is Smi::kMinValue.
1420 __ SmiNeg(rax, rax, &done); 1420 __ SmiNeg(rax, rax, &done);
1421 1421 __ jmp(&slow);
1422 // Either zero or Smi::kMinValue, neither of which become a smi when
1423 // negated.
1424 if (negative_zero_ == kStrictNegativeZero) {
1425 __ SmiCompare(rax, Smi::FromInt(0));
1426 __ j(not_equal, &slow);
1427 __ Move(rax, Factory::minus_zero_value());
1428 __ jmp(&done);
1429 } else {
1430 __ jmp(&slow);
1431 }
1432 1422
1433 // Try floating point case. 1423 // Try floating point case.
1434 __ bind(&try_float); 1424 __ bind(&try_float);
1435 __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset)); 1425 __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset));
1436 __ CompareRoot(rdx, Heap::kHeapNumberMapRootIndex); 1426 __ CompareRoot(rdx, Heap::kHeapNumberMapRootIndex);
1437 __ j(not_equal, &slow); 1427 __ j(not_equal, &slow);
1438 // Operand is a float, negate its value by flipping sign bit. 1428 // Operand is a float, negate its value by flipping sign bit.
1439 __ movq(rdx, FieldOperand(rax, HeapNumber::kValueOffset)); 1429 __ movq(rdx, FieldOperand(rax, HeapNumber::kValueOffset));
1440 __ movq(kScratchRegister, Immediate(0x01)); 1430 __ movq(kScratchRegister, Immediate(0x01));
1441 __ shl(kScratchRegister, Immediate(63)); 1431 __ shl(kScratchRegister, Immediate(63));
(...skipping 2565 matching lines...) Expand 10 before | Expand all | Expand 10 after
4007 // tagged as a small integer. 3997 // tagged as a small integer.
4008 __ bind(&runtime); 3998 __ bind(&runtime);
4009 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); 3999 __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
4010 } 4000 }
4011 4001
4012 #undef __ 4002 #undef __
4013 4003
4014 } } // namespace v8::internal 4004 } } // namespace v8::internal
4015 4005
4016 #endif // V8_TARGET_ARCH_X64 4006 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/version.cc ('k') | test/mjsunit/smi-negative-zero.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698