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 3902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3913 // Enter the exit frame that transitions from JavaScript to C++. | 3913 // Enter the exit frame that transitions from JavaScript to C++. |
3914 __ EnterExitFrame(frame_type); | 3914 __ EnterExitFrame(frame_type); |
3915 | 3915 |
3916 // r4: number of arguments (C callee-saved) | 3916 // r4: number of arguments (C callee-saved) |
3917 // r5: pointer to builtin function (C callee-saved) | 3917 // r5: pointer to builtin function (C callee-saved) |
3918 // r6: pointer to first argument (C callee-saved) | 3918 // r6: pointer to first argument (C callee-saved) |
3919 | 3919 |
3920 Label throw_out_of_memory_exception; | 3920 Label throw_out_of_memory_exception; |
3921 Label throw_normal_exception; | 3921 Label throw_normal_exception; |
3922 | 3922 |
3923 #ifdef DEBUG | 3923 // Call into the runtime system. Collect garbage before the call if |
| 3924 // running with --gc-greedy set. |
3924 if (FLAG_gc_greedy) { | 3925 if (FLAG_gc_greedy) { |
3925 Failure* failure = Failure::RetryAfterGC(0); | 3926 Failure* failure = Failure::RetryAfterGC(0); |
3926 __ mov(r0, Operand(reinterpret_cast<intptr_t>(failure))); | 3927 __ mov(r0, Operand(reinterpret_cast<intptr_t>(failure))); |
3927 } | 3928 } |
| 3929 GenerateCore(masm, &throw_normal_exception, |
| 3930 &throw_out_of_memory_exception, |
| 3931 frame_type, |
| 3932 FLAG_gc_greedy); |
| 3933 |
| 3934 // Do space-specific GC and retry runtime call. |
3928 GenerateCore(masm, | 3935 GenerateCore(masm, |
3929 &throw_normal_exception, | 3936 &throw_normal_exception, |
3930 &throw_out_of_memory_exception, | 3937 &throw_out_of_memory_exception, |
3931 frame_type, | 3938 frame_type, |
3932 FLAG_gc_greedy); | 3939 true); |
3933 #else | 3940 |
| 3941 // Do full GC and retry runtime call one final time. |
| 3942 Failure* failure = Failure::InternalError(); |
| 3943 __ mov(r0, Operand(reinterpret_cast<int32_t>(failure))); |
3934 GenerateCore(masm, | 3944 GenerateCore(masm, |
3935 &throw_normal_exception, | 3945 &throw_normal_exception, |
3936 &throw_out_of_memory_exception, | 3946 &throw_out_of_memory_exception, |
3937 frame_type, | |
3938 false); | |
3939 #endif | |
3940 GenerateCore(masm, | |
3941 &throw_normal_exception, | |
3942 &throw_out_of_memory_exception, | |
3943 frame_type, | 3947 frame_type, |
3944 true); | 3948 true); |
3945 | 3949 |
3946 __ bind(&throw_out_of_memory_exception); | 3950 __ bind(&throw_out_of_memory_exception); |
3947 GenerateThrowOutOfMemory(masm); | 3951 GenerateThrowOutOfMemory(masm); |
3948 // control flow for generated will not return. | 3952 // control flow for generated will not return. |
3949 | 3953 |
3950 __ bind(&throw_normal_exception); | 3954 __ bind(&throw_normal_exception); |
3951 GenerateThrowTOS(masm); | 3955 GenerateThrowTOS(masm); |
3952 } | 3956 } |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4185 // Slow-case: Non-function called. | 4189 // Slow-case: Non-function called. |
4186 __ bind(&slow); | 4190 __ bind(&slow); |
4187 __ mov(r0, Operand(argc_)); // Setup the number of arguments. | 4191 __ mov(r0, Operand(argc_)); // Setup the number of arguments. |
4188 __ InvokeBuiltin(Builtins::CALL_NON_FUNCTION, JUMP_JS); | 4192 __ InvokeBuiltin(Builtins::CALL_NON_FUNCTION, JUMP_JS); |
4189 } | 4193 } |
4190 | 4194 |
4191 | 4195 |
4192 #undef __ | 4196 #undef __ |
4193 | 4197 |
4194 } } // namespace v8::internal | 4198 } } // namespace v8::internal |
OLD | NEW |