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 4134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4145 | 4145 |
4146 Label retry; | 4146 Label retry; |
4147 // If the returned exception is RETRY_AFTER_GC continue at retry label | 4147 // If the returned exception is RETRY_AFTER_GC continue at retry label |
4148 STATIC_ASSERT(Failure::RETRY_AFTER_GC == 0); | 4148 STATIC_ASSERT(Failure::RETRY_AFTER_GC == 0); |
4149 __ testl(rax, Immediate(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize)); | 4149 __ testl(rax, Immediate(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize)); |
4150 __ j(zero, &retry, Label::kNear); | 4150 __ j(zero, &retry, Label::kNear); |
4151 | 4151 |
4152 // Special handling of out of memory exceptions. | 4152 // Special handling of out of memory exceptions. |
4153 JumpIfOOM(masm, rax, kScratchRegister, throw_out_of_memory_exception); | 4153 JumpIfOOM(masm, rax, kScratchRegister, throw_out_of_memory_exception); |
4154 | 4154 |
4155 // Retrieve the pending exception and clear the variable. | 4155 // Retrieve the pending exception. |
4156 ExternalReference pending_exception_address( | 4156 ExternalReference pending_exception_address( |
4157 Isolate::kPendingExceptionAddress, masm->isolate()); | 4157 Isolate::kPendingExceptionAddress, masm->isolate()); |
4158 Operand pending_exception_operand = | 4158 Operand pending_exception_operand = |
4159 masm->ExternalOperand(pending_exception_address); | 4159 masm->ExternalOperand(pending_exception_address); |
4160 __ movq(rax, pending_exception_operand); | 4160 __ movq(rax, pending_exception_operand); |
4161 | |
4162 // See if we just retrieved an OOM exception. | |
4163 JumpIfOOM(masm, rax, kScratchRegister, throw_out_of_memory_exception); | |
4164 | |
4165 // Clear the pending exception. | |
4166 pending_exception_operand = | |
4167 masm->ExternalOperand(pending_exception_address); | |
Michael Starzinger
2013/04/16 12:09:45
nit: Do we really need to recompute the operand he
Jakob Kummerow
2013/04/16 12:13:11
Yes, we need to, because the call to masm->Externa
| |
4161 __ LoadRoot(rdx, Heap::kTheHoleValueRootIndex); | 4168 __ LoadRoot(rdx, Heap::kTheHoleValueRootIndex); |
4162 __ movq(pending_exception_operand, rdx); | 4169 __ movq(pending_exception_operand, rdx); |
4163 | 4170 |
4164 // Special handling of termination exceptions which are uncatchable | 4171 // Special handling of termination exceptions which are uncatchable |
4165 // by javascript code. | 4172 // by javascript code. |
4166 __ CompareRoot(rax, Heap::kTerminationExceptionRootIndex); | 4173 __ CompareRoot(rax, Heap::kTerminationExceptionRootIndex); |
4167 __ j(equal, throw_termination_exception); | 4174 __ j(equal, throw_termination_exception); |
4168 | 4175 |
4169 // Handle normal exception. | 4176 // Handle normal exception. |
4170 __ jmp(throw_normal_exception); | 4177 __ jmp(throw_normal_exception); |
(...skipping 2537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6708 #endif | 6715 #endif |
6709 | 6716 |
6710 __ Ret(); | 6717 __ Ret(); |
6711 } | 6718 } |
6712 | 6719 |
6713 #undef __ | 6720 #undef __ |
6714 | 6721 |
6715 } } // namespace v8::internal | 6722 } } // namespace v8::internal |
6716 | 6723 |
6717 #endif // V8_TARGET_ARCH_X64 | 6724 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |