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 4210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4221 __ pop(rdx); | 4221 __ pop(rdx); |
4222 __ SmiToInteger32(rdx, rdx); | 4222 __ SmiToInteger32(rdx, rdx); |
4223 __ Move(rcx, masm_->CodeObject()); | 4223 __ Move(rcx, masm_->CodeObject()); |
4224 __ addq(rdx, rcx); | 4224 __ addq(rdx, rcx); |
4225 __ jmp(rdx); | 4225 __ jmp(rdx); |
4226 } | 4226 } |
4227 | 4227 |
4228 | 4228 |
4229 #undef __ | 4229 #undef __ |
4230 | 4230 |
| 4231 #define __ ACCESS_MASM(masm()) |
| 4232 |
| 4233 FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit( |
| 4234 int* stack_depth, |
| 4235 int* context_length) { |
| 4236 // The macros used here must preserve the result register. |
| 4237 |
| 4238 // Because the handler block contains the context of the finally |
| 4239 // code, we can restore it directly from there for the finally code |
| 4240 // rather than iteratively unwinding contexts via their previous |
| 4241 // links. |
| 4242 __ Drop(*stack_depth); // Down to the handler block. |
| 4243 if (*context_length > 0) { |
| 4244 // Restore the context to its dedicated register and the stack. |
| 4245 __ movq(rsi, Operand(rsp, StackHandlerConstants::kContextOffset)); |
| 4246 __ movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi); |
| 4247 } |
| 4248 __ PopTryHandler(); |
| 4249 __ call(finally_entry_); |
| 4250 |
| 4251 *stack_depth = 0; |
| 4252 *context_length = 0; |
| 4253 return previous_; |
| 4254 } |
| 4255 |
| 4256 |
| 4257 #undef __ |
4231 | 4258 |
4232 } } // namespace v8::internal | 4259 } } // namespace v8::internal |
4233 | 4260 |
4234 #endif // V8_TARGET_ARCH_X64 | 4261 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |