| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 __ jmp(&int_exponent); | 433 __ jmp(&int_exponent); |
| 434 | 434 |
| 435 __ bind(&exponent_not_smi); | 435 __ bind(&exponent_not_smi); |
| 436 __ movsd(double_exponent, | 436 __ movsd(double_exponent, |
| 437 FieldOperand(exponent, HeapNumber::kValueOffset)); | 437 FieldOperand(exponent, HeapNumber::kValueOffset)); |
| 438 } | 438 } |
| 439 | 439 |
| 440 if (exponent_type() != INTEGER) { | 440 if (exponent_type() != INTEGER) { |
| 441 Label fast_power, try_arithmetic_simplification; | 441 Label fast_power, try_arithmetic_simplification; |
| 442 __ DoubleToI(exponent, double_exponent, double_scratch, | 442 __ DoubleToI(exponent, double_exponent, double_scratch, |
| 443 TREAT_MINUS_ZERO_AS_ZERO, &try_arithmetic_simplification); | 443 TREAT_MINUS_ZERO_AS_ZERO, &try_arithmetic_simplification, |
| 444 &try_arithmetic_simplification, |
| 445 &try_arithmetic_simplification); |
| 444 __ jmp(&int_exponent); | 446 __ jmp(&int_exponent); |
| 445 | 447 |
| 446 __ bind(&try_arithmetic_simplification); | 448 __ bind(&try_arithmetic_simplification); |
| 447 // Skip to runtime if possibly NaN (indicated by the indefinite integer). | 449 // Skip to runtime if possibly NaN (indicated by the indefinite integer). |
| 448 __ cvttsd2si(exponent, Operand(double_exponent)); | 450 __ cvttsd2si(exponent, Operand(double_exponent)); |
| 449 __ cmp(exponent, Immediate(0x1)); | 451 __ cmp(exponent, Immediate(0x1)); |
| 450 __ j(overflow, &call_runtime); | 452 __ j(overflow, &call_runtime); |
| 451 | 453 |
| 452 if (exponent_type() == ON_STACK) { | 454 if (exponent_type() == ON_STACK) { |
| 453 // Detect square root case. Crankshaft detects constant +/-0.5 at | 455 // Detect square root case. Crankshaft detects constant +/-0.5 at |
| (...skipping 4245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4699 Operand(ebp, 7 * kPointerSize), | 4701 Operand(ebp, 7 * kPointerSize), |
| 4700 NULL); | 4702 NULL); |
| 4701 } | 4703 } |
| 4702 | 4704 |
| 4703 | 4705 |
| 4704 #undef __ | 4706 #undef __ |
| 4705 | 4707 |
| 4706 } } // namespace v8::internal | 4708 } } // namespace v8::internal |
| 4707 | 4709 |
| 4708 #endif // V8_TARGET_ARCH_IA32 | 4710 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |