OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 4937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4948 // eax: result parameter for PerformGC, if any (setup below) | 4948 // eax: result parameter for PerformGC, if any (setup below) |
4949 // ebx: pointer to builtin function (C callee-saved) | 4949 // ebx: pointer to builtin function (C callee-saved) |
4950 // ebp: frame pointer (restored after C call) | 4950 // ebp: frame pointer (restored after C call) |
4951 // esp: stack pointer (restored after C call) | 4951 // esp: stack pointer (restored after C call) |
4952 // edi: number of arguments including receiver (C callee-saved) | 4952 // edi: number of arguments including receiver (C callee-saved) |
4953 // esi: argv pointer (C callee-saved) | 4953 // esi: argv pointer (C callee-saved) |
4954 | 4954 |
4955 Label throw_out_of_memory_exception; | 4955 Label throw_out_of_memory_exception; |
4956 Label throw_normal_exception; | 4956 Label throw_normal_exception; |
4957 | 4957 |
4958 #ifdef DEBUG | 4958 // Call into the runtime system. Collect garbage before the call if |
| 4959 // running with --gc-greedy set. |
4959 if (FLAG_gc_greedy) { | 4960 if (FLAG_gc_greedy) { |
4960 Failure* failure = Failure::RetryAfterGC(0); | 4961 Failure* failure = Failure::RetryAfterGC(0); |
4961 __ mov(Operand(eax), Immediate(reinterpret_cast<int32_t>(failure))); | 4962 __ mov(Operand(eax), Immediate(reinterpret_cast<int32_t>(failure))); |
4962 } | 4963 } |
4963 GenerateCore(masm, &throw_normal_exception, | 4964 GenerateCore(masm, &throw_normal_exception, |
4964 &throw_out_of_memory_exception, | 4965 &throw_out_of_memory_exception, |
4965 frame_type, | 4966 frame_type, |
4966 FLAG_gc_greedy); | 4967 FLAG_gc_greedy); |
4967 #else | 4968 |
| 4969 // Do space-specific GC and retry runtime call. |
4968 GenerateCore(masm, | 4970 GenerateCore(masm, |
4969 &throw_normal_exception, | 4971 &throw_normal_exception, |
4970 &throw_out_of_memory_exception, | 4972 &throw_out_of_memory_exception, |
4971 frame_type, | 4973 frame_type, |
4972 false); | 4974 true); |
4973 #endif | |
4974 | 4975 |
| 4976 // Do full GC and retry runtime call one final time. |
| 4977 Failure* failure = Failure::InternalError(); |
| 4978 __ mov(Operand(eax), Immediate(reinterpret_cast<int32_t>(failure))); |
4975 GenerateCore(masm, | 4979 GenerateCore(masm, |
4976 &throw_normal_exception, | 4980 &throw_normal_exception, |
4977 &throw_out_of_memory_exception, | 4981 &throw_out_of_memory_exception, |
4978 frame_type, | 4982 frame_type, |
4979 true); | 4983 true); |
4980 | 4984 |
4981 __ bind(&throw_out_of_memory_exception); | 4985 __ bind(&throw_out_of_memory_exception); |
4982 GenerateThrowOutOfMemory(masm); | 4986 GenerateThrowOutOfMemory(masm); |
4983 // control flow for generated will not return. | 4987 // control flow for generated will not return. |
4984 | 4988 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5117 | 5121 |
5118 // Slow-case: Go through the JavaScript implementation. | 5122 // Slow-case: Go through the JavaScript implementation. |
5119 __ bind(&slow); | 5123 __ bind(&slow); |
5120 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 5124 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
5121 } | 5125 } |
5122 | 5126 |
5123 | 5127 |
5124 #undef __ | 5128 #undef __ |
5125 | 5129 |
5126 } } // namespace v8::internal | 5130 } } // namespace v8::internal |
OLD | NEW |