| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 6917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6928 __ Set(eax, Immediate(argc_)); | 6928 __ Set(eax, Immediate(argc_)); |
| 6929 __ Set(ebx, Immediate(0)); | 6929 __ Set(ebx, Immediate(0)); |
| 6930 __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION); | 6930 __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION); |
| 6931 Handle<Code> adaptor(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)); | 6931 Handle<Code> adaptor(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)); |
| 6932 __ jmp(adaptor, RelocInfo::CODE_TARGET); | 6932 __ jmp(adaptor, RelocInfo::CODE_TARGET); |
| 6933 } | 6933 } |
| 6934 | 6934 |
| 6935 | 6935 |
| 6936 | 6936 |
| 6937 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) { | 6937 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) { |
| 6938 ASSERT(StackHandlerConstants::kSize == 6 * kPointerSize); // adjust this code | 6938 // Adjust this code if not the case. |
| 6939 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); |
| 6939 ExternalReference handler_address(Top::k_handler_address); | 6940 ExternalReference handler_address(Top::k_handler_address); |
| 6940 __ mov(edx, Operand::StaticVariable(handler_address)); | 6941 __ mov(edx, Operand::StaticVariable(handler_address)); |
| 6941 __ mov(ecx, Operand(edx, -1 * kPointerSize)); // get next in chain | 6942 // Get next in chain. |
| 6943 __ mov(ecx, Operand(edx, StackHandlerConstants::kAddressDisplacement)); |
| 6942 __ mov(Operand::StaticVariable(handler_address), ecx); | 6944 __ mov(Operand::StaticVariable(handler_address), ecx); |
| 6943 __ mov(esp, Operand(edx)); | 6945 __ mov(esp, Operand(edx)); |
| 6944 __ pop(edi); | |
| 6945 __ pop(ebp); | 6946 __ pop(ebp); |
| 6946 __ pop(edx); // remove code pointer | 6947 __ pop(edx); // Remove state. |
| 6947 __ pop(edx); // remove state | |
| 6948 | 6948 |
| 6949 // Before returning we restore the context from the frame pointer if not NULL. | 6949 // Before returning we restore the context from the frame pointer if not NULL. |
| 6950 // The frame pointer is NULL in the exception handler of a JS entry frame. | 6950 // The frame pointer is NULL in the exception handler of a JS entry frame. |
| 6951 __ xor_(esi, Operand(esi)); // tentatively set context pointer to NULL | 6951 __ xor_(esi, Operand(esi)); // tentatively set context pointer to NULL |
| 6952 Label skip; | 6952 Label skip; |
| 6953 __ cmp(ebp, 0); | 6953 __ cmp(ebp, 0); |
| 6954 __ j(equal, &skip, not_taken); | 6954 __ j(equal, &skip, not_taken); |
| 6955 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 6955 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 6956 __ bind(&skip); | 6956 __ bind(&skip); |
| 6957 | 6957 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7033 | 7033 |
| 7034 // Handle normal exception. | 7034 // Handle normal exception. |
| 7035 __ jmp(throw_normal_exception); | 7035 __ jmp(throw_normal_exception); |
| 7036 | 7036 |
| 7037 // Retry. | 7037 // Retry. |
| 7038 __ bind(&retry); | 7038 __ bind(&retry); |
| 7039 } | 7039 } |
| 7040 | 7040 |
| 7041 | 7041 |
| 7042 void CEntryStub::GenerateThrowOutOfMemory(MacroAssembler* masm) { | 7042 void CEntryStub::GenerateThrowOutOfMemory(MacroAssembler* masm) { |
| 7043 // Adjust this code if not the case. |
| 7044 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); |
| 7045 |
| 7043 // Fetch top stack handler. | 7046 // Fetch top stack handler. |
| 7044 ExternalReference handler_address(Top::k_handler_address); | 7047 ExternalReference handler_address(Top::k_handler_address); |
| 7045 __ mov(edx, Operand::StaticVariable(handler_address)); | 7048 __ mov(edx, Operand::StaticVariable(handler_address)); |
| 7046 | 7049 |
| 7047 // Unwind the handlers until the ENTRY handler is found. | 7050 // Unwind the handlers until the ENTRY handler is found. |
| 7048 Label loop, done; | 7051 Label loop, done; |
| 7049 __ bind(&loop); | 7052 __ bind(&loop); |
| 7050 // Load the type of the current stack handler. | 7053 // Load the type of the current stack handler. |
| 7051 const int kStateOffset = StackHandlerConstants::kAddressDisplacement + | 7054 const int kStateOffset = StackHandlerConstants::kAddressDisplacement + |
| 7052 StackHandlerConstants::kStateOffset; | 7055 StackHandlerConstants::kStateOffset; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 7073 ExternalReference pending_exception(Top::k_pending_exception_address); | 7076 ExternalReference pending_exception(Top::k_pending_exception_address); |
| 7074 __ mov(Operand::StaticVariable(pending_exception), eax); | 7077 __ mov(Operand::StaticVariable(pending_exception), eax); |
| 7075 | 7078 |
| 7076 // Restore the stack to the address of the ENTRY handler | 7079 // Restore the stack to the address of the ENTRY handler |
| 7077 __ mov(esp, Operand(edx)); | 7080 __ mov(esp, Operand(edx)); |
| 7078 | 7081 |
| 7079 // Clear the context pointer; | 7082 // Clear the context pointer; |
| 7080 __ xor_(esi, Operand(esi)); | 7083 __ xor_(esi, Operand(esi)); |
| 7081 | 7084 |
| 7082 // Restore registers from handler. | 7085 // Restore registers from handler. |
| 7083 __ pop(edi); // PP | |
| 7084 __ pop(ebp); // FP | 7086 __ pop(ebp); // FP |
| 7085 __ pop(edx); // Code | |
| 7086 __ pop(edx); // State | 7087 __ pop(edx); // State |
| 7087 | 7088 |
| 7088 __ ret(0); | 7089 __ ret(0); |
| 7089 } | 7090 } |
| 7090 | 7091 |
| 7091 | 7092 |
| 7092 void CEntryStub::GenerateBody(MacroAssembler* masm, bool is_debug_break) { | 7093 void CEntryStub::GenerateBody(MacroAssembler* masm, bool is_debug_break) { |
| 7093 // eax: number of arguments including receiver | 7094 // eax: number of arguments including receiver |
| 7094 // ebx: pointer to C function (C callee-saved) | 7095 // ebx: pointer to C function (C callee-saved) |
| 7095 // ebp: frame pointer (restored after C call) | 7096 // ebp: frame pointer (restored after C call) |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7311 | 7312 |
| 7312 // Slow-case: Go through the JavaScript implementation. | 7313 // Slow-case: Go through the JavaScript implementation. |
| 7313 __ bind(&slow); | 7314 __ bind(&slow); |
| 7314 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 7315 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
| 7315 } | 7316 } |
| 7316 | 7317 |
| 7317 | 7318 |
| 7318 #undef __ | 7319 #undef __ |
| 7319 | 7320 |
| 7320 } } // namespace v8::internal | 7321 } } // namespace v8::internal |
| OLD | NEW |