| 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 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 Label skip; | 855 Label skip; |
| 856 test(esi, esi); | 856 test(esi, esi); |
| 857 j(zero, &skip, Label::kNear); | 857 j(zero, &skip, Label::kNear); |
| 858 mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi); | 858 mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi); |
| 859 bind(&skip); | 859 bind(&skip); |
| 860 | 860 |
| 861 JumpToHandlerEntry(); | 861 JumpToHandlerEntry(); |
| 862 } | 862 } |
| 863 | 863 |
| 864 | 864 |
| 865 void MacroAssembler::ThrowUncatchable(UncatchableExceptionType type, | 865 void MacroAssembler::ThrowUncatchable(Register value) { |
| 866 Register value) { | |
| 867 // Adjust this code if not the case. | 866 // Adjust this code if not the case. |
| 868 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); | 867 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); |
| 869 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 868 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
| 870 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); | 869 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); |
| 871 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); | 870 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); |
| 872 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); | 871 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); |
| 873 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); | 872 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); |
| 874 | 873 |
| 875 // The exception is expected in eax. | 874 // The exception is expected in eax. |
| 876 if (type == OUT_OF_MEMORY) { | 875 if (!value.is(eax)) { |
| 877 // Set external caught exception to false. | |
| 878 ExternalReference external_caught(Isolate::kExternalCaughtExceptionAddress, | |
| 879 isolate()); | |
| 880 mov(Operand::StaticVariable(external_caught), Immediate(false)); | |
| 881 | |
| 882 // Set pending exception and eax to out of memory exception. | |
| 883 ExternalReference pending_exception(Isolate::kPendingExceptionAddress, | |
| 884 isolate()); | |
| 885 mov(eax, reinterpret_cast<int32_t>(Failure::OutOfMemoryException())); | |
| 886 mov(Operand::StaticVariable(pending_exception), eax); | |
| 887 } else if (!value.is(eax)) { | |
| 888 mov(eax, value); | 876 mov(eax, value); |
| 889 } | 877 } |
| 890 | |
| 891 // Drop the stack pointer to the top of the top stack handler. | 878 // Drop the stack pointer to the top of the top stack handler. |
| 892 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); | 879 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); |
| 893 mov(esp, Operand::StaticVariable(handler_address)); | 880 mov(esp, Operand::StaticVariable(handler_address)); |
| 894 | 881 |
| 895 // Unwind the handlers until the top ENTRY handler is found. | 882 // Unwind the handlers until the top ENTRY handler is found. |
| 896 Label fetch_next, check_kind; | 883 Label fetch_next, check_kind; |
| 897 jmp(&check_kind, Label::kNear); | 884 jmp(&check_kind, Label::kNear); |
| 898 bind(&fetch_next); | 885 bind(&fetch_next); |
| 899 mov(esp, Operand(esp, StackHandlerConstants::kNextOffset)); | 886 mov(esp, Operand(esp, StackHandlerConstants::kNextOffset)); |
| 900 | 887 |
| (...skipping 1884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2785 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); | 2772 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); |
| 2786 Check(less_equal, "Live Bytes Count overflow chunk size"); | 2773 Check(less_equal, "Live Bytes Count overflow chunk size"); |
| 2787 } | 2774 } |
| 2788 | 2775 |
| 2789 bind(&done); | 2776 bind(&done); |
| 2790 } | 2777 } |
| 2791 | 2778 |
| 2792 } } // namespace v8::internal | 2779 } } // namespace v8::internal |
| 2793 | 2780 |
| 2794 #endif // V8_TARGET_ARCH_IA32 | 2781 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |