OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 4179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4190 ExternalReference c_entry_fp(Isolate::k_c_entry_fp_address, masm->isolate()); | 4190 ExternalReference c_entry_fp(Isolate::k_c_entry_fp_address, masm->isolate()); |
4191 __ push(Operand::StaticVariable(c_entry_fp)); | 4191 __ push(Operand::StaticVariable(c_entry_fp)); |
4192 | 4192 |
4193 #ifdef ENABLE_LOGGING_AND_PROFILING | 4193 #ifdef ENABLE_LOGGING_AND_PROFILING |
4194 // If this is the outermost JS call, set js_entry_sp value. | 4194 // If this is the outermost JS call, set js_entry_sp value. |
4195 ExternalReference js_entry_sp(Isolate::k_js_entry_sp_address, | 4195 ExternalReference js_entry_sp(Isolate::k_js_entry_sp_address, |
4196 masm->isolate()); | 4196 masm->isolate()); |
4197 __ cmp(Operand::StaticVariable(js_entry_sp), Immediate(0)); | 4197 __ cmp(Operand::StaticVariable(js_entry_sp), Immediate(0)); |
4198 __ j(not_equal, ¬_outermost_js); | 4198 __ j(not_equal, ¬_outermost_js); |
4199 __ mov(Operand::StaticVariable(js_entry_sp), ebp); | 4199 __ mov(Operand::StaticVariable(js_entry_sp), ebp); |
| 4200 __ push(Immediate(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME))); |
| 4201 Label cont; |
| 4202 __ jmp(&cont); |
4200 __ bind(¬_outermost_js); | 4203 __ bind(¬_outermost_js); |
| 4204 __ push(Immediate(Smi::FromInt(StackFrame::INNER_JSENTRY_FRAME))); |
| 4205 __ bind(&cont); |
4201 #endif | 4206 #endif |
4202 | 4207 |
4203 // Call a faked try-block that does the invoke. | 4208 // Call a faked try-block that does the invoke. |
4204 __ call(&invoke); | 4209 __ call(&invoke); |
4205 | 4210 |
4206 // Caught exception: Store result (exception) in the pending | 4211 // Caught exception: Store result (exception) in the pending |
4207 // exception field in the JSEnv and return a failure sentinel. | 4212 // exception field in the JSEnv and return a failure sentinel. |
4208 ExternalReference pending_exception(Isolate::k_pending_exception_address, | 4213 ExternalReference pending_exception(Isolate::k_pending_exception_address, |
4209 masm->isolate()); | 4214 masm->isolate()); |
4210 __ mov(Operand::StaticVariable(pending_exception), eax); | 4215 __ mov(Operand::StaticVariable(pending_exception), eax); |
(...skipping 25 matching lines...) Expand all Loading... |
4236 } else { | 4241 } else { |
4237 ExternalReference entry(Builtins::kJSEntryTrampoline, | 4242 ExternalReference entry(Builtins::kJSEntryTrampoline, |
4238 masm->isolate()); | 4243 masm->isolate()); |
4239 __ mov(edx, Immediate(entry)); | 4244 __ mov(edx, Immediate(entry)); |
4240 } | 4245 } |
4241 __ mov(edx, Operand(edx, 0)); // deref address | 4246 __ mov(edx, Operand(edx, 0)); // deref address |
4242 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); | 4247 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); |
4243 __ call(Operand(edx)); | 4248 __ call(Operand(edx)); |
4244 | 4249 |
4245 // Unlink this frame from the handler chain. | 4250 // Unlink this frame from the handler chain. |
4246 __ pop(Operand::StaticVariable(ExternalReference( | 4251 __ PopTryHandler(); |
4247 Isolate::k_handler_address, | |
4248 masm->isolate()))); | |
4249 // Pop next_sp. | |
4250 __ add(Operand(esp), Immediate(StackHandlerConstants::kSize - kPointerSize)); | |
4251 | 4252 |
| 4253 __ bind(&exit); |
4252 #ifdef ENABLE_LOGGING_AND_PROFILING | 4254 #ifdef ENABLE_LOGGING_AND_PROFILING |
4253 // If current EBP value is the same as js_entry_sp value, it means that | 4255 // Check if the current stack frame is marked as the outermost JS frame. |
4254 // the current function is the outermost. | 4256 __ pop(ebx); |
4255 __ cmp(ebp, Operand::StaticVariable(js_entry_sp)); | 4257 __ cmp(Operand(ebx), Immediate(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAM
E))); |
4256 __ j(not_equal, ¬_outermost_js_2); | 4258 __ j(not_equal, ¬_outermost_js_2); |
4257 __ mov(Operand::StaticVariable(js_entry_sp), Immediate(0)); | 4259 __ mov(Operand::StaticVariable(js_entry_sp), Immediate(0)); |
4258 __ bind(¬_outermost_js_2); | 4260 __ bind(¬_outermost_js_2); |
4259 #endif | 4261 #endif |
4260 | 4262 |
4261 // Restore the top frame descriptor from the stack. | 4263 // Restore the top frame descriptor from the stack. |
4262 __ bind(&exit); | |
4263 __ pop(Operand::StaticVariable(ExternalReference( | 4264 __ pop(Operand::StaticVariable(ExternalReference( |
4264 Isolate::k_c_entry_fp_address, | 4265 Isolate::k_c_entry_fp_address, |
4265 masm->isolate()))); | 4266 masm->isolate()))); |
4266 | 4267 |
4267 // Restore callee-saved registers (C calling conventions). | 4268 // Restore callee-saved registers (C calling conventions). |
4268 __ pop(ebx); | 4269 __ pop(ebx); |
4269 __ pop(esi); | 4270 __ pop(esi); |
4270 __ pop(edi); | 4271 __ pop(edi); |
4271 __ add(Operand(esp), Immediate(2 * kPointerSize)); // remove markers | 4272 __ add(Operand(esp), Immediate(2 * kPointerSize)); // remove markers |
4272 | 4273 |
(...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6150 __ Drop(1); | 6151 __ Drop(1); |
6151 __ ret(2 * kPointerSize); | 6152 __ ret(2 * kPointerSize); |
6152 } | 6153 } |
6153 | 6154 |
6154 | 6155 |
6155 #undef __ | 6156 #undef __ |
6156 | 6157 |
6157 } } // namespace v8::internal | 6158 } } // namespace v8::internal |
6158 | 6159 |
6159 #endif // V8_TARGET_ARCH_IA32 | 6160 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |