| 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 2199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2210 int nof_escapes = node->escaping_targets()->length(); | 2210 int nof_escapes = node->escaping_targets()->length(); |
| 2211 List<ShadowTarget*> shadows(1 + nof_escapes); | 2211 List<ShadowTarget*> shadows(1 + nof_escapes); |
| 2212 shadows.Add(new ShadowTarget(&function_return_)); | 2212 shadows.Add(new ShadowTarget(&function_return_)); |
| 2213 for (int i = 0; i < nof_escapes; i++) { | 2213 for (int i = 0; i < nof_escapes; i++) { |
| 2214 shadows.Add(new ShadowTarget(node->escaping_targets()->at(i))); | 2214 shadows.Add(new ShadowTarget(node->escaping_targets()->at(i))); |
| 2215 } | 2215 } |
| 2216 bool function_return_was_shadowed = function_return_is_shadowed_; | 2216 bool function_return_was_shadowed = function_return_is_shadowed_; |
| 2217 function_return_is_shadowed_ = true; | 2217 function_return_is_shadowed_ = true; |
| 2218 | 2218 |
| 2219 // Generate code for the statements in the try block. | 2219 // Generate code for the statements in the try block. |
| 2220 bool was_inside_try = is_inside_try_; | 2220 { TempAssign<bool> temp(&is_inside_try_, true); |
| 2221 is_inside_try_ = true; | 2221 VisitStatementsAndSpill(node->try_block()->statements()); |
| 2222 VisitStatementsAndSpill(node->try_block()->statements()); | 2222 } |
| 2223 is_inside_try_ = was_inside_try; | |
| 2224 | 2223 |
| 2225 // Stop the introduced shadowing and count the number of required unlinks. | 2224 // Stop the introduced shadowing and count the number of required unlinks. |
| 2226 // After shadowing stops, the original targets are unshadowed and the | 2225 // After shadowing stops, the original targets are unshadowed and the |
| 2227 // ShadowTargets represent the formerly shadowing targets. | 2226 // ShadowTargets represent the formerly shadowing targets. |
| 2228 int nof_unlinks = 0; | 2227 int nof_unlinks = 0; |
| 2229 for (int i = 0; i <= nof_escapes; i++) { | 2228 for (int i = 0; i <= nof_escapes; i++) { |
| 2230 shadows[i]->StopShadowing(); | 2229 shadows[i]->StopShadowing(); |
| 2231 if (shadows[i]->is_linked()) nof_unlinks++; | 2230 if (shadows[i]->is_linked()) nof_unlinks++; |
| 2232 } | 2231 } |
| 2233 function_return_is_shadowed_ = function_return_was_shadowed; | 2232 function_return_is_shadowed_ = function_return_was_shadowed; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2319 int nof_escapes = node->escaping_targets()->length(); | 2318 int nof_escapes = node->escaping_targets()->length(); |
| 2320 List<ShadowTarget*> shadows(1 + nof_escapes); | 2319 List<ShadowTarget*> shadows(1 + nof_escapes); |
| 2321 shadows.Add(new ShadowTarget(&function_return_)); | 2320 shadows.Add(new ShadowTarget(&function_return_)); |
| 2322 for (int i = 0; i < nof_escapes; i++) { | 2321 for (int i = 0; i < nof_escapes; i++) { |
| 2323 shadows.Add(new ShadowTarget(node->escaping_targets()->at(i))); | 2322 shadows.Add(new ShadowTarget(node->escaping_targets()->at(i))); |
| 2324 } | 2323 } |
| 2325 bool function_return_was_shadowed = function_return_is_shadowed_; | 2324 bool function_return_was_shadowed = function_return_is_shadowed_; |
| 2326 function_return_is_shadowed_ = true; | 2325 function_return_is_shadowed_ = true; |
| 2327 | 2326 |
| 2328 // Generate code for the statements in the try block. | 2327 // Generate code for the statements in the try block. |
| 2329 bool was_inside_try = is_inside_try_; | 2328 { TempAssign<bool> temp(&is_inside_try_, true); |
| 2330 is_inside_try_ = true; | 2329 VisitStatementsAndSpill(node->try_block()->statements()); |
| 2331 VisitStatementsAndSpill(node->try_block()->statements()); | 2330 } |
| 2332 is_inside_try_ = was_inside_try; | |
| 2333 | 2331 |
| 2334 // Stop the introduced shadowing and count the number of required unlinks. | 2332 // Stop the introduced shadowing and count the number of required unlinks. |
| 2335 // After shadowing stops, the original targets are unshadowed and the | 2333 // After shadowing stops, the original targets are unshadowed and the |
| 2336 // ShadowTargets represent the formerly shadowing targets. | 2334 // ShadowTargets represent the formerly shadowing targets. |
| 2337 int nof_unlinks = 0; | 2335 int nof_unlinks = 0; |
| 2338 for (int i = 0; i <= nof_escapes; i++) { | 2336 for (int i = 0; i <= nof_escapes; i++) { |
| 2339 shadows[i]->StopShadowing(); | 2337 shadows[i]->StopShadowing(); |
| 2340 if (shadows[i]->is_linked()) nof_unlinks++; | 2338 if (shadows[i]->is_linked()) nof_unlinks++; |
| 2341 } | 2339 } |
| 2342 function_return_is_shadowed_ = function_return_was_shadowed; | 2340 function_return_is_shadowed_ = function_return_was_shadowed; |
| (...skipping 3320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5663 | 5661 |
| 5664 // Slow-case: Go through the JavaScript implementation. | 5662 // Slow-case: Go through the JavaScript implementation. |
| 5665 __ bind(&slow); | 5663 __ bind(&slow); |
| 5666 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 5664 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
| 5667 } | 5665 } |
| 5668 | 5666 |
| 5669 | 5667 |
| 5670 #undef __ | 5668 #undef __ |
| 5671 | 5669 |
| 5672 } } // namespace v8::internal | 5670 } } // namespace v8::internal |
| OLD | NEW |