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

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

Issue 3748007: Do not return the constant singleton float -0.0 from UnaryOpStub, because it ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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 | « no previous file | 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 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1406 if (op_ == Token::SUB) { 1406 if (op_ == Token::SUB) {
1407 if (include_smi_code_) { 1407 if (include_smi_code_) {
1408 // Check whether the value is a smi. 1408 // Check whether the value is a smi.
1409 Label try_float; 1409 Label try_float;
1410 __ JumpIfNotSmi(rax, &try_float); 1410 __ JumpIfNotSmi(rax, &try_float);
1411 if (negative_zero_ == kIgnoreNegativeZero) { 1411 if (negative_zero_ == kIgnoreNegativeZero) {
1412 __ SmiCompare(rax, Smi::FromInt(0)); 1412 __ SmiCompare(rax, Smi::FromInt(0));
1413 __ j(equal, &done); 1413 __ j(equal, &done);
1414 } 1414 }
1415 __ SmiNeg(rax, rax, &done); 1415 __ SmiNeg(rax, rax, &done);
1416 __ jmp(&slow); // zero, if not handled above, and Smi::kMinValue.
1416 1417
1417 // Either zero or Smi::kMinValue, neither of which become a smi when
1418 // negated. We handle negative zero here if required. We always enter
1419 // the runtime system if we have Smi::kMinValue.
1420 if (negative_zero_ == kStrictNegativeZero) {
1421 __ SmiCompare(rax, Smi::FromInt(0));
1422 __ j(not_equal, &slow);
1423 __ Move(rax, Factory::minus_zero_value());
1424 __ jmp(&done);
1425 } else {
1426 __ SmiCompare(rax, Smi::FromInt(Smi::kMinValue));
1427 __ j(equal, &slow);
1428 __ jmp(&done);
1429 }
1430 // Try floating point case. 1418 // Try floating point case.
1431 __ bind(&try_float); 1419 __ bind(&try_float);
1432 } else if (FLAG_debug_code) { 1420 } else if (FLAG_debug_code) {
1433 __ AbortIfSmi(rax); 1421 __ AbortIfSmi(rax);
1434 } 1422 }
1435 1423
1436 __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset)); 1424 __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset));
1437 __ CompareRoot(rdx, Heap::kHeapNumberMapRootIndex); 1425 __ CompareRoot(rdx, Heap::kHeapNumberMapRootIndex);
1438 __ j(not_equal, &slow); 1426 __ j(not_equal, &slow);
1439 // Operand is a float, negate its value by flipping sign bit. 1427 // Operand is a float, negate its value by flipping sign bit.
(...skipping 2605 matching lines...) Expand 10 before | Expand all | Expand 10 after
4045 // tagged as a small integer. 4033 // tagged as a small integer.
4046 __ bind(&runtime); 4034 __ bind(&runtime);
4047 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); 4035 __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
4048 } 4036 }
4049 4037
4050 #undef __ 4038 #undef __
4051 4039
4052 } } // namespace v8::internal 4040 } } // namespace v8::internal
4053 4041
4054 #endif // V8_TARGET_ARCH_X64 4042 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/smi-negative-zero.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698