| OLD | NEW |
| 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 9410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9421 | 9421 |
| 9422 if (negative_zero_ == kIgnoreNegativeZero) { | 9422 if (negative_zero_ == kIgnoreNegativeZero) { |
| 9423 __ SmiCompare(rax, Smi::FromInt(0)); | 9423 __ SmiCompare(rax, Smi::FromInt(0)); |
| 9424 __ j(equal, &done); | 9424 __ j(equal, &done); |
| 9425 } | 9425 } |
| 9426 | 9426 |
| 9427 // Enter runtime system if the value of the smi is zero | 9427 // Enter runtime system if the value of the smi is zero |
| 9428 // to make sure that we switch between 0 and -0. | 9428 // to make sure that we switch between 0 and -0. |
| 9429 // Also enter it if the value of the smi is Smi::kMinValue. | 9429 // Also enter it if the value of the smi is Smi::kMinValue. |
| 9430 __ SmiNeg(rax, rax, &done); | 9430 __ SmiNeg(rax, rax, &done); |
| 9431 | 9431 __ jmp(&slow); |
| 9432 // Either zero or Smi::kMinValue, neither of which become a smi when | |
| 9433 // negated. | |
| 9434 if (negative_zero_ == kStrictNegativeZero) { | |
| 9435 __ SmiCompare(rax, Smi::FromInt(0)); | |
| 9436 __ j(not_equal, &slow); | |
| 9437 __ Move(rax, Factory::minus_zero_value()); | |
| 9438 __ jmp(&done); | |
| 9439 } else { | |
| 9440 __ jmp(&slow); | |
| 9441 } | |
| 9442 | 9432 |
| 9443 // Try floating point case. | 9433 // Try floating point case. |
| 9444 __ bind(&try_float); | 9434 __ bind(&try_float); |
| 9445 __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset)); | 9435 __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset)); |
| 9446 __ CompareRoot(rdx, Heap::kHeapNumberMapRootIndex); | 9436 __ CompareRoot(rdx, Heap::kHeapNumberMapRootIndex); |
| 9447 __ j(not_equal, &slow); | 9437 __ j(not_equal, &slow); |
| 9448 // Operand is a float, negate its value by flipping sign bit. | 9438 // Operand is a float, negate its value by flipping sign bit. |
| 9449 __ movq(rdx, FieldOperand(rax, HeapNumber::kValueOffset)); | 9439 __ movq(rdx, FieldOperand(rax, HeapNumber::kValueOffset)); |
| 9450 __ movq(kScratchRegister, Immediate(0x01)); | 9440 __ movq(kScratchRegister, Immediate(0x01)); |
| 9451 __ shl(kScratchRegister, Immediate(63)); | 9441 __ shl(kScratchRegister, Immediate(63)); |
| (...skipping 2627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12079 #undef __ | 12069 #undef __ |
| 12080 | 12070 |
| 12081 void RecordWriteStub::Generate(MacroAssembler* masm) { | 12071 void RecordWriteStub::Generate(MacroAssembler* masm) { |
| 12082 masm->RecordWriteHelper(object_, addr_, scratch_); | 12072 masm->RecordWriteHelper(object_, addr_, scratch_); |
| 12083 masm->ret(0); | 12073 masm->ret(0); |
| 12084 } | 12074 } |
| 12085 | 12075 |
| 12086 } } // namespace v8::internal | 12076 } } // namespace v8::internal |
| 12087 | 12077 |
| 12088 #endif // V8_TARGET_ARCH_X64 | 12078 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |