OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 movq(Operand(base_reg, kNextOffset), prev_next_address_reg); | 744 movq(Operand(base_reg, kNextOffset), prev_next_address_reg); |
745 cmpq(prev_limit_reg, Operand(base_reg, kLimitOffset)); | 745 cmpq(prev_limit_reg, Operand(base_reg, kLimitOffset)); |
746 j(not_equal, &delete_allocated_handles); | 746 j(not_equal, &delete_allocated_handles); |
747 bind(&leave_exit_frame); | 747 bind(&leave_exit_frame); |
748 | 748 |
749 // Check if the function scheduled an exception. | 749 // Check if the function scheduled an exception. |
750 movq(rsi, scheduled_exception_address); | 750 movq(rsi, scheduled_exception_address); |
751 Cmp(Operand(rsi, 0), factory->the_hole_value()); | 751 Cmp(Operand(rsi, 0), factory->the_hole_value()); |
752 j(not_equal, &promote_scheduled_exception); | 752 j(not_equal, &promote_scheduled_exception); |
753 | 753 |
| 754 #if ENABLE_EXTRA_CHECKS |
| 755 // Check if the function returned a valid JavaScript value. |
| 756 Label ok; |
| 757 Register return_value = rax; |
| 758 Register map = rcx; |
| 759 |
| 760 JumpIfSmi(return_value, &ok, Label::kNear); |
| 761 movq(map, FieldOperand(return_value, HeapObject::kMapOffset)); |
| 762 |
| 763 CmpInstanceType(map, FIRST_NONSTRING_TYPE); |
| 764 j(below, &ok, Label::kNear); |
| 765 |
| 766 CmpInstanceType(map, FIRST_SPEC_OBJECT_TYPE); |
| 767 j(above_equal, &ok, Label::kNear); |
| 768 |
| 769 CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
| 770 j(equal, &ok, Label::kNear); |
| 771 |
| 772 CompareRoot(return_value, Heap::kUndefinedValueRootIndex); |
| 773 j(equal, &ok, Label::kNear); |
| 774 |
| 775 CompareRoot(return_value, Heap::kTrueValueRootIndex); |
| 776 j(equal, &ok, Label::kNear); |
| 777 |
| 778 CompareRoot(return_value, Heap::kFalseValueRootIndex); |
| 779 j(equal, &ok, Label::kNear); |
| 780 |
| 781 CompareRoot(return_value, Heap::kNullValueRootIndex); |
| 782 j(equal, &ok, Label::kNear); |
| 783 |
| 784 Abort("API call returned invalid object"); |
| 785 |
| 786 bind(&ok); |
| 787 #endif |
| 788 |
754 LeaveApiExitFrame(); | 789 LeaveApiExitFrame(); |
755 ret(stack_space * kPointerSize); | 790 ret(stack_space * kPointerSize); |
756 | 791 |
757 bind(&empty_result); | 792 bind(&empty_result); |
758 // It was zero; the result is undefined. | 793 // It was zero; the result is undefined. |
759 LoadRoot(rax, Heap::kUndefinedValueRootIndex); | 794 LoadRoot(rax, Heap::kUndefinedValueRootIndex); |
760 jmp(&prologue); | 795 jmp(&prologue); |
761 | 796 |
762 bind(&promote_scheduled_exception); | 797 bind(&promote_scheduled_exception); |
763 TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1); | 798 TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1); |
(...skipping 3757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4521 | 4556 |
4522 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); | 4557 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); |
4523 cmpq(rcx, null_value); | 4558 cmpq(rcx, null_value); |
4524 j(not_equal, &next); | 4559 j(not_equal, &next); |
4525 } | 4560 } |
4526 | 4561 |
4527 | 4562 |
4528 } } // namespace v8::internal | 4563 } } // namespace v8::internal |
4529 | 4564 |
4530 #endif // V8_TARGET_ARCH_X64 | 4565 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |