| 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 2242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2253 // Push the state on the stack. | 2253 // Push the state on the stack. |
| 2254 frame_->EmitPush(r2); | 2254 frame_->EmitPush(r2); |
| 2255 | 2255 |
| 2256 // We keep two elements on the stack - the (possibly faked) result | 2256 // We keep two elements on the stack - the (possibly faked) result |
| 2257 // and the state - while evaluating the finally block. | 2257 // and the state - while evaluating the finally block. |
| 2258 // | 2258 // |
| 2259 // Generate code for the statements in the finally block. | 2259 // Generate code for the statements in the finally block. |
| 2260 VisitStatementsAndSpill(node->finally_block()->statements()); | 2260 VisitStatementsAndSpill(node->finally_block()->statements()); |
| 2261 | 2261 |
| 2262 if (has_valid_frame()) { | 2262 if (has_valid_frame()) { |
| 2263 JumpTarget exit(this); | |
| 2264 // Restore state and return value or faked TOS. | 2263 // Restore state and return value or faked TOS. |
| 2265 frame_->EmitPop(r2); | 2264 frame_->EmitPop(r2); |
| 2266 frame_->EmitPop(r0); | 2265 frame_->EmitPop(r0); |
| 2266 } |
| 2267 | 2267 |
| 2268 // Generate code to jump to the right destination for all used | 2268 // Generate code to jump to the right destination for all used |
| 2269 // formerly shadowing targets. Deallocate each shadow target. | 2269 // formerly shadowing targets. Deallocate each shadow target. |
| 2270 for (int i = 0; i < shadows.length(); i++) { | 2270 for (int i = 0; i < shadows.length(); i++) { |
| 2271 if (shadows[i]->is_bound()) { | 2271 if (has_valid_frame() && shadows[i]->is_bound()) { |
| 2272 JumpTarget* original = shadows[i]->other_target(); | 2272 JumpTarget* original = shadows[i]->other_target(); |
| 2273 __ cmp(r2, Operand(Smi::FromInt(JUMPING + i))); | 2273 __ cmp(r2, Operand(Smi::FromInt(JUMPING + i))); |
| 2274 if (!function_return_is_shadowed_ && i == kReturnShadowIndex) { | 2274 if (!function_return_is_shadowed_ && i == kReturnShadowIndex) { |
| 2275 JumpTarget skip(this); | 2275 JumpTarget skip(this); |
| 2276 skip.Branch(ne); | 2276 skip.Branch(ne); |
| 2277 frame_->PrepareForReturn(); | 2277 frame_->PrepareForReturn(); |
| 2278 original->Jump(); | 2278 original->Jump(); |
| 2279 skip.Bind(); | 2279 skip.Bind(); |
| 2280 } else { | 2280 } else { |
| 2281 original->Branch(eq); | 2281 original->Branch(eq); |
| 2282 } | |
| 2283 } | 2282 } |
| 2284 delete shadows[i]; | |
| 2285 } | 2283 } |
| 2284 delete shadows[i]; |
| 2285 } |
| 2286 | 2286 |
| 2287 if (has_valid_frame()) { |
| 2287 // Check if we need to rethrow the exception. | 2288 // Check if we need to rethrow the exception. |
| 2289 JumpTarget exit(this); |
| 2288 __ cmp(r2, Operand(Smi::FromInt(THROWING))); | 2290 __ cmp(r2, Operand(Smi::FromInt(THROWING))); |
| 2289 exit.Branch(ne); | 2291 exit.Branch(ne); |
| 2290 | 2292 |
| 2291 // Rethrow exception. | 2293 // Rethrow exception. |
| 2292 frame_->EmitPush(r0); | 2294 frame_->EmitPush(r0); |
| 2293 frame_->CallRuntime(Runtime::kReThrow, 1); | 2295 frame_->CallRuntime(Runtime::kReThrow, 1); |
| 2294 | 2296 |
| 2295 // Done. | 2297 // Done. |
| 2296 exit.Bind(); | 2298 exit.Bind(); |
| 2297 } | 2299 } |
| (...skipping 2850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5148 __ mov(r2, Operand(0)); | 5150 __ mov(r2, Operand(0)); |
| 5149 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); | 5151 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); |
| 5150 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), | 5152 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), |
| 5151 RelocInfo::CODE_TARGET); | 5153 RelocInfo::CODE_TARGET); |
| 5152 } | 5154 } |
| 5153 | 5155 |
| 5154 | 5156 |
| 5155 #undef __ | 5157 #undef __ |
| 5156 | 5158 |
| 5157 } } // namespace v8::internal | 5159 } } // namespace v8::internal |
| OLD | NEW |