| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3109 DoubleToIStub stub(input_reg, result_reg, offset, true); | 3109 DoubleToIStub stub(input_reg, result_reg, offset, true); |
| 3110 call(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); | 3110 call(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); |
| 3111 } | 3111 } |
| 3112 | 3112 |
| 3113 | 3113 |
| 3114 void MacroAssembler::TruncateHeapNumberToI(Register result_reg, | 3114 void MacroAssembler::TruncateHeapNumberToI(Register result_reg, |
| 3115 Register input_reg) { | 3115 Register input_reg) { |
| 3116 Label done; | 3116 Label done; |
| 3117 movsd(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset)); | 3117 movsd(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset)); |
| 3118 cvttsd2siq(result_reg, xmm0); | 3118 cvttsd2siq(result_reg, xmm0); |
| 3119 Set(kScratchRegister, V8_UINT64_C(0x8000000000000000)); | 3119 MoveInteger64(kScratchRegister, V8_UINT64_C(0x8000000000000000)); |
| 3120 cmpq(result_reg, kScratchRegister); | 3120 cmpq(result_reg, kScratchRegister); |
| 3121 j(not_equal, &done, Label::kNear); | 3121 j(not_equal, &done, Label::kNear); |
| 3122 | 3122 |
| 3123 // Slow case. | 3123 // Slow case. |
| 3124 if (input_reg.is(result_reg)) { | 3124 if (input_reg.is(result_reg)) { |
| 3125 subq(rsp, Immediate(kDoubleSize)); | 3125 subq(rsp, Immediate(kDoubleSize)); |
| 3126 movsd(MemOperand(rsp, 0), xmm0); | 3126 movsd(MemOperand(rsp, 0), xmm0); |
| 3127 SlowTruncateToI(result_reg, rsp, 0); | 3127 SlowTruncateToI(result_reg, rsp, 0); |
| 3128 addq(rsp, Immediate(kDoubleSize)); | 3128 addq(rsp, Immediate(kDoubleSize)); |
| 3129 } else { | 3129 } else { |
| 3130 SlowTruncateToI(result_reg, input_reg); | 3130 SlowTruncateToI(result_reg, input_reg); |
| 3131 } | 3131 } |
| 3132 | 3132 |
| 3133 bind(&done); | 3133 bind(&done); |
| 3134 } | 3134 } |
| 3135 | 3135 |
| 3136 | 3136 |
| 3137 void MacroAssembler::TruncateDoubleToI(Register result_reg, | 3137 void MacroAssembler::TruncateDoubleToI(Register result_reg, |
| 3138 XMMRegister input_reg) { | 3138 XMMRegister input_reg) { |
| 3139 Label done; | 3139 Label done; |
| 3140 cvttsd2siq(result_reg, input_reg); | 3140 cvttsd2siq(result_reg, input_reg); |
| 3141 movq(kScratchRegister, V8_INT64_C(0x8000000000000000)); | 3141 MoveInteger64(kScratchRegister, V8_INT64_C(0x8000000000000000)); |
| 3142 cmpq(result_reg, kScratchRegister); | 3142 cmpq(result_reg, kScratchRegister); |
| 3143 j(not_equal, &done, Label::kNear); | 3143 j(not_equal, &done, Label::kNear); |
| 3144 | 3144 |
| 3145 subq(rsp, Immediate(kDoubleSize)); | 3145 subq(rsp, Immediate(kDoubleSize)); |
| 3146 movsd(MemOperand(rsp, 0), input_reg); | 3146 movsd(MemOperand(rsp, 0), input_reg); |
| 3147 SlowTruncateToI(result_reg, rsp, 0); | 3147 SlowTruncateToI(result_reg, rsp, 0); |
| 3148 addq(rsp, Immediate(kDoubleSize)); | 3148 addq(rsp, Immediate(kDoubleSize)); |
| 3149 | 3149 |
| 3150 bind(&done); | 3150 bind(&done); |
| 3151 } | 3151 } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3281 if (emit_debug_code()) { | 3281 if (emit_debug_code()) { |
| 3282 Condition is_smi = CheckSmi(object); | 3282 Condition is_smi = CheckSmi(object); |
| 3283 Check(is_smi, kOperandIsNotASmi); | 3283 Check(is_smi, kOperandIsNotASmi); |
| 3284 } | 3284 } |
| 3285 } | 3285 } |
| 3286 | 3286 |
| 3287 | 3287 |
| 3288 void MacroAssembler::AssertZeroExtended(Register int32_register) { | 3288 void MacroAssembler::AssertZeroExtended(Register int32_register) { |
| 3289 if (emit_debug_code()) { | 3289 if (emit_debug_code()) { |
| 3290 ASSERT(!int32_register.is(kScratchRegister)); | 3290 ASSERT(!int32_register.is(kScratchRegister)); |
| 3291 movq(kScratchRegister, V8_INT64_C(0x0000000100000000)); | 3291 MoveInteger64(kScratchRegister, V8_INT64_C(0x0000000100000000)); |
| 3292 cmpq(kScratchRegister, int32_register); | 3292 cmpq(kScratchRegister, int32_register); |
| 3293 Check(above_equal, k32BitValueInRegisterIsNotZeroExtended); | 3293 Check(above_equal, k32BitValueInRegisterIsNotZeroExtended); |
| 3294 } | 3294 } |
| 3295 } | 3295 } |
| 3296 | 3296 |
| 3297 | 3297 |
| 3298 void MacroAssembler::AssertString(Register object) { | 3298 void MacroAssembler::AssertString(Register object) { |
| 3299 if (emit_debug_code()) { | 3299 if (emit_debug_code()) { |
| 3300 testb(object, Immediate(kSmiTagMask)); | 3300 testb(object, Immediate(kSmiTagMask)); |
| 3301 Check(not_equal, kOperandIsASmiAndNotAString); | 3301 Check(not_equal, kOperandIsASmiAndNotAString); |
| (...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5007 j(equal, found); | 5007 j(equal, found); |
| 5008 movq(current, FieldOperand(current, Map::kPrototypeOffset)); | 5008 movq(current, FieldOperand(current, Map::kPrototypeOffset)); |
| 5009 CompareRoot(current, Heap::kNullValueRootIndex); | 5009 CompareRoot(current, Heap::kNullValueRootIndex); |
| 5010 j(not_equal, &loop_again); | 5010 j(not_equal, &loop_again); |
| 5011 } | 5011 } |
| 5012 | 5012 |
| 5013 | 5013 |
| 5014 } } // namespace v8::internal | 5014 } } // namespace v8::internal |
| 5015 | 5015 |
| 5016 #endif // V8_TARGET_ARCH_X64 | 5016 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |