| 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/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
| (...skipping 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2477 | 2477 |
| 2478 if (left->IsConstantOperand() && right->IsConstantOperand()) { | 2478 if (left->IsConstantOperand() && right->IsConstantOperand()) { |
| 2479 // We can statically evaluate the comparison. | 2479 // We can statically evaluate the comparison. |
| 2480 double left_val = ToDouble(LConstantOperand::cast(left)); | 2480 double left_val = ToDouble(LConstantOperand::cast(left)); |
| 2481 double right_val = ToDouble(LConstantOperand::cast(right)); | 2481 double right_val = ToDouble(LConstantOperand::cast(right)); |
| 2482 int next_block = EvalComparison(instr->op(), left_val, right_val) ? | 2482 int next_block = EvalComparison(instr->op(), left_val, right_val) ? |
| 2483 instr->TrueDestination(chunk_) : instr->FalseDestination(chunk_); | 2483 instr->TrueDestination(chunk_) : instr->FalseDestination(chunk_); |
| 2484 EmitGoto(next_block); | 2484 EmitGoto(next_block); |
| 2485 } else { | 2485 } else { |
| 2486 if (instr->is_double()) { | 2486 if (instr->is_double()) { |
| 2487 if (right->IsConstantOperand()) { | 2487 __ Fcmp(ToDoubleRegister(left), ToDoubleRegister(right)); |
| 2488 __ Fcmp(ToDoubleRegister(left), | |
| 2489 ToDouble(LConstantOperand::cast(right))); | |
| 2490 } else if (left->IsConstantOperand()) { | |
| 2491 // Commute the operands and the condition. | |
| 2492 __ Fcmp(ToDoubleRegister(right), | |
| 2493 ToDouble(LConstantOperand::cast(left))); | |
| 2494 cond = CommuteCondition(cond); | |
| 2495 } else { | |
| 2496 __ Fcmp(ToDoubleRegister(left), ToDoubleRegister(right)); | |
| 2497 } | |
| 2498 | 2488 |
| 2499 // If a NaN is involved, i.e. the result is unordered (V set), | 2489 // If a NaN is involved, i.e. the result is unordered (V set), |
| 2500 // jump to false block label. | 2490 // jump to false block label. |
| 2501 __ B(vs, instr->FalseLabel(chunk_)); | 2491 __ B(vs, instr->FalseLabel(chunk_)); |
| 2502 EmitBranch(instr, cond); | 2492 EmitBranch(instr, cond); |
| 2503 } else { | 2493 } else { |
| 2504 if (instr->hydrogen_value()->representation().IsInteger32()) { | 2494 if (instr->hydrogen_value()->representation().IsInteger32()) { |
| 2505 if (right->IsConstantOperand()) { | 2495 if (right->IsConstantOperand()) { |
| 2506 EmitCompareAndBranch(instr, | 2496 EmitCompareAndBranch(instr, |
| 2507 cond, | 2497 cond, |
| (...skipping 3545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6053 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6043 Handle<ScopeInfo> scope_info = instr->scope_info(); |
| 6054 __ Push(scope_info); | 6044 __ Push(scope_info); |
| 6055 __ Push(ToRegister(instr->function())); | 6045 __ Push(ToRegister(instr->function())); |
| 6056 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6046 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6057 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6047 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6058 } | 6048 } |
| 6059 | 6049 |
| 6060 | 6050 |
| 6061 | 6051 |
| 6062 } } // namespace v8::internal | 6052 } } // namespace v8::internal |
| OLD | NEW |