Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 14066009: Handle OOM failures correctly in the CEntryStub when embedders set V8::IgnoreOutOfMemoryException() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 5047 matching lines...) Expand 10 before | Expand all | Expand 10 after
5058 5058
5059 Label retry; 5059 Label retry;
5060 // If the returned exception is RETRY_AFTER_GC continue at retry label 5060 // If the returned exception is RETRY_AFTER_GC continue at retry label
5061 STATIC_ASSERT(Failure::RETRY_AFTER_GC == 0); 5061 STATIC_ASSERT(Failure::RETRY_AFTER_GC == 0);
5062 __ test(eax, Immediate(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize)); 5062 __ test(eax, Immediate(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize));
5063 __ j(zero, &retry, Label::kNear); 5063 __ j(zero, &retry, Label::kNear);
5064 5064
5065 // Special handling of out of memory exceptions. 5065 // Special handling of out of memory exceptions.
5066 JumpIfOOM(masm, eax, ecx, throw_out_of_memory_exception); 5066 JumpIfOOM(masm, eax, ecx, throw_out_of_memory_exception);
5067 5067
5068 // Retrieve the pending exception and clear the variable. 5068 // Retrieve the pending exception.
5069 __ mov(eax, Operand::StaticVariable(pending_exception_address)); 5069 __ mov(eax, Operand::StaticVariable(pending_exception_address));
5070
5071 // See if we just retrieved an OOM exception.
5072 JumpIfOOM(masm, eax, ecx, throw_out_of_memory_exception);
5073
5074 // Clear the pending exception.
5070 __ mov(edx, Immediate(masm->isolate()->factory()->the_hole_value())); 5075 __ mov(edx, Immediate(masm->isolate()->factory()->the_hole_value()));
5071 __ mov(Operand::StaticVariable(pending_exception_address), edx); 5076 __ mov(Operand::StaticVariable(pending_exception_address), edx);
5072 5077
5073 // Special handling of termination exceptions which are uncatchable 5078 // Special handling of termination exceptions which are uncatchable
5074 // by javascript code. 5079 // by javascript code.
5075 __ cmp(eax, masm->isolate()->factory()->termination_exception()); 5080 __ cmp(eax, masm->isolate()->factory()->termination_exception());
5076 __ j(equal, throw_termination_exception); 5081 __ j(equal, throw_termination_exception);
5077 5082
5078 // Handle normal exception. 5083 // Handle normal exception.
5079 __ jmp(throw_normal_exception); 5084 __ jmp(throw_normal_exception);
(...skipping 2600 matching lines...) Expand 10 before | Expand all | Expand 10 after
7680 // Restore ecx. 7685 // Restore ecx.
7681 __ pop(ecx); 7686 __ pop(ecx);
7682 __ ret(0); 7687 __ ret(0);
7683 } 7688 }
7684 7689
7685 #undef __ 7690 #undef __
7686 7691
7687 } } // namespace v8::internal 7692 } } // namespace v8::internal
7688 7693
7689 #endif // V8_TARGET_ARCH_IA32 7694 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | src/x64/code-stubs-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698