| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/arm64/lithium-codegen-arm64.h" | 7 #include "src/arm64/lithium-codegen-arm64.h" |
| 8 #include "src/arm64/lithium-gap-resolver-arm64.h" | 8 #include "src/arm64/lithium-gap-resolver-arm64.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/stub-cache.h" | 10 #include "src/stub-cache.h" |
| (...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1841 | 1841 |
| 1842 | 1842 |
| 1843 void LCodeGen::DoBoundsCheck(LBoundsCheck *instr) { | 1843 void LCodeGen::DoBoundsCheck(LBoundsCheck *instr) { |
| 1844 Condition cond = instr->hydrogen()->allow_equality() ? hi : hs; | 1844 Condition cond = instr->hydrogen()->allow_equality() ? hi : hs; |
| 1845 ASSERT(instr->hydrogen()->index()->representation().IsInteger32()); | 1845 ASSERT(instr->hydrogen()->index()->representation().IsInteger32()); |
| 1846 ASSERT(instr->hydrogen()->length()->representation().IsInteger32()); | 1846 ASSERT(instr->hydrogen()->length()->representation().IsInteger32()); |
| 1847 if (instr->index()->IsConstantOperand()) { | 1847 if (instr->index()->IsConstantOperand()) { |
| 1848 Operand index = ToOperand32I(instr->index()); | 1848 Operand index = ToOperand32I(instr->index()); |
| 1849 Register length = ToRegister32(instr->length()); | 1849 Register length = ToRegister32(instr->length()); |
| 1850 __ Cmp(length, index); | 1850 __ Cmp(length, index); |
| 1851 cond = ReverseCondition(cond); | 1851 cond = CommuteCondition(cond); |
| 1852 } else { | 1852 } else { |
| 1853 Register index = ToRegister32(instr->index()); | 1853 Register index = ToRegister32(instr->index()); |
| 1854 Operand length = ToOperand32I(instr->length()); | 1854 Operand length = ToOperand32I(instr->length()); |
| 1855 __ Cmp(index, length); | 1855 __ Cmp(index, length); |
| 1856 } | 1856 } |
| 1857 if (FLAG_debug_code && instr->hydrogen()->skip_check()) { | 1857 if (FLAG_debug_code && instr->hydrogen()->skip_check()) { |
| 1858 __ Assert(NegateCondition(cond), kEliminatedBoundsCheckFailed); | 1858 __ Assert(NegateCondition(cond), kEliminatedBoundsCheckFailed); |
| 1859 } else { | 1859 } else { |
| 1860 DeoptimizeIf(cond, instr->environment()); | 1860 DeoptimizeIf(cond, instr->environment()); |
| 1861 } | 1861 } |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2479 double right_val = ToDouble(LConstantOperand::cast(right)); | 2479 double right_val = ToDouble(LConstantOperand::cast(right)); |
| 2480 int next_block = EvalComparison(instr->op(), left_val, right_val) ? | 2480 int next_block = EvalComparison(instr->op(), left_val, right_val) ? |
| 2481 instr->TrueDestination(chunk_) : instr->FalseDestination(chunk_); | 2481 instr->TrueDestination(chunk_) : instr->FalseDestination(chunk_); |
| 2482 EmitGoto(next_block); | 2482 EmitGoto(next_block); |
| 2483 } else { | 2483 } else { |
| 2484 if (instr->is_double()) { | 2484 if (instr->is_double()) { |
| 2485 if (right->IsConstantOperand()) { | 2485 if (right->IsConstantOperand()) { |
| 2486 __ Fcmp(ToDoubleRegister(left), | 2486 __ Fcmp(ToDoubleRegister(left), |
| 2487 ToDouble(LConstantOperand::cast(right))); | 2487 ToDouble(LConstantOperand::cast(right))); |
| 2488 } else if (left->IsConstantOperand()) { | 2488 } else if (left->IsConstantOperand()) { |
| 2489 // Transpose the operands and reverse the condition. | 2489 // Commute the operands and the condition. |
| 2490 __ Fcmp(ToDoubleRegister(right), | 2490 __ Fcmp(ToDoubleRegister(right), |
| 2491 ToDouble(LConstantOperand::cast(left))); | 2491 ToDouble(LConstantOperand::cast(left))); |
| 2492 cond = ReverseCondition(cond); | 2492 cond = CommuteCondition(cond); |
| 2493 } else { | 2493 } else { |
| 2494 __ Fcmp(ToDoubleRegister(left), ToDoubleRegister(right)); | 2494 __ Fcmp(ToDoubleRegister(left), ToDoubleRegister(right)); |
| 2495 } | 2495 } |
| 2496 | 2496 |
| 2497 // If a NaN is involved, i.e. the result is unordered (V set), | 2497 // If a NaN is involved, i.e. the result is unordered (V set), |
| 2498 // jump to false block label. | 2498 // jump to false block label. |
| 2499 __ B(vs, instr->FalseLabel(chunk_)); | 2499 __ B(vs, instr->FalseLabel(chunk_)); |
| 2500 EmitBranch(instr, cond); | 2500 EmitBranch(instr, cond); |
| 2501 } else { | 2501 } else { |
| 2502 if (instr->hydrogen_value()->representation().IsInteger32()) { | 2502 if (instr->hydrogen_value()->representation().IsInteger32()) { |
| 2503 if (right->IsConstantOperand()) { | 2503 if (right->IsConstantOperand()) { |
| 2504 EmitCompareAndBranch(instr, | 2504 EmitCompareAndBranch(instr, |
| 2505 cond, | 2505 cond, |
| 2506 ToRegister32(left), | 2506 ToRegister32(left), |
| 2507 ToOperand32I(right)); | 2507 ToOperand32I(right)); |
| 2508 } else { | 2508 } else { |
| 2509 // Transpose the operands and reverse the condition. | 2509 // Commute the operands and the condition. |
| 2510 EmitCompareAndBranch(instr, | 2510 EmitCompareAndBranch(instr, |
| 2511 ReverseCondition(cond), | 2511 CommuteCondition(cond), |
| 2512 ToRegister32(right), | 2512 ToRegister32(right), |
| 2513 ToOperand32I(left)); | 2513 ToOperand32I(left)); |
| 2514 } | 2514 } |
| 2515 } else { | 2515 } else { |
| 2516 ASSERT(instr->hydrogen_value()->representation().IsSmi()); | 2516 ASSERT(instr->hydrogen_value()->representation().IsSmi()); |
| 2517 if (right->IsConstantOperand()) { | 2517 if (right->IsConstantOperand()) { |
| 2518 int32_t value = ToInteger32(LConstantOperand::cast(right)); | 2518 int32_t value = ToInteger32(LConstantOperand::cast(right)); |
| 2519 EmitCompareAndBranch(instr, | 2519 EmitCompareAndBranch(instr, |
| 2520 cond, | 2520 cond, |
| 2521 ToRegister(left), | 2521 ToRegister(left), |
| 2522 Operand(Smi::FromInt(value))); | 2522 Operand(Smi::FromInt(value))); |
| 2523 } else if (left->IsConstantOperand()) { | 2523 } else if (left->IsConstantOperand()) { |
| 2524 // Transpose the operands and reverse the condition. | 2524 // Commute the operands and the condition. |
| 2525 int32_t value = ToInteger32(LConstantOperand::cast(left)); | 2525 int32_t value = ToInteger32(LConstantOperand::cast(left)); |
| 2526 EmitCompareAndBranch(instr, | 2526 EmitCompareAndBranch(instr, |
| 2527 ReverseCondition(cond), | 2527 CommuteCondition(cond), |
| 2528 ToRegister(right), | 2528 ToRegister(right), |
| 2529 Operand(Smi::FromInt(value))); | 2529 Operand(Smi::FromInt(value))); |
| 2530 } else { | 2530 } else { |
| 2531 EmitCompareAndBranch(instr, | 2531 EmitCompareAndBranch(instr, |
| 2532 cond, | 2532 cond, |
| 2533 ToRegister(left), | 2533 ToRegister(left), |
| 2534 ToRegister(right)); | 2534 ToRegister(right)); |
| 2535 } | 2535 } |
| 2536 } | 2536 } |
| 2537 } | 2537 } |
| (...skipping 3495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6033 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 6033 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| 6034 // Index is equal to negated out of object property index plus 1. | 6034 // Index is equal to negated out of object property index plus 1. |
| 6035 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 6035 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 6036 __ Ldr(result, FieldMemOperand(result, | 6036 __ Ldr(result, FieldMemOperand(result, |
| 6037 FixedArray::kHeaderSize - kPointerSize)); | 6037 FixedArray::kHeaderSize - kPointerSize)); |
| 6038 __ Bind(deferred->exit()); | 6038 __ Bind(deferred->exit()); |
| 6039 __ Bind(&done); | 6039 __ Bind(&done); |
| 6040 } | 6040 } |
| 6041 | 6041 |
| 6042 } } // namespace v8::internal | 6042 } } // namespace v8::internal |
| OLD | NEW |