| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 Visit(stmt->catch_block()); | 1140 Visit(stmt->catch_block()); |
| 1141 } | 1141 } |
| 1142 // Restore the context. | 1142 // Restore the context. |
| 1143 LoadContextField(context_register(), Context::PREVIOUS_INDEX); | 1143 LoadContextField(context_register(), Context::PREVIOUS_INDEX); |
| 1144 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); | 1144 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); |
| 1145 scope_ = saved_scope; | 1145 scope_ = saved_scope; |
| 1146 __ jmp(&exit); | 1146 __ jmp(&exit); |
| 1147 | 1147 |
| 1148 // Try block code. Sets up the exception handler chain. | 1148 // Try block code. Sets up the exception handler chain. |
| 1149 __ bind(&try_entry); | 1149 __ bind(&try_entry); |
| 1150 __ PushTryHandler(IN_JAVASCRIPT, TRY_CATCH_HANDLER, stmt->index()); | 1150 __ PushTryHandler(StackHandler::CATCH, stmt->index()); |
| 1151 { TryCatch try_body(this); | 1151 { TryCatch try_body(this); |
| 1152 Visit(stmt->try_block()); | 1152 Visit(stmt->try_block()); |
| 1153 } | 1153 } |
| 1154 __ PopTryHandler(); | 1154 __ PopTryHandler(); |
| 1155 __ bind(&exit); | 1155 __ bind(&exit); |
| 1156 } | 1156 } |
| 1157 | 1157 |
| 1158 | 1158 |
| 1159 void FullCodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) { | 1159 void FullCodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) { |
| 1160 Comment cmnt(masm_, "[ TryFinallyStatement"); | 1160 Comment cmnt(masm_, "[ TryFinallyStatement"); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 // Finally block implementation. | 1197 // Finally block implementation. |
| 1198 __ bind(&finally_entry); | 1198 __ bind(&finally_entry); |
| 1199 EnterFinallyBlock(); | 1199 EnterFinallyBlock(); |
| 1200 { Finally finally_body(this); | 1200 { Finally finally_body(this); |
| 1201 Visit(stmt->finally_block()); | 1201 Visit(stmt->finally_block()); |
| 1202 } | 1202 } |
| 1203 ExitFinallyBlock(); // Return to the calling code. | 1203 ExitFinallyBlock(); // Return to the calling code. |
| 1204 | 1204 |
| 1205 // Set up try handler. | 1205 // Set up try handler. |
| 1206 __ bind(&try_entry); | 1206 __ bind(&try_entry); |
| 1207 __ PushTryHandler(IN_JAVASCRIPT, TRY_FINALLY_HANDLER, stmt->index()); | 1207 __ PushTryHandler(StackHandler::FINALLY, stmt->index()); |
| 1208 { TryFinally try_body(this, &finally_entry); | 1208 { TryFinally try_body(this, &finally_entry); |
| 1209 Visit(stmt->try_block()); | 1209 Visit(stmt->try_block()); |
| 1210 } | 1210 } |
| 1211 __ PopTryHandler(); | 1211 __ PopTryHandler(); |
| 1212 // Execute the finally block on the way out. Clobber the unpredictable | 1212 // Execute the finally block on the way out. Clobber the unpredictable |
| 1213 // value in the result register with one that's safe for GC because the | 1213 // value in the result register with one that's safe for GC because the |
| 1214 // finally block will unconditionally preserve the result register on the | 1214 // finally block will unconditionally preserve the result register on the |
| 1215 // stack. | 1215 // stack. |
| 1216 ClearAccumulator(); | 1216 ClearAccumulator(); |
| 1217 __ Call(&finally_entry); | 1217 __ Call(&finally_entry); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1326 } | 1326 } |
| 1327 | 1327 |
| 1328 return false; | 1328 return false; |
| 1329 } | 1329 } |
| 1330 | 1330 |
| 1331 | 1331 |
| 1332 #undef __ | 1332 #undef __ |
| 1333 | 1333 |
| 1334 | 1334 |
| 1335 } } // namespace v8::internal | 1335 } } // namespace v8::internal |
| OLD | NEW |