| 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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 } | 667 } |
| 668 } | 668 } |
| 669 | 669 |
| 670 | 670 |
| 671 void FullCodeGenerator::DoTest(Expression* condition, | 671 void FullCodeGenerator::DoTest(Expression* condition, |
| 672 Label* if_true, | 672 Label* if_true, |
| 673 Label* if_false, | 673 Label* if_false, |
| 674 Label* fall_through) { | 674 Label* fall_through) { |
| 675 Handle<Code> ic = ToBooleanStub::GetUninitialized(isolate()); | 675 Handle<Code> ic = ToBooleanStub::GetUninitialized(isolate()); |
| 676 CallIC(ic, condition->test_id()); | 676 CallIC(ic, condition->test_id()); |
| 677 __ CompareAndSplit(result_register(), 0, ne, if_true, if_false, fall_through); | 677 __ CompareRoot(result_register(), Heap::kTrueValueRootIndex); |
| 678 Split(eq, if_true, if_false, fall_through); |
| 678 } | 679 } |
| 679 | 680 |
| 680 | 681 |
| 681 // If (cond), branch to if_true. | 682 // If (cond), branch to if_true. |
| 682 // If (!cond), branch to if_false. | 683 // If (!cond), branch to if_false. |
| 683 // fall_through is used as an optimization in cases where only one branch | 684 // fall_through is used as an optimization in cases where only one branch |
| 684 // instruction is necessary. | 685 // instruction is necessary. |
| 685 void FullCodeGenerator::Split(Condition cond, | 686 void FullCodeGenerator::Split(Condition cond, |
| 686 Label* if_true, | 687 Label* if_true, |
| 687 Label* if_false, | 688 Label* if_false, |
| (...skipping 3914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4602 __ Move(load_receiver, x0); | 4603 __ Move(load_receiver, x0); |
| 4603 | 4604 |
| 4604 __ Push(load_receiver); // save result | 4605 __ Push(load_receiver); // save result |
| 4605 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" | 4606 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" |
| 4606 __ Mov(LoadDescriptor::SlotRegister(), | 4607 __ Mov(LoadDescriptor::SlotRegister(), |
| 4607 SmiFromSlot(expr->DoneFeedbackSlot())); | 4608 SmiFromSlot(expr->DoneFeedbackSlot())); |
| 4608 CallLoadIC(NOT_INSIDE_TYPEOF); // x0=result.done | 4609 CallLoadIC(NOT_INSIDE_TYPEOF); // x0=result.done |
| 4609 // The ToBooleanStub argument (result.done) is in x0. | 4610 // The ToBooleanStub argument (result.done) is in x0. |
| 4610 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); | 4611 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); |
| 4611 CallIC(bool_ic); | 4612 CallIC(bool_ic); |
| 4612 __ Cbz(x0, &l_try); | 4613 __ CompareRoot(result_register(), Heap::kTrueValueRootIndex); |
| 4614 __ B(ne, &l_try); |
| 4613 | 4615 |
| 4614 // result.value | 4616 // result.value |
| 4615 __ Pop(load_receiver); // result | 4617 __ Pop(load_receiver); // result |
| 4616 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" | 4618 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" |
| 4617 __ Mov(LoadDescriptor::SlotRegister(), | 4619 __ Mov(LoadDescriptor::SlotRegister(), |
| 4618 SmiFromSlot(expr->ValueFeedbackSlot())); | 4620 SmiFromSlot(expr->ValueFeedbackSlot())); |
| 4619 CallLoadIC(NOT_INSIDE_TYPEOF); // x0=result.value | 4621 CallLoadIC(NOT_INSIDE_TYPEOF); // x0=result.value |
| 4620 context()->DropAndPlug(2, x0); // drop iter and g | 4622 context()->DropAndPlug(2, x0); // drop iter and g |
| 4621 break; | 4623 break; |
| 4622 } | 4624 } |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4951 } | 4953 } |
| 4952 | 4954 |
| 4953 return INTERRUPT; | 4955 return INTERRUPT; |
| 4954 } | 4956 } |
| 4955 | 4957 |
| 4956 | 4958 |
| 4957 } // namespace internal | 4959 } // namespace internal |
| 4958 } // namespace v8 | 4960 } // namespace v8 |
| 4959 | 4961 |
| 4960 #endif // V8_TARGET_ARCH_ARM64 | 4962 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |