| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/ast.h" | 7 #include "src/ast.h" |
| 8 #include "src/ast-numbering.h" | 8 #include "src/ast-numbering.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1175 SetStatementPosition(stmt); | 1175 SetStatementPosition(stmt); |
| 1176 // The try block adds a handler to the exception handler chain before | 1176 // The try block adds a handler to the exception handler chain before |
| 1177 // entering, and removes it again when exiting normally. If an exception | 1177 // entering, and removes it again when exiting normally. If an exception |
| 1178 // is thrown during execution of the try block, the handler is consumed | 1178 // is thrown during execution of the try block, the handler is consumed |
| 1179 // and control is passed to the catch block with the exception in the | 1179 // and control is passed to the catch block with the exception in the |
| 1180 // result register. | 1180 // result register. |
| 1181 | 1181 |
| 1182 Label try_entry, handler_entry, exit; | 1182 Label try_entry, handler_entry, exit; |
| 1183 __ jmp(&try_entry); | 1183 __ jmp(&try_entry); |
| 1184 __ bind(&handler_entry); | 1184 __ bind(&handler_entry); |
| 1185 |
| 1186 ClearPendingMessage(); |
| 1185 // Exception handler code, the exception is in the result register. | 1187 // Exception handler code, the exception is in the result register. |
| 1186 // Extend the context before executing the catch block. | 1188 // Extend the context before executing the catch block. |
| 1187 { Comment cmnt(masm_, "[ Extend catch context"); | 1189 { Comment cmnt(masm_, "[ Extend catch context"); |
| 1188 __ Push(stmt->variable()->name()); | 1190 __ Push(stmt->variable()->name()); |
| 1189 __ Push(result_register()); | 1191 __ Push(result_register()); |
| 1190 PushFunctionArgumentForContextAllocation(); | 1192 PushFunctionArgumentForContextAllocation(); |
| 1191 __ CallRuntime(Runtime::kPushCatchContext, 3); | 1193 __ CallRuntime(Runtime::kPushCatchContext, 3); |
| 1192 StoreToFrameField(StandardFrameConstants::kContextOffset, | 1194 StoreToFrameField(StandardFrameConstants::kContextOffset, |
| 1193 context_register()); | 1195 context_register()); |
| 1194 } | 1196 } |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1635 } | 1637 } |
| 1636 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1638 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
| 1637 codegen_->scope_ = saved_scope_; | 1639 codegen_->scope_ = saved_scope_; |
| 1638 } | 1640 } |
| 1639 | 1641 |
| 1640 | 1642 |
| 1641 #undef __ | 1643 #undef __ |
| 1642 | 1644 |
| 1643 | 1645 |
| 1644 } } // namespace v8::internal | 1646 } } // namespace v8::internal |
| OLD | NEW |