OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 ASSERT(!frame_is_built_); | 180 ASSERT(!frame_is_built_); |
181 frame_is_built_ = true; | 181 frame_is_built_ = true; |
182 __ Prologue(info()->IsStub() ? BUILD_STUB_FRAME : BUILD_FUNCTION_FRAME); | 182 __ Prologue(info()->IsStub() ? BUILD_STUB_FRAME : BUILD_FUNCTION_FRAME); |
183 info()->AddNoFrameRange(0, masm_->pc_offset()); | 183 info()->AddNoFrameRange(0, masm_->pc_offset()); |
184 } | 184 } |
185 | 185 |
186 // Reserve space for the stack slots needed by the code. | 186 // Reserve space for the stack slots needed by the code. |
187 int slots = GetStackSlotCount(); | 187 int slots = GetStackSlotCount(); |
188 if (slots > 0) { | 188 if (slots > 0) { |
189 if (FLAG_debug_code) { | 189 if (FLAG_debug_code) { |
190 __ subq(rsp, Immediate(slots * kPointerSize)); | 190 __ subp(rsp, Immediate(slots * kPointerSize)); |
191 #ifdef _MSC_VER | 191 #ifdef _MSC_VER |
192 MakeSureStackPagesMapped(slots * kPointerSize); | 192 MakeSureStackPagesMapped(slots * kPointerSize); |
193 #endif | 193 #endif |
194 __ Push(rax); | 194 __ Push(rax); |
195 __ Set(rax, slots); | 195 __ Set(rax, slots); |
196 __ movq(kScratchRegister, kSlotsZapValue); | 196 __ movq(kScratchRegister, kSlotsZapValue); |
197 Label loop; | 197 Label loop; |
198 __ bind(&loop); | 198 __ bind(&loop); |
199 __ movp(MemOperand(rsp, rax, times_pointer_size, 0), | 199 __ movp(MemOperand(rsp, rax, times_pointer_size, 0), |
200 kScratchRegister); | 200 kScratchRegister); |
201 __ decl(rax); | 201 __ decl(rax); |
202 __ j(not_zero, &loop); | 202 __ j(not_zero, &loop); |
203 __ Pop(rax); | 203 __ Pop(rax); |
204 } else { | 204 } else { |
205 __ subq(rsp, Immediate(slots * kPointerSize)); | 205 __ subp(rsp, Immediate(slots * kPointerSize)); |
206 #ifdef _MSC_VER | 206 #ifdef _MSC_VER |
207 MakeSureStackPagesMapped(slots * kPointerSize); | 207 MakeSureStackPagesMapped(slots * kPointerSize); |
208 #endif | 208 #endif |
209 } | 209 } |
210 | 210 |
211 if (info()->saves_caller_doubles()) { | 211 if (info()->saves_caller_doubles()) { |
212 SaveCallerDoubles(); | 212 SaveCallerDoubles(); |
213 } | 213 } |
214 } | 214 } |
215 | 215 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 // Generate the OSR entry prologue at the first unknown OSR value, or if there | 262 // Generate the OSR entry prologue at the first unknown OSR value, or if there |
263 // are none, at the OSR entrypoint instruction. | 263 // are none, at the OSR entrypoint instruction. |
264 if (osr_pc_offset_ >= 0) return; | 264 if (osr_pc_offset_ >= 0) return; |
265 | 265 |
266 osr_pc_offset_ = masm()->pc_offset(); | 266 osr_pc_offset_ = masm()->pc_offset(); |
267 | 267 |
268 // Adjust the frame size, subsuming the unoptimized frame into the | 268 // Adjust the frame size, subsuming the unoptimized frame into the |
269 // optimized frame. | 269 // optimized frame. |
270 int slots = GetStackSlotCount() - graph()->osr()->UnoptimizedFrameSlots(); | 270 int slots = GetStackSlotCount() - graph()->osr()->UnoptimizedFrameSlots(); |
271 ASSERT(slots >= 0); | 271 ASSERT(slots >= 0); |
272 __ subq(rsp, Immediate(slots * kPointerSize)); | 272 __ subp(rsp, Immediate(slots * kPointerSize)); |
273 } | 273 } |
274 | 274 |
275 | 275 |
276 void LCodeGen::GenerateBodyInstructionPre(LInstruction* instr) { | 276 void LCodeGen::GenerateBodyInstructionPre(LInstruction* instr) { |
277 if (!instr->IsLazyBailout() && !instr->IsGap()) { | 277 if (!instr->IsLazyBailout() && !instr->IsGap()) { |
278 safepoints_.BumpLastLazySafepointIndex(); | 278 safepoints_.BumpLastLazySafepointIndex(); |
279 } | 279 } |
280 } | 280 } |
281 | 281 |
282 | 282 |
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 default: | 1341 default: |
1342 __ imull(left, left, Immediate(right_value)); | 1342 __ imull(left, left, Immediate(right_value)); |
1343 break; | 1343 break; |
1344 } | 1344 } |
1345 } else { | 1345 } else { |
1346 __ imull(left, left, Immediate(right_value)); | 1346 __ imull(left, left, Immediate(right_value)); |
1347 } | 1347 } |
1348 } else if (right->IsStackSlot()) { | 1348 } else if (right->IsStackSlot()) { |
1349 if (instr->hydrogen_value()->representation().IsSmi()) { | 1349 if (instr->hydrogen_value()->representation().IsSmi()) { |
1350 __ SmiToInteger64(left, left); | 1350 __ SmiToInteger64(left, left); |
1351 __ imul(left, ToOperand(right)); | 1351 __ imulp(left, ToOperand(right)); |
1352 } else { | 1352 } else { |
1353 __ imull(left, ToOperand(right)); | 1353 __ imull(left, ToOperand(right)); |
1354 } | 1354 } |
1355 } else { | 1355 } else { |
1356 if (instr->hydrogen_value()->representation().IsSmi()) { | 1356 if (instr->hydrogen_value()->representation().IsSmi()) { |
1357 __ SmiToInteger64(left, left); | 1357 __ SmiToInteger64(left, left); |
1358 __ imul(left, ToRegister(right)); | 1358 __ imulp(left, ToRegister(right)); |
1359 } else { | 1359 } else { |
1360 __ imull(left, ToRegister(right)); | 1360 __ imull(left, ToRegister(right)); |
1361 } | 1361 } |
1362 } | 1362 } |
1363 | 1363 |
1364 if (can_overflow) { | 1364 if (can_overflow) { |
1365 DeoptimizeIf(overflow, instr->environment()); | 1365 DeoptimizeIf(overflow, instr->environment()); |
1366 } | 1366 } |
1367 | 1367 |
1368 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 1368 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1536 void LCodeGen::DoSubI(LSubI* instr) { | 1536 void LCodeGen::DoSubI(LSubI* instr) { |
1537 LOperand* left = instr->left(); | 1537 LOperand* left = instr->left(); |
1538 LOperand* right = instr->right(); | 1538 LOperand* right = instr->right(); |
1539 ASSERT(left->Equals(instr->result())); | 1539 ASSERT(left->Equals(instr->result())); |
1540 | 1540 |
1541 if (right->IsConstantOperand()) { | 1541 if (right->IsConstantOperand()) { |
1542 __ subl(ToRegister(left), | 1542 __ subl(ToRegister(left), |
1543 Immediate(ToInteger32(LConstantOperand::cast(right)))); | 1543 Immediate(ToInteger32(LConstantOperand::cast(right)))); |
1544 } else if (right->IsRegister()) { | 1544 } else if (right->IsRegister()) { |
1545 if (instr->hydrogen_value()->representation().IsSmi()) { | 1545 if (instr->hydrogen_value()->representation().IsSmi()) { |
1546 __ subq(ToRegister(left), ToRegister(right)); | 1546 __ subp(ToRegister(left), ToRegister(right)); |
1547 } else { | 1547 } else { |
1548 __ subl(ToRegister(left), ToRegister(right)); | 1548 __ subl(ToRegister(left), ToRegister(right)); |
1549 } | 1549 } |
1550 } else { | 1550 } else { |
1551 if (instr->hydrogen_value()->representation().IsSmi()) { | 1551 if (instr->hydrogen_value()->representation().IsSmi()) { |
1552 __ subq(ToRegister(left), ToOperand(right)); | 1552 __ subp(ToRegister(left), ToOperand(right)); |
1553 } else { | 1553 } else { |
1554 __ subl(ToRegister(left), ToOperand(right)); | 1554 __ subl(ToRegister(left), ToOperand(right)); |
1555 } | 1555 } |
1556 } | 1556 } |
1557 | 1557 |
1558 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { | 1558 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { |
1559 DeoptimizeIf(overflow, instr->environment()); | 1559 DeoptimizeIf(overflow, instr->environment()); |
1560 } | 1560 } |
1561 } | 1561 } |
1562 | 1562 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 } | 1724 } |
1725 } | 1725 } |
1726 } | 1726 } |
1727 | 1727 |
1728 | 1728 |
1729 void LCodeGen::DoAddI(LAddI* instr) { | 1729 void LCodeGen::DoAddI(LAddI* instr) { |
1730 LOperand* left = instr->left(); | 1730 LOperand* left = instr->left(); |
1731 LOperand* right = instr->right(); | 1731 LOperand* right = instr->right(); |
1732 | 1732 |
1733 Representation target_rep = instr->hydrogen()->representation(); | 1733 Representation target_rep = instr->hydrogen()->representation(); |
1734 bool is_q = target_rep.IsSmi() || target_rep.IsExternal(); | 1734 bool is_p = target_rep.IsSmi() || target_rep.IsExternal(); |
1735 | 1735 |
1736 if (LAddI::UseLea(instr->hydrogen()) && !left->Equals(instr->result())) { | 1736 if (LAddI::UseLea(instr->hydrogen()) && !left->Equals(instr->result())) { |
1737 if (right->IsConstantOperand()) { | 1737 if (right->IsConstantOperand()) { |
1738 int32_t offset = ToInteger32(LConstantOperand::cast(right)); | 1738 int32_t offset = ToInteger32(LConstantOperand::cast(right)); |
1739 if (is_q) { | 1739 if (is_p) { |
1740 __ lea(ToRegister(instr->result()), | 1740 __ lea(ToRegister(instr->result()), |
1741 MemOperand(ToRegister(left), offset)); | 1741 MemOperand(ToRegister(left), offset)); |
1742 } else { | 1742 } else { |
1743 __ leal(ToRegister(instr->result()), | 1743 __ leal(ToRegister(instr->result()), |
1744 MemOperand(ToRegister(left), offset)); | 1744 MemOperand(ToRegister(left), offset)); |
1745 } | 1745 } |
1746 } else { | 1746 } else { |
1747 Operand address(ToRegister(left), ToRegister(right), times_1, 0); | 1747 Operand address(ToRegister(left), ToRegister(right), times_1, 0); |
1748 if (is_q) { | 1748 if (is_p) { |
1749 __ lea(ToRegister(instr->result()), address); | 1749 __ lea(ToRegister(instr->result()), address); |
1750 } else { | 1750 } else { |
1751 __ leal(ToRegister(instr->result()), address); | 1751 __ leal(ToRegister(instr->result()), address); |
1752 } | 1752 } |
1753 } | 1753 } |
1754 } else { | 1754 } else { |
1755 if (right->IsConstantOperand()) { | 1755 if (right->IsConstantOperand()) { |
1756 if (is_q) { | 1756 if (is_p) { |
1757 __ addq(ToRegister(left), | 1757 __ addp(ToRegister(left), |
1758 Immediate(ToInteger32(LConstantOperand::cast(right)))); | 1758 Immediate(ToInteger32(LConstantOperand::cast(right)))); |
1759 } else { | 1759 } else { |
1760 __ addl(ToRegister(left), | 1760 __ addl(ToRegister(left), |
1761 Immediate(ToInteger32(LConstantOperand::cast(right)))); | 1761 Immediate(ToInteger32(LConstantOperand::cast(right)))); |
1762 } | 1762 } |
1763 } else if (right->IsRegister()) { | 1763 } else if (right->IsRegister()) { |
1764 if (is_q) { | 1764 if (is_p) { |
1765 __ addq(ToRegister(left), ToRegister(right)); | 1765 __ addp(ToRegister(left), ToRegister(right)); |
1766 } else { | 1766 } else { |
1767 __ addl(ToRegister(left), ToRegister(right)); | 1767 __ addl(ToRegister(left), ToRegister(right)); |
1768 } | 1768 } |
1769 } else { | 1769 } else { |
1770 if (is_q) { | 1770 if (is_p) { |
1771 __ addq(ToRegister(left), ToOperand(right)); | 1771 __ addp(ToRegister(left), ToOperand(right)); |
1772 } else { | 1772 } else { |
1773 __ addl(ToRegister(left), ToOperand(right)); | 1773 __ addl(ToRegister(left), ToOperand(right)); |
1774 } | 1774 } |
1775 } | 1775 } |
1776 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { | 1776 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { |
1777 DeoptimizeIf(overflow, instr->environment()); | 1777 DeoptimizeIf(overflow, instr->environment()); |
1778 } | 1778 } |
1779 } | 1779 } |
1780 } | 1780 } |
1781 | 1781 |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2200 Register input_reg = ToRegister(instr->object()); | 2200 Register input_reg = ToRegister(instr->object()); |
2201 __ Cmp(input_reg, factory()->the_hole_value()); | 2201 __ Cmp(input_reg, factory()->the_hole_value()); |
2202 EmitBranch(instr, equal); | 2202 EmitBranch(instr, equal); |
2203 return; | 2203 return; |
2204 } | 2204 } |
2205 | 2205 |
2206 XMMRegister input_reg = ToDoubleRegister(instr->object()); | 2206 XMMRegister input_reg = ToDoubleRegister(instr->object()); |
2207 __ ucomisd(input_reg, input_reg); | 2207 __ ucomisd(input_reg, input_reg); |
2208 EmitFalseBranch(instr, parity_odd); | 2208 EmitFalseBranch(instr, parity_odd); |
2209 | 2209 |
2210 __ subq(rsp, Immediate(kDoubleSize)); | 2210 __ subp(rsp, Immediate(kDoubleSize)); |
2211 __ movsd(MemOperand(rsp, 0), input_reg); | 2211 __ movsd(MemOperand(rsp, 0), input_reg); |
2212 __ addq(rsp, Immediate(kDoubleSize)); | 2212 __ addp(rsp, Immediate(kDoubleSize)); |
2213 | 2213 |
2214 int offset = sizeof(kHoleNanUpper32); | 2214 int offset = sizeof(kHoleNanUpper32); |
2215 __ cmpl(MemOperand(rsp, -offset), Immediate(kHoleNanUpper32)); | 2215 __ cmpl(MemOperand(rsp, -offset), Immediate(kHoleNanUpper32)); |
2216 EmitBranch(instr, equal); | 2216 EmitBranch(instr, equal); |
2217 } | 2217 } |
2218 | 2218 |
2219 | 2219 |
2220 void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) { | 2220 void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) { |
2221 Representation rep = instr->hydrogen()->value()->representation(); | 2221 Representation rep = instr->hydrogen()->value()->representation(); |
2222 ASSERT(!rep.IsInteger32()); | 2222 ASSERT(!rep.IsInteger32()); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2429 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, temp); | 2429 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, temp); |
2430 __ j(below, is_false); | 2430 __ j(below, is_false); |
2431 __ j(equal, is_true); | 2431 __ j(equal, is_true); |
2432 __ CmpInstanceType(temp, LAST_SPEC_OBJECT_TYPE); | 2432 __ CmpInstanceType(temp, LAST_SPEC_OBJECT_TYPE); |
2433 __ j(equal, is_true); | 2433 __ j(equal, is_true); |
2434 } else { | 2434 } else { |
2435 // Faster code path to avoid two compares: subtract lower bound from the | 2435 // Faster code path to avoid two compares: subtract lower bound from the |
2436 // actual type and do a signed compare with the width of the type range. | 2436 // actual type and do a signed compare with the width of the type range. |
2437 __ movp(temp, FieldOperand(input, HeapObject::kMapOffset)); | 2437 __ movp(temp, FieldOperand(input, HeapObject::kMapOffset)); |
2438 __ movzxbl(temp2, FieldOperand(temp, Map::kInstanceTypeOffset)); | 2438 __ movzxbl(temp2, FieldOperand(temp, Map::kInstanceTypeOffset)); |
2439 __ subq(temp2, Immediate(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 2439 __ subp(temp2, Immediate(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
2440 __ cmpq(temp2, Immediate(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - | 2440 __ cmpq(temp2, Immediate(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - |
2441 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 2441 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
2442 __ j(above, is_false); | 2442 __ j(above, is_false); |
2443 } | 2443 } |
2444 | 2444 |
2445 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. | 2445 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. |
2446 // Check if the constructor in the map is a function. | 2446 // Check if the constructor in the map is a function. |
2447 __ movp(temp, FieldOperand(temp, Map::kConstructorOffset)); | 2447 __ movp(temp, FieldOperand(temp, Map::kConstructorOffset)); |
2448 | 2448 |
2449 // Objects with a non-function constructor have class 'Object'. | 2449 // Objects with a non-function constructor have class 'Object'. |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2660 if (instr->has_constant_parameter_count()) { | 2660 if (instr->has_constant_parameter_count()) { |
2661 __ Ret((ToInteger32(instr->constant_parameter_count()) + 1) * kPointerSize, | 2661 __ Ret((ToInteger32(instr->constant_parameter_count()) + 1) * kPointerSize, |
2662 rcx); | 2662 rcx); |
2663 } else { | 2663 } else { |
2664 Register reg = ToRegister(instr->parameter_count()); | 2664 Register reg = ToRegister(instr->parameter_count()); |
2665 // The argument count parameter is a smi | 2665 // The argument count parameter is a smi |
2666 __ SmiToInteger32(reg, reg); | 2666 __ SmiToInteger32(reg, reg); |
2667 Register return_addr_reg = reg.is(rcx) ? rbx : rcx; | 2667 Register return_addr_reg = reg.is(rcx) ? rbx : rcx; |
2668 __ PopReturnAddressTo(return_addr_reg); | 2668 __ PopReturnAddressTo(return_addr_reg); |
2669 __ shl(reg, Immediate(kPointerSizeLog2)); | 2669 __ shl(reg, Immediate(kPointerSizeLog2)); |
2670 __ addq(rsp, reg); | 2670 __ addp(rsp, reg); |
2671 __ jmp(return_addr_reg); | 2671 __ jmp(return_addr_reg); |
2672 } | 2672 } |
2673 if (no_frame_start != -1) { | 2673 if (no_frame_start != -1) { |
2674 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | 2674 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
2675 } | 2675 } |
2676 } | 2676 } |
2677 | 2677 |
2678 | 2678 |
2679 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { | 2679 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { |
2680 Register result = ToRegister(instr->result()); | 2680 Register result = ToRegister(instr->result()); |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3384 | 3384 |
3385 if (instr->target()->IsConstantOperand()) { | 3385 if (instr->target()->IsConstantOperand()) { |
3386 LConstantOperand* target = LConstantOperand::cast(instr->target()); | 3386 LConstantOperand* target = LConstantOperand::cast(instr->target()); |
3387 Handle<Code> code = Handle<Code>::cast(ToHandle(target)); | 3387 Handle<Code> code = Handle<Code>::cast(ToHandle(target)); |
3388 generator.BeforeCall(__ CallSize(code)); | 3388 generator.BeforeCall(__ CallSize(code)); |
3389 __ call(code, RelocInfo::CODE_TARGET); | 3389 __ call(code, RelocInfo::CODE_TARGET); |
3390 } else { | 3390 } else { |
3391 ASSERT(instr->target()->IsRegister()); | 3391 ASSERT(instr->target()->IsRegister()); |
3392 Register target = ToRegister(instr->target()); | 3392 Register target = ToRegister(instr->target()); |
3393 generator.BeforeCall(__ CallSize(target)); | 3393 generator.BeforeCall(__ CallSize(target)); |
3394 __ addq(target, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 3394 __ addp(target, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
3395 __ call(target); | 3395 __ call(target); |
3396 } | 3396 } |
3397 generator.AfterCall(); | 3397 generator.AfterCall(); |
3398 } | 3398 } |
3399 | 3399 |
3400 | 3400 |
3401 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { | 3401 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { |
3402 ASSERT(ToRegister(instr->function()).is(rdi)); | 3402 ASSERT(ToRegister(instr->function()).is(rdi)); |
3403 ASSERT(ToRegister(instr->result()).is(rax)); | 3403 ASSERT(ToRegister(instr->result()).is(rax)); |
3404 | 3404 |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3756 __ movsd(input_reg, nan_operand); | 3756 __ movsd(input_reg, nan_operand); |
3757 __ jmp(&done, Label::kNear); | 3757 __ jmp(&done, Label::kNear); |
3758 __ bind(&zero); | 3758 __ bind(&zero); |
3759 ExternalReference ninf = | 3759 ExternalReference ninf = |
3760 ExternalReference::address_of_negative_infinity(); | 3760 ExternalReference::address_of_negative_infinity(); |
3761 Operand ninf_operand = masm()->ExternalOperand(ninf); | 3761 Operand ninf_operand = masm()->ExternalOperand(ninf); |
3762 __ movsd(input_reg, ninf_operand); | 3762 __ movsd(input_reg, ninf_operand); |
3763 __ jmp(&done, Label::kNear); | 3763 __ jmp(&done, Label::kNear); |
3764 __ bind(&positive); | 3764 __ bind(&positive); |
3765 __ fldln2(); | 3765 __ fldln2(); |
3766 __ subq(rsp, Immediate(kDoubleSize)); | 3766 __ subp(rsp, Immediate(kDoubleSize)); |
3767 __ movsd(Operand(rsp, 0), input_reg); | 3767 __ movsd(Operand(rsp, 0), input_reg); |
3768 __ fld_d(Operand(rsp, 0)); | 3768 __ fld_d(Operand(rsp, 0)); |
3769 __ fyl2x(); | 3769 __ fyl2x(); |
3770 __ fstp_d(Operand(rsp, 0)); | 3770 __ fstp_d(Operand(rsp, 0)); |
3771 __ movsd(input_reg, Operand(rsp, 0)); | 3771 __ movsd(input_reg, Operand(rsp, 0)); |
3772 __ addq(rsp, Immediate(kDoubleSize)); | 3772 __ addp(rsp, Immediate(kDoubleSize)); |
3773 __ bind(&done); | 3773 __ bind(&done); |
3774 } | 3774 } |
3775 | 3775 |
3776 | 3776 |
3777 void LCodeGen::DoMathClz32(LMathClz32* instr) { | 3777 void LCodeGen::DoMathClz32(LMathClz32* instr) { |
3778 Register input = ToRegister(instr->value()); | 3778 Register input = ToRegister(instr->value()); |
3779 Register result = ToRegister(instr->result()); | 3779 Register result = ToRegister(instr->result()); |
3780 Label not_zero_input; | 3780 Label not_zero_input; |
3781 __ bsrl(result, input); | 3781 __ bsrl(result, input); |
3782 | 3782 |
(...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5636 FixedArray::kHeaderSize - kPointerSize)); | 5636 FixedArray::kHeaderSize - kPointerSize)); |
5637 __ bind(&done); | 5637 __ bind(&done); |
5638 } | 5638 } |
5639 | 5639 |
5640 | 5640 |
5641 #undef __ | 5641 #undef __ |
5642 | 5642 |
5643 } } // namespace v8::internal | 5643 } } // namespace v8::internal |
5644 | 5644 |
5645 #endif // V8_TARGET_ARCH_X64 | 5645 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |