| 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 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 EmitReturnSequence(); | 949 EmitReturnSequence(); |
| 950 } | 950 } |
| 951 | 951 |
| 952 | 952 |
| 953 void FullCodeGenerator::VisitEnterWithContextStatement( | 953 void FullCodeGenerator::VisitEnterWithContextStatement( |
| 954 EnterWithContextStatement* stmt) { | 954 EnterWithContextStatement* stmt) { |
| 955 Comment cmnt(masm_, "[ EnterWithContextStatement"); | 955 Comment cmnt(masm_, "[ EnterWithContextStatement"); |
| 956 SetStatementPosition(stmt); | 956 SetStatementPosition(stmt); |
| 957 | 957 |
| 958 VisitForStackValue(stmt->expression()); | 958 VisitForStackValue(stmt->expression()); |
| 959 __ CallRuntime(Runtime::kPushWithContext, 1); | 959 PushFunctionArgumentForContextAllocation(); |
| 960 __ CallRuntime(Runtime::kPushWithContext, 2); |
| 960 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); | 961 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); |
| 961 } | 962 } |
| 962 | 963 |
| 963 | 964 |
| 964 void FullCodeGenerator::VisitExitContextStatement(ExitContextStatement* stmt) { | 965 void FullCodeGenerator::VisitExitContextStatement(ExitContextStatement* stmt) { |
| 965 Comment cmnt(masm_, "[ ExitContextStatement"); | 966 Comment cmnt(masm_, "[ ExitContextStatement"); |
| 966 SetStatementPosition(stmt); | 967 SetStatementPosition(stmt); |
| 967 | 968 |
| 968 // Pop context. | 969 // Pop context. |
| 969 LoadContextField(context_register(), Context::PREVIOUS_INDEX); | 970 LoadContextField(context_register(), Context::PREVIOUS_INDEX); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 // that scope again afterwards. | 1101 // that scope again afterwards. |
| 1101 | 1102 |
| 1102 Label try_handler_setup, catch_entry, done; | 1103 Label try_handler_setup, catch_entry, done; |
| 1103 __ Call(&try_handler_setup); | 1104 __ Call(&try_handler_setup); |
| 1104 // Try handler code, exception in result register. | 1105 // Try handler code, exception in result register. |
| 1105 | 1106 |
| 1106 // Extend the context before executing the catch block. | 1107 // Extend the context before executing the catch block. |
| 1107 { Comment cmnt(masm_, "[ Extend catch context"); | 1108 { Comment cmnt(masm_, "[ Extend catch context"); |
| 1108 __ Push(stmt->name()); | 1109 __ Push(stmt->name()); |
| 1109 __ push(result_register()); | 1110 __ push(result_register()); |
| 1110 __ CallRuntime(Runtime::kPushCatchContext, 2); | 1111 PushFunctionArgumentForContextAllocation(); |
| 1112 __ CallRuntime(Runtime::kPushCatchContext, 3); |
| 1111 StoreToFrameField(StandardFrameConstants::kContextOffset, | 1113 StoreToFrameField(StandardFrameConstants::kContextOffset, |
| 1112 context_register()); | 1114 context_register()); |
| 1113 } | 1115 } |
| 1114 | 1116 |
| 1115 Visit(stmt->catch_block()); | 1117 Visit(stmt->catch_block()); |
| 1116 __ jmp(&done); | 1118 __ jmp(&done); |
| 1117 | 1119 |
| 1118 // Try block code. Sets up the exception handler chain. | 1120 // Try block code. Sets up the exception handler chain. |
| 1119 __ bind(&try_handler_setup); | 1121 __ bind(&try_handler_setup); |
| 1120 { | 1122 { |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1307 } | 1309 } |
| 1308 | 1310 |
| 1309 return false; | 1311 return false; |
| 1310 } | 1312 } |
| 1311 | 1313 |
| 1312 | 1314 |
| 1313 #undef __ | 1315 #undef __ |
| 1314 | 1316 |
| 1315 | 1317 |
| 1316 } } // namespace v8::internal | 1318 } } // namespace v8::internal |
| OLD | NEW |